* mi/mi-main.c (enum captured_mi_execute_command_actions)
[deliverable/binutils-gdb.git] / gdb / sparc64nbsd-tdep.c
index 35ad2326ff366ce1e92c84a083e1c6baebc0702a..67b790010666bd25055aa423643c6bcc9640f6a1 100644 (file)
@@ -1,13 +1,14 @@
 /* Target-dependent code for NetBSD/sparc64.
 
-   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   Free Software Foundation, Inc.
    Based on code contributed by Wasabi Systems, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +17,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "frame.h"
@@ -28,6 +27,7 @@
 #include "regcache.h"
 #include "regset.h"
 #include "symtab.h"
+#include "objfiles.h"
 #include "solib-svr4.h"
 #include "trad-frame.h"
 
@@ -132,6 +132,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;
@@ -160,12 +174,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;
@@ -188,7 +204,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);
@@ -232,15 +248,20 @@ sparc64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   tdep->fpregset = regset_alloc (gdbarch, sparc64nbsd_supply_fpregset, NULL);
   tdep->sizeof_fpregset = 272;
 
+  /* Make sure we can single-step "new" syscalls.  */
+  tdep->step_trap = sparcnbsd_step_trap;
+
   frame_unwind_append_sniffer (gdbarch, sparc64nbsd_sigtramp_frame_sniffer);
 
   sparc64_init_abi (info, gdbarch);
 
+  /* 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, nbsd_lp64_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.025196 seconds and 4 git commands to generate.