GDB/MI: Document support for -exec-run --start in -list-features
[deliverable/binutils-gdb.git] / gdb / ppc-linux-tdep.c
index cdf362f22604c536b9fec7cab9186a07553b52dd..fc095608bc447a31aec8c94d9df4cd9f0c08c6c9 100644 (file)
@@ -57,6 +57,7 @@
 #include "parser-defs.h"
 #include "user-regs.h"
 #include <ctype.h>
+#include "elf-bfd.h"            /* for elfcore_write_* */
 
 #include "features/rs6000/powerpc-32l.c"
 #include "features/rs6000/powerpc-altivec32l.c"
@@ -331,7 +332,7 @@ static struct ppc_insn_pattern powerpc32_plt_stub_so[] =
 static int
 powerpc_linux_in_dynsym_resolve_code (CORE_ADDR pc)
 {
-  struct minimal_symbol *sym;
+  struct bound_minimal_symbol sym;
 
   /* Check whether PC is in the dynamic linker.  This also checks
      whether it is in the .plt section, used by non-PIC executables.  */
@@ -340,9 +341,10 @@ powerpc_linux_in_dynsym_resolve_code (CORE_ADDR pc)
 
   /* Check if we are in the resolver.  */
   sym = lookup_minimal_symbol_by_pc (pc);
-  if (sym != NULL
-      && (strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink") == 0
-         || strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink_PLTresolve") == 0))
+  if (sym.minsym != NULL
+      && (strcmp (SYMBOL_LINKAGE_NAME (sym.minsym), "__glink") == 0
+         || strcmp (SYMBOL_LINKAGE_NAME (sym.minsym),
+                    "__glink_PLTresolve") == 0))
     return 1;
 
   return 0;
@@ -353,13 +355,13 @@ powerpc_linux_in_dynsym_resolve_code (CORE_ADDR pc)
 static CORE_ADDR
 ppc_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 {
-  int insnbuf[POWERPC32_PLT_STUB_LEN];
+  unsigned int insnbuf[POWERPC32_PLT_STUB_LEN];
   struct gdbarch *gdbarch = get_frame_arch (frame);
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR target = 0;
 
-  if (ppc_insns_match_pattern (pc, powerpc32_plt_stub, insnbuf))
+  if (ppc_insns_match_pattern (frame, pc, powerpc32_plt_stub, insnbuf))
     {
       /* Insn pattern is
                lis   r11, xxxx
@@ -371,7 +373,7 @@ ppc_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
       target = read_memory_unsigned_integer (target, 4, byte_order);
     }
 
-  if (ppc_insns_match_pattern (pc, powerpc32_plt_stub_so, insnbuf))
+  if (ppc_insns_match_pattern (frame, pc, powerpc32_plt_stub_so, insnbuf))
     {
       /* Insn pattern is
                lwz   r11, xxxx(r30)
@@ -1335,6 +1337,9 @@ ppc_linux_init_abi (struct gdbarch_info info,
       set_gdbarch_convert_from_func_ptr_addr
        (gdbarch, ppc64_convert_from_func_ptr_addr);
 
+      set_gdbarch_elf_make_msymbol_special (gdbarch,
+                                           ppc64_elf_make_msymbol_special);
+
       /* Shared library handling.  */
       set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code);
       set_solib_svr4_fetch_link_map_offsets
@@ -1368,6 +1373,13 @@ ppc_linux_init_abi (struct gdbarch_info info,
        set_gdbarch_core_regset_sections (gdbarch,
                                          ppc64_linux_fp_regset_sections);
     }
+
+  /* PPC32 uses a different prpsinfo32 compared to most other Linux
+     archs.  */
+  if (tdep->wordsize == 4)
+    set_gdbarch_elfcore_write_linux_prpsinfo (gdbarch,
+                                             elfcore_write_ppc_linux_prpsinfo32);
+
   set_gdbarch_regset_from_core_section (gdbarch,
                                        ppc_linux_regset_from_core_section);
   set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description);
This page took 0.024752 seconds and 4 git commands to generate.