OLD | NEW |
1 /* Target-dependent code for GDB, the GNU debugger. | 1 /* Target-dependent code for GDB, the GNU debugger. |
2 | 2 |
3 Copyright (C) 1986-1987, 1989, 1991-1997, 2000-2012 Free Software | 3 Copyright (C) 1986-1987, 1989, 1991-1997, 2000-2012 Free Software |
4 Foundation, Inc. | 4 Foundation, Inc. |
5 | 5 |
6 This file is part of GDB. | 6 This file is part of GDB. |
7 | 7 |
8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "regcache.h" | 30 #include "regcache.h" |
31 #include "value.h" | 31 #include "value.h" |
32 #include "osabi.h" | 32 #include "osabi.h" |
33 #include "regset.h" | 33 #include "regset.h" |
34 #include "solib-svr4.h" | 34 #include "solib-svr4.h" |
35 #include "solib-spu.h" | 35 #include "solib-spu.h" |
36 #include "solib.h" | 36 #include "solib.h" |
37 #include "solist.h" | 37 #include "solist.h" |
38 #include "ppc-tdep.h" | 38 #include "ppc-tdep.h" |
39 #include "ppc-linux-tdep.h" | 39 #include "ppc-linux-tdep.h" |
| 40 #include "glibc-tdep.h" |
40 #include "trad-frame.h" | 41 #include "trad-frame.h" |
41 #include "frame-unwind.h" | 42 #include "frame-unwind.h" |
42 #include "tramp-frame.h" | 43 #include "tramp-frame.h" |
43 #include "observer.h" | 44 #include "observer.h" |
44 #include "auxv.h" | 45 #include "auxv.h" |
45 #include "elf/common.h" | 46 #include "elf/common.h" |
46 #include "exceptions.h" | 47 #include "exceptions.h" |
47 #include "arch-utils.h" | 48 #include "arch-utils.h" |
48 #include "spu-tdep.h" | 49 #include "spu-tdep.h" |
49 #include "xml-syscall.h" | 50 #include "xml-syscall.h" |
50 #include "linux-tdep.h" | 51 #include "linux-tdep.h" |
51 | 52 |
| 53 #include "stap-probe.h" |
| 54 #include "ax.h" |
| 55 #include "ax-gdb.h" |
| 56 #include "cli/cli-utils.h" |
| 57 #include "parser-defs.h" |
| 58 #include "user-regs.h" |
| 59 #include <ctype.h> |
| 60 |
52 #include "features/rs6000/powerpc-32l.c" | 61 #include "features/rs6000/powerpc-32l.c" |
53 #include "features/rs6000/powerpc-altivec32l.c" | 62 #include "features/rs6000/powerpc-altivec32l.c" |
54 #include "features/rs6000/powerpc-cell32l.c" | 63 #include "features/rs6000/powerpc-cell32l.c" |
55 #include "features/rs6000/powerpc-vsx32l.c" | 64 #include "features/rs6000/powerpc-vsx32l.c" |
56 #include "features/rs6000/powerpc-isa205-32l.c" | 65 #include "features/rs6000/powerpc-isa205-32l.c" |
57 #include "features/rs6000/powerpc-isa205-altivec32l.c" | 66 #include "features/rs6000/powerpc-isa205-altivec32l.c" |
58 #include "features/rs6000/powerpc-isa205-vsx32l.c" | 67 #include "features/rs6000/powerpc-isa205-vsx32l.c" |
59 #include "features/rs6000/powerpc-64l.c" | 68 #include "features/rs6000/powerpc-64l.c" |
60 #include "features/rs6000/powerpc-altivec64l.c" | 69 #include "features/rs6000/powerpc-altivec64l.c" |
61 #include "features/rs6000/powerpc-cell64l.c" | 70 #include "features/rs6000/powerpc-cell64l.c" |
62 #include "features/rs6000/powerpc-vsx64l.c" | 71 #include "features/rs6000/powerpc-vsx64l.c" |
63 #include "features/rs6000/powerpc-isa205-64l.c" | 72 #include "features/rs6000/powerpc-isa205-64l.c" |
64 #include "features/rs6000/powerpc-isa205-altivec64l.c" | 73 #include "features/rs6000/powerpc-isa205-altivec64l.c" |
65 #include "features/rs6000/powerpc-isa205-vsx64l.c" | 74 #include "features/rs6000/powerpc-isa205-vsx64l.c" |
66 #include "features/rs6000/powerpc-e500l.c" | 75 #include "features/rs6000/powerpc-e500l.c" |
67 | 76 |
| 77 /* Shared library operations for PowerPC-Linux. */ |
| 78 static struct target_so_ops powerpc_so_ops; |
| 79 |
68 /* The syscall's XML filename for PPC and PPC64. */ | 80 /* The syscall's XML filename for PPC and PPC64. */ |
69 #define XML_SYSCALL_FILENAME_PPC "syscalls/ppc-linux.xml" | 81 #define XML_SYSCALL_FILENAME_PPC "syscalls/ppc-linux.xml" |
70 #define XML_SYSCALL_FILENAME_PPC64 "syscalls/ppc64-linux.xml" | 82 #define XML_SYSCALL_FILENAME_PPC64 "syscalls/ppc64-linux.xml" |
71 | 83 |
72 /* ppc_linux_memory_remove_breakpoints attempts to remove a breakpoint | 84 /* ppc_linux_memory_remove_breakpoints attempts to remove a breakpoint |
73 in much the same fashion as memory_remove_breakpoint in mem-break.c, | 85 in much the same fashion as memory_remove_breakpoint in mem-break.c, |
74 but is careful not to write back the previous contents if the code | 86 but is careful not to write back the previous contents if the code |
75 in question has changed in between inserting the breakpoint and | 87 in question has changed in between inserting the breakpoint and |
76 removing it. | 88 removing it. |
77 | 89 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 do_cleanups (cleanup); | 234 do_cleanups (cleanup); |
223 return val; | 235 return val; |
224 } | 236 } |
225 | 237 |
226 /* For historic reasons, PPC 32 GNU/Linux follows PowerOpen rather | 238 /* For historic reasons, PPC 32 GNU/Linux follows PowerOpen rather |
227 than the 32 bit SYSV R4 ABI structure return convention - all | 239 than the 32 bit SYSV R4 ABI structure return convention - all |
228 structures, no matter their size, are put in memory. Vectors, | 240 structures, no matter their size, are put in memory. Vectors, |
229 which were added later, do get returned in a register though. */ | 241 which were added later, do get returned in a register though. */ |
230 | 242 |
231 static enum return_value_convention | 243 static enum return_value_convention |
232 ppc_linux_return_value (struct gdbarch *gdbarch, struct type *func_type, | 244 ppc_linux_return_value (struct gdbarch *gdbarch, struct value *function, |
233 struct type *valtype, struct regcache *regcache, | 245 struct type *valtype, struct regcache *regcache, |
234 gdb_byte *readbuf, const gdb_byte *writebuf) | 246 gdb_byte *readbuf, const gdb_byte *writebuf) |
235 { | 247 { |
236 if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT | 248 if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT |
237 || TYPE_CODE (valtype) == TYPE_CODE_UNION) | 249 || TYPE_CODE (valtype) == TYPE_CODE_UNION) |
238 && !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8) | 250 && !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8) |
239 && TYPE_VECTOR (valtype))) | 251 && TYPE_VECTOR (valtype))) |
240 return RETURN_VALUE_STRUCT_CONVENTION; | 252 return RETURN_VALUE_STRUCT_CONVENTION; |
241 else | 253 else |
242 return ppc_sysv_abi_return_value (gdbarch, func_type, valtype, regcache, | 254 return ppc_sysv_abi_return_value (gdbarch, function, valtype, regcache, |
243 readbuf, writebuf); | 255 readbuf, writebuf); |
244 } | 256 } |
245 | 257 |
246 /* Macros for matching instructions. Note that, since all the | 258 /* Macros for matching instructions. Note that, since all the |
247 operands are masked off before they're or-ed into the instruction, | 259 operands are masked off before they're or-ed into the instruction, |
248 you can use -1 to make masks. */ | 260 you can use -1 to make masks. */ |
249 | 261 |
250 #define insn_d(opcd, rts, ra, d) \ | 262 #define insn_d(opcd, rts, ra, d) \ |
251 ((((opcd) & 0x3f) << 26) \ | 263 ((((opcd) & 0x3f) << 26) \ |
252 | (((rts) & 0x1f) << 21) \ | 264 | (((rts) & 0x1f) << 21) \ |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 references. */ | 604 references. */ |
593 CORE_ADDR desc | 605 CORE_ADDR desc |
594 = ((CORE_ADDR) get_frame_register_unsigned (frame, | 606 = ((CORE_ADDR) get_frame_register_unsigned (frame, |
595 tdep->ppc_gp0_regnum + 2) | 607 tdep->ppc_gp0_regnum + 2) |
596 + insn_ds_field (insn[1])); | 608 + insn_ds_field (insn[1])); |
597 | 609 |
598 /* The first word of the descriptor is the entry point. Return that. */ | 610 /* The first word of the descriptor is the entry point. Return that. */ |
599 return ppc64_desc_entry_point (gdbarch, desc); | 611 return ppc64_desc_entry_point (gdbarch, desc); |
600 } | 612 } |
601 | 613 |
| 614 /* PLT stub in executable. */ |
| 615 static struct insn_pattern powerpc32_plt_stub[] = |
| 616 { |
| 617 { 0xffff0000, 0x3d600000, 0 }, /* lis r11, xxxx */ |
| 618 { 0xffff0000, 0x816b0000, 0 }, /* lwz r11, xxxx(r11) */ |
| 619 { 0xffffffff, 0x7d6903a6, 0 }, /* mtctr r11 */ |
| 620 { 0xffffffff, 0x4e800420, 0 }, /* bctr */ |
| 621 { 0, 0, 0 } |
| 622 }; |
| 623 |
| 624 /* PLT stub in shared library. */ |
| 625 static struct insn_pattern powerpc32_plt_stub_so[] = |
| 626 { |
| 627 { 0xffff0000, 0x817e0000, 0 }, /* lwz r11, xxxx(r30) */ |
| 628 { 0xffffffff, 0x7d6903a6, 0 }, /* mtctr r11 */ |
| 629 { 0xffffffff, 0x4e800420, 0 }, /* bctr */ |
| 630 { 0xffffffff, 0x60000000, 0 }, /* nop */ |
| 631 { 0, 0, 0 } |
| 632 }; |
| 633 #define POWERPC32_PLT_STUB_LEN ARRAY_SIZE (powerpc32_plt_stub) |
| 634 |
| 635 /* Check if PC is in PLT stub. For non-secure PLT, stub is in .plt |
| 636 section. For secure PLT, stub is in .text and we need to check |
| 637 instruction patterns. */ |
| 638 |
| 639 static int |
| 640 powerpc_linux_in_dynsym_resolve_code (CORE_ADDR pc) |
| 641 { |
| 642 struct minimal_symbol *sym; |
| 643 |
| 644 /* Check whether PC is in the dynamic linker. This also checks |
| 645 whether it is in the .plt section, used by non-PIC executables. */ |
| 646 if (svr4_in_dynsym_resolve_code (pc)) |
| 647 return 1; |
| 648 |
| 649 /* Check if we are in the resolver. */ |
| 650 sym = lookup_minimal_symbol_by_pc (pc); |
| 651 if (sym != NULL |
| 652 && (strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink") == 0 |
| 653 || strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink_PLTresolve") == 0)) |
| 654 return 1; |
| 655 |
| 656 return 0; |
| 657 } |
| 658 |
| 659 /* Follow PLT stub to actual routine. */ |
| 660 |
| 661 static CORE_ADDR |
| 662 ppc_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) |
| 663 { |
| 664 int insnbuf[POWERPC32_PLT_STUB_LEN]; |
| 665 struct gdbarch *gdbarch = get_frame_arch (frame); |
| 666 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); |
| 667 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 668 CORE_ADDR target = 0; |
| 669 |
| 670 if (insns_match_pattern (pc, powerpc32_plt_stub, insnbuf)) |
| 671 { |
| 672 /* Insn pattern is |
| 673 lis r11, xxxx |
| 674 lwz r11, xxxx(r11) |
| 675 Branch target is in r11. */ |
| 676 |
| 677 target = (insn_d_field (insnbuf[0]) << 16) | insn_d_field (insnbuf[1]); |
| 678 target = read_memory_unsigned_integer (target, 4, byte_order); |
| 679 } |
| 680 |
| 681 if (insns_match_pattern (pc, powerpc32_plt_stub_so, insnbuf)) |
| 682 { |
| 683 /* Insn pattern is |
| 684 lwz r11, xxxx(r30) |
| 685 Branch target is in r11. */ |
| 686 |
| 687 target = get_frame_register_unsigned (frame, tdep->ppc_gp0_regnum + 30) |
| 688 + insn_d_field (insnbuf[0]); |
| 689 target = read_memory_unsigned_integer (target, 4, byte_order); |
| 690 } |
| 691 |
| 692 return target; |
| 693 } |
602 | 694 |
603 /* Given that we've begun executing a call trampoline at PC, return | 695 /* Given that we've begun executing a call trampoline at PC, return |
604 the entry point of the function the trampoline will go to. */ | 696 the entry point of the function the trampoline will go to. */ |
605 static CORE_ADDR | 697 static CORE_ADDR |
606 ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) | 698 ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) |
607 { | 699 { |
608 unsigned int ppc64_standard_linkage1_insn[PPC64_STANDARD_LINKAGE1_LEN]; | 700 unsigned int ppc64_standard_linkage1_insn[PPC64_STANDARD_LINKAGE1_LEN]; |
609 unsigned int ppc64_standard_linkage2_insn[PPC64_STANDARD_LINKAGE2_LEN]; | 701 unsigned int ppc64_standard_linkage2_insn[PPC64_STANDARD_LINKAGE2_LEN]; |
610 unsigned int ppc64_standard_linkage3_insn[PPC64_STANDARD_LINKAGE3_LEN]; | 702 unsigned int ppc64_standard_linkage3_insn[PPC64_STANDARD_LINKAGE3_LEN]; |
611 CORE_ADDR target; | 703 CORE_ADDR target; |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 else if (altivec) | 1277 else if (altivec) |
1186 return tdesc_powerpc_altivec64l; | 1278 return tdesc_powerpc_altivec64l; |
1187 else | 1279 else |
1188 return tdesc_powerpc_64l; | 1280 return tdesc_powerpc_64l; |
1189 | 1281 |
1190 default: | 1282 default: |
1191 return NULL; | 1283 return NULL; |
1192 } | 1284 } |
1193 } | 1285 } |
1194 | 1286 |
| 1287 /* Implementation of `gdbarch_stap_is_single_operand', as defined in |
| 1288 gdbarch.h. */ |
| 1289 |
| 1290 static int |
| 1291 ppc_stap_is_single_operand (struct gdbarch *gdbarch, const char *s) |
| 1292 { |
| 1293 return (*s == 'i' /* Literal number. */ |
| 1294 || (isdigit (*s) && s[1] == '(' |
| 1295 && isdigit (s[2])) /* Displacement. */ |
| 1296 || (*s == '(' && isdigit (s[1])) /* Register indirection. */ |
| 1297 || isdigit (*s)); /* Register value. */ |
| 1298 } |
| 1299 |
| 1300 /* Implementation of `gdbarch_stap_parse_special_token', as defined in |
| 1301 gdbarch.h. */ |
| 1302 |
| 1303 static int |
| 1304 ppc_stap_parse_special_token (struct gdbarch *gdbarch, |
| 1305 struct stap_parse_info *p) |
| 1306 { |
| 1307 if (isdigit (*p->arg)) |
| 1308 { |
| 1309 /* This temporary pointer is needed because we have to do a lookahead. |
| 1310 We could be dealing with a register displacement, and in such case |
| 1311 we would not need to do anything. */ |
| 1312 const char *s = p->arg; |
| 1313 char *regname; |
| 1314 int len; |
| 1315 struct stoken str; |
| 1316 |
| 1317 while (isdigit (*s)) |
| 1318 ++s; |
| 1319 |
| 1320 if (*s == '(') |
| 1321 { |
| 1322 /* It is a register displacement indeed. Returning 0 means we are |
| 1323 deferring the treatment of this case to the generic parser. */ |
| 1324 return 0; |
| 1325 } |
| 1326 |
| 1327 len = s - p->arg; |
| 1328 regname = alloca (len + 2); |
| 1329 regname[0] = 'r'; |
| 1330 |
| 1331 strncpy (regname + 1, p->arg, len); |
| 1332 ++len; |
| 1333 regname[len] = '\0'; |
| 1334 |
| 1335 if (user_reg_map_name_to_regnum (gdbarch, regname, len) == -1) |
| 1336 error (_("Invalid register name `%s' on expression `%s'."), |
| 1337 regname, p->saved_arg); |
| 1338 |
| 1339 write_exp_elt_opcode (OP_REGISTER); |
| 1340 str.ptr = regname; |
| 1341 str.length = len; |
| 1342 write_exp_string (str); |
| 1343 write_exp_elt_opcode (OP_REGISTER); |
| 1344 |
| 1345 p->arg = s; |
| 1346 } |
| 1347 else |
| 1348 { |
| 1349 /* All the other tokens should be handled correctly by the generic |
| 1350 parser. */ |
| 1351 return 0; |
| 1352 } |
| 1353 |
| 1354 return 1; |
| 1355 } |
1195 | 1356 |
1196 /* Cell/B.E. active SPE context tracking support. */ | 1357 /* Cell/B.E. active SPE context tracking support. */ |
1197 | 1358 |
1198 static struct objfile *spe_context_objfile = NULL; | 1359 static struct objfile *spe_context_objfile = NULL; |
1199 static CORE_ADDR spe_context_lm_addr = 0; | 1360 static CORE_ADDR spe_context_lm_addr = 0; |
1200 static CORE_ADDR spe_context_offset = 0; | 1361 static CORE_ADDR spe_context_offset = 0; |
1201 | 1362 |
1202 static ptid_t spe_context_cache_ptid; | 1363 static ptid_t spe_context_cache_ptid; |
1203 static CORE_ADDR spe_context_cache_address; | 1364 static CORE_ADDR spe_context_cache_address; |
1204 | 1365 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 size of type actually used in each case. */ | 1663 size of type actually used in each case. */ |
1503 set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT); | 1664 set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT); |
1504 set_gdbarch_long_double_format (gdbarch, floatformats_ibm_long_double); | 1665 set_gdbarch_long_double_format (gdbarch, floatformats_ibm_long_double); |
1505 | 1666 |
1506 /* Handle inferior calls during interrupted system calls. */ | 1667 /* Handle inferior calls during interrupted system calls. */ |
1507 set_gdbarch_write_pc (gdbarch, ppc_linux_write_pc); | 1668 set_gdbarch_write_pc (gdbarch, ppc_linux_write_pc); |
1508 | 1669 |
1509 /* Get the syscall number from the arch's register. */ | 1670 /* Get the syscall number from the arch's register. */ |
1510 set_gdbarch_get_syscall_number (gdbarch, ppc_linux_get_syscall_number); | 1671 set_gdbarch_get_syscall_number (gdbarch, ppc_linux_get_syscall_number); |
1511 | 1672 |
| 1673 /* SystemTap functions. */ |
| 1674 set_gdbarch_stap_integer_prefix (gdbarch, "i"); |
| 1675 set_gdbarch_stap_register_indirection_prefix (gdbarch, "("); |
| 1676 set_gdbarch_stap_register_indirection_suffix (gdbarch, ")"); |
| 1677 set_gdbarch_stap_gdb_register_prefix (gdbarch, "r"); |
| 1678 set_gdbarch_stap_is_single_operand (gdbarch, ppc_stap_is_single_operand); |
| 1679 set_gdbarch_stap_parse_special_token (gdbarch, |
| 1680 ppc_stap_parse_special_token); |
| 1681 |
1512 if (tdep->wordsize == 4) | 1682 if (tdep->wordsize == 4) |
1513 { | 1683 { |
1514 /* Until November 2001, gcc did not comply with the 32 bit SysV | 1684 /* Until November 2001, gcc did not comply with the 32 bit SysV |
1515 R4 ABI requirement that structures less than or equal to 8 | 1685 R4 ABI requirement that structures less than or equal to 8 |
1516 bytes should be returned in registers. Instead GCC was using | 1686 bytes should be returned in registers. Instead GCC was using |
1517 the AIX/PowerOpen ABI - everything returned in memory | 1687 the AIX/PowerOpen ABI - everything returned in memory |
1518 (well ignoring vectors that is). When this was corrected, it | 1688 (well ignoring vectors that is). When this was corrected, it |
1519 wasn't fixed for GNU/Linux native platform. Use the | 1689 wasn't fixed for GNU/Linux native platform. Use the |
1520 PowerOpen struct convention. */ | 1690 PowerOpen struct convention. */ |
1521 set_gdbarch_return_value (gdbarch, ppc_linux_return_value); | 1691 set_gdbarch_return_value (gdbarch, ppc_linux_return_value); |
1522 | 1692 |
1523 set_gdbarch_memory_remove_breakpoint (gdbarch, | 1693 set_gdbarch_memory_remove_breakpoint (gdbarch, |
1524 ppc_linux_memory_remove_breakpoint); | 1694 ppc_linux_memory_remove_breakpoint); |
1525 | 1695 |
1526 /* Shared library handling. */ | 1696 /* Shared library handling. */ |
1527 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); | 1697 set_gdbarch_skip_trampoline_code (gdbarch, ppc_skip_trampoline_code); |
1528 set_solib_svr4_fetch_link_map_offsets | 1698 set_solib_svr4_fetch_link_map_offsets |
1529 (gdbarch, svr4_ilp32_fetch_link_map_offsets); | 1699 (gdbarch, svr4_ilp32_fetch_link_map_offsets); |
1530 | 1700 |
1531 /* Setting the correct XML syscall filename. */ | 1701 /* Setting the correct XML syscall filename. */ |
1532 set_xml_syscall_file_name (XML_SYSCALL_FILENAME_PPC); | 1702 set_xml_syscall_file_name (XML_SYSCALL_FILENAME_PPC); |
1533 | 1703 |
1534 /* Trampolines. */ | 1704 /* Trampolines. */ |
1535 tramp_frame_prepend_unwinder (gdbarch, | 1705 tramp_frame_prepend_unwinder (gdbarch, |
1536 &ppc32_linux_sigaction_tramp_frame); | 1706 &ppc32_linux_sigaction_tramp_frame); |
1537 tramp_frame_prepend_unwinder (gdbarch, | 1707 tramp_frame_prepend_unwinder (gdbarch, |
(...skipping 10 matching lines...) Expand all Loading... |
1548 "org.gnu.gdb.power.vsx")) | 1718 "org.gnu.gdb.power.vsx")) |
1549 set_gdbarch_core_regset_sections (gdbarch, | 1719 set_gdbarch_core_regset_sections (gdbarch, |
1550 ppc_linux_vsx_regset_sections); | 1720 ppc_linux_vsx_regset_sections); |
1551 else if (tdesc_find_feature (info.target_desc, | 1721 else if (tdesc_find_feature (info.target_desc, |
1552 "org.gnu.gdb.power.altivec")) | 1722 "org.gnu.gdb.power.altivec")) |
1553 set_gdbarch_core_regset_sections (gdbarch, | 1723 set_gdbarch_core_regset_sections (gdbarch, |
1554 ppc_linux_vmx_regset_sections); | 1724 ppc_linux_vmx_regset_sections); |
1555 else | 1725 else |
1556 set_gdbarch_core_regset_sections (gdbarch, | 1726 set_gdbarch_core_regset_sections (gdbarch, |
1557 ppc_linux_fp_regset_sections); | 1727 ppc_linux_fp_regset_sections); |
| 1728 |
| 1729 if (powerpc_so_ops.in_dynsym_resolve_code == NULL) |
| 1730 { |
| 1731 powerpc_so_ops = svr4_so_ops; |
| 1732 /* Override dynamic resolve function. */ |
| 1733 powerpc_so_ops.in_dynsym_resolve_code = |
| 1734 powerpc_linux_in_dynsym_resolve_code; |
| 1735 } |
| 1736 set_solib_ops (gdbarch, &powerpc_so_ops); |
| 1737 |
| 1738 set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver); |
1558 } | 1739 } |
1559 | 1740 |
1560 if (tdep->wordsize == 8) | 1741 if (tdep->wordsize == 8) |
1561 { | 1742 { |
1562 /* Handle PPC GNU/Linux 64-bit function pointers (which are really | 1743 /* Handle PPC GNU/Linux 64-bit function pointers (which are really |
1563 function descriptors). */ | 1744 function descriptors). */ |
1564 set_gdbarch_convert_from_func_ptr_addr | 1745 set_gdbarch_convert_from_func_ptr_addr |
1565 (gdbarch, ppc64_linux_convert_from_func_ptr_addr); | 1746 (gdbarch, ppc64_linux_convert_from_func_ptr_addr); |
1566 | 1747 |
1567 /* Shared library handling. */ | 1748 /* Shared library handling. */ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 set_spu_solib_ops (gdbarch); | 1816 set_spu_solib_ops (gdbarch); |
1636 | 1817 |
1637 /* Cell/B.E. cross-architecture unwinder support. */ | 1818 /* Cell/B.E. cross-architecture unwinder support. */ |
1638 frame_unwind_prepend_unwinder (gdbarch, &ppu2spu_unwind); | 1819 frame_unwind_prepend_unwinder (gdbarch, &ppu2spu_unwind); |
1639 | 1820 |
1640 /* The default displaced_step_at_entry_point doesn't work for | 1821 /* The default displaced_step_at_entry_point doesn't work for |
1641 SPU stand-alone executables. */ | 1822 SPU stand-alone executables. */ |
1642 set_gdbarch_displaced_step_location (gdbarch, | 1823 set_gdbarch_displaced_step_location (gdbarch, |
1643 ppc_linux_displaced_step_location); | 1824 ppc_linux_displaced_step_location); |
1644 } | 1825 } |
| 1826 |
| 1827 set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); |
1645 } | 1828 } |
1646 | 1829 |
1647 /* Provide a prototype to silence -Wmissing-prototypes. */ | 1830 /* Provide a prototype to silence -Wmissing-prototypes. */ |
1648 extern initialize_file_ftype _initialize_ppc_linux_tdep; | 1831 extern initialize_file_ftype _initialize_ppc_linux_tdep; |
1649 | 1832 |
1650 void | 1833 void |
1651 _initialize_ppc_linux_tdep (void) | 1834 _initialize_ppc_linux_tdep (void) |
1652 { | 1835 { |
1653 /* Register for all sub-familes of the POWER/PowerPC: 32-bit and | 1836 /* Register for all sub-familes of the POWER/PowerPC: 32-bit and |
1654 64-bit PowerPC, and the older rs6k. */ | 1837 64-bit PowerPC, and the older rs6k. */ |
(...skipping 22 matching lines...) Expand all Loading... |
1677 initialize_tdesc_powerpc_isa205_vsx32l (); | 1860 initialize_tdesc_powerpc_isa205_vsx32l (); |
1678 initialize_tdesc_powerpc_64l (); | 1861 initialize_tdesc_powerpc_64l (); |
1679 initialize_tdesc_powerpc_altivec64l (); | 1862 initialize_tdesc_powerpc_altivec64l (); |
1680 initialize_tdesc_powerpc_cell64l (); | 1863 initialize_tdesc_powerpc_cell64l (); |
1681 initialize_tdesc_powerpc_vsx64l (); | 1864 initialize_tdesc_powerpc_vsx64l (); |
1682 initialize_tdesc_powerpc_isa205_64l (); | 1865 initialize_tdesc_powerpc_isa205_64l (); |
1683 initialize_tdesc_powerpc_isa205_altivec64l (); | 1866 initialize_tdesc_powerpc_isa205_altivec64l (); |
1684 initialize_tdesc_powerpc_isa205_vsx64l (); | 1867 initialize_tdesc_powerpc_isa205_vsx64l (); |
1685 initialize_tdesc_powerpc_e500l (); | 1868 initialize_tdesc_powerpc_e500l (); |
1686 } | 1869 } |
OLD | NEW |