* archures.c: Update copyright.
[deliverable/binutils-gdb.git] / gdb / ppc-linux-tdep.c
index a82c95ea4d6bc44983685078d70a70862242ebda..4b35f7f109e923989da811fc6d662395bb6c3c2d 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-dependent code for GDB, the GNU debugger.
 
    Copyright (C) 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -753,7 +753,7 @@ ppc_linux_sigtramp_cache (struct frame_info *next_frame,
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   base = frame_unwind_register_unsigned (next_frame,
-                                        gdbarch_sp_regnum (current_gdbarch));
+                                        gdbarch_sp_regnum (gdbarch));
   if (bias > 0 && frame_pc_unwind (next_frame) != func)
     /* See below, some signal trampolines increment the stack as their
        first instruction, need to compensate for that.  */
@@ -773,7 +773,7 @@ ppc_linux_sigtramp_cache (struct frame_info *next_frame,
       trad_frame_set_reg_addr (this_cache, regnum, gpregs + i * tdep->wordsize);
     }
   trad_frame_set_reg_addr (this_cache,
-                          gdbarch_pc_regnum (current_gdbarch),
+                          gdbarch_pc_regnum (gdbarch),
                           gpregs + 32 * tdep->wordsize);
   trad_frame_set_reg_addr (this_cache, tdep->ppc_ctr_regnum,
                           gpregs + 35 * tdep->wordsize);
@@ -789,7 +789,7 @@ ppc_linux_sigtramp_cache (struct frame_info *next_frame,
       /* Floating point registers.  */
       for (i = 0; i < 32; i++)
        {
-         int regnum = i + gdbarch_fp0_regnum (current_gdbarch);
+         int regnum = i + gdbarch_fp0_regnum (gdbarch);
          trad_frame_set_reg_addr (this_cache, regnum,
                                   fpregs + i * tdep->wordsize);
        }
@@ -896,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.04034 seconds and 4 git commands to generate.