2007-11-15 Markus Deuling <deuling@de.ibm.com>
[deliverable/binutils-gdb.git] / gdb / ppc-linux-tdep.c
index 324cef74c2a83a421ccad6b4592d74a9594e3f9e..95d127e552d3f73ba00276312b053e9b115742b8 100644 (file)
@@ -57,10 +57,10 @@ ppc_linux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
   char symname[1024];
   struct minimal_symbol *msymbol;
 
-  /* Find the section pc is in; return if not in .plt */
+  /* Find the section pc is in; if not in .plt, try the default method.  */
   sect = find_pc_section (pc);
   if (!sect || strcmp (sect->the_bfd_section->name, ".plt") != 0)
-    return 0;
+    return find_solib_trampoline_target (frame, pc);
 
   objfile = sect->objfile;
 
@@ -650,8 +650,8 @@ static const struct ppc_reg_offsets ppc32_linux_reg_offsets =
 
     /* AltiVec registers.  */
     /* .vr0_offset = */ 0,
-    /* .vrsave_offset = */ 512,
-    /* .vscr_offset = */ 512 + 12
+    /* .vscr_offset = */ 512 + 12,
+    /* .vrsave_offset = */ 528
   };
 
 static const struct ppc_reg_offsets ppc64_linux_reg_offsets =
@@ -675,8 +675,8 @@ static const struct ppc_reg_offsets ppc64_linux_reg_offsets =
 
     /* AltiVec registers.  */
     /* .vr0_offset = */ 0,
-    /* .vrsave_offset = */ 528,
-    /* .vscr_offset = */ 512 + 12
+    /* .vscr_offset = */ 512 + 12,
+    /* .vrsave_offset = */ 528
   };
 
 static const struct regset ppc32_linux_gregset = {
@@ -700,6 +700,13 @@ static const struct regset ppc32_linux_fpregset = {
   NULL
 };
 
+static const struct regset ppc32_linux_vrregset = {
+  &ppc32_linux_reg_offsets,
+  ppc_supply_vrregset,
+  ppc_collect_vrregset,
+  NULL
+};
+
 const struct regset *
 ppc_linux_gregset (int wordsize)
 {
@@ -726,6 +733,8 @@ ppc_linux_regset_from_core_section (struct gdbarch *core_arch,
     }
   if (strcmp (sect_name, ".reg2") == 0)
     return &ppc32_linux_fpregset;
+  if (strcmp (sect_name, ".reg-ppc-vmx") == 0)
+    return &ppc32_linux_vrregset;
   return NULL;
 }
 
@@ -887,15 +896,13 @@ ppc_linux_init_abi (struct gdbarch_info info,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  /* NOTE: jimb/2004-03-26: The System V ABI PowerPC Processor
-     Supplement says that long doubles are sixteen bytes long.
-     However, as one of the known warts of its ABI, PPC GNU/Linux uses
-     eight-byte long doubles.  GCC only recently got 128-bit long
-     double support on PPC, so it may be changing soon.  The
-     Linux[sic] Standards Base says that programs that use 'long
-     double' on PPC GNU/Linux are non-conformant.  */
-  /* NOTE: cagney/2005-01-25: True for both 32- and 64-bit.  */
-  set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+  /* PPC GNU/Linux uses either 64-bit or 128-bit long doubles; where
+     128-bit, they are IBM long double, not IEEE quad long double as
+     in the System V ABI PowerPC Processor Supplement.  We can safely
+     let them default to 128-bit, since the debug info will give the
+     size of type actually used in each case.  */
+  set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);
+  set_gdbarch_long_double_format (gdbarch, floatformats_ibm_long_double);
 
   /* Handle PPC GNU/Linux 64-bit function pointers (which are really
      function descriptors) and 32-bit secure PLT entries.  */
This page took 0.024637 seconds and 4 git commands to generate.