GDB (xrefs)

/tmp/gdb-8.1/gdb/ppc-linux-tdep.c
Go to the documentation of this file.
1 /* Target-dependent code for GDB, the GNU debugger.
2
3 Copyright (C) 1986-2018 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 #include "defs.h"
21 #include "frame.h"
22 #include "inferior.h"
23 #include "symtab.h"
24 #include "target.h"
25 #include "gdbcore.h"
26 #include "gdbcmd.h"
27 #include "symfile.h"
28 #include "objfiles.h"
29 #include "regcache.h"
30 #include "value.h"
31 #include "osabi.h"
32 #include "regset.h"
33 #include "solib-svr4.h"
34 #include "solib-spu.h"
35 #include "solib.h"
36 #include "solist.h"
37 #include "ppc-tdep.h"
38 #include "ppc64-tdep.h"
39 #include "ppc-linux-tdep.h"
40 #include "glibc-tdep.h"
41 #include "trad-frame.h"
42 #include "frame-unwind.h"
43 #include "tramp-frame.h"
44 #include "observer.h"
45 #include "auxv.h"
46 #include "elf/common.h"
47 #include "elf/ppc64.h"
48 #include "arch-utils.h"
49 #include "spu-tdep.h"
50 #include "xml-syscall.h"
51 #include "linux-tdep.h"
52 #include "linux-record.h"
53 #include "record-full.h"
54 #include "infrun.h"
55
56 #include "stap-probe.h"
57 #include "ax.h"
58 #include "ax-gdb.h"
59 #include "cli/cli-utils.h"
60 #include "parser-defs.h"
61 #include "user-regs.h"
62 #include <ctype.h>
63 #include "elf-bfd.h"
64
65 #include "features/rs6000/powerpc-32l.c"
66 #include "features/rs6000/powerpc-altivec32l.c"
67 #include "features/rs6000/powerpc-cell32l.c"
68 #include "features/rs6000/powerpc-vsx32l.c"
69 #include "features/rs6000/powerpc-isa205-32l.c"
70 #include "features/rs6000/powerpc-isa205-altivec32l.c"
71 #include "features/rs6000/powerpc-isa205-vsx32l.c"
72 #include "features/rs6000/powerpc-64l.c"
73 #include "features/rs6000/powerpc-altivec64l.c"
74 #include "features/rs6000/powerpc-cell64l.c"
75 #include "features/rs6000/powerpc-vsx64l.c"
76 #include "features/rs6000/powerpc-isa205-64l.c"
77 #include "features/rs6000/powerpc-isa205-altivec64l.c"
78 #include "features/rs6000/powerpc-isa205-vsx64l.c"
79 #include "features/rs6000/powerpc-e500l.c"
80
81 /* Shared library operations for PowerPC-Linux. */
82 static struct target_so_ops powerpc_so_ops;
83
84 /* The syscall's XML filename for PPC and PPC64. */
85 #define XML_SYSCALL_FILENAME_PPC "syscalls/ppc-linux.xml"
86 #define XML_SYSCALL_FILENAME_PPC64 "syscalls/ppc64-linux.xml"
87
88 /* ppc_linux_memory_remove_breakpoints attempts to remove a breakpoint
89 in much the same fashion as memory_remove_breakpoint in mem-break.c,
90 but is careful not to write back the previous contents if the code
91 in question has changed in between inserting the breakpoint and
92 removing it.
93
94 Here is the problem that we're trying to solve...
95
96 Once upon a time, before introducing this function to remove
97 breakpoints from the inferior, setting a breakpoint on a shared
98 library function prior to running the program would not work
99 properly. In order to understand the problem, it is first
100 necessary to understand a little bit about dynamic linking on
101 this platform.
102
103 A call to a shared library function is accomplished via a bl
104 (branch-and-link) instruction whose branch target is an entry
105 in the procedure linkage table (PLT). The PLT in the object
106 file is uninitialized. To gdb, prior to running the program, the
107 entries in the PLT are all zeros.
108
109 Once the program starts running, the shared libraries are loaded
110 and the procedure linkage table is initialized, but the entries in
111 the table are not (necessarily) resolved. Once a function is
112 actually called, the code in the PLT is hit and the function is
113 resolved. In order to better illustrate this, an example is in
114 order; the following example is from the gdb testsuite.
115
116 We start the program shmain.
117
118 [kev@arroyo testsuite]$ ../gdb gdb.base/shmain
119 [...]
120
121 We place two breakpoints, one on shr1 and the other on main.
122
123 (gdb) b shr1
124 Breakpoint 1 at 0x100409d4
125 (gdb) b main
126 Breakpoint 2 at 0x100006a0: file gdb.base/shmain.c, line 44.
127
128 Examine the instruction (and the immediatly following instruction)
129 upon which the breakpoint was placed. Note that the PLT entry
130 for shr1 contains zeros.
131
132 (gdb) x/2i 0x100409d4
133 0x100409d4 <shr1>: .long 0x0
134 0x100409d8 <shr1+4>: .long 0x0
135
136 Now run 'til main.
137
138 (gdb) r
139 Starting program: gdb.base/shmain
140 Breakpoint 1 at 0xffaf790: file gdb.base/shr1.c, line 19.
141
142 Breakpoint 2, main ()
143 at gdb.base/shmain.c:44
144 44 g = 1;
145
146 Examine the PLT again. Note that the loading of the shared
147 library has initialized the PLT to code which loads a constant
148 (which I think is an index into the GOT) into r11 and then
149 branchs a short distance to the code which actually does the
150 resolving.
151
152 (gdb) x/2i 0x100409d4
153 0x100409d4 <shr1>: li r11,4
154 0x100409d8 <shr1+4>: b 0x10040984 <sg+4>
155 (gdb) c
156 Continuing.
157
158 Breakpoint 1, shr1 (x=1)
159 at gdb.base/shr1.c:19
160 19 l = 1;
161
162 Now we've hit the breakpoint at shr1. (The breakpoint was
163 reset from the PLT entry to the actual shr1 function after the
164 shared library was loaded.) Note that the PLT entry has been
165 resolved to contain a branch that takes us directly to shr1.
166 (The real one, not the PLT entry.)
167
168 (gdb) x/2i 0x100409d4
169 0x100409d4 <shr1>: b 0xffaf76c <shr1>
170 0x100409d8 <shr1+4>: b 0x10040984 <sg+4>
171
172 The thing to note here is that the PLT entry for shr1 has been
173 changed twice.
174
175 Now the problem should be obvious. GDB places a breakpoint (a
176 trap instruction) on the zero value of the PLT entry for shr1.
177 Later on, after the shared library had been loaded and the PLT
178 initialized, GDB gets a signal indicating this fact and attempts
179 (as it always does when it stops) to remove all the breakpoints.
180
181 The breakpoint removal was causing the former contents (a zero
182 word) to be written back to the now initialized PLT entry thus
183 destroying a portion of the initialization that had occurred only a
184 short time ago. When execution continued, the zero word would be
185 executed as an instruction an illegal instruction trap was
186 generated instead. (0 is not a legal instruction.)
187
188 The fix for this problem was fairly straightforward. The function
189 memory_remove_breakpoint from mem-break.c was copied to this file,
190 modified slightly, and renamed to ppc_linux_memory_remove_breakpoint.
191 In tm-linux.h, MEMORY_REMOVE_BREAKPOINT is defined to call this new
192 function.
193
194 The differences between ppc_linux_memory_remove_breakpoint () and
195 memory_remove_breakpoint () are minor. All that the former does
196 that the latter does not is check to make sure that the breakpoint
197 location actually contains a breakpoint (trap instruction) prior
198 to attempting to write back the old contents. If it does contain
199 a trap instruction, we allow the old contents to be written back.
200 Otherwise, we silently do nothing.
201
202 The big question is whether memory_remove_breakpoint () should be
203 changed to have the same functionality. The downside is that more
204 traffic is generated for remote targets since we'll have an extra
205 fetch of a memory word each time a breakpoint is removed.
206
207 For the time being, we'll leave this self-modifying-code-friendly
208 version in ppc-linux-tdep.c, but it ought to be migrated somewhere
209 else in the event that some other platform has similar needs with
210 regard to removing breakpoints in some potentially self modifying
211 code. */
212 static int
213 ppc_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
214 struct bp_target_info *bp_tgt)
215 {
216 CORE_ADDR addr = bp_tgt->reqstd_address;
217 const unsigned char *bp;
218 int val;
219 int bplen;
220 gdb_byte old_contents[BREAKPOINT_MAX];
221
222 /* Determine appropriate breakpoint contents and size for this address. */
223 bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
224
225 /* Make sure we see the memory breakpoints. */
226 scoped_restore restore_memory
227 = make_scoped_restore_show_memory_breakpoints (1);
228 val = target_read_memory (addr, old_contents, bplen);
229
230 /* If our breakpoint is no longer at the address, this means that the
231 program modified the code on us, so it is wrong to put back the
232 old value. */
233 if (val == 0 && memcmp (bp, old_contents, bplen) == 0)
234 val = target_write_raw_memory (addr, bp_tgt->shadow_contents, bplen);
235
236 return val;
237 }
238
239 /* For historic reasons, PPC 32 GNU/Linux follows PowerOpen rather
240 than the 32 bit SYSV R4 ABI structure return convention - all
241 structures, no matter their size, are put in memory. Vectors,
242 which were added later, do get returned in a register though. */
243
244 static enum return_value_convention
245 ppc_linux_return_value (struct gdbarch *gdbarch, struct value *function,
246 struct type *valtype, struct regcache *regcache,
247 gdb_byte *readbuf, const gdb_byte *writebuf)
248 {
249 if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
250 || TYPE_CODE (valtype) == TYPE_CODE_UNION)
251 && !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8)
252 && TYPE_VECTOR (valtype)))
253 return RETURN_VALUE_STRUCT_CONVENTION;
254 else
255 return ppc_sysv_abi_return_value (gdbarch, function, valtype, regcache,
256 readbuf, writebuf);
257 }
258
259 /* PLT stub in executable. */
260 static struct ppc_insn_pattern powerpc32_plt_stub[] =
261 {
262 { 0xffff0000, 0x3d600000, 0 }, /* lis r11, xxxx */
263 { 0xffff0000, 0x816b0000, 0 }, /* lwz r11, xxxx(r11) */
264 { 0xffffffff, 0x7d6903a6, 0 }, /* mtctr r11 */
265 { 0xffffffff, 0x4e800420, 0 }, /* bctr */
266 { 0, 0, 0 }
267 };
268
269 /* PLT stub in shared library. */
270 static struct ppc_insn_pattern powerpc32_plt_stub_so[] =
271 {
272 { 0xffff0000, 0x817e0000, 0 }, /* lwz r11, xxxx(r30) */
273 { 0xffffffff, 0x7d6903a6, 0 }, /* mtctr r11 */
274 { 0xffffffff, 0x4e800420, 0 }, /* bctr */
275 { 0xffffffff, 0x60000000, 0 }, /* nop */
276 { 0, 0, 0 }
277 };
278 #define POWERPC32_PLT_STUB_LEN ARRAY_SIZE (powerpc32_plt_stub)
279
280 /* Check if PC is in PLT stub. For non-secure PLT, stub is in .plt
281 section. For secure PLT, stub is in .text and we need to check
282 instruction patterns. */
283
284 static int
285 powerpc_linux_in_dynsym_resolve_code (CORE_ADDR pc)
286 {
287 struct bound_minimal_symbol sym;
288
289 /* Check whether PC is in the dynamic linker. This also checks
290 whether it is in the .plt section, used by non-PIC executables. */
291 if (svr4_in_dynsym_resolve_code (pc))
292 return 1;
293
294 /* Check if we are in the resolver. */
295 sym = lookup_minimal_symbol_by_pc (pc);
296 if (sym.minsym != NULL
297 && (strcmp (MSYMBOL_LINKAGE_NAME (sym.minsym), "__glink") == 0
298 || strcmp (MSYMBOL_LINKAGE_NAME (sym.minsym),
299 "__glink_PLTresolve") == 0))
300 return 1;
301
302 return 0;
303 }
304
305 /* Follow PLT stub to actual routine.
306
307 When the execution direction is EXEC_REVERSE, scan backward to
308 check whether we are in the middle of a PLT stub. Currently,
309 we only look-behind at most 4 instructions (the max length of PLT
310 stub sequence. */
311
312 static CORE_ADDR
313 ppc_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
314 {
315 unsigned int insnbuf[POWERPC32_PLT_STUB_LEN];
316 struct gdbarch *gdbarch = get_frame_arch (frame);
317 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
318 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
319 CORE_ADDR target = 0;
320 int scan_limit, i;
321
322 scan_limit = 1;
323 /* When reverse-debugging, scan backward to check whether we are
324 in the middle of trampoline code. */
325 if (execution_direction == EXEC_REVERSE)
326 scan_limit = 4; /* At more 4 instructions. */
327
328 for (i = 0; i < scan_limit; i++)
329 {
330 if (ppc_insns_match_pattern (frame, pc, powerpc32_plt_stub, insnbuf))
331 {
332 /* Insn pattern is
333 lis r11, xxxx
334 lwz r11, xxxx(r11)
335 Branch target is in r11. */
336
337 target = (ppc_insn_d_field (insnbuf[0]) << 16)
338 | ppc_insn_d_field (insnbuf[1]);
339 target = read_memory_unsigned_integer (target, 4, byte_order);
340 }
341 else if (ppc_insns_match_pattern (frame, pc, powerpc32_plt_stub_so,
342 insnbuf))
343 {
344 /* Insn pattern is
345 lwz r11, xxxx(r30)
346 Branch target is in r11. */
347
348 target = get_frame_register_unsigned (frame,
349 tdep->ppc_gp0_regnum + 30)
350 + ppc_insn_d_field (insnbuf[0]);
351 target = read_memory_unsigned_integer (target, 4, byte_order);
352 }
353 else
354 {
355 /* Scan backward one more instructions if doesn't match. */
356 pc -= 4;
357 continue;
358 }
359
360 return target;
361 }
362
363 return 0;
364 }
365
366 /* Wrappers to handle Linux-only registers. */
367
368 static void
369 ppc_linux_supply_gregset (const struct regset *regset,
370 struct regcache *regcache,
371 int regnum, const void *gregs, size_t len)
372 {
373 const struct ppc_reg_offsets *offsets
374 = (const struct ppc_reg_offsets *) regset->regmap;
375
376 ppc_supply_gregset (regset, regcache, regnum, gregs, len);
377
378 if (ppc_linux_trap_reg_p (regcache->arch ()))
379 {
380 /* "orig_r3" is stored 2 slots after "pc". */
381 if (regnum == -1 || regnum == PPC_ORIG_R3_REGNUM)
382 ppc_supply_reg (regcache, PPC_ORIG_R3_REGNUM, (const gdb_byte *) gregs,
383 offsets->pc_offset + 2 * offsets->gpr_size,
384 offsets->gpr_size);
385
386 /* "trap" is stored 8 slots after "pc". */
387 if (regnum == -1 || regnum == PPC_TRAP_REGNUM)
388 ppc_supply_reg (regcache, PPC_TRAP_REGNUM, (const gdb_byte *) gregs,
389 offsets->pc_offset + 8 * offsets->gpr_size,
390 offsets->gpr_size);
391 }
392 }
393
394 static void
395 ppc_linux_collect_gregset (const struct regset *regset,
396 const struct regcache *regcache,
397 int regnum, void *gregs, size_t len)
398 {
399 const struct ppc_reg_offsets *offsets
400 = (const struct ppc_reg_offsets *) regset->regmap;
401
402 /* Clear areas in the linux gregset not written elsewhere. */
403 if (regnum == -1)
404 memset (gregs, 0, len);
405
406 ppc_collect_gregset (regset, regcache, regnum, gregs, len);
407
408 if (ppc_linux_trap_reg_p (regcache->arch ()))
409 {
410 /* "orig_r3" is stored 2 slots after "pc". */
411 if (regnum == -1 || regnum == PPC_ORIG_R3_REGNUM)
412 ppc_collect_reg (regcache, PPC_ORIG_R3_REGNUM, (gdb_byte *) gregs,
413 offsets->pc_offset + 2 * offsets->gpr_size,
414 offsets->gpr_size);
415
416 /* "trap" is stored 8 slots after "pc". */
417 if (regnum == -1 || regnum == PPC_TRAP_REGNUM)
418 ppc_collect_reg (regcache, PPC_TRAP_REGNUM, (gdb_byte *) gregs,
419 offsets->pc_offset + 8 * offsets->gpr_size,
420 offsets->gpr_size);
421 }
422 }
423
424 /* Regset descriptions. */
425 static const struct ppc_reg_offsets ppc32_linux_reg_offsets =
426 {
427 /* General-purpose registers. */
428 /* .r0_offset = */ 0,
429 /* .gpr_size = */ 4,
430 /* .xr_size = */ 4,
431 /* .pc_offset = */ 128,
432 /* .ps_offset = */ 132,
433 /* .cr_offset = */ 152,
434 /* .lr_offset = */ 144,
435 /* .ctr_offset = */ 140,
436 /* .xer_offset = */ 148,
437 /* .mq_offset = */ 156,
438
439 /* Floating-point registers. */
440 /* .f0_offset = */ 0,
441 /* .fpscr_offset = */ 256,
442 /* .fpscr_size = */ 8,
443
444 /* AltiVec registers. */
445 /* .vr0_offset = */ 0,
446 /* .vscr_offset = */ 512 + 12,
447 /* .vrsave_offset = */ 528
448 };
449
450 static const struct ppc_reg_offsets ppc64_linux_reg_offsets =
451 {
452 /* General-purpose registers. */
453 /* .r0_offset = */ 0,
454 /* .gpr_size = */ 8,
455 /* .xr_size = */ 8,
456 /* .pc_offset = */ 256,
457 /* .ps_offset = */ 264,
458 /* .cr_offset = */ 304,
459 /* .lr_offset = */ 288,
460 /* .ctr_offset = */ 280,
461 /* .xer_offset = */ 296,
462 /* .mq_offset = */ 312,
463
464 /* Floating-point registers. */
465 /* .f0_offset = */ 0,
466 /* .fpscr_offset = */ 256,
467 /* .fpscr_size = */ 8,
468
469 /* AltiVec registers. */
470 /* .vr0_offset = */ 0,
471 /* .vscr_offset = */ 512 + 12,
472 /* .vrsave_offset = */ 528
473 };
474
475 static const struct regset ppc32_linux_gregset = {
476 &ppc32_linux_reg_offsets,
477 ppc_linux_supply_gregset,
478 ppc_linux_collect_gregset
479 };
480
481 static const struct regset ppc64_linux_gregset = {
482 &ppc64_linux_reg_offsets,
483 ppc_linux_supply_gregset,
484 ppc_linux_collect_gregset
485 };
486
487 static const struct regset ppc32_linux_fpregset = {
488 &ppc32_linux_reg_offsets,
489 ppc_supply_fpregset,
490 ppc_collect_fpregset
491 };
492
493 static const struct regset ppc32_linux_vrregset = {
494 &ppc32_linux_reg_offsets,
495 ppc_supply_vrregset,
496 ppc_collect_vrregset
497 };
498
499 static const struct regset ppc32_linux_vsxregset = {
500 &ppc32_linux_reg_offsets,
501 ppc_supply_vsxregset,
502 ppc_collect_vsxregset
503 };
504
505 const struct regset *
506 ppc_linux_gregset (int wordsize)
507 {
508 return wordsize == 8 ? &ppc64_linux_gregset : &ppc32_linux_gregset;
509 }
510
511 const struct regset *
512 ppc_linux_fpregset (void)
513 {
514 return &ppc32_linux_fpregset;
515 }
516
517 /* Iterate over supported core file register note sections. */
518
519 static void
520 ppc_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
521 iterate_over_regset_sections_cb *cb,
522 void *cb_data,
523 const struct regcache *regcache)
524 {
525 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
526 int have_altivec = tdep->ppc_vr0_regnum != -1;
527 int have_vsx = tdep->ppc_vsr0_upper_regnum != -1;
528
529 if (tdep->wordsize == 4)
530 cb (".reg", 48 * 4, &ppc32_linux_gregset, NULL, cb_data);
531 else
532 cb (".reg", 48 * 8, &ppc64_linux_gregset, NULL, cb_data);
533
534 cb (".reg2", 264, &ppc32_linux_fpregset, NULL, cb_data);
535
536 if (have_altivec)
537 cb (".reg-ppc-vmx", 544, &ppc32_linux_vrregset, "ppc Altivec", cb_data);
538
539 if (have_vsx)
540 cb (".reg-ppc-vsx", 256, &ppc32_linux_vsxregset, "POWER7 VSX", cb_data);
541 }
542
543 static void
544 ppc_linux_sigtramp_cache (struct frame_info *this_frame,
545 struct trad_frame_cache *this_cache,
546 CORE_ADDR func, LONGEST offset,
547 int bias)
548 {
549 CORE_ADDR base;
550 CORE_ADDR regs;
551 CORE_ADDR gpregs;
552 CORE_ADDR fpregs;
553 int i;
554 struct gdbarch *gdbarch = get_frame_arch (this_frame);
555 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
556 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
557
558 base = get_frame_register_unsigned (this_frame,
559 gdbarch_sp_regnum (gdbarch));
560 if (bias > 0 && get_frame_pc (this_frame) != func)
561 /* See below, some signal trampolines increment the stack as their
562 first instruction, need to compensate for that. */
563 base -= bias;
564
565 /* Find the address of the register buffer pointer. */
566 regs = base + offset;
567 /* Use that to find the address of the corresponding register
568 buffers. */
569 gpregs = read_memory_unsigned_integer (regs, tdep->wordsize, byte_order);
570 fpregs = gpregs + 48 * tdep->wordsize;
571
572 /* General purpose. */
573 for (i = 0; i < 32; i++)
574 {
575 int regnum = i + tdep->ppc_gp0_regnum;
576 trad_frame_set_reg_addr (this_cache,
577 regnum, gpregs + i * tdep->wordsize);
578 }
579 trad_frame_set_reg_addr (this_cache,
580 gdbarch_pc_regnum (gdbarch),
581 gpregs + 32 * tdep->wordsize);
582 trad_frame_set_reg_addr (this_cache, tdep->ppc_ctr_regnum,
583 gpregs + 35 * tdep->wordsize);
584 trad_frame_set_reg_addr (this_cache, tdep->ppc_lr_regnum,
585 gpregs + 36 * tdep->wordsize);
586 trad_frame_set_reg_addr (this_cache, tdep->ppc_xer_regnum,
587 gpregs + 37 * tdep->wordsize);
588 trad_frame_set_reg_addr (this_cache, tdep->ppc_cr_regnum,
589 gpregs + 38 * tdep->wordsize);
590
591 if (ppc_linux_trap_reg_p (gdbarch))
592 {
593 trad_frame_set_reg_addr (this_cache, PPC_ORIG_R3_REGNUM,
594 gpregs + 34 * tdep->wordsize);
595 trad_frame_set_reg_addr (this_cache, PPC_TRAP_REGNUM,
596 gpregs + 40 * tdep->wordsize);
597 }
598
599 if (ppc_floating_point_unit_p (gdbarch))
600 {
601 /* Floating point registers. */
602 for (i = 0; i < 32; i++)
603 {
604 int regnum = i + gdbarch_fp0_regnum (gdbarch);
605 trad_frame_set_reg_addr (this_cache, regnum,
606 fpregs + i * tdep->wordsize);
607 }
608 trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum,
609 fpregs + 32 * tdep->wordsize);
610 }
611 trad_frame_set_id (this_cache, frame_id_build (base, func));
612 }
613
614 static void
615 ppc32_linux_sigaction_cache_init (const struct tramp_frame *self,
616 struct frame_info *this_frame,
617 struct trad_frame_cache *this_cache,
618 CORE_ADDR func)
619 {
620 ppc_linux_sigtramp_cache (this_frame, this_cache, func,
621 0xd0 /* Offset to ucontext_t. */
622 + 0x30 /* Offset to .reg. */,
623 0);
624 }
625
626 static void
627 ppc64_linux_sigaction_cache_init (const struct tramp_frame *self,
628 struct frame_info *this_frame,
629 struct trad_frame_cache *this_cache,
630 CORE_ADDR func)
631 {
632 ppc_linux_sigtramp_cache (this_frame, this_cache, func,
633 0x80 /* Offset to ucontext_t. */
634 + 0xe0 /* Offset to .reg. */,
635 128);
636 }
637
638 static void
639 ppc32_linux_sighandler_cache_init (const struct tramp_frame *self,
640 struct frame_info *this_frame,
641 struct trad_frame_cache *this_cache,
642 CORE_ADDR func)
643 {
644 ppc_linux_sigtramp_cache (this_frame, this_cache, func,
645 0x40 /* Offset to ucontext_t. */
646 + 0x1c /* Offset to .reg. */,
647 0);
648 }
649
650 static void
651 ppc64_linux_sighandler_cache_init (const struct tramp_frame *self,
652 struct frame_info *this_frame,
653 struct trad_frame_cache *this_cache,
654 CORE_ADDR func)
655 {
656 ppc_linux_sigtramp_cache (this_frame, this_cache, func,
657 0x80 /* Offset to struct sigcontext. */
658 + 0x38 /* Offset to .reg. */,
659 128);
660 }
661
662 static struct tramp_frame ppc32_linux_sigaction_tramp_frame = {
663 SIGTRAMP_FRAME,
664 4,
665 {
666 { 0x380000ac, -1 }, /* li r0, 172 */
667 { 0x44000002, -1 }, /* sc */
668 { TRAMP_SENTINEL_INSN },
669 },
670 ppc32_linux_sigaction_cache_init
671 };
672 static struct tramp_frame ppc64_linux_sigaction_tramp_frame = {
673 SIGTRAMP_FRAME,
674 4,
675 {
676 { 0x38210080, -1 }, /* addi r1,r1,128 */
677 { 0x380000ac, -1 }, /* li r0, 172 */
678 { 0x44000002, -1 }, /* sc */
679 { TRAMP_SENTINEL_INSN },
680 },
681 ppc64_linux_sigaction_cache_init
682 };
683 static struct tramp_frame ppc32_linux_sighandler_tramp_frame = {
684 SIGTRAMP_FRAME,
685 4,
686 {
687 { 0x38000077, -1 }, /* li r0,119 */
688 { 0x44000002, -1 }, /* sc */
689 { TRAMP_SENTINEL_INSN },
690 },
691 ppc32_linux_sighandler_cache_init
692 };
693 static struct tramp_frame ppc64_linux_sighandler_tramp_frame = {
694 SIGTRAMP_FRAME,
695 4,
696 {
697 { 0x38210080, -1 }, /* addi r1,r1,128 */
698 { 0x38000077, -1 }, /* li r0,119 */
699 { 0x44000002, -1 }, /* sc */
700 { TRAMP_SENTINEL_INSN },
701 },
702 ppc64_linux_sighandler_cache_init
703 };
704
705 /* Return 1 if PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM are usable. */
706 int
707 ppc_linux_trap_reg_p (struct gdbarch *gdbarch)
708 {
709 /* If we do not have a target description with registers, then
710 the special registers will not be included in the register set. */
711 if (!tdesc_has_registers (gdbarch_target_desc (gdbarch)))
712 return 0;
713
714 /* If we do, then it is safe to check the size. */
715 return register_size (gdbarch, PPC_ORIG_R3_REGNUM) > 0
716 && register_size (gdbarch, PPC_TRAP_REGNUM) > 0;
717 }
718
719 /* Return the current system call's number present in the
720 r0 register. When the function fails, it returns -1. */
721 static LONGEST
722 ppc_linux_get_syscall_number (struct gdbarch *gdbarch,
723 ptid_t ptid)
724 {
725 struct regcache *regcache = get_thread_regcache (ptid);
726 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
727 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
728
729 /* Make sure we're in a 32- or 64-bit machine */
730 gdb_assert (tdep->wordsize == 4 || tdep->wordsize == 8);
731
732 /* The content of a register */
733 gdb::byte_vector buf (tdep->wordsize);
734
735 /* Getting the system call number from the register.
736 When dealing with PowerPC architecture, this information
737 is stored at 0th register. */
738 regcache_cooked_read (regcache, tdep->ppc_gp0_regnum, buf.data ());
739
740 return extract_signed_integer (buf.data (), tdep->wordsize, byte_order);
741 }
742
743 /* PPC process record-replay */
744
745 static struct linux_record_tdep ppc_linux_record_tdep;
746 static struct linux_record_tdep ppc64_linux_record_tdep;
747
748 /* ppc_canonicalize_syscall maps from the native PowerPC Linux set of
749 syscall ids into a canonical set of syscall ids used by process
750 record. (See arch/powerpc/include/uapi/asm/unistd.h in kernel tree.)
751 Return -1 if this system call is not supported by process record.
752 Otherwise, return the syscall number for preocess reocrd of given
753 SYSCALL. */
754
755 static enum gdb_syscall
756 ppc_canonicalize_syscall (int syscall)
757 {
758 int result = -1;
759
760 if (syscall <= 165)
761 result = syscall;
762 else if (syscall >= 167 && syscall <= 190) /* Skip query_module 166 */
763 result = syscall + 1;
764 else if (syscall >= 192 && syscall <= 197) /* mmap2 */
765 result = syscall;
766 else if (syscall == 208) /* tkill */
767 result = gdb_sys_tkill;
768 else if (syscall >= 207 && syscall <= 220) /* gettid */
769 result = syscall + 224 - 207;
770 else if (syscall >= 234 && syscall <= 239) /* exit_group */
771 result = syscall + 252 - 234;
772 else if (syscall >= 240 && syscall <= 248) /* timer_create */
773 result = syscall += 259 - 240;
774 else if (syscall >= 250 && syscall <= 251) /* tgkill */
775 result = syscall + 270 - 250;
776 else if (syscall == 336)
777 result = gdb_sys_recv;
778 else if (syscall == 337)
779 result = gdb_sys_recvfrom;
780 else if (syscall == 342)
781 result = gdb_sys_recvmsg;
782
783 return (enum gdb_syscall) result;
784 }
785
786 /* Record registers which might be clobbered during system call.
787 Return 0 if successful. */
788
789 static int
790 ppc_linux_syscall_record (struct regcache *regcache)
791 {
792 struct gdbarch *gdbarch = regcache->arch ();
793 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
794 ULONGEST scnum;
795 enum gdb_syscall syscall_gdb;
796 int ret;
797 int i;
798
799 regcache_raw_read_unsigned (regcache, tdep->ppc_gp0_regnum, &scnum);
800 syscall_gdb = ppc_canonicalize_syscall (scnum);
801
802 if (syscall_gdb < 0)
803 {
804 printf_unfiltered (_("Process record and replay target doesn't "
805 "support syscall number %d\n"), (int) scnum);
806 return 0;
807 }
808
809 if (syscall_gdb == gdb_sys_sigreturn
810 || syscall_gdb == gdb_sys_rt_sigreturn)
811 {
812 int i, j;
813 int regsets[] = { tdep->ppc_gp0_regnum,
814 tdep->ppc_fp0_regnum,
815 tdep->ppc_vr0_regnum,
816 tdep->ppc_vsr0_upper_regnum };
817
818 for (j = 0; j < 4; j++)
819 {
820 if (regsets[j] == -1)
821 continue;
822 for (i = 0; i < 32; i++)
823 {
824 if (record_full_arch_list_add_reg (regcache, regsets[j] + i))
825 return -1;
826 }
827 }
828
829 if (record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum))
830 return -1;
831 if (record_full_arch_list_add_reg (regcache, tdep->ppc_ctr_regnum))
832 return -1;
833 if (record_full_arch_list_add_reg (regcache, tdep->ppc_lr_regnum))
834 return -1;
835 if (record_full_arch_list_add_reg (regcache, tdep->ppc_xer_regnum))
836 return -1;
837
838 return 0;
839 }
840
841 if (tdep->wordsize == 8)
842 ret = record_linux_system_call (syscall_gdb, regcache,
843 &ppc64_linux_record_tdep);
844 else
845 ret = record_linux_system_call (syscall_gdb, regcache,
846 &ppc_linux_record_tdep);
847
848 if (ret != 0)
849 return ret;
850
851 /* Record registers clobbered during syscall. */
852 for (i = 3; i <= 12; i++)
853 {
854 if (record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + i))
855 return -1;
856 }
857 if (record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + 0))
858 return -1;
859 if (record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum))
860 return -1;
861 if (record_full_arch_list_add_reg (regcache, tdep->ppc_ctr_regnum))
862 return -1;
863 if (record_full_arch_list_add_reg (regcache, tdep->ppc_lr_regnum))
864 return -1;
865
866 return 0;
867 }
868
869 /* Record registers which might be clobbered during signal handling.
870 Return 0 if successful. */
871
872 static int
873 ppc_linux_record_signal (struct gdbarch *gdbarch, struct regcache *regcache,
874 enum gdb_signal signal)
875 {
876 /* See handle_rt_signal64 in arch/powerpc/kernel/signal_64.c
877 handle_rt_signal32 in arch/powerpc/kernel/signal_32.c
878 arch/powerpc/include/asm/ptrace.h
879 for details. */
880 const int SIGNAL_FRAMESIZE = 128;
881 const int sizeof_rt_sigframe = 1440 * 2 + 8 * 2 + 4 * 6 + 8 + 8 + 128 + 512;
882 ULONGEST sp;
883 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
884 int i;
885
886 for (i = 3; i <= 12; i++)
887 {
888 if (record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + i))
889 return -1;
890 }
891
892 if (record_full_arch_list_add_reg (regcache, tdep->ppc_lr_regnum))
893 return -1;
894 if (record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum))
895 return -1;
896 if (record_full_arch_list_add_reg (regcache, tdep->ppc_ctr_regnum))
897 return -1;
898 if (record_full_arch_list_add_reg (regcache, gdbarch_pc_regnum (gdbarch)))
899 return -1;
900 if (record_full_arch_list_add_reg (regcache, gdbarch_sp_regnum (gdbarch)))
901 return -1;
902
903 /* Record the change in the stack.
904 frame-size = sizeof (struct rt_sigframe) + SIGNAL_FRAMESIZE */
905 regcache_raw_read_unsigned (regcache, gdbarch_sp_regnum (gdbarch), &sp);
906 sp -= SIGNAL_FRAMESIZE;
907 sp -= sizeof_rt_sigframe;
908
909 if (record_full_arch_list_add_mem (sp, SIGNAL_FRAMESIZE + sizeof_rt_sigframe))
910 return -1;
911
912 if (record_full_arch_list_add_end ())
913 return -1;
914
915 return 0;
916 }
917
918 static void
919 ppc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
920 {
921 struct gdbarch *gdbarch = regcache->arch ();
922
923 regcache_cooked_write_unsigned (regcache, gdbarch_pc_regnum (gdbarch), pc);
924
925 /* Set special TRAP register to -1 to prevent the kernel from
926 messing with the PC we just installed, if we happen to be
927 within an interrupted system call that the kernel wants to
928 restart.
929
930 Note that after we return from the dummy call, the TRAP and
931 ORIG_R3 registers will be automatically restored, and the
932 kernel continues to restart the system call at this point. */
933 if (ppc_linux_trap_reg_p (gdbarch))
934 regcache_cooked_write_unsigned (regcache, PPC_TRAP_REGNUM, -1);
935 }
936
937 static int
938 ppc_linux_spu_section (bfd *abfd, asection *asect, void *user_data)
939 {
940 return startswith (bfd_section_name (abfd, asect), "SPU/");
941 }
942
943 static const struct target_desc *
944 ppc_linux_core_read_description (struct gdbarch *gdbarch,
945 struct target_ops *target,
946 bfd *abfd)
947 {
948 asection *cell = bfd_sections_find_if (abfd, ppc_linux_spu_section, NULL);
949 asection *altivec = bfd_get_section_by_name (abfd, ".reg-ppc-vmx");
950 asection *vsx = bfd_get_section_by_name (abfd, ".reg-ppc-vsx");
951 asection *section = bfd_get_section_by_name (abfd, ".reg");
952 if (! section)
953 return NULL;
954
955 switch (bfd_section_size (abfd, section))
956 {
957 case 48 * 4:
958 if (cell)
959 return tdesc_powerpc_cell32l;
960 else if (vsx)
961 return tdesc_powerpc_vsx32l;
962 else if (altivec)
963 return tdesc_powerpc_altivec32l;
964 else
965 return tdesc_powerpc_32l;
966
967 case 48 * 8:
968 if (cell)
969 return tdesc_powerpc_cell64l;
970 else if (vsx)
971 return tdesc_powerpc_vsx64l;
972 else if (altivec)
973 return tdesc_powerpc_altivec64l;
974 else
975 return tdesc_powerpc_64l;
976
977 default:
978 return NULL;
979 }
980 }
981
982
983 /* Implementation of `gdbarch_elf_make_msymbol_special', as defined in
984 gdbarch.h. This implementation is used for the ELFv2 ABI only. */
985
986 static void
987 ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
988 {
989 elf_symbol_type *elf_sym = (elf_symbol_type *)sym;
990
991 /* If the symbol is marked as having a local entry point, set a target
992 flag in the msymbol. We currently only support local entry point
993 offsets of 8 bytes, which is the only entry point offset ever used
994 by current compilers. If/when other offsets are ever used, we will
995 have to use additional target flag bits to store them. */
996 switch (PPC64_LOCAL_ENTRY_OFFSET (elf_sym->internal_elf_sym.st_other))
997 {
998 default:
999 break;
1000 case 8:
1001 MSYMBOL_TARGET_FLAG_1 (msym) = 1;
1002 break;
1003 }
1004 }
1005
1006 /* Implementation of `gdbarch_skip_entrypoint', as defined in
1007 gdbarch.h. This implementation is used for the ELFv2 ABI only. */
1008
1009 static CORE_ADDR
1010 ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc)
1011 {
1012 struct bound_minimal_symbol fun;
1013 int local_entry_offset = 0;
1014
1015 fun = lookup_minimal_symbol_by_pc (pc);
1016 if (fun.minsym == NULL)
1017 return pc;
1018
1019 /* See ppc_elfv2_elf_make_msymbol_special for how local entry point
1020 offset values are encoded. */
1021 if (MSYMBOL_TARGET_FLAG_1 (fun.minsym))
1022 local_entry_offset = 8;
1023
1024 if (BMSYMBOL_VALUE_ADDRESS (fun) <= pc
1025 && pc < BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset)
1026 return BMSYMBOL_VALUE_ADDRESS (fun) + local_entry_offset;
1027
1028 return pc;
1029 }
1030
1031 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
1032 gdbarch.h. */
1033
1034 static int
1035 ppc_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
1036 {
1037 return (*s == 'i' /* Literal number. */
1038 || (isdigit (*s) && s[1] == '('
1039 && isdigit (s[2])) /* Displacement. */
1040 || (*s == '(' && isdigit (s[1])) /* Register indirection. */
1041 || isdigit (*s)); /* Register value. */
1042 }
1043
1044 /* Implementation of `gdbarch_stap_parse_special_token', as defined in
1045 gdbarch.h. */
1046
1047 static int
1048 ppc_stap_parse_special_token (struct gdbarch *gdbarch,
1049 struct stap_parse_info *p)
1050 {
1051 if (isdigit (*p->arg))
1052 {
1053 /* This temporary pointer is needed because we have to do a lookahead.
1054 We could be dealing with a register displacement, and in such case
1055 we would not need to do anything. */
1056 const char *s = p->arg;
1057 char *regname;
1058 int len;
1059 struct stoken str;
1060
1061 while (isdigit (*s))
1062 ++s;
1063
1064 if (*s == '(')
1065 {
1066 /* It is a register displacement indeed. Returning 0 means we are
1067 deferring the treatment of this case to the generic parser. */
1068 return 0;
1069 }
1070
1071 len = s - p->arg;
1072 regname = (char *) alloca (len + 2);
1073 regname[0] = 'r';
1074
1075 strncpy (regname + 1, p->arg, len);
1076 ++len;
1077 regname[len] = '\0';
1078
1079 if (user_reg_map_name_to_regnum (gdbarch, regname, len) == -1)
1080 error (_("Invalid register name `%s' on expression `%s'."),
1081 regname, p->saved_arg);
1082
1083 write_exp_elt_opcode (&p->pstate, OP_REGISTER);
1084 str.ptr = regname;
1085 str.length = len;
1086 write_exp_string (&p->pstate, str);
1087 write_exp_elt_opcode (&p->pstate, OP_REGISTER);
1088
1089 p->arg = s;
1090 }
1091 else
1092 {
1093 /* All the other tokens should be handled correctly by the generic
1094 parser. */
1095 return 0;
1096 }
1097
1098 return 1;
1099 }
1100
1101 /* Cell/B.E. active SPE context tracking support. */
1102
1103 static struct objfile *spe_context_objfile = NULL;
1104 static CORE_ADDR spe_context_lm_addr = 0;
1105 static CORE_ADDR spe_context_offset = 0;
1106
1107 static ptid_t spe_context_cache_ptid;
1108 static CORE_ADDR spe_context_cache_address;
1109
1110 /* Hook into inferior_created, solib_loaded, and solib_unloaded observers
1111 to track whether we've loaded a version of libspe2 (as static or dynamic
1112 library) that provides the __spe_current_active_context variable. */
1113 static void
1114 ppc_linux_spe_context_lookup (struct objfile *objfile)
1115 {
1116 struct bound_minimal_symbol sym;
1117
1118 if (!objfile)
1119 {
1120 spe_context_objfile = NULL;
1121 spe_context_lm_addr = 0;
1122 spe_context_offset = 0;
1123 spe_context_cache_ptid = minus_one_ptid;
1124 spe_context_cache_address = 0;
1125 return;
1126 }
1127
1128 sym = lookup_minimal_symbol ("__spe_current_active_context", NULL, objfile);
1129 if (sym.minsym)
1130 {
1131 spe_context_objfile = objfile;
1132 spe_context_lm_addr = svr4_fetch_objfile_link_map (objfile);
1133 spe_context_offset = MSYMBOL_VALUE_RAW_ADDRESS (sym.minsym);
1134 spe_context_cache_ptid = minus_one_ptid;
1135 spe_context_cache_address = 0;
1136 return;
1137 }
1138 }
1139
1140 static void
1141 ppc_linux_spe_context_inferior_created (struct target_ops *t, int from_tty)
1142 {
1143 struct objfile *objfile;
1144
1145 ppc_linux_spe_context_lookup (NULL);
1146 ALL_OBJFILES (objfile)
1147 ppc_linux_spe_context_lookup (objfile);
1148 }
1149
1150 static void
1151 ppc_linux_spe_context_solib_loaded (struct so_list *so)
1152 {
1153 if (strstr (so->so_original_name, "/libspe") != NULL)
1154 {
1155 solib_read_symbols (so, 0);
1156 ppc_linux_spe_context_lookup (so->objfile);
1157 }
1158 }
1159
1160 static void
1161 ppc_linux_spe_context_solib_unloaded (struct so_list *so)
1162 {
1163 if (so->objfile == spe_context_objfile)
1164 ppc_linux_spe_context_lookup (NULL);
1165 }
1166
1167 /* Retrieve contents of the N'th element in the current thread's
1168 linked SPE context list into ID and NPC. Return the address of
1169 said context element, or 0 if not found. */
1170 static CORE_ADDR
1171 ppc_linux_spe_context (int wordsize, enum bfd_endian byte_order,
1172 int n, int *id, unsigned int *npc)
1173 {
1174 CORE_ADDR spe_context = 0;
1175 gdb_byte buf[16];
1176 int i;
1177
1178 /* Quick exit if we have not found __spe_current_active_context. */
1179 if (!spe_context_objfile)
1180 return 0;
1181
1182 /* Look up cached address of thread-local variable. */
1183 if (!ptid_equal (spe_context_cache_ptid, inferior_ptid))
1184 {
1185 struct target_ops *target = &current_target;
1186
1187 TRY
1188 {
1189 /* We do not call target_translate_tls_address here, because
1190 svr4_fetch_objfile_link_map may invalidate the frame chain,
1191 which must not do while inside a frame sniffer.
1192
1193 Instead, we have cached the lm_addr value, and use that to
1194 directly call the target's to_get_thread_local_address. */
1195 spe_context_cache_address
1196 = target->to_get_thread_local_address (target, inferior_ptid,
1197 spe_context_lm_addr,
1198 spe_context_offset);
1199 spe_context_cache_ptid = inferior_ptid;
1200 }
1201
1202 CATCH (ex, RETURN_MASK_ERROR)
1203 {
1204 return 0;
1205 }
1206 END_CATCH
1207 }
1208
1209 /* Read variable value. */
1210 if (target_read_memory (spe_context_cache_address, buf, wordsize) == 0)
1211 spe_context = extract_unsigned_integer (buf, wordsize, byte_order);
1212
1213 /* Cyle through to N'th linked list element. */
1214 for (i = 0; i < n && spe_context; i++)
1215 if (target_read_memory (spe_context + align_up (12, wordsize),
1216 buf, wordsize) == 0)
1217 spe_context = extract_unsigned_integer (buf, wordsize, byte_order);
1218 else
1219 spe_context = 0;
1220
1221 /* Read current context. */
1222 if (spe_context
1223 && target_read_memory (spe_context, buf, 12) != 0)
1224 spe_context = 0;
1225
1226 /* Extract data elements. */
1227 if (spe_context)
1228 {
1229 if (id)
1230 *id = extract_signed_integer (buf, 4, byte_order);
1231 if (npc)
1232 *npc = extract_unsigned_integer (buf + 4, 4, byte_order);
1233 }
1234
1235 return spe_context;
1236 }
1237
1238
1239 /* Cell/B.E. cross-architecture unwinder support. */
1240
1241 struct ppu2spu_cache
1242 {
1243 struct frame_id frame_id;
1244 struct regcache *regcache;
1245 };
1246
1247 static struct gdbarch *
1248 ppu2spu_prev_arch (struct frame_info *this_frame, void **this_cache)
1249 {
1250 struct ppu2spu_cache *cache = (struct ppu2spu_cache *) *this_cache;
1251 return cache->regcache->arch ();
1252 }
1253
1254 static void
1255 ppu2spu_this_id (struct frame_info *this_frame,
1256 void **this_cache, struct frame_id *this_id)
1257 {
1258 struct ppu2spu_cache *cache = (struct ppu2spu_cache *) *this_cache;
1259 *this_id = cache->frame_id;
1260 }
1261
1262 static struct value *
1263 ppu2spu_prev_register (struct frame_info *this_frame,
1264 void **this_cache, int regnum)
1265 {
1266 struct ppu2spu_cache *cache = (struct ppu2spu_cache *) *this_cache;
1267 struct gdbarch *gdbarch = cache->regcache->arch ();
1268 gdb_byte *buf;
1269
1270 buf = (gdb_byte *) alloca (register_size (gdbarch, regnum));
1271
1272 if (regnum < gdbarch_num_regs (gdbarch))
1273 regcache_raw_read (cache->regcache, regnum, buf);
1274 else
1275 gdbarch_pseudo_register_read (gdbarch, cache->regcache, regnum, buf);
1276
1277 return frame_unwind_got_bytes (this_frame, regnum, buf);
1278 }
1279
1280 struct ppu2spu_data
1281 {
1282 struct gdbarch *gdbarch;
1283 int id;
1284 unsigned int npc;
1285 gdb_byte gprs[128*16];
1286 };
1287
1288 static enum register_status
1289 ppu2spu_unwind_register (void *src, int regnum, gdb_byte *buf)
1290 {
1291 struct ppu2spu_data *data = (struct ppu2spu_data *) src;
1292 enum bfd_endian byte_order = gdbarch_byte_order (data->gdbarch);
1293
1294 if (regnum >= 0 && regnum < SPU_NUM_GPRS)
1295 memcpy (buf, data->gprs + 16*regnum, 16);
1296 else if (regnum == SPU_ID_REGNUM)
1297 store_unsigned_integer (buf, 4, byte_order, data->id);
1298 else if (regnum == SPU_PC_REGNUM)
1299 store_unsigned_integer (buf, 4, byte_order, data->npc);
1300 else
1301 return REG_UNAVAILABLE;
1302
1303 return REG_VALID;
1304 }
1305
1306 static int
1307 ppu2spu_sniffer (const struct frame_unwind *self,
1308 struct frame_info *this_frame, void **this_prologue_cache)
1309 {
1310 struct gdbarch *gdbarch = get_frame_arch (this_frame);
1311 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
1312 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
1313 struct ppu2spu_data data;
1314 struct frame_info *fi;
1315 CORE_ADDR base, func, backchain, spe_context;
1316 gdb_byte buf[8];
1317 int n = 0;
1318
1319 /* Count the number of SPU contexts already in the frame chain. */
1320 for (fi = get_next_frame (this_frame); fi; fi = get_next_frame (fi))
1321 if (get_frame_type (fi) == ARCH_FRAME
1322 && gdbarch_bfd_arch_info (get_frame_arch (fi))->arch == bfd_arch_spu)
1323 n++;
1324
1325 base = get_frame_sp (this_frame);
1326 func = get_frame_pc (this_frame);
1327 if (target_read_memory (base, buf, tdep->wordsize))
1328 return 0;
1329 backchain = extract_unsigned_integer (buf, tdep->wordsize, byte_order);
1330
1331 spe_context = ppc_linux_spe_context (tdep->wordsize, byte_order,
1332 n, &data.id, &data.npc);
1333 if (spe_context && base <= spe_context && spe_context < backchain)
1334 {
1335 char annex[32];
1336
1337 /* Find gdbarch for SPU. */
1338 struct gdbarch_info info;
1339 gdbarch_info_init (&info);
1340 info.bfd_arch_info = bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu);
1341 info.byte_order = BFD_ENDIAN_BIG;
1342 info.osabi = GDB_OSABI_LINUX;
1343 info.id = &data.id;
1344 data.gdbarch = gdbarch_find_by_info (info);
1345 if (!data.gdbarch)
1346 return 0;
1347
1348 xsnprintf (annex, sizeof annex, "%d/regs", data.id);
1349 if (target_read (&current_target, TARGET_OBJECT_SPU, annex,
1350 data.gprs, 0, sizeof data.gprs)
1351 == sizeof data.gprs)
1352 {
1353 struct ppu2spu_cache *cache
1354 = FRAME_OBSTACK_CALLOC (1, struct ppu2spu_cache);
1355 std::unique_ptr<struct regcache> regcache
1356 (new struct regcache (data.gdbarch));
1357
1358 regcache_save (regcache.get (), ppu2spu_unwind_register, &data);
1359
1360 cache->frame_id = frame_id_build (base, func);
1361 cache->regcache = regcache.release ();
1362 *this_prologue_cache = cache;
1363 return 1;
1364 }
1365 }
1366
1367 return 0;
1368 }
1369
1370 static void
1371 ppu2spu_dealloc_cache (struct frame_info *self, void *this_cache)
1372 {
1373 struct ppu2spu_cache *cache = (struct ppu2spu_cache *) this_cache;
1374 delete cache->regcache;
1375 }
1376
1377 static const struct frame_unwind ppu2spu_unwind = {
1378 ARCH_FRAME,
1379 default_frame_unwind_stop_reason,
1380 ppu2spu_this_id,
1381 ppu2spu_prev_register,
1382 NULL,
1383 ppu2spu_sniffer,
1384 ppu2spu_dealloc_cache,
1385 ppu2spu_prev_arch,
1386 };
1387
1388 /* Initialize linux_record_tdep if not initialized yet.
1389 WORDSIZE is 4 or 8 for 32- or 64-bit PowerPC Linux respectively.
1390 Sizes of data structures are initialized accordingly. */
1391
1392 static void
1393 ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
1394 int wordsize)
1395 {
1396 /* Simply return if it had been initialized. */
1397 if (record_tdep->size_pointer != 0)
1398 return;
1399
1400 /* These values are the size of the type that will be used in a system
1401 call. They are obtained from Linux Kernel source. */
1402
1403 if (wordsize == 8)
1404 {
1405 record_tdep->size_pointer = 8;
1406 record_tdep->size__old_kernel_stat = 32;
1407 record_tdep->size_tms = 32;
1408 record_tdep->size_loff_t = 8;
1409 record_tdep->size_flock = 32;
1410 record_tdep->size_oldold_utsname = 45;
1411 record_tdep->size_ustat = 32;
1412 record_tdep->size_old_sigaction = 32;
1413 record_tdep->size_old_sigset_t = 8;
1414 record_tdep->size_rlimit = 16;
1415 record_tdep->size_rusage = 144;
1416 record_tdep->size_timeval = 16;
1417 record_tdep->size_timezone = 8;
1418 record_tdep->size_old_gid_t = 4;
1419 record_tdep->size_old_uid_t = 4;
1420 record_tdep->size_fd_set = 128;
1421 record_tdep->size_old_dirent = 280;
1422 record_tdep->size_statfs = 120;
1423 record_tdep->size_statfs64 = 120;
1424 record_tdep->size_sockaddr = 16;
1425 record_tdep->size_int = 4;
1426 record_tdep->size_long = 8;
1427 record_tdep->size_ulong = 8;
1428 record_tdep->size_msghdr = 56;
1429 record_tdep->size_itimerval = 32;
1430 record_tdep->size_stat = 144;
1431 record_tdep->size_old_utsname = 325;
1432 record_tdep->size_sysinfo = 112;
1433 record_tdep->size_msqid_ds = 120;
1434 record_tdep->size_shmid_ds = 112;
1435 record_tdep->size_new_utsname = 390;
1436 record_tdep->size_timex = 208;
1437 record_tdep->size_mem_dqinfo = 24;
1438 record_tdep->size_if_dqblk = 72;
1439 record_tdep->size_fs_quota_stat = 80;
1440 record_tdep->size_timespec = 16;
1441 record_tdep->size_pollfd = 8;
1442 record_tdep->size_NFS_FHSIZE = 32;
1443 record_tdep->size_knfsd_fh = 132;
1444 record_tdep->size_TASK_COMM_LEN = 16;
1445 record_tdep->size_sigaction = 32;
1446 record_tdep->size_sigset_t = 8;
1447 record_tdep->size_siginfo_t = 128;
1448 record_tdep->size_cap_user_data_t = 8;
1449 record_tdep->size_stack_t = 24;
1450 record_tdep->size_off_t = 8;
1451 record_tdep->size_stat64 = 104;
1452 record_tdep->size_gid_t = 4;
1453 record_tdep->size_uid_t = 4;
1454 record_tdep->size_PAGE_SIZE = 0x10000; /* 64KB */
1455 record_tdep->size_flock64 = 32;
1456 record_tdep->size_io_event = 32;
1457 record_tdep->size_iocb = 64;
1458 record_tdep->size_epoll_event = 16;
1459 record_tdep->size_itimerspec = 32;
1460 record_tdep->size_mq_attr = 64;
1461 record_tdep->size_termios = 44;
1462 record_tdep->size_pid_t = 4;
1463 record_tdep->size_winsize = 8;
1464 record_tdep->size_serial_struct = 72;
1465 record_tdep->size_serial_icounter_struct = 80;
1466 record_tdep->size_size_t = 8;
1467 record_tdep->size_iovec = 16;
1468 record_tdep->size_time_t = 8;
1469 }
1470 else if (wordsize == 4)
1471 {
1472 record_tdep->size_pointer = 4;
1473 record_tdep->size__old_kernel_stat = 32;
1474 record_tdep->size_tms = 16;
1475 record_tdep->size_loff_t = 8;
1476 record_tdep->size_flock = 16;
1477 record_tdep->size_oldold_utsname = 45;
1478 record_tdep->size_ustat = 20;
1479 record_tdep->size_old_sigaction = 16;
1480 record_tdep->size_old_sigset_t = 4;
1481 record_tdep->size_rlimit = 8;
1482 record_tdep->size_rusage = 72;
1483 record_tdep->size_timeval = 8;
1484 record_tdep->size_timezone = 8;
1485 record_tdep->size_old_gid_t = 4;
1486 record_tdep->size_old_uid_t = 4;
1487 record_tdep->size_fd_set = 128;
1488 record_tdep->size_old_dirent = 268;
1489 record_tdep->size_statfs = 64;
1490 record_tdep->size_statfs64 = 88;
1491 record_tdep->size_sockaddr = 16;
1492 record_tdep->size_int = 4;
1493 record_tdep->size_long = 4;
1494 record_tdep->size_ulong = 4;
1495 record_tdep->size_msghdr = 28;
1496 record_tdep->size_itimerval = 16;
1497 record_tdep->size_stat = 88;
1498 record_tdep->size_old_utsname = 325;
1499 record_tdep->size_sysinfo = 64;
1500 record_tdep->size_msqid_ds = 68;
1501 record_tdep->size_shmid_ds = 60;
1502 record_tdep->size_new_utsname = 390;
1503 record_tdep->size_timex = 128;
1504 record_tdep->size_mem_dqinfo = 24;
1505 record_tdep->size_if_dqblk = 72;
1506 record_tdep->size_fs_quota_stat = 80;
1507 record_tdep->size_timespec = 8;
1508 record_tdep->size_pollfd = 8;
1509 record_tdep->size_NFS_FHSIZE = 32;
1510 record_tdep->size_knfsd_fh = 132;
1511 record_tdep->size_TASK_COMM_LEN = 16;
1512 record_tdep->size_sigaction = 20;
1513 record_tdep->size_sigset_t = 8;
1514 record_tdep->size_siginfo_t = 128;
1515 record_tdep->size_cap_user_data_t = 4;
1516 record_tdep->size_stack_t = 12;
1517 record_tdep->size_off_t = 4;
1518 record_tdep->size_stat64 = 104;
1519 record_tdep->size_gid_t = 4;
1520 record_tdep->size_uid_t = 4;
1521 record_tdep->size_PAGE_SIZE = 0x10000; /* 64KB */
1522 record_tdep->size_flock64 = 32;
1523 record_tdep->size_io_event = 32;
1524 record_tdep->size_iocb = 64;
1525 record_tdep->size_epoll_event = 16;
1526 record_tdep->size_itimerspec = 16;
1527 record_tdep->size_mq_attr = 32;
1528 record_tdep->size_termios = 44;
1529 record_tdep->size_pid_t = 4;
1530 record_tdep->size_winsize = 8;
1531 record_tdep->size_serial_struct = 60;
1532 record_tdep->size_serial_icounter_struct = 80;
1533 record_tdep->size_size_t = 4;
1534 record_tdep->size_iovec = 8;
1535 record_tdep->size_time_t = 4;
1536 }
1537 else
1538 internal_error (__FILE__, __LINE__, _("unexpected wordsize"));
1539
1540 /* These values are the second argument of system call "sys_fcntl"
1541 and "sys_fcntl64". They are obtained from Linux Kernel source. */
1542 record_tdep->fcntl_F_GETLK = 5;
1543 record_tdep->fcntl_F_GETLK64 = 12;
1544 record_tdep->fcntl_F_SETLK64 = 13;
1545 record_tdep->fcntl_F_SETLKW64 = 14;
1546
1547 record_tdep->arg1 = PPC_R0_REGNUM + 3;
1548 record_tdep->arg2 = PPC_R0_REGNUM + 4;
1549 record_tdep->arg3 = PPC_R0_REGNUM + 5;
1550 record_tdep->arg4 = PPC_R0_REGNUM + 6;
1551 record_tdep->arg5 = PPC_R0_REGNUM + 7;
1552 record_tdep->arg6 = PPC_R0_REGNUM + 8;
1553
1554 /* These values are the second argument of system call "sys_ioctl".
1555 They are obtained from Linux Kernel source.
1556 See arch/powerpc/include/uapi/asm/ioctls.h. */
1557 record_tdep->ioctl_TCGETS = 0x403c7413;
1558 record_tdep->ioctl_TCSETS = 0x803c7414;
1559 record_tdep->ioctl_TCSETSW = 0x803c7415;
1560 record_tdep->ioctl_TCSETSF = 0x803c7416;
1561 record_tdep->ioctl_TCGETA = 0x40147417;
1562 record_tdep->ioctl_TCSETA = 0x80147418;
1563 record_tdep->ioctl_TCSETAW = 0x80147419;
1564 record_tdep->ioctl_TCSETAF = 0x8014741c;
1565 record_tdep->ioctl_TCSBRK = 0x2000741d;
1566 record_tdep->ioctl_TCXONC = 0x2000741e;
1567 record_tdep->ioctl_TCFLSH = 0x2000741f;
1568 record_tdep->ioctl_TIOCEXCL = 0x540c;
1569 record_tdep->ioctl_TIOCNXCL = 0x540d;
1570 record_tdep->ioctl_TIOCSCTTY = 0x540e;
1571 record_tdep->ioctl_TIOCGPGRP = 0x40047477;
1572 record_tdep->ioctl_TIOCSPGRP = 0x80047476;
1573 record_tdep->ioctl_TIOCOUTQ = 0x40047473;
1574 record_tdep->ioctl_TIOCSTI = 0x5412;
1575 record_tdep->ioctl_TIOCGWINSZ = 0x40087468;
1576 record_tdep->ioctl_TIOCSWINSZ = 0x80087467;
1577 record_tdep->ioctl_TIOCMGET = 0x5415;
1578 record_tdep->ioctl_TIOCMBIS = 0x5416;
1579 record_tdep->ioctl_TIOCMBIC = 0x5417;
1580 record_tdep->ioctl_TIOCMSET = 0x5418;
1581 record_tdep->ioctl_TIOCGSOFTCAR = 0x5419;
1582 record_tdep->ioctl_TIOCSSOFTCAR = 0x541a;
1583 record_tdep->ioctl_FIONREAD = 0x4004667f;
1584 record_tdep->ioctl_TIOCINQ = 0x4004667f;
1585 record_tdep->ioctl_TIOCLINUX = 0x541c;
1586 record_tdep->ioctl_TIOCCONS = 0x541d;
1587 record_tdep->ioctl_TIOCGSERIAL = 0x541e;
1588 record_tdep->ioctl_TIOCSSERIAL = 0x541f;
1589 record_tdep->ioctl_TIOCPKT = 0x5420;
1590 record_tdep->ioctl_FIONBIO = 0x8004667e;
1591 record_tdep->ioctl_TIOCNOTTY = 0x5422;
1592 record_tdep->ioctl_TIOCSETD = 0x5423;
1593 record_tdep->ioctl_TIOCGETD = 0x5424;
1594 record_tdep->ioctl_TCSBRKP = 0x5425;
1595 record_tdep->ioctl_TIOCSBRK = 0x5427;
1596 record_tdep->ioctl_TIOCCBRK = 0x5428;
1597 record_tdep->ioctl_TIOCGSID = 0x5429;
1598 record_tdep->ioctl_TIOCGPTN = 0x40045430;
1599 record_tdep->ioctl_TIOCSPTLCK = 0x80045431;
1600 record_tdep->ioctl_FIONCLEX = 0x20006602;
1601 record_tdep->ioctl_FIOCLEX = 0x20006601;
1602 record_tdep->ioctl_FIOASYNC = 0x8004667d;
1603 record_tdep->ioctl_TIOCSERCONFIG = 0x5453;
1604 record_tdep->ioctl_TIOCSERGWILD = 0x5454;
1605 record_tdep->ioctl_TIOCSERSWILD = 0x5455;
1606 record_tdep->ioctl_TIOCGLCKTRMIOS = 0x5456;
1607 record_tdep->ioctl_TIOCSLCKTRMIOS = 0x5457;
1608 record_tdep->ioctl_TIOCSERGSTRUCT = 0x5458;
1609 record_tdep->ioctl_TIOCSERGETLSR = 0x5459;
1610 record_tdep->ioctl_TIOCSERGETMULTI = 0x545a;
1611 record_tdep->ioctl_TIOCSERSETMULTI = 0x545b;
1612 record_tdep->ioctl_TIOCMIWAIT = 0x545c;
1613 record_tdep->ioctl_TIOCGICOUNT = 0x545d;
1614 record_tdep->ioctl_FIOQSIZE = 0x40086680;
1615 }
1616
1617 /* Return a floating-point format for a floating-point variable of
1618 length LEN in bits. If non-NULL, NAME is the name of its type.
1619 If no suitable type is found, return NULL. */
1620
1621 const struct floatformat **
1622 ppc_floatformat_for_type (struct gdbarch *gdbarch,
1623 const char *name, int len)
1624 {
1625 if (len == 128 && name)
1626 {
1627 if (strcmp (name, "__float128") == 0
1628 || strcmp (name, "_Float128") == 0
1629 || strcmp (name, "_Float64x") == 0
1630 || strcmp (name, "complex _Float128") == 0
1631 || strcmp (name, "complex _Float64x") == 0)
1632 return floatformats_ia64_quad;
1633
1634 if (strcmp (name, "__ibm128") == 0)
1635 return floatformats_ibm_long_double;
1636 }
1637
1638 return default_floatformat_for_type (gdbarch, name, len);
1639 }
1640
1641 static void
1642 ppc_linux_init_abi (struct gdbarch_info info,
1643 struct gdbarch *gdbarch)
1644 {
1645 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
1646 struct tdesc_arch_data *tdesc_data = info.tdesc_data;
1647 static const char *const stap_integer_prefixes[] = { "i", NULL };
1648 static const char *const stap_register_indirection_prefixes[] = { "(",
1649 NULL };
1650 static const char *const stap_register_indirection_suffixes[] = { ")",
1651 NULL };
1652
1653 linux_init_abi (info, gdbarch);
1654
1655 /* PPC GNU/Linux uses either 64-bit or 128-bit long doubles; where
1656 128-bit, they can be either IBM long double or IEEE quad long double.
1657 The 64-bit long double case will be detected automatically using
1658 the size specified in debug info. We use a .gnu.attribute flag
1659 to distinguish between the IBM long double and IEEE quad cases. */
1660 set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);
1661 if (tdep->long_double_abi == POWERPC_LONG_DOUBLE_IEEE128)
1662 set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad);
1663 else
1664 set_gdbarch_long_double_format (gdbarch, floatformats_ibm_long_double);
1665
1666 /* Support for floating-point data type variants. */
1667 set_gdbarch_floatformat_for_type (gdbarch, ppc_floatformat_for_type);
1668
1669 /* Handle inferior calls during interrupted system calls. */
1670 set_gdbarch_write_pc (gdbarch, ppc_linux_write_pc);
1671
1672 /* Get the syscall number from the arch's register. */
1673 set_gdbarch_get_syscall_number (gdbarch, ppc_linux_get_syscall_number);
1674
1675 /* SystemTap functions. */
1676 set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes);
1677 set_gdbarch_stap_register_indirection_prefixes (gdbarch,
1678 stap_register_indirection_prefixes);
1679 set_gdbarch_stap_register_indirection_suffixes (gdbarch,
1680 stap_register_indirection_suffixes);
1681 set_gdbarch_stap_gdb_register_prefix (gdbarch, "r");
1682 set_gdbarch_stap_is_single_operand (gdbarch, ppc_stap_is_single_operand);
1683 set_gdbarch_stap_parse_special_token (gdbarch,
1684 ppc_stap_parse_special_token);
1685
1686 if (tdep->wordsize == 4)
1687 {
1688 /* Until November 2001, gcc did not comply with the 32 bit SysV
1689 R4 ABI requirement that structures less than or equal to 8
1690 bytes should be returned in registers. Instead GCC was using
1691 the AIX/PowerOpen ABI - everything returned in memory
1692 (well ignoring vectors that is). When this was corrected, it
1693 wasn't fixed for GNU/Linux native platform. Use the
1694 PowerOpen struct convention. */
1695 set_gdbarch_return_value (gdbarch, ppc_linux_return_value);
1696
1697 set_gdbarch_memory_remove_breakpoint (gdbarch,
1698 ppc_linux_memory_remove_breakpoint);
1699
1700 /* Shared library handling. */
1701 set_gdbarch_skip_trampoline_code (gdbarch, ppc_skip_trampoline_code);
1702 set_solib_svr4_fetch_link_map_offsets
1703 (gdbarch, svr4_ilp32_fetch_link_map_offsets);
1704
1705 /* Setting the correct XML syscall filename. */
1706 set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_PPC);
1707
1708 /* Trampolines. */
1709 tramp_frame_prepend_unwinder (gdbarch,
1710 &ppc32_linux_sigaction_tramp_frame);
1711 tramp_frame_prepend_unwinder (gdbarch,
1712 &ppc32_linux_sighandler_tramp_frame);
1713
1714 /* BFD target for core files. */
1715 if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
1716 set_gdbarch_gcore_bfd_target (gdbarch, "elf32-powerpcle");
1717 else
1718 set_gdbarch_gcore_bfd_target (gdbarch, "elf32-powerpc");
1719
1720 if (powerpc_so_ops.in_dynsym_resolve_code == NULL)
1721 {
1722 powerpc_so_ops = svr4_so_ops;
1723 /* Override dynamic resolve function. */
1724 powerpc_so_ops.in_dynsym_resolve_code =
1725 powerpc_linux_in_dynsym_resolve_code;
1726 }
1727 set_solib_ops (gdbarch, &powerpc_so_ops);
1728
1729 set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
1730 }
1731
1732 if (tdep->wordsize == 8)
1733 {
1734 if (tdep->elf_abi == POWERPC_ELF_V1)
1735 {
1736 /* Handle PPC GNU/Linux 64-bit function pointers (which are really
1737 function descriptors). */
1738 set_gdbarch_convert_from_func_ptr_addr
1739 (gdbarch, ppc64_convert_from_func_ptr_addr);
1740
1741 set_gdbarch_elf_make_msymbol_special
1742 (gdbarch, ppc64_elf_make_msymbol_special);
1743 }
1744 else
1745 {
1746 set_gdbarch_elf_make_msymbol_special
1747 (gdbarch, ppc_elfv2_elf_make_msymbol_special);
1748
1749 set_gdbarch_skip_entrypoint (gdbarch, ppc_elfv2_skip_entrypoint);
1750 }
1751
1752 /* Shared library handling. */
1753 set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code);
1754 set_solib_svr4_fetch_link_map_offsets
1755 (gdbarch, svr4_lp64_fetch_link_map_offsets);
1756
1757 /* Setting the correct XML syscall filename. */
1758 set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_PPC64);
1759
1760 /* Trampolines. */
1761 tramp_frame_prepend_unwinder (gdbarch,
1762 &ppc64_linux_sigaction_tramp_frame);
1763 tramp_frame_prepend_unwinder (gdbarch,
1764 &ppc64_linux_sighandler_tramp_frame);
1765
1766 /* BFD target for core files. */
1767 if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
1768 set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpcle");
1769 else
1770 set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpc");
1771 }
1772
1773 set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description);
1774 set_gdbarch_iterate_over_regset_sections (gdbarch,
1775 ppc_linux_iterate_over_regset_sections);
1776
1777 /* Enable TLS support. */
1778 set_gdbarch_fetch_tls_load_module_address (gdbarch,
1779 svr4_fetch_objfile_link_map);
1780
1781 if (tdesc_data)
1782 {
1783 const struct tdesc_feature *feature;
1784
1785 /* If we have target-described registers, then we can safely
1786 reserve a number for PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM
1787 (whether they are described or not). */
1788 gdb_assert (gdbarch_num_regs (gdbarch) <= PPC_ORIG_R3_REGNUM);
1789 set_gdbarch_num_regs (gdbarch, PPC_TRAP_REGNUM + 1);
1790
1791 /* If they are present, then assign them to the reserved number. */
1792 feature = tdesc_find_feature (info.target_desc,
1793 "org.gnu.gdb.power.linux");
1794 if (feature != NULL)
1795 {
1796 tdesc_numbered_register (feature, tdesc_data,
1797 PPC_ORIG_R3_REGNUM, "orig_r3");
1798 tdesc_numbered_register (feature, tdesc_data,
1799 PPC_TRAP_REGNUM, "trap");
1800 }
1801 }
1802
1803 /* Enable Cell/B.E. if supported by the target. */
1804 if (tdesc_compatible_p (info.target_desc,
1805 bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu)))
1806 {
1807 /* Cell/B.E. multi-architecture support. */
1808 set_spu_solib_ops (gdbarch);
1809
1810 /* Cell/B.E. cross-architecture unwinder support. */
1811 frame_unwind_prepend_unwinder (gdbarch, &ppu2spu_unwind);
1812
1813 /* We need to support more than "addr_bit" significant address bits
1814 in order to support SPUADDR_ADDR encoded values. */
1815 set_gdbarch_significant_addr_bit (gdbarch, 64);
1816 }
1817
1818 set_gdbarch_displaced_step_location (gdbarch,
1819 linux_displaced_step_location);
1820
1821 /* Support reverse debugging. */
1822 set_gdbarch_process_record (gdbarch, ppc_process_record);
1823 set_gdbarch_process_record_signal (gdbarch, ppc_linux_record_signal);
1824 tdep->ppc_syscall_record = ppc_linux_syscall_record;
1825
1826 ppc_init_linux_record_tdep (&ppc_linux_record_tdep, 4);
1827 ppc_init_linux_record_tdep (&ppc64_linux_record_tdep, 8);
1828 }
1829
1830 void
1831 _initialize_ppc_linux_tdep (void)
1832 {
1833 /* Register for all sub-familes of the POWER/PowerPC: 32-bit and
1834 64-bit PowerPC, and the older rs6k. */
1835 gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, GDB_OSABI_LINUX,
1836 ppc_linux_init_abi);
1837 gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, GDB_OSABI_LINUX,
1838 ppc_linux_init_abi);
1839 gdbarch_register_osabi (bfd_arch_rs6000, bfd_mach_rs6k, GDB_OSABI_LINUX,
1840 ppc_linux_init_abi);
1841
1842 /* Attach to observers to track __spe_current_active_context. */
1843 observer_attach_inferior_created (ppc_linux_spe_context_inferior_created);
1844 observer_attach_solib_loaded (ppc_linux_spe_context_solib_loaded);
1845 observer_attach_solib_unloaded (ppc_linux_spe_context_solib_unloaded);
1846
1847 /* Initialize the Linux target descriptions. */
1848 initialize_tdesc_powerpc_32l ();
1849 initialize_tdesc_powerpc_altivec32l ();
1850 initialize_tdesc_powerpc_cell32l ();
1851 initialize_tdesc_powerpc_vsx32l ();
1852 initialize_tdesc_powerpc_isa205_32l ();
1853 initialize_tdesc_powerpc_isa205_altivec32l ();
1854 initialize_tdesc_powerpc_isa205_vsx32l ();
1855 initialize_tdesc_powerpc_64l ();
1856 initialize_tdesc_powerpc_altivec64l ();
1857 initialize_tdesc_powerpc_cell64l ();
1858 initialize_tdesc_powerpc_vsx64l ();
1859 initialize_tdesc_powerpc_isa205_64l ();
1860 initialize_tdesc_powerpc_isa205_altivec64l ();
1861 initialize_tdesc_powerpc_isa205_vsx64l ();
1862 initialize_tdesc_powerpc_e500l ();
1863 }
ppc_reg_offsets::gpr_size
int gpr_size
Definition: ppc-tdep.h:89
linux_record_tdep::ioctl_TIOCCONS
int ioctl_TIOCCONS
Definition: linux-record.h:124
set_gdbarch_num_regs
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
Definition: gdbarch.c:2050
ppu2spu_cache::regcache
struct regcache * regcache
Definition: ppc-linux-tdep.c:1244
gdbarch
Definition: gdbarch.c:127
linux_record_tdep::ioctl_TIOCGICOUNT
int ioctl_TIOCGICOUNT
Definition: linux-record.h:156
gdbarch_info::id
int * id
Definition: gdbarch.h:1653
bp_target_info::reqstd_address
CORE_ADDR reqstd_address
Definition: breakpoint.h:251
linux_record_tdep::ioctl_TCSETAF
int ioctl_TCSETAF
Definition: linux-record.h:102
SPU_ID_REGNUM
Definition: spu-tdep.h:40
linux_record_tdep::arg1
int arg1
Definition: linux-record.h:170
initialize_tdesc_powerpc_cell32l
static void initialize_tdesc_powerpc_cell32l(void)
Definition: powerpc-cell32l.c:10
linux_record_tdep::ioctl_TIOCSBRK
int ioctl_TIOCSBRK
Definition: linux-record.h:134
linux_record_tdep::size_itimerspec
int size_itimerspec
Definition: linux-record.h:81
trad_frame_set_reg_addr
void trad_frame_set_reg_addr(struct trad_frame_cache *this_trad_cache, int regnum, CORE_ADDR addr)
Definition: trad-frame.c:126
linux_record_tdep::ioctl_TCFLSH
int ioctl_TCFLSH
Definition: linux-record.h:105
linux_record_tdep::size_serial_icounter_struct
int size_serial_icounter_struct
Definition: linux-record.h:88
initialize_tdesc_powerpc_32l
static void initialize_tdesc_powerpc_32l(void)
Definition: powerpc-32l.c:10
ppc_linux_init_abi
static void ppc_linux_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: ppc-linux-tdep.c:1642
frame_id_build
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
Definition: frame.c:624
linux_record_tdep::ioctl_TIOCSWINSZ
int ioctl_TIOCSWINSZ
Definition: linux-record.h:114
XML_SYSCALL_FILENAME_PPC
#define XML_SYSCALL_FILENAME_PPC
Definition: ppc-linux-tdep.c:85
frame_unwind_got_bytes
struct value * frame_unwind_got_bytes(struct frame_info *frame, int regnum, gdb_byte *buf)
Definition: frame-unwind.c:260
powerpc-isa205-altivec64l.c
ppc_linux_supply_gregset
static void ppc_linux_supply_gregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
Definition: ppc-linux-tdep.c:369
ppc_elfv2_skip_entrypoint
static CORE_ADDR ppc_elfv2_skip_entrypoint(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition: ppc-linux-tdep.c:1010
REG_VALID
Definition: common-regcache.h:32
linux_record_tdep::size_cap_user_data_t
int size_cap_user_data_t
Definition: linux-record.h:69
linux_record_tdep::ioctl_TIOCSCTTY
int ioctl_TIOCSCTTY
Definition: linux-record.h:108
linux_record_tdep::fcntl_F_GETLK64
int fcntl_F_GETLK64
Definition: linux-record.h:164
ppu2spu_sniffer
static int ppu2spu_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: ppc-linux-tdep.c:1307
ppc_linux_sigtramp_cache
static void ppc_linux_sigtramp_cache(struct frame_info *this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func, LONGEST offset, int bias)
Definition: ppc-linux-tdep.c:544
get_frame_pc
CORE_ADDR get_frame_pc(struct frame_info *frame)
Definition: frame.c:2376
MSYMBOL_LINKAGE_NAME
#define MSYMBOL_LINKAGE_NAME(symbol)
Definition: symtab.h:707
initialize_tdesc_powerpc_isa205_64l
static void initialize_tdesc_powerpc_isa205_64l(void)
Definition: powerpc-isa205-64l.c:10
gdbarch_tdep::elf_abi
int elf_abi
Definition: nds32-tdep.h:52
syscall
Definition: target.h:105
CORE_ADDR
bfd_vma CORE_ADDR
Definition: common-types.h:41
ppc64_linux_reg_offsets
static const struct ppc_reg_offsets ppc64_linux_reg_offsets
Definition: ppc-linux-tdep.c:450
set_gdbarch_fetch_tls_load_module_address
void set_gdbarch_fetch_tls_load_module_address(struct gdbarch *gdbarch, gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
Definition: gdbarch.c:3038
TRAMP_SENTINEL_INSN
#define TRAMP_SENTINEL_INSN
Definition: tramp-frame.h:44
ppc32_linux_fpregset
static const struct regset ppc32_linux_fpregset
Definition: ppc-linux-tdep.c:487
initialize_tdesc_powerpc_isa205_altivec32l
static void initialize_tdesc_powerpc_isa205_altivec32l(void)
Definition: powerpc-isa205-altivec32l.c:10
svr4_lp64_fetch_link_map_offsets
struct link_map_offsets * svr4_lp64_fetch_link_map_offsets(void)
Definition: solib-svr4.c:3214
linux_record_tdep::ioctl_TCSETSW
int ioctl_TCSETSW
Definition: linux-record.h:97
linux_record_tdep::size_msqid_ds
int size_msqid_ds
Definition: linux-record.h:54
linux_record_tdep::ioctl_TIOCCBRK
int ioctl_TIOCCBRK
Definition: linux-record.h:135
get_thread_regcache
struct regcache * get_thread_regcache(ptid_t ptid)
Definition: regcache.c:434
stap-probe.h
spu-tdep.h
ppc64_linux_gregset
static const struct regset ppc64_linux_gregset
Definition: ppc-linux-tdep.c:481
ppc32_linux_sigaction_tramp_frame
static struct tramp_frame ppc32_linux_sigaction_tramp_frame
Definition: ppc-linux-tdep.c:662
stoken::ptr
const char * ptr
Definition: parser-defs.h:91
set_gdbarch_stap_parse_special_token
void set_gdbarch_stap_parse_special_token(struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype stap_parse_special_token)
Definition: gdbarch.c:4499
ARCH_FRAME
Definition: frame.h:257
linux_record_tdep::size_flock64
int size_flock64
Definition: linux-record.h:76
ppc64-tdep.h
solist.h
default_floatformat_for_type
const struct floatformat ** default_floatformat_for_type(struct gdbarch *gdbarch, const char *name, int len)
Definition: arch-utils.c:230
linux_record_tdep::ioctl_TIOCSERGSTRUCT
int ioctl_TIOCSERGSTRUCT
Definition: linux-record.h:151
record-full.h
initialize_tdesc_powerpc_vsx32l
static void initialize_tdesc_powerpc_vsx32l(void)
Definition: powerpc-vsx32l.c:10
ppc32_linux_sigaction_cache_init
static void ppc32_linux_sigaction_cache_init(const struct tramp_frame *self, struct frame_info *this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func)
Definition: ppc-linux-tdep.c:615
record_full_arch_list_add_reg
int record_full_arch_list_add_reg(struct regcache *regcache, int regnum)
Definition: record-full.c:468
gdbarch_tdep::ppc_lr_regnum
int ppc_lr_regnum
Definition: ppc-tdep.h:231
linux_record_tdep::size_gid_t
int size_gid_t
Definition: linux-record.h:73
PPC_ORIG_R3_REGNUM
Definition: ppc-linux-tdep.h:36
linux_record_tdep::ioctl_FIOCLEX
int ioctl_FIOCLEX
Definition: linux-record.h:144
func
void(* func)(char *)
Definition: remote-fileio.c:1104
if
if(!(yy_init))
Definition: ada-lex.c:1075
set_solib_ops
void set_solib_ops(struct gdbarch *gdbarch, const struct target_so_ops *new_ops)
Definition: solib.c:77
BMSYMBOL_VALUE_ADDRESS
#define BMSYMBOL_VALUE_ADDRESS(symbol)
Definition: symtab.h:691
iterate_over_regset_sections_cb
void() iterate_over_regset_sections_cb(const char *sect_name, int size, const struct regset *regset, const char *human_name, void *cb_data)
Definition: gdbarch.h:99
set_gdbarch_skip_trampoline_code
void set_gdbarch_skip_trampoline_code(struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
Definition: gdbarch.c:3316
ppc_supply_fpregset
void ppc_supply_fpregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *fpregs, size_t len)
Definition: rs6000-tdep.c:561
glibc_skip_solib_resolver
CORE_ADDR glibc_skip_solib_resolver(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition: glibc-tdep.c:38
ppc_linux_write_pc
static void ppc_linux_write_pc(struct regcache *regcache, CORE_ADDR pc)
Definition: ppc-linux-tdep.c:919
linux_record_tdep::ioctl_TCGETA
int ioctl_TCGETA
Definition: linux-record.h:99
tdesc_compatible_p
int tdesc_compatible_p(const struct target_desc *target_desc, const struct bfd_arch_info *arch)
Definition: target-descriptions.c:873
ppu2spu_cache::frame_id
struct frame_id frame_id
Definition: ppc-linux-tdep.c:1243
svr4_in_dynsym_resolve_code
int svr4_in_dynsym_resolve_code(CORE_ADDR pc)
Definition: solib-svr4.c:1628
set_gdbarch_write_pc
void set_gdbarch_write_pc(struct gdbarch *gdbarch, gdbarch_write_pc_ftype write_pc)
Definition: gdbarch.c:1943
set_gdbarch_displaced_step_location
void set_gdbarch_displaced_step_location(struct gdbarch *gdbarch, gdbarch_displaced_step_location_ftype displaced_step_location)
Definition: gdbarch.c:3999
linux_record_tdep::size_time_t
int size_time_t
Definition: linux-record.h:92
trad_frame_set_id
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
Definition: trad-frame.c:171
linux_record_tdep::size_statfs
int size_statfs
Definition: linux-record.h:43
RETURN_VALUE_STRUCT_CONVENTION
Definition: defs.h:258
GDB_OSABI_LINUX
Definition: defs.h:517
linux_record_tdep::ioctl_TIOCSERCONFIG
int ioctl_TIOCSERCONFIG
Definition: linux-record.h:146
linux_record_tdep::ioctl_TIOCSERGETMULTI
int ioctl_TIOCSERGETMULTI
Definition: linux-record.h:153
linux_record_tdep::size_iovec
int size_iovec
Definition: linux-record.h:91
stap_parse_info
Definition: stap-probe.h:29
gdbarch_tdep::ppc_fpscr_regnum
int ppc_fpscr_regnum
Definition: ppc-tdep.h:241
RETURN_MASK_ERROR
Definition: common-exceptions.h:43
set_gdbarch_process_record_signal
void set_gdbarch_process_record_signal(struct gdbarch *gdbarch, gdbarch_process_record_signal_ftype process_record_signal)
Definition: gdbarch.c:4161
get_frame_sp
CORE_ADDR get_frame_sp(struct frame_info *this_frame)
Definition: frame.c:2782
gdbarch_find_by_info
struct gdbarch * gdbarch_find_by_info(struct gdbarch_info info)
Definition: gdbarch.c:5332
linux_record_tdep::ioctl_TIOCSLCKTRMIOS
int ioctl_TIOCSLCKTRMIOS
Definition: linux-record.h:150
ppc-tdep.h
initialize_tdesc_powerpc_altivec64l
static void initialize_tdesc_powerpc_altivec64l(void)
Definition: powerpc-altivec64l.c:10
memset
void * memset(T *s, int c, size_t n)=delete
internal_error
void internal_error(const char *file, int line, const char *fmt,...)
Definition: errors.c:50
ppc_process_record
int ppc_process_record(struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
Definition: rs6000-tdep.c:5638
ax-gdb.h
gdbarch_tdep::pc
struct m32c_reg * pc
Definition: m32c-tdep.c:116
gdbarch_tdep
Definition: aarch64-tdep.h:55
return_value_convention
return_value_convention
Definition: defs.h:247
stap_parse_info::arg
const char * arg
Definition: stap-probe.h:46
linux_record_tdep::fcntl_F_GETLK
int fcntl_F_GETLK
Definition: linux-record.h:163
linux_record_tdep::ioctl_TIOCMBIC
int ioctl_TIOCMBIC
Definition: linux-record.h:117
ppc_supply_reg
void ppc_supply_reg(struct regcache *regcache, int regnum, const gdb_byte *regs, size_t offset, int regsize)
Definition: rs6000-tdep.c:389
linux_init_abi
void linux_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: linux-tdep.c:2492
linux_record_tdep::size_termios
int size_termios
Definition: linux-record.h:83
ppc_init_linux_record_tdep
static void ppc_init_linux_record_tdep(struct linux_record_tdep *record_tdep, int wordsize)
Definition: ppc-linux-tdep.c:1393
ppc_skip_trampoline_code
static CORE_ADDR ppc_skip_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
Definition: ppc-linux-tdep.c:313
auxv.h
linux_record_tdep::size_epoll_event
int size_epoll_event
Definition: linux-record.h:80
SIGTRAMP_FRAME
Definition: frame.h:255
linux_record_tdep::size_TASK_COMM_LEN
int size_TASK_COMM_LEN
Definition: linux-record.h:65
ppc64_linux_record_tdep
static struct linux_record_tdep ppc64_linux_record_tdep
Definition: ppc-linux-tdep.c:746
linux_record_tdep::size_size_t
int size_size_t
Definition: linux-record.h:90
linux_record_tdep::size_ulong
int size_ulong
Definition: linux-record.h:48
frame_info
Definition: frame.c:85
tdesc_powerpc_32l
struct target_desc * tdesc_powerpc_32l
Definition: powerpc-32l.c:8
svr4_ilp32_fetch_link_map_offsets
struct link_map_offsets * svr4_ilp32_fetch_link_map_offsets(void)
Definition: solib-svr4.c:3183
make_scoped_restore_show_memory_breakpoints
scoped_restore_tmpl< int > make_scoped_restore_show_memory_breakpoints(int show)
Definition: target.c:1250
linux_record_tdep::size_sockaddr
int size_sockaddr
Definition: linux-record.h:45
floatformats_ia64_quad
const struct floatformat * floatformats_ia64_quad[BFD_ENDIAN_UNKNOWN]
Definition: gdbtypes.c:100
so_list
Definition: solist.h:38
linux_record_tdep::ioctl_TIOCSPGRP
int ioctl_TIOCSPGRP
Definition: linux-record.h:110
spe_context_objfile
static struct objfile * spe_context_objfile
Definition: ppc-linux-tdep.c:1103
register_status
register_status
Definition: common-regcache.h:25
gdb_sys_recvmsg
Definition: linux-record.h:519
ppc_linux_gregset
const struct regset * ppc_linux_gregset(int wordsize)
Definition: ppc-linux-tdep.c:506
gdbarch_num_regs
int gdbarch_num_regs(struct gdbarch *gdbarch)
Definition: gdbarch.c:2039
_
#define _(String)
Definition: gdb_locale.h:35
linux_record_tdep::arg2
int arg2
Definition: linux-record.h:171
target_so_ops
Definition: solist.h:91
gdbarch_info::bfd_arch_info
const struct bfd_arch_info * bfd_arch_info
Definition: gdbarch.h:1629
MSYMBOL_TARGET_FLAG_1
#define MSYMBOL_TARGET_FLAG_1(msymbol)
Definition: symtab.h:670
linux_record_tdep::size_old_dirent
int size_old_dirent
Definition: linux-record.h:42
ppc32_linux_vsxregset
static const struct regset ppc32_linux_vsxregset
Definition: ppc-linux-tdep.c:499
gdbarch_tdep::long_double_abi
enum powerpc_long_double_abi long_double_abi
Definition: ppc-tdep.h:222
powerpc-isa205-altivec32l.c
regcache_save
void regcache_save(struct regcache *regcache, regcache_cooked_read_ftype *cooked_read, void *src)
Definition: regcache.c:276
linux_record_tdep::size_oldold_utsname
int size_oldold_utsname
Definition: linux-record.h:31
defs.h
gdbarch_tdep::ppc_cr_regnum
int ppc_cr_regnum
Definition: ppc-tdep.h:230
ppu2spu_data::npc
unsigned int npc
Definition: ppc-linux-tdep.c:1284
gdbarch_tdep
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
Definition: gdbarch.c:1491
XML_SYSCALL_FILENAME_PPC64
#define XML_SYSCALL_FILENAME_PPC64
Definition: ppc-linux-tdep.c:86
linux_record_tdep::size_pollfd
int size_pollfd
Definition: linux-record.h:62
gdb_sys_recvfrom
Definition: linux-record.h:517
END_CATCH
#define END_CATCH
Definition: common-exceptions.h:259
tdesc_powerpc_cell32l
struct target_desc * tdesc_powerpc_cell32l
Definition: powerpc-cell32l.c:8
ppc64_skip_trampoline_code
CORE_ADDR ppc64_skip_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
Definition: ppc64-tdep.c:522
frame_unwind_prepend_unwinder
void frame_unwind_prepend_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
Definition: frame-unwind.c:64
linux_record_tdep::arg3
int arg3
Definition: linux-record.h:172
initialize_tdesc_powerpc_isa205_32l
static void initialize_tdesc_powerpc_isa205_32l(void)
Definition: powerpc-isa205-32l.c:10
set_gdbarch_process_record
void set_gdbarch_process_record(struct gdbarch *gdbarch, gdbarch_process_record_ftype process_record)
Definition: gdbarch.c:4137
set_gdbarch_significant_addr_bit
void set_gdbarch_significant_addr_bit(struct gdbarch *gdbarch, int significant_addr_bit)
Definition: gdbarch.c:3234
ax.h
set_gdbarch_elf_make_msymbol_special
void set_gdbarch_elf_make_msymbol_special(struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
Definition: gdbarch.c:3391
ppc_linux_spe_context_solib_loaded
static void ppc_linux_spe_context_solib_loaded(struct so_list *so)
Definition: ppc-linux-tdep.c:1151
POWERPC_ELF_V1
Definition: ppc-tdep.h:190
ppc_canonicalize_syscall
static enum gdb_syscall ppc_canonicalize_syscall(int syscall)
Definition: ppc-linux-tdep.c:756
objfiles.h
set_gdbarch_stap_register_indirection_suffixes
void set_gdbarch_stap_register_indirection_suffixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_suffixes)
Definition: gdbarch.c:4417
arch-utils.h
linux_record_tdep::ioctl_TIOCGWINSZ
int ioctl_TIOCGWINSZ
Definition: linux-record.h:113
observer.h
svr4_fetch_objfile_link_map
CORE_ADDR svr4_fetch_objfile_link_map(struct objfile *objfile)
Definition: solib-svr4.c:1579
linux_record_tdep::arg4
int arg4
Definition: linux-record.h:173
linux_record_tdep::size_uid_t
int size_uid_t
Definition: linux-record.h:74
tdesc_powerpc_64l
struct target_desc * tdesc_powerpc_64l
Definition: powerpc-64l.c:8
regset
Definition: regset.h:34
set_gdbarch_floatformat_for_type
void set_gdbarch_floatformat_for_type(struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype floatformat_for_type)
Definition: gdbarch.c:1824
linux_record_tdep::ioctl_TIOCSPTLCK
int ioctl_TIOCSPTLCK
Definition: linux-record.h:142
parser-defs.h
observer_attach_inferior_created
struct observer * observer_attach_inferior_created(observer_inferior_created_ftype *f)
TRY
#define TRY
Definition: common-exceptions.h:246
set_gdbarch_stap_integer_prefixes
void set_gdbarch_stap_integer_prefixes(struct gdbarch *gdbarch, const char *const *stap_integer_prefixes)
Definition: gdbarch.c:4332
bp_target_info
Definition: breakpoint.h:238
set_gdbarch_stap_gdb_register_prefix
void set_gdbarch_stap_gdb_register_prefix(struct gdbarch *gdbarch, const char *stap_gdb_register_prefix)
Definition: gdbarch.c:4434
symtab.h
stap_parse_info::pstate
struct parser_state pstate
Definition: stap-probe.h:49
linux_record_tdep::ioctl_TIOCLINUX
int ioctl_TIOCLINUX
Definition: linux-record.h:123
ppc_linux_iterate_over_regset_sections
static void ppc_linux_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
Definition: ppc-linux-tdep.c:520
MSYMBOL_VALUE_RAW_ADDRESS
#define MSYMBOL_VALUE_RAW_ADDRESS(symbol)
Definition: symtab.h:684
linux_record_tdep::ioctl_TIOCSERSETMULTI
int ioctl_TIOCSERSETMULTI
Definition: linux-record.h:154
initialize_tdesc_powerpc_vsx64l
static void initialize_tdesc_powerpc_vsx64l(void)
Definition: powerpc-vsx64l.c:10
tdesc_numbered_register
int tdesc_numbered_register(const struct tdesc_feature *feature, struct tdesc_arch_data *data, int regno, const char *name)
Definition: target-descriptions.c:1084
linux_record_tdep::size_timespec
int size_timespec
Definition: linux-record.h:61
extract_bp_kind::bp
initialize_tdesc_powerpc_isa205_vsx32l
static void initialize_tdesc_powerpc_isa205_vsx32l(void)
Definition: powerpc-isa205-vsx32l.c:10
name
const char *const name
Definition: aarch64-tdep.c:76
get_frame_type
enum frame_type get_frame_type(struct frame_info *frame)
Definition: frame.c:2619
linux_record_tdep::size_loff_t
int size_loff_t
Definition: linux-record.h:29
powerpc-isa205-vsx64l.c
initialize_tdesc_powerpc_64l
static void initialize_tdesc_powerpc_64l(void)
Definition: powerpc-64l.c:10
target_so_ops::in_dynsym_resolve_code
int(* in_dynsym_resolve_code)(CORE_ADDR pc)
Definition: solist.h:129
TARGET_OBJECT_SPU
Definition: target.h:137
linux_record_tdep::size_old_sigaction
int size_old_sigaction
Definition: linux-record.h:33
linux_record_tdep::size_sysinfo
int size_sysinfo
Definition: linux-record.h:53
ppc_collect_gregset
void ppc_collect_gregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len)
Definition: rs6000-tdep.c:675
execution_direction
enum exec_direction_kind execution_direction
Definition: infrun.c:9088
CATCH
#define CATCH(EXCEPTION, MASK)
Definition: common-exceptions.h:254
gdbarch_tdep::ppc_vsr0_upper_regnum
int ppc_vsr0_upper_regnum
Definition: ppc-tdep.h:248
tdesc_powerpc_cell64l
struct target_desc * tdesc_powerpc_cell64l
Definition: powerpc-cell64l.c:8
gdb_sys_sigreturn
Definition: linux-record.h:306
linux_record_tdep::ioctl_TIOCEXCL
int ioctl_TIOCEXCL
Definition: linux-record.h:106
ppc_stap_is_single_operand
static int ppc_stap_is_single_operand(struct gdbarch *gdbarch, const char *s)
Definition: ppc-linux-tdep.c:1035
solib-spu.h
ppc64_linux_sighandler_tramp_frame
static struct tramp_frame ppc64_linux_sighandler_tramp_frame
Definition: ppc-linux-tdep.c:693
ppu2spu_this_id
static void ppu2spu_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: ppc-linux-tdep.c:1255
linux_record_tdep::ioctl_TCSETA
int ioctl_TCSETA
Definition: linux-record.h:100
initialize_tdesc_powerpc_cell64l
static void initialize_tdesc_powerpc_cell64l(void)
Definition: powerpc-cell64l.c:10
linux_record_tdep::size_knfsd_fh
int size_knfsd_fh
Definition: linux-record.h:64
powerpc-cell64l.c
current_target
struct target_ops current_target
linux_record_tdep::size_shmid_ds
int size_shmid_ds
Definition: linux-record.h:55
ppc64_linux_sighandler_cache_init
static void ppc64_linux_sighandler_cache_init(const struct tramp_frame *self, struct frame_info *this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func)
Definition: ppc-linux-tdep.c:651
linux_record_tdep::ioctl_FIONBIO
int ioctl_FIONBIO
Definition: linux-record.h:128
gdbarch_sp_regnum
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
Definition: gdbarch.c:2146
objfile::objfile
objfile(bfd *, const char *, objfile_flags)
Definition: objfiles.c:373
trad-frame.h
linux_record_tdep::ioctl_TIOCSSOFTCAR
int ioctl_TIOCSSOFTCAR
Definition: linux-record.h:120
target_ops
Definition: target.h:412
tdesc_powerpc_altivec32l
struct target_desc * tdesc_powerpc_altivec32l
Definition: powerpc-altivec32l.c:8
powerpc-isa205-64l.c
record_linux_system_call
int record_linux_system_call(enum gdb_syscall syscall, struct regcache *regcache, struct linux_record_tdep *tdep)
Definition: linux-record.c:241
powerpc_linux_in_dynsym_resolve_code
static int powerpc_linux_in_dynsym_resolve_code(CORE_ADDR pc)
Definition: ppc-linux-tdep.c:285
solib-svr4.h
spe_context_offset
static CORE_ADDR spe_context_offset
Definition: ppc-linux-tdep.c:1105
extract_unsigned_integer
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
Definition: defs.h:577
linux_record_tdep::ioctl_TIOCGPGRP
int ioctl_TIOCGPGRP
Definition: linux-record.h:109
osabi.h
linux_record_tdep::size_pointer
int size_pointer
Definition: linux-record.h:26
trad_frame_cache
Definition: trad-frame.c:27
regcache.h
ppc_linux_spu_section
static int ppc_linux_spu_section(bfd *abfd, asection *asect, void *user_data)
Definition: ppc-linux-tdep.c:938
ppc_collect_reg
void ppc_collect_reg(const struct regcache *regcache, int regnum, gdb_byte *regs, size_t offset, int regsize)
Definition: rs6000-tdep.c:410
initialize_tdesc_powerpc_e500l
static void initialize_tdesc_powerpc_e500l(void)
Definition: powerpc-e500l.c:10
bound_minimal_symbol
Definition: minsyms.h:29
powerpc-altivec32l.c
gdb_sys_recv
Definition: linux-record.h:528
ppc_collect_vrregset
void ppc_collect_vrregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *vrregs, size_t len)
Definition: rs6000-tdep.c:800
linux_record_tdep::size_timex
int size_timex
Definition: linux-record.h:57
powerpc32_plt_stub
static struct ppc_insn_pattern powerpc32_plt_stub[]
Definition: ppc-linux-tdep.c:260
ptid_t
Definition: ptid.h:35
ppc_linux_syscall_record
static int ppc_linux_syscall_record(struct regcache *regcache)
Definition: ppc-linux-tdep.c:790
linux_record_tdep::size_sigset_t
int size_sigset_t
Definition: linux-record.h:67
gdbarch_tdep::ppc_gp0_regnum
int ppc_gp0_regnum
Definition: ppc-tdep.h:227
linux_record_tdep::size_old_gid_t
int size_old_gid_t
Definition: linux-record.h:39
ppc_linux_trap_reg_p
int ppc_linux_trap_reg_p(struct gdbarch *gdbarch)
Definition: ppc-linux-tdep.c:707
linux_record_tdep::size_pid_t
int size_pid_t
Definition: linux-record.h:85
ppc_linux_return_value
static enum return_value_convention ppc_linux_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
Definition: ppc-linux-tdep.c:245
cli-utils.h
TYPE_VECTOR
#define TYPE_VECTOR(t)
Definition: gdbtypes.h:252
observer_attach_solib_unloaded
struct observer * observer_attach_solib_unloaded(observer_solib_unloaded_ftype *f)
frame.h
linux_record_tdep::size_rlimit
int size_rlimit
Definition: linux-record.h:35
linux_record_tdep::ioctl_TIOCSERSWILD
int ioctl_TIOCSERSWILD
Definition: linux-record.h:148
BREAKPOINT_MAX
#define BREAKPOINT_MAX
Definition: breakpoint.h:62
bp_target_info::shadow_contents
gdb_byte shadow_contents[BREAKPOINT_MAX]
Definition: breakpoint.h:261
so_list::so_original_name
char so_original_name[SO_NAME_MAX_PATH_SIZE]
Definition: solist.h:57
target_ops::to_get_thread_local_address
CORE_ADDR(* to_get_thread_local_address)(struct target_ops *ops, ptid_t ptid, CORE_ADDR load_module_addr, CORE_ADDR offset) TARGET_DEFAULT_NORETURN(generic_tls_error())
Definition: target.h:701
gdbarch_byte_order
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1509
target_write_raw_memory
int target_write_raw_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
Definition: target.c:1469
inferior.h
linux_record_tdep::size_winsize
int size_winsize
Definition: linux-record.h:86
TYPE_CODE_UNION
Definition: gdbtypes.h:107
ppc64_convert_from_func_ptr_addr
CORE_ADDR ppc64_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
Definition: ppc64-tdep.c:559
TARGET_CHAR_BIT
#define TARGET_CHAR_BIT
Definition: host-defs.h:29
set_solib_svr4_fetch_link_map_offsets
void set_solib_svr4_fetch_link_map_offsets(struct gdbarch *gdbarch, struct link_map_offsets *(*flmo)(void))
Definition: solib-svr4.c:3137
set_gdbarch_gcore_bfd_target
void set_gdbarch_gcore_bfd_target(struct gdbarch *gdbarch, const char *gcore_bfd_target)
Definition: gdbarch.c:3840
scoped_restore_base
Definition: scoped_restore.h:24
set_gdbarch_stap_register_indirection_prefixes
void set_gdbarch_stap_register_indirection_prefixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_prefixes)
Definition: gdbarch.c:4400
infrun.h
gdbarch_info::osabi
enum gdb_osabi osabi
Definition: gdbarch.h:1657
type
Definition: gdbtypes.h:749
linux_record_tdep::arg5
int arg5
Definition: linux-record.h:174
ppu2spu_data
Definition: ppc-linux-tdep.c:1280
SPU_NUM_GPRS
#define SPU_NUM_GPRS
Definition: spu-tdep.h:25
ppc64_linux_sigaction_tramp_frame
static struct tramp_frame ppc64_linux_sigaction_tramp_frame
Definition: ppc-linux-tdep.c:672
initialize_tdesc_powerpc_isa205_altivec64l
static void initialize_tdesc_powerpc_isa205_altivec64l(void)
Definition: powerpc-isa205-altivec64l.c:10
linux_record_tdep::size_ustat
int size_ustat
Definition: linux-record.h:32
frame-unwind.h
ppu2spu_prev_arch
static struct gdbarch * ppu2spu_prev_arch(struct frame_info *this_frame, void **this_cache)
Definition: ppc-linux-tdep.c:1248
floatformats_ibm_long_double
const struct floatformat * floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN]
Definition: gdbtypes.c:112
ppc_linux_memory_remove_breakpoint
static int ppc_linux_memory_remove_breakpoint(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
Definition: ppc-linux-tdep.c:213
linux_record_tdep::size_flock
int size_flock
Definition: linux-record.h:30
linux_record_tdep::ioctl_TCXONC
int ioctl_TCXONC
Definition: linux-record.h:104
ppc_collect_fpregset
void ppc_collect_fpregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *fpregs, size_t len)
Definition: rs6000-tdep.c:726
gdbarch_tdep::ppc_syscall_record
int(* ppc_syscall_record)(struct regcache *regcache)
Definition: ppc-tdep.h:276
stap_parse_info::saved_arg
const char * saved_arg
Definition: stap-probe.h:54
linux_record_tdep::ioctl_TIOCGPTN
int ioctl_TIOCGPTN
Definition: linux-record.h:141
ppc_reg_offsets
Definition: ppc-tdep.h:85
solib.h
startswith
static int startswith(const char *string, const char *pattern)
Definition: common-utils.h:107
ppc64_linux_sigaction_cache_init
static void ppc64_linux_sigaction_cache_init(const struct tramp_frame *self, struct frame_info *this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func)
Definition: ppc-linux-tdep.c:627
ppc_stap_parse_special_token
static int ppc_stap_parse_special_token(struct gdbarch *gdbarch, struct stap_parse_info *p)
Definition: ppc-linux-tdep.c:1048
linux_record_tdep::ioctl_FIOASYNC
int ioctl_FIOASYNC
Definition: linux-record.h:145
ppc_supply_vrregset
void ppc_supply_vrregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *vrregs, size_t len)
Definition: rs6000-tdep.c:630
ppu2spu_data::gprs
gdb_byte gprs[128 *16]
Definition: ppc-linux-tdep.c:1285
tdesc_feature
Definition: target-descriptions.c:516
set_gdbarch_convert_from_func_ptr_addr
void set_gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
Definition: gdbarch.c:3201
regnum
int regnum
Definition: aarch64-tdep.c:77
EXEC_REVERSE
Definition: infrun.h:70
set_xml_syscall_file_name
void set_xml_syscall_file_name(struct gdbarch *gdbarch, const char *name)
Definition: xml-syscall.c:513
printf_unfiltered
void printf_unfiltered(const char *format,...)
Definition: utils.c:2056
powerpc-vsx64l.c
xml-syscall.h
linux_record_tdep::size_statfs64
int size_statfs64
Definition: linux-record.h:44
user_reg_map_name_to_regnum
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)
Definition: user-regs.c:130
linux_record_tdep
Definition: linux-record.h:23
powerpc-e500l.c
get_frame_register_unsigned
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1308
set_spu_solib_ops
void set_spu_solib_ops(struct gdbarch *gdbarch)
Definition: solib-spu.c:506
powerpc-isa205-32l.c
gdbarch_register_osabi
void gdbarch_register_osabi(enum bfd_architecture arch, unsigned long machine, enum gdb_osabi osabi, void(*init_osabi)(struct gdbarch_info, struct gdbarch *))
Definition: osabi.c:143
linux_displaced_step_location
CORE_ADDR linux_displaced_step_location(struct gdbarch *gdbarch)
Definition: linux-tdep.c:2437
TYPE_CODE_STRUCT
Definition: gdbtypes.h:106
PPC_TRAP_REGNUM
Definition: ppc-linux-tdep.h:37
ppc_linux_core_read_description
static const struct target_desc * ppc_linux_core_read_description(struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
Definition: ppc-linux-tdep.c:944
glibc-tdep.h
powerpc-isa205-vsx32l.c
linux_record_tdep::ioctl_TIOCNOTTY
int ioctl_TIOCNOTTY
Definition: linux-record.h:129
ppc_insns_match_pattern
int ppc_insns_match_pattern(struct frame_info *frame, CORE_ADDR pc, struct ppc_insn_pattern *pattern, unsigned int *insns)
Definition: rs6000-tdep.c:6729
linux_record_tdep::ioctl_TIOCGSERIAL
int ioctl_TIOCGSERIAL
Definition: linux-record.h:125
ppc64_elf_make_msymbol_special
void ppc64_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym)
Definition: ppc64-tdep.c:608
gdb_syscall
gdb_syscall
Definition: linux-record.h:183
user-regs.h
record_full_arch_list_add_mem
int record_full_arch_list_add_mem(CORE_ADDR addr, int len)
Definition: record-full.c:491
gdb_assert
#define gdb_assert(expr)
Definition: gdb_assert.h:32
gdbarch_info::target_desc
const struct target_desc * target_desc
Definition: gdbarch.h:1660
linux_record_tdep::ioctl_TIOCINQ
int ioctl_TIOCINQ
Definition: linux-record.h:122
value
Definition: value.c:169
ppc32_linux_reg_offsets
static const struct ppc_reg_offsets ppc32_linux_reg_offsets
Definition: ppc-linux-tdep.c:425
tramp-frame.h
ppc_elfv2_elf_make_msymbol_special
static void ppc_elfv2_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym)
Definition: ppc-linux-tdep.c:987
linux_record_tdep::ioctl_TIOCSTI
int ioctl_TIOCSTI
Definition: linux-record.h:112
ppc_linux_fpregset
const struct regset * ppc_linux_fpregset(void)
Definition: ppc-linux-tdep.c:512
ppu2spu_unwind
static const struct frame_unwind ppu2spu_unwind
Definition: ppc-linux-tdep.c:1377
linux_record_tdep::ioctl_TCSBRKP
int ioctl_TCSBRKP
Definition: linux-record.h:132
linux_record_tdep::size_new_utsname
int size_new_utsname
Definition: linux-record.h:56
ppc32_linux_sighandler_cache_init
static void ppc32_linux_sighandler_cache_init(const struct tramp_frame *self, struct frame_info *this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func)
Definition: ppc-linux-tdep.c:639
write_exp_elt_opcode
void write_exp_elt_opcode(struct parser_state *ps, enum exp_opcode expelt)
Definition: parse.c:205
objfile
Definition: objfiles.h:286
linux_record_tdep::size_long
int size_long
Definition: linux-record.h:47
gdb_sys_rt_sigreturn
Definition: linux-record.h:360
gdb_byte
bfd_byte gdb_byte
Definition: common-types.h:38
spe_context_lm_addr
static CORE_ADDR spe_context_lm_addr
Definition: ppc-linux-tdep.c:1104
gdbarch_tdep::ppc_ctr_regnum
int ppc_ctr_regnum
Definition: ppc-tdep.h:232
get_next_frame
struct frame_info * get_next_frame(struct frame_info *this_frame)
Definition: frame.c:1771
gdbarch_tdep::ppc_vr0_regnum
int ppc_vr0_regnum
Definition: ppc-tdep.h:252
svr4_so_ops
struct target_so_ops svr4_so_ops
Definition: solib-svr4.c:3242
powerpc-altivec64l.c
align_up
ULONGEST align_up(ULONGEST v, int n)
Definition: utils.c:2997
POWERPC32_PLT_STUB_LEN
#define POWERPC32_PLT_STUB_LEN
Definition: ppc-linux-tdep.c:278
linux_record_tdep::ioctl_TIOCGLCKTRMIOS
int ioctl_TIOCGLCKTRMIOS
Definition: linux-record.h:149
lookup_minimal_symbol_by_pc
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
Definition: minsyms.c:928
linux_record_tdep::size_serial_struct
int size_serial_struct
Definition: linux-record.h:87
ppc_collect_vsxregset
void ppc_collect_vsxregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *vsxregs, size_t len)
Definition: rs6000-tdep.c:766
ppc_linux_get_syscall_number
static LONGEST ppc_linux_get_syscall_number(struct gdbarch *gdbarch, ptid_t ptid)
Definition: ppc-linux-tdep.c:722
ppc32_linux_vrregset
static const struct regset ppc32_linux_vrregset
Definition: ppc-linux-tdep.c:493
ppc_insn_d_field
CORE_ADDR ppc_insn_d_field(unsigned int insn)
Definition: rs6000-tdep.c:6758
linux_record_tdep::ioctl_TIOCOUTQ
int ioctl_TIOCOUTQ
Definition: linux-record.h:111
gdbarch_fp0_regnum
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
Definition: gdbarch.c:2197
linux_record_tdep::ioctl_TCSBRK
int ioctl_TCSBRK
Definition: linux-record.h:103
gdbcore.h
gdbarch_pseudo_register_read
enum register_status gdbarch_pseudo_register_read(struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
Definition: gdbarch.c:1974
ppc_linux_spe_context_inferior_created
static void ppc_linux_spe_context_inferior_created(struct target_ops *t, int from_tty)
Definition: ppc-linux-tdep.c:1141
linux_record_tdep::size_fd_set
int size_fd_set
Definition: linux-record.h:41
xsnprintf
int xsnprintf(char *str, size_t size, const char *format,...)
Definition: common-utils.c:134
TYPE_CODE
#define TYPE_CODE(thistype)
Definition: gdbtypes.h:1238
powerpc-vsx32l.c
regcache_raw_read
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
Definition: regcache.c:565
regcache_cooked_write_unsigned
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
Definition: regcache.c:806
target_read_memory
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: target.c:1370
gdbarch_tdep::wordsize
int wordsize
Definition: ppc-tdep.h:216
gdbarch_breakpoint_from_pc
const gdb_byte * gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
Definition: gdbarch.c:2844
gdbarch_info_init
void gdbarch_info_init(struct gdbarch_info *info)
Definition: arch-utils.c:725
ppc_linux_record_signal
static int ppc_linux_record_signal(struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal)
Definition: ppc-linux-tdep.c:873
target_desc
Definition: target-descriptions.c:591
inferior_ptid
ptid_t inferior_ptid
Definition: infcmd.c:94
bound_minimal_symbol::minsym
struct minimal_symbol * minsym
Definition: minsyms.h:34
linux-record.h
set_gdbarch_stap_is_single_operand
void set_gdbarch_stap_is_single_operand(struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype stap_is_single_operand)
Definition: gdbarch.c:4475
linux_record_tdep::ioctl_TIOCMGET
int ioctl_TIOCMGET
Definition: linux-record.h:115
offset
int offset
Definition: agent.c:65
set_gdbarch_get_syscall_number
void set_gdbarch_get_syscall_number(struct gdbarch *gdbarch, gdbarch_get_syscall_number_ftype get_syscall_number)
Definition: gdbarch.c:4281
linux_record_tdep::size_stat
int size_stat
Definition: linux-record.h:51
tramp_frame_prepend_unwinder
void tramp_frame_prepend_unwinder(struct gdbarch *gdbarch, const struct tramp_frame *tramp_frame)
Definition: tramp-frame.c:146
linux_record_tdep::ioctl_TIOCSSERIAL
int ioctl_TIOCSSERIAL
Definition: linux-record.h:126
gdbarch_tdep::ppc_xer_regnum
int ppc_xer_regnum
Definition: ppc-tdep.h:233
linux_record_tdep::size_old_sigset_t
int size_old_sigset_t
Definition: linux-record.h:34
_initialize_ppc_linux_tdep
void _initialize_ppc_linux_tdep(void)
Definition: ppc-linux-tdep.c:1831
regcache::arch
gdbarch * arch() const
Definition: regcache.c:221
powerpc-32l.c
regcache_cooked_read
enum register_status regcache_cooked_read(struct regcache *regcache, int regnum, gdb_byte *buf)
Definition: regcache.c:661
linux_record_tdep::size_NFS_FHSIZE
int size_NFS_FHSIZE
Definition: linux-record.h:63
POWERPC_LONG_DOUBLE_IEEE128
Definition: ppc-tdep.h:210
linux-tdep.h
linux_record_tdep::size_mem_dqinfo
int size_mem_dqinfo
Definition: linux-record.h:58
ppc_reg_offsets::pc_offset
int pc_offset
Definition: ppc-tdep.h:91
linux_record_tdep::size_fs_quota_stat
int size_fs_quota_stat
Definition: linux-record.h:60
linux_record_tdep::size_old_utsname
int size_old_utsname
Definition: linux-record.h:52
ppc32_linux_gregset
static const struct regset ppc32_linux_gregset
Definition: ppc-linux-tdep.c:475
extract_signed_integer
static LONGEST extract_signed_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
Definition: defs.h:570
target.h
ppu2spu_data::gdbarch
struct gdbarch * gdbarch
Definition: ppc-linux-tdep.c:1282
gdbarch_tdep::regs
struct m32c_reg regs[M32C_MAX_NUM_REGS]
Definition: m32c-tdep.c:110
linux_record_tdep::size_if_dqblk
int size_if_dqblk
Definition: linux-record.h:59
initialize_tdesc_powerpc_isa205_vsx64l
static void initialize_tdesc_powerpc_isa205_vsx64l(void)
Definition: powerpc-isa205-vsx64l.c:10
value.h
frame_unwind
Definition: frame-unwind.h:144
linux_record_tdep::ioctl_TIOCGSID
int ioctl_TIOCGSID
Definition: linux-record.h:136
ppc32_linux_sighandler_tramp_frame
static struct tramp_frame ppc32_linux_sighandler_tramp_frame
Definition: ppc-linux-tdep.c:683
gdbarch_tdep::sp
struct m32c_reg * sp
Definition: m32c-tdep.c:119
linux_record_tdep::size_int
int size_int
Definition: linux-record.h:46
ptid_equal
int ptid_equal(const ptid_t &ptid1, const ptid_t &ptid2)
Definition: ptid.c:71
linux_record_tdep::fcntl_F_SETLKW64
int fcntl_F_SETLKW64
Definition: linux-record.h:166
gdb::byte_vector
gdb::def_vector< gdb_byte > byte_vector
Definition: byte-vector.h:58
set_gdbarch_memory_remove_breakpoint
void set_gdbarch_memory_remove_breakpoint(struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
Definition: gdbarch.c:2963
powerpc-64l.c
linux_record_tdep::ioctl_TIOCSETD
int ioctl_TIOCSETD
Definition: linux-record.h:130
tdesc_powerpc_vsx64l
struct target_desc * tdesc_powerpc_vsx64l
Definition: powerpc-vsx64l.c:8
linux_record_tdep::size_stat64
int size_stat64
Definition: linux-record.h:72
ppc_linux_spe_context_lookup
static void ppc_linux_spe_context_lookup(struct objfile *objfile)
Definition: ppc-linux-tdep.c:1114
linux_record_tdep::size_timeval
int size_timeval
Definition: linux-record.h:37
regset::regmap
const void * regmap
Definition: regset.h:39
ULONGEST
unsigned long long ULONGEST
Definition: common-types.h:53
default_frame_unwind_stop_reason
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184
linux_record_tdep::ioctl_FIONREAD
int ioctl_FIONREAD
Definition: linux-record.h:121
tdesc_find_feature
const struct tdesc_feature * tdesc_find_feature(const struct target_desc *target_desc, const char *name)
Definition: target-descriptions.c:942
tdesc_arch_data
Definition: target-descriptions.c:670
register_size
int register_size(struct gdbarch *gdbarch, int regnum)
Definition: regcache.c:164
regcache
Definition: regcache.h:232
linux_record_tdep::ioctl_TIOCMBIS
int ioctl_TIOCMBIS
Definition: linux-record.h:116
initialize_tdesc_powerpc_altivec32l
static void initialize_tdesc_powerpc_altivec32l(void)
Definition: powerpc-altivec32l.c:10
linux_record_tdep::size_stack_t
int size_stack_t
Definition: linux-record.h:70
gdbarch_info
Definition: gdbarch.h:1626
set_gdbarch_long_double_bit
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
Definition: gdbarch.c:1756
set_gdbarch_skip_entrypoint
void set_gdbarch_skip_entrypoint(struct gdbarch *gdbarch, gdbarch_skip_entrypoint_ftype skip_entrypoint)
Definition: gdbarch.c:2820
linux_record_tdep::ioctl_TIOCSERGETLSR
int ioctl_TIOCSERGETLSR
Definition: linux-record.h:152
linux_record_tdep::ioctl_TCGETS
int ioctl_TCGETS
Definition: linux-record.h:95
frame_info::base
const struct frame_base * base
Definition: frame.c:142
tdesc_powerpc_vsx32l
struct target_desc * tdesc_powerpc_vsx32l
Definition: powerpc-vsx32l.c:8
linux_record_tdep::size_siginfo_t
int size_siginfo_t
Definition: linux-record.h:68
ppc_linux_spe_context_solib_unloaded
static void ppc_linux_spe_context_solib_unloaded(struct so_list *so)
Definition: ppc-linux-tdep.c:1161
set_gdbarch_return_value
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
Definition: gdbarch.c:2738
target_read
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
Definition: target.c:1562
gdbarch_bfd_arch_info
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
Definition: gdbarch.c:1500
gdbarch_pc_regnum
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
Definition: gdbarch.c:2163
linux_record_tdep::ioctl_TIOCMIWAIT
int ioctl_TIOCMIWAIT
Definition: linux-record.h:155
linux_record_tdep::size_mq_attr
int size_mq_attr
Definition: linux-record.h:82
regset.h
solib_read_symbols
int solib_read_symbols(struct so_list *so, symfile_add_flags flags)
Definition: solib.c:676
linux_record_tdep::size_timezone
int size_timezone
Definition: linux-record.h:38
linux_record_tdep::ioctl_TCSETSF
int ioctl_TCSETSF
Definition: linux-record.h:98
set_gdbarch_long_double_format
void set_gdbarch_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
Definition: gdbarch.c:1772
linux_record_tdep::ioctl_FIOQSIZE
int ioctl_FIOQSIZE
Definition: linux-record.h:159
TYPE_LENGTH
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1235
minimal_symbol
Definition: symtab.h:623
powerpc32_plt_stub_so
static struct ppc_insn_pattern powerpc32_plt_stub_so[]
Definition: ppc-linux-tdep.c:270
tramp_frame
Definition: tramp-frame.h:46
bound_minimal_symbol::objfile
struct objfile * objfile
Definition: minsyms.h:39
regcache_raw_read_unsigned
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
Definition: regcache.c:612
ppc_insn_pattern
Definition: ppc-tdep.h:325
linux_record_tdep::ioctl_TIOCSERGWILD
int ioctl_TIOCSERGWILD
Definition: linux-record.h:147
linux_record_tdep::size_msghdr
int size_msghdr
Definition: linux-record.h:49
linux_record_tdep::size_off_t
int size_off_t
Definition: linux-record.h:71
gdb_sys_tkill
Definition: linux-record.h:425
read_memory_unsigned_integer
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:326
ppc_floatformat_for_type
const struct floatformat ** ppc_floatformat_for_type(struct gdbarch *gdbarch, const char *name, int len)
Definition: ppc-linux-tdep.c:1622
linux_record_tdep::arg6
int arg6
Definition: linux-record.h:175
ppu2spu_unwind_register
static enum register_status ppu2spu_unwind_register(void *src, int regnum, gdb_byte *buf)
Definition: ppc-linux-tdep.c:1289
set_gdbarch_iterate_over_regset_sections
void set_gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype iterate_over_regset_sections)
Definition: gdbarch.c:3647
regcache::ptid
ptid_t ptid() const
Definition: regcache.h:325
ALL_OBJFILES
#define ALL_OBJFILES(obj)
Definition: objfiles.h:582
ppc_linux_record_tdep
static struct linux_record_tdep ppc_linux_record_tdep
Definition: ppc-linux-tdep.c:745
linux_record_tdep::size_itimerval
int size_itimerval
Definition: linux-record.h:50
linux_record_tdep::size__old_kernel_stat
int size__old_kernel_stat
Definition: linux-record.h:27
ppu2spu_prev_register
static struct value * ppu2spu_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: ppc-linux-tdep.c:1263
tdesc_data
static struct gdbarch_data * tdesc_data
Definition: target-descriptions.c:725
ppc_supply_vsxregset
void ppc_supply_vsxregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *vsxregs, size_t len)
Definition: rs6000-tdep.c:599
so_list::objfile
struct objfile * objfile
Definition: solist.h:77
linux_record_tdep::ioctl_TCSETAW
int ioctl_TCSETAW
Definition: linux-record.h:101
tdesc_powerpc_altivec64l
struct target_desc * tdesc_powerpc_altivec64l
Definition: powerpc-altivec64l.c:8
ppc_linux_collect_gregset
static void ppc_linux_collect_gregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len)
Definition: ppc-linux-tdep.c:395
gdbarch_info::byte_order
enum bfd_endian byte_order
Definition: gdbarch.h:1632
linux_record_tdep::ioctl_TIOCPKT
int ioctl_TIOCPKT
Definition: linux-record.h:127
set_gdbarch_skip_solib_resolver
void set_gdbarch_skip_solib_resolver(struct gdbarch *gdbarch, gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
Definition: gdbarch.c:3333
lookup_minimal_symbol
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
Definition: minsyms.c:311
ppc_floating_point_unit_p
int ppc_floating_point_unit_p(struct gdbarch *gdbarch)
Definition: rs6000-tdep.c:218
linux_record_tdep::ioctl_TIOCNXCL
int ioctl_TIOCNXCL
Definition: linux-record.h:107
linux_record_tdep::size_PAGE_SIZE
int size_PAGE_SIZE
Definition: linux-record.h:75
gdbarch_info::tdesc_data
struct tdesc_arch_data * tdesc_data
Definition: gdbarch.h:1648
linux_record_tdep::size_old_uid_t
int size_old_uid_t
Definition: linux-record.h:40
stoken
Definition: parser-defs.h:88
write_exp_string
void write_exp_string(struct parser_state *ps, struct stoken str)
Definition: parse.c:318
gdbcmd.h
record_full_arch_list_add_end
int record_full_arch_list_add_end(void)
Definition: record-full.c:522
set_gdbarch_core_read_description
void set_gdbarch_core_read_description(struct gdbarch *gdbarch, gdbarch_core_read_description_ftype core_read_description)
Definition: gdbarch.c:4072
linux_record_tdep::size_io_event
int size_io_event
Definition: linux-record.h:78
tdesc_has_registers
int tdesc_has_registers(const struct target_desc *target_desc)
Definition: target-descriptions.c:926
linux_record_tdep::fcntl_F_SETLK64
int fcntl_F_SETLK64
Definition: linux-record.h:165
REG_UNAVAILABLE
Definition: common-regcache.h:40
linux_record_tdep::ioctl_TIOCGSOFTCAR
int ioctl_TIOCGSOFTCAR
Definition: linux-record.h:119
ppc_sysv_abi_return_value
enum return_value_convention ppc_sysv_abi_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
Definition: ppc-sysv-tdep.c:1042
error
void error(const char *fmt,...)
Definition: errors.c:38
ppu2spu_data::id
int id
Definition: ppc-linux-tdep.c:1283
linux_record_tdep::size_rusage
int size_rusage
Definition: linux-record.h:36
linux_record_tdep::ioctl_FIONCLEX
int ioctl_FIONCLEX
Definition: linux-record.h:143
gdbarch_tdep::ppc_fp0_regnum
int ppc_fp0_regnum
Definition: ppc-tdep.h:240
linux_record_tdep::size_sigaction
int size_sigaction
Definition: linux-record.h:66
linux_record_tdep::ioctl_TCSETS
int ioctl_TCSETS
Definition: linux-record.h:96
ppc_supply_gregset
void ppc_supply_gregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
Definition: rs6000-tdep.c:511
PPC_R0_REGNUM
Definition: ppc-tdep.h:299
minus_one_ptid
ptid_t minus_one_ptid
Definition: ptid.c:26
SPU_PC_REGNUM
Definition: spu-tdep.h:41
frame_id
Definition: frame.h:111
get_frame_arch
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
Definition: frame.c:2691
FRAME_OBSTACK_CALLOC
#define FRAME_OBSTACK_CALLOC(NUMBER, TYPE)
Definition: frame.h:680
LONGEST
long long LONGEST
Definition: common-types.h:52
wordsize
#define wordsize
spe_context_cache_address
static CORE_ADDR spe_context_cache_address
Definition: ppc-linux-tdep.c:1108
ppu2spu_cache
Definition: ppc-linux-tdep.c:1241
linux_record_tdep::size_tms
int size_tms
Definition: linux-record.h:28
ppc-linux-tdep.h
observer_attach_solib_loaded
struct observer * observer_attach_solib_loaded(observer_solib_loaded_ftype *f)
ppu2spu_dealloc_cache
static void ppu2spu_dealloc_cache(struct frame_info *self, void *this_cache)
Definition: ppc-linux-tdep.c:1371
powerpc_so_ops
static struct target_so_ops powerpc_so_ops
Definition: ppc-linux-tdep.c:82
stoken::length
int length
Definition: parser-defs.h:93
symfile.h
ppc_linux_spe_context
static CORE_ADDR ppc_linux_spe_context(int wordsize, enum bfd_endian byte_order, int n, int *id, unsigned int *npc)
Definition: ppc-linux-tdep.c:1171
linux_record_tdep::ioctl_TIOCGETD
int ioctl_TIOCGETD
Definition: linux-record.h:131
store_unsigned_integer
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
Definition: defs.h:604
linux_record_tdep::ioctl_TIOCMSET
int ioctl_TIOCMSET
Definition: linux-record.h:118
gdbarch_target_desc
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
Definition: gdbarch.c:1536
powerpc-cell32l.c
linux_record_tdep::size_iocb
int size_iocb
Definition: linux-record.h:79
spe_context_cache_ptid
static ptid_t spe_context_cache_ptid
Definition: ppc-linux-tdep.c:1107