1 /* Low level interface to valgrind, for the remote server for GDB integrated
4 Free Software Foundation, Inc.
6 This file is part of VALGRIND.
7 It has been inspired from a file from gdbserver in gdb 6.6.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
29 #include "pub_core_machine.h"
30 #include "pub_core_threadstate.h"
31 #include "pub_core_transtab.h"
32 #include "pub_core_gdbserver.h"
34 #include "valgrind_low.h"
36 #include "libvex_guest_ppc64.h"
38 /* The PPC64 register layout with vs register support (Power 7 and beyond)
39 consists of 64 VSR registers of size 128-bits. The 32 floating point
40 registers fp map to the upper 64-bits of vsr[0] to vsr[31]. The 32
41 vr[0] to vr[31] registers of size 128-bits map to vsr[31] to vsr[63]. The
42 lower 64-bits of the vsr[0] to vsr[31] registers are in the pseudo
43 registers vs[0]h to vs[31]h registers. These pseudo registers get printed
44 by GDB but there are no instructions that directly access these registers.
45 When GDB prints the vsr[0] to vsr[31] registers it combines the contents
46 of the floating point registers fp[0] to fp[31] and its corresponding
47 vs[0]h to vs[31]h registers to display the VSR contents. The vsr[32]
48 to vsr[63] contents are the same as the the vr[0] to vr[31] contents.
50 GDB also prints fp[32] to fp[63]. These are simply the upper 64 bits of
51 vsr[32] to vsr[63] however, these are not "real" floating point registers
52 as none of the floating point instructions can access these registers.
55 MSB IBM bit numbering LSB
57 vsr[0] | fp[0] | vs[0]h |
58 vsr[1] | fp[1] | vs[1]h |
59 vsr[2] | fp[2] | vs[2]h |
61 vsr[31] | fp[31] | vs[31]h |
67 Note, not shown above are the fake fp[32] to fp[63] that GDB prints
69 Valgrind has two shadow registers for each real register denoted with
70 the suffix s1 and s2. When printing the contents of the shadow registers,
71 GDB does not explicitly print the shadow registers vsr[0] to vsr[63]. GDB
72 prints the shadow register contents of the 32 floating point registers as
73 fp[0]s1 to fp[31]s1 and fp[0]s2 to fp[31]s2. The shadow register contents
74 of vs[0]hs1 to vs[31]hs1 and vs[0]hs2 to vs[31]hs2 are also printed. The
75 user needs to construct the vsr[i]s1 shadow register contents by looking
76 at fp[i]s1 for the upper 64-bits and vs[i]hs1 for the lower 64-bits. The
77 vsr[i]s2 shadow register contents are constructed similarly.
79 GDB prints the 128-bit shadow register contents of the 32 vr registers as
80 vr[0]s1 to vr[31]s1 and vr[0]s2 to vr[31]s2. These are also the value of the
81 VSR shadow registers vsr[32]s1 to vsr[63]s1 and vsr[32]s2 to vsr[63]s2. */
83 static struct reg regs
[] = {
154 { "fpscr", 4416, 32 },
155 { "orig_r3", 4448, 64 },
156 { "trap", 4512, 64 },
157 { "vr0", 4576, 128 },
158 { "vr1", 4704, 128 },
159 { "vr2", 4832, 128 },
160 { "vr3", 4960, 128 },
161 { "vr4", 5088, 128 },
162 { "vr5", 5216, 128 },
163 { "vr6", 5344, 128 },
164 { "vr7", 5472, 128 },
165 { "vr8", 5600, 128 },
166 { "vr9", 5728, 128 },
167 { "vr10", 5856, 128 },
168 { "vr11", 5984, 128 },
169 { "vr12", 6112, 128 },
170 { "vr13", 6240, 128 },
171 { "vr14", 6368, 128 },
172 { "vr15", 6496, 128 },
173 { "vr16", 6624, 128 },
174 { "vr17", 6752, 128 },
175 { "vr18", 6880, 128 },
176 { "vr19", 7008, 128 },
177 { "vr20", 7136, 128 },
178 { "vr21", 7264, 128 },
179 { "vr22", 7392, 128 },
180 { "vr23", 7520, 128 },
181 { "vr24", 7648, 128 },
182 { "vr25", 7776, 128 },
183 { "vr26", 7904, 128 },
184 { "vr27", 8032, 128 },
185 { "vr28", 8160, 128 },
186 { "vr29", 8288, 128 },
187 { "vr30", 8416, 128 },
188 { "vr31", 8544, 128 },
189 { "vscr", 8672, 32 },
190 { "vrsave", 8704, 32 },
191 { "vs0h", 8736, 64 },
192 { "vs1h", 8800, 64 },
193 { "vs2h", 8864, 64 },
194 { "vs3h", 8928, 64 },
195 { "vs4h", 8992, 64 },
196 { "vs5h", 9056, 64 },
197 { "vs6h", 9120, 64 },
198 { "vs7h", 9184, 64 },
199 { "vs8h", 9248, 64 },
200 { "vs9h", 9312, 64 },
201 { "vs10h", 9376, 64 },
202 { "vs11h", 9440, 64 },
203 { "vs12h", 9504, 64 },
204 { "vs13h", 9568, 64 },
205 { "vs14h", 9632, 64 },
206 { "vs15h", 9696, 64 },
207 { "vs16h", 9760, 64 },
208 { "vs17h", 9824, 64 },
209 { "vs18h", 9888, 64 },
210 { "vs19h", 9952, 64 },
211 { "vs20h", 10016, 64 },
212 { "vs21h", 10080, 64 },
213 { "vs22h", 10144, 64 },
214 { "vs23h", 10208, 64 },
215 { "vs24h", 10272, 64 },
216 { "vs25h", 10336, 64 },
217 { "vs26h", 10400, 64 },
218 { "vs27h", 10464, 64 },
219 { "vs28h", 10528, 64 },
220 { "vs29h", 10592, 64 },
221 { "vs30h", 10656, 64 },
222 { "vs31h", 10720, 64 },
225 static const char *expedite_regs
[] = { "r1", "pc", 0 };
226 #define num_regs (sizeof (regs) / sizeof (regs[0]))
229 CORE_ADDR
get_pc (void)
233 collect_register_by_name ("pc", &pc
);
235 dlog(1, "stop pc is %p\n", (void *) pc
);
240 void set_pc (CORE_ADDR newpc
)
242 supply_register_by_name ("pc", &newpc
);
245 /* store registers in the guest state (gdbserver_to_valgrind)
246 or fetch register from the guest state (valgrind_to_gdbserver). */
248 void transfer_register (ThreadId tid
, int abs_regno
, void * buf
,
249 transfer_direction dir
, int size
, Bool
*mod
)
251 ThreadState
* tst
= VG_(get_ThreadState
)(tid
);
252 int set
= abs_regno
/ num_regs
;
253 int regno
= abs_regno
% num_regs
;
254 int low_offset
, high_offset
;
258 VexGuestPPC64State
* ppc64
= (VexGuestPPC64State
*) get_arch (set
, tst
);
261 #if defined (VG_LITTLEENDIAN)
262 /* Fetch the 64-bits for the VR registers (VSR[32] to VSR[63] stored as
263 * Little Endian. The 128-bit value is stored as an array of four 32-bit
264 * values. The lower 32-bits are in element 0 in Little Endian format.
268 /* Fetch the upper 64-bits for the floating point register stored as
269 * Little Endian. The 128-bit value is stored as an array of four 32-bit
270 * values. The upper 32-bits are in element 3 in Little Endian format.
273 #elif defined (VG_BIGENDIAN)
274 /* Fetch the 64-bits for the VR registers (VSR[32] to VSR[63] stored as
275 * Little Endian. The 128-bit value is stored as an array of four 32-bit
276 * values. The lower 32-bits are in element 3 in Big Endian format.
280 /* Fetch the upper 64-bits for the floating point register stored as
281 * Little Endian. The 128-bit value is stored as an array of four 32-bit
282 * values. The upper 32-bits are in element 0 in Big Endian format.
286 # error "Unknown endianness"
290 // numbers here have to match the order of regs above
291 // Attention: gdb order does not match valgrind order.
292 case 0: VG_(transfer
) (&ppc64
->guest_GPR0
, buf
, dir
, size
, mod
); break;
293 case 1: VG_(transfer
) (&ppc64
->guest_GPR1
, buf
, dir
, size
, mod
); break;
294 case 2: VG_(transfer
) (&ppc64
->guest_GPR2
, buf
, dir
, size
, mod
); break;
295 case 3: VG_(transfer
) (&ppc64
->guest_GPR3
, buf
, dir
, size
, mod
); break;
296 case 4: VG_(transfer
) (&ppc64
->guest_GPR4
, buf
, dir
, size
, mod
); break;
297 case 5: VG_(transfer
) (&ppc64
->guest_GPR5
, buf
, dir
, size
, mod
); break;
298 case 6: VG_(transfer
) (&ppc64
->guest_GPR6
, buf
, dir
, size
, mod
); break;
299 case 7: VG_(transfer
) (&ppc64
->guest_GPR7
, buf
, dir
, size
, mod
); break;
300 case 8: VG_(transfer
) (&ppc64
->guest_GPR8
, buf
, dir
, size
, mod
); break;
301 case 9: VG_(transfer
) (&ppc64
->guest_GPR9
, buf
, dir
, size
, mod
); break;
302 case 10: VG_(transfer
) (&ppc64
->guest_GPR10
, buf
, dir
, size
, mod
); break;
303 case 11: VG_(transfer
) (&ppc64
->guest_GPR11
, buf
, dir
, size
, mod
); break;
304 case 12: VG_(transfer
) (&ppc64
->guest_GPR12
, buf
, dir
, size
, mod
); break;
305 case 13: VG_(transfer
) (&ppc64
->guest_GPR13
, buf
, dir
, size
, mod
); break;
306 case 14: VG_(transfer
) (&ppc64
->guest_GPR14
, buf
, dir
, size
, mod
); break;
307 case 15: VG_(transfer
) (&ppc64
->guest_GPR15
, buf
, dir
, size
, mod
); break;
308 case 16: VG_(transfer
) (&ppc64
->guest_GPR16
, buf
, dir
, size
, mod
); break;
309 case 17: VG_(transfer
) (&ppc64
->guest_GPR17
, buf
, dir
, size
, mod
); break;
310 case 18: VG_(transfer
) (&ppc64
->guest_GPR18
, buf
, dir
, size
, mod
); break;
311 case 19: VG_(transfer
) (&ppc64
->guest_GPR19
, buf
, dir
, size
, mod
); break;
312 case 20: VG_(transfer
) (&ppc64
->guest_GPR20
, buf
, dir
, size
, mod
); break;
313 case 21: VG_(transfer
) (&ppc64
->guest_GPR21
, buf
, dir
, size
, mod
); break;
314 case 22: VG_(transfer
) (&ppc64
->guest_GPR22
, buf
, dir
, size
, mod
); break;
315 case 23: VG_(transfer
) (&ppc64
->guest_GPR23
, buf
, dir
, size
, mod
); break;
316 case 24: VG_(transfer
) (&ppc64
->guest_GPR24
, buf
, dir
, size
, mod
); break;
317 case 25: VG_(transfer
) (&ppc64
->guest_GPR25
, buf
, dir
, size
, mod
); break;
318 case 26: VG_(transfer
) (&ppc64
->guest_GPR26
, buf
, dir
, size
, mod
); break;
319 case 27: VG_(transfer
) (&ppc64
->guest_GPR27
, buf
, dir
, size
, mod
); break;
320 case 28: VG_(transfer
) (&ppc64
->guest_GPR28
, buf
, dir
, size
, mod
); break;
321 case 29: VG_(transfer
) (&ppc64
->guest_GPR29
, buf
, dir
, size
, mod
); break;
322 case 30: VG_(transfer
) (&ppc64
->guest_GPR30
, buf
, dir
, size
, mod
); break;
323 case 31: VG_(transfer
) (&ppc64
->guest_GPR31
, buf
, dir
, size
, mod
); break;
325 case 32: VG_(transfer
) (&ppc64
->guest_VSR0
[high_offset
], buf
, dir
, size
, mod
); break;
326 case 33: VG_(transfer
) (&ppc64
->guest_VSR1
[high_offset
], buf
, dir
, size
, mod
); break;
327 case 34: VG_(transfer
) (&ppc64
->guest_VSR2
[high_offset
], buf
, dir
, size
, mod
); break;
328 case 35: VG_(transfer
) (&ppc64
->guest_VSR3
[high_offset
], buf
, dir
, size
, mod
); break;
329 case 36: VG_(transfer
) (&ppc64
->guest_VSR4
[high_offset
], buf
, dir
, size
, mod
); break;
330 case 37: VG_(transfer
) (&ppc64
->guest_VSR5
[high_offset
], buf
, dir
, size
, mod
); break;
331 case 38: VG_(transfer
) (&ppc64
->guest_VSR6
[high_offset
], buf
, dir
, size
, mod
); break;
332 case 39: VG_(transfer
) (&ppc64
->guest_VSR7
[high_offset
], buf
, dir
, size
, mod
); break;
333 case 40: VG_(transfer
) (&ppc64
->guest_VSR8
[high_offset
], buf
, dir
, size
, mod
); break;
334 case 41: VG_(transfer
) (&ppc64
->guest_VSR9
[high_offset
], buf
, dir
, size
, mod
); break;
335 case 42: VG_(transfer
) (&ppc64
->guest_VSR10
[high_offset
], buf
, dir
, size
, mod
); break;
336 case 43: VG_(transfer
) (&ppc64
->guest_VSR11
[high_offset
], buf
, dir
, size
, mod
); break;
337 case 44: VG_(transfer
) (&ppc64
->guest_VSR12
[high_offset
], buf
, dir
, size
, mod
); break;
338 case 45: VG_(transfer
) (&ppc64
->guest_VSR13
[high_offset
], buf
, dir
, size
, mod
); break;
339 case 46: VG_(transfer
) (&ppc64
->guest_VSR14
[high_offset
], buf
, dir
, size
, mod
); break;
340 case 47: VG_(transfer
) (&ppc64
->guest_VSR15
[high_offset
], buf
, dir
, size
, mod
); break;
341 case 48: VG_(transfer
) (&ppc64
->guest_VSR16
[high_offset
], buf
, dir
, size
, mod
); break;
342 case 49: VG_(transfer
) (&ppc64
->guest_VSR17
[high_offset
], buf
, dir
, size
, mod
); break;
343 case 50: VG_(transfer
) (&ppc64
->guest_VSR18
[high_offset
], buf
, dir
, size
, mod
); break;
344 case 51: VG_(transfer
) (&ppc64
->guest_VSR19
[high_offset
], buf
, dir
, size
, mod
); break;
345 case 52: VG_(transfer
) (&ppc64
->guest_VSR20
[high_offset
], buf
, dir
, size
, mod
); break;
346 case 53: VG_(transfer
) (&ppc64
->guest_VSR21
[high_offset
], buf
, dir
, size
, mod
); break;
347 case 54: VG_(transfer
) (&ppc64
->guest_VSR22
[high_offset
], buf
, dir
, size
, mod
); break;
348 case 55: VG_(transfer
) (&ppc64
->guest_VSR23
[high_offset
], buf
, dir
, size
, mod
); break;
349 case 56: VG_(transfer
) (&ppc64
->guest_VSR24
[high_offset
], buf
, dir
, size
, mod
); break;
350 case 57: VG_(transfer
) (&ppc64
->guest_VSR25
[high_offset
], buf
, dir
, size
, mod
); break;
351 case 58: VG_(transfer
) (&ppc64
->guest_VSR26
[high_offset
], buf
, dir
, size
, mod
); break;
352 case 59: VG_(transfer
) (&ppc64
->guest_VSR27
[high_offset
], buf
, dir
, size
, mod
); break;
353 case 60: VG_(transfer
) (&ppc64
->guest_VSR28
[high_offset
], buf
, dir
, size
, mod
); break;
354 case 61: VG_(transfer
) (&ppc64
->guest_VSR29
[high_offset
], buf
, dir
, size
, mod
); break;
355 case 62: VG_(transfer
) (&ppc64
->guest_VSR30
[high_offset
], buf
, dir
, size
, mod
); break;
356 case 63: VG_(transfer
) (&ppc64
->guest_VSR31
[high_offset
], buf
, dir
, size
, mod
); break;
358 case 64: VG_(transfer
) (&ppc64
->guest_CIA
, buf
, dir
, size
, mod
); break;
359 case 65: *mod
= False
; break; // VEX does not model Machine State Register
361 UInt cr
= LibVEX_GuestPPC64_get_CR (ppc64
);
362 if (dir
== valgrind_to_gdbserver
) {
363 VG_(transfer
) (&cr
, buf
, dir
, size
, mod
);
366 VG_(transfer
) (&newcr
, buf
, dir
, size
, mod
);
368 LibVEX_GuestPPC64_put_CR (newcr
, ppc64
);
372 case 67: VG_(transfer
) (&ppc64
->guest_LR
, buf
, dir
, size
, mod
); break;
373 case 68: VG_(transfer
) (&ppc64
->guest_CTR
, buf
, dir
, size
, mod
); break;
375 UInt xer
= LibVEX_GuestPPC64_get_XER (ppc64
);
376 if (dir
== valgrind_to_gdbserver
) {
377 VG_(transfer
) (&xer
, buf
, dir
, size
, mod
);
380 VG_(transfer
) (&newxer
, buf
, dir
, size
, mod
);
381 *mod
= newxer
!= xer
;
382 LibVEX_GuestPPC64_put_XER (newxer
, ppc64
);
386 case 70: VG_(transfer
) (&ppc64
->guest_FPROUND
, buf
, dir
, size
, mod
); break;
387 case 71: *mod
= False
; break; // GDBTD???? VEX { "orig_r3", 4448, 64 },
388 case 72: *mod
= False
; break; // GDBTD???? VEX { "trap", 4512, 64 },
390 case 73: VG_(transfer
) (&ppc64
->guest_VSR32
, buf
, dir
, size
, mod
); break;
391 case 74: VG_(transfer
) (&ppc64
->guest_VSR33
, buf
, dir
, size
, mod
); break;
392 case 75: VG_(transfer
) (&ppc64
->guest_VSR34
, buf
, dir
, size
, mod
); break;
393 case 76: VG_(transfer
) (&ppc64
->guest_VSR35
, buf
, dir
, size
, mod
); break;
394 case 77: VG_(transfer
) (&ppc64
->guest_VSR36
, buf
, dir
, size
, mod
); break;
395 case 78: VG_(transfer
) (&ppc64
->guest_VSR37
, buf
, dir
, size
, mod
); break;
396 case 79: VG_(transfer
) (&ppc64
->guest_VSR38
, buf
, dir
, size
, mod
); break;
397 case 80: VG_(transfer
) (&ppc64
->guest_VSR39
, buf
, dir
, size
, mod
); break;
398 case 81: VG_(transfer
) (&ppc64
->guest_VSR40
, buf
, dir
, size
, mod
); break;
399 case 82: VG_(transfer
) (&ppc64
->guest_VSR40
, buf
, dir
, size
, mod
); break;
400 case 83: VG_(transfer
) (&ppc64
->guest_VSR42
, buf
, dir
, size
, mod
); break;
401 case 84: VG_(transfer
) (&ppc64
->guest_VSR43
, buf
, dir
, size
, mod
); break;
402 case 85: VG_(transfer
) (&ppc64
->guest_VSR44
, buf
, dir
, size
, mod
); break;
403 case 86: VG_(transfer
) (&ppc64
->guest_VSR45
, buf
, dir
, size
, mod
); break;
404 case 87: VG_(transfer
) (&ppc64
->guest_VSR46
, buf
, dir
, size
, mod
); break;
405 case 88: VG_(transfer
) (&ppc64
->guest_VSR47
, buf
, dir
, size
, mod
); break;
406 case 89: VG_(transfer
) (&ppc64
->guest_VSR48
, buf
, dir
, size
, mod
); break;
407 case 90: VG_(transfer
) (&ppc64
->guest_VSR49
, buf
, dir
, size
, mod
); break;
408 case 91: VG_(transfer
) (&ppc64
->guest_VSR50
, buf
, dir
, size
, mod
); break;
409 case 92: VG_(transfer
) (&ppc64
->guest_VSR51
, buf
, dir
, size
, mod
); break;
410 case 93: VG_(transfer
) (&ppc64
->guest_VSR52
, buf
, dir
, size
, mod
); break;
411 case 94: VG_(transfer
) (&ppc64
->guest_VSR53
, buf
, dir
, size
, mod
); break;
412 case 95: VG_(transfer
) (&ppc64
->guest_VSR54
, buf
, dir
, size
, mod
); break;
413 case 96: VG_(transfer
) (&ppc64
->guest_VSR55
, buf
, dir
, size
, mod
); break;
414 case 97: VG_(transfer
) (&ppc64
->guest_VSR56
, buf
, dir
, size
, mod
); break;
415 case 98: VG_(transfer
) (&ppc64
->guest_VSR57
, buf
, dir
, size
, mod
); break;
416 case 99: VG_(transfer
) (&ppc64
->guest_VSR58
, buf
, dir
, size
, mod
); break;
417 case 100: VG_(transfer
) (&ppc64
->guest_VSR59
, buf
, dir
, size
, mod
); break;
418 case 101: VG_(transfer
) (&ppc64
->guest_VSR60
, buf
, dir
, size
, mod
); break;
419 case 102: VG_(transfer
) (&ppc64
->guest_VSR61
, buf
, dir
, size
, mod
); break;
420 case 103: VG_(transfer
) (&ppc64
->guest_VSR62
, buf
, dir
, size
, mod
); break;
421 case 104: VG_(transfer
) (&ppc64
->guest_VSR63
, buf
, dir
, size
, mod
); break;
422 case 105: VG_(transfer
) (&ppc64
->guest_VSCR
, buf
, dir
, size
, mod
); break;
423 case 106: VG_(transfer
) (&ppc64
->guest_VRSAVE
, buf
, dir
, size
, mod
); break;
425 /* Fetch the lower 64-bits of the VSR registers. GDB will combine the
426 * lower 64-bits of the VSR with the upper 64-bits it got fetching the
427 * corresponding floating point register to display the full 128-bit
430 case 107: VG_(transfer
) (&ppc64
->guest_VSR0
[low_offset
], buf
, dir
, size
, mod
); break;
431 case 108: VG_(transfer
) (&ppc64
->guest_VSR1
[low_offset
], buf
, dir
, size
, mod
); break;
432 case 109: VG_(transfer
) (&ppc64
->guest_VSR2
[low_offset
], buf
, dir
, size
, mod
); break;
433 case 110: VG_(transfer
) (&ppc64
->guest_VSR3
[low_offset
], buf
, dir
, size
, mod
); break;
434 case 111: VG_(transfer
) (&ppc64
->guest_VSR4
[low_offset
], buf
, dir
, size
, mod
); break;
435 case 112: VG_(transfer
) (&ppc64
->guest_VSR5
[low_offset
], buf
, dir
, size
, mod
); break;
436 case 113: VG_(transfer
) (&ppc64
->guest_VSR6
[low_offset
], buf
, dir
, size
, mod
); break;
437 case 114: VG_(transfer
) (&ppc64
->guest_VSR7
[low_offset
], buf
, dir
, size
, mod
); break;
438 case 115: VG_(transfer
) (&ppc64
->guest_VSR8
[low_offset
], buf
, dir
, size
, mod
); break;
439 case 116: VG_(transfer
) (&ppc64
->guest_VSR9
[low_offset
], buf
, dir
, size
, mod
); break;
440 case 117: VG_(transfer
) (&ppc64
->guest_VSR10
[low_offset
], buf
, dir
, size
, mod
); break;
441 case 118: VG_(transfer
) (&ppc64
->guest_VSR11
[low_offset
], buf
, dir
, size
, mod
); break;
442 case 119: VG_(transfer
) (&ppc64
->guest_VSR12
[low_offset
], buf
, dir
, size
, mod
); break;
443 case 120: VG_(transfer
) (&ppc64
->guest_VSR13
[low_offset
], buf
, dir
, size
, mod
); break;
444 case 121: VG_(transfer
) (&ppc64
->guest_VSR14
[low_offset
], buf
, dir
, size
, mod
); break;
445 case 122: VG_(transfer
) (&ppc64
->guest_VSR15
[low_offset
], buf
, dir
, size
, mod
); break;
446 case 123: VG_(transfer
) (&ppc64
->guest_VSR16
[low_offset
], buf
, dir
, size
, mod
); break;
447 case 124: VG_(transfer
) (&ppc64
->guest_VSR17
[low_offset
], buf
, dir
, size
, mod
); break;
448 case 125: VG_(transfer
) (&ppc64
->guest_VSR18
[low_offset
], buf
, dir
, size
, mod
); break;
449 case 126: VG_(transfer
) (&ppc64
->guest_VSR19
[low_offset
], buf
, dir
, size
, mod
); break;
450 case 127: VG_(transfer
) (&ppc64
->guest_VSR20
[low_offset
], buf
, dir
, size
, mod
); break;
451 case 128: VG_(transfer
) (&ppc64
->guest_VSR21
[low_offset
], buf
, dir
, size
, mod
); break;
452 case 129: VG_(transfer
) (&ppc64
->guest_VSR22
[low_offset
], buf
, dir
, size
, mod
); break;
453 case 130: VG_(transfer
) (&ppc64
->guest_VSR23
[low_offset
], buf
, dir
, size
, mod
); break;
454 case 131: VG_(transfer
) (&ppc64
->guest_VSR24
[low_offset
], buf
, dir
, size
, mod
); break;
455 case 132: VG_(transfer
) (&ppc64
->guest_VSR25
[low_offset
], buf
, dir
, size
, mod
); break;
456 case 133: VG_(transfer
) (&ppc64
->guest_VSR26
[low_offset
], buf
, dir
, size
, mod
); break;
457 case 134: VG_(transfer
) (&ppc64
->guest_VSR27
[low_offset
], buf
, dir
, size
, mod
); break;
458 case 135: VG_(transfer
) (&ppc64
->guest_VSR28
[low_offset
], buf
, dir
, size
, mod
); break;
459 case 136: VG_(transfer
) (&ppc64
->guest_VSR29
[low_offset
], buf
, dir
, size
, mod
); break;
460 case 137: VG_(transfer
) (&ppc64
->guest_VSR30
[low_offset
], buf
, dir
, size
, mod
); break;
461 case 138: VG_(transfer
) (&ppc64
->guest_VSR31
[low_offset
], buf
, dir
, size
, mod
); break;
462 default: vg_assert(0);
467 const char* target_xml (Bool shadow_mode
)
469 /* NOTE, the current powerpc-altivec64l*.xml files includes the vsx
470 * registers. Power 6 and earlier power processors do not support the
471 * vsx registers. GDB has a bug in that it is only checking for ptrace
472 * support rather then checking the actual HW feature. Hence GDB on
473 * power 6 prints vsx registers that do not exist. Valgrind GDB support
474 * also has to include the vsx register definitions to be consistent with
478 return "powerpc-altivec64l-valgrind.xml";
480 return "powerpc-altivec64l.xml";
484 static CORE_ADDR
** target_get_dtv (ThreadState
*tst
)
486 VexGuestPPC64State
* ppc64
= (VexGuestPPC64State
*)&tst
->arch
.vex
;
487 // ppc64 dtv is located just before the tcb, which is 0x7000 before
488 // the thread id (r13)
489 return (CORE_ADDR
**)((CORE_ADDR
)ppc64
->guest_GPR13
490 - 0x7000 - sizeof(CORE_ADDR
));
493 static struct valgrind_target_ops low_target
= {
505 void ppc64_init_architecture (struct valgrind_target_ops
*target
)
507 *target
= low_target
;
508 set_register_cache (regs
, num_regs
);
509 gdbserver_expedite_regs
= expedite_regs
;