2005-07-11 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / sparc64nbsd-tdep.c
index e02ee3ae6d97422eb6f077983bba8a54b9812de5..a9771d2390073a56f9e10d9a19a653451945dfd3 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for NetBSD/sparc64.
 
-   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    Based on code contributed by Wasabi Systems, Inc.
 
    This file is part of GDB.
@@ -133,6 +133,20 @@ sparc64nbsd_sigcontext_saved_regs (CORE_ADDR sigcontext_addr,
        regnum <= SPARC_I7_REGNUM; regnum++, addr += 8)
     saved_regs[regnum].addr = addr;
 
+  /* Handle StackGhost.  */
+  {
+    ULONGEST wcookie = sparc_fetch_wcookie ();
+
+    if (wcookie != 0)
+      {
+       ULONGEST i7;
+
+       addr = saved_regs[SPARC_I7_REGNUM].addr;
+       i7 = get_frame_memory_unsigned (next_frame, addr, 8);
+       trad_frame_set_value (saved_regs, SPARC_I7_REGNUM, i7 ^ wcookie);
+      }
+  }
+
   /* TODO: Handle the floating-point registers.  */
 
   return saved_regs;
@@ -161,12 +175,14 @@ sparc64nbsd_sigcontext_frame_cache (struct frame_info *next_frame,
          initialized under the assumption that we're frameless.  */
       cache->frameless_p = 0;
       addr = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
+      if (addr & 1)
+       addr += BIAS;
       cache->base = addr;
     }
 
   /* We find the appropriate instance of `struct sigcontext' at a
      fixed offset in the signal frame.  */
-  addr = cache->base + BIAS + 128 + 8;
+  addr = cache->base + 128 + 8;
   cache->saved_regs = sparc64nbsd_sigcontext_saved_regs (addr, next_frame);
 
   return cache;
@@ -189,7 +205,7 @@ sparc64nbsd_sigcontext_frame_prev_register (struct frame_info *next_frame,
                                            int regnum, int *optimizedp,
                                            enum lval_type *lvalp,
                                            CORE_ADDR *addrp,
-                                           int *realnump, void *valuep)
+                                           int *realnump, gdb_byte *valuep)
 {
   struct sparc_frame_cache *cache =
     sparc64nbsd_sigcontext_frame_cache (next_frame, this_cache);
@@ -237,13 +253,13 @@ sparc64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   sparc64_init_abi (info, gdbarch);
 
-  /* NetBSD/sparc64 has SVR4-style shared libraries...  */
+  /* NetBSD/sparc64 has SVR4-style shared libraries.  */
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_lp64_fetch_link_map_offsets);
 }
-
 \f
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_sparc64nbsd_tdep (void);
 
This page took 0.025056 seconds and 4 git commands to generate.