2003-02-12 Andrew Cagney <ac131313@redhat.com>
[deliverable/binutils-gdb.git] / gdb / alphanbsd-tdep.c
index a3a1f532a03f407e9bb27cf13c61e97d9c283615..6137c5e98de96c9d51c7f20d8088981d754e9fa2 100644 (file)
@@ -1,5 +1,5 @@
 /* Target-dependent code for NetBSD/Alpha.
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
    This file is part of GDB.
 
 #include "defs.h"
 #include "gdbcore.h"
+#include "frame.h"
 #include "regcache.h"
 #include "value.h"
+#include "osabi.h"
 
 #include "solib-svr4.h"
 
@@ -182,6 +184,29 @@ alphanbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
          || alphanbsd_sigtramp_offset (pc) >= 0);
 }
 
+static CORE_ADDR
+alphanbsd_sigcontext_addr (struct frame_info *frame)
+{
+  /* FIXME: This is not correct for all versions of NetBSD/alpha.
+     We will probably need to disassemble the trampoline to figure
+     out which trampoline frame type we have.  */
+  return frame->frame;
+}
+
+static CORE_ADDR
+alphanbsd_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
+{
+  char *name;
+
+  /* FIXME: This is not correct for all versions of NetBSD/alpha.
+     We will probably need to disassemble the trampoline to figure
+     out which trampoline frame type we have.  */
+  find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
+  if (PC_IN_SIGTRAMP (pc, name))
+    return frame->frame;
+  return 0;
+}
+
 static void
 alphanbsd_init_abi (struct gdbarch_info info,
                     struct gdbarch *gdbarch)
@@ -197,7 +222,9 @@ alphanbsd_init_abi (struct gdbarch_info info,
   set_solib_svr4_fetch_link_map_offsets (gdbarch,
                                  nbsd_lp64_solib_svr4_fetch_link_map_offsets);
 
+  tdep->skip_sigtramp_frame = alphanbsd_skip_sigtramp_frame;
   tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;
+  tdep->sigcontext_addr = alphanbsd_sigcontext_addr;
 
   tdep->jb_pc = 2;
   tdep->jb_elt_size = 8;
@@ -206,7 +233,7 @@ alphanbsd_init_abi (struct gdbarch_info info,
 void
 _initialize_alphanbsd_tdep (void)
 {
-  gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_NETBSD_ELF,
+  gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_ELF,
                           alphanbsd_init_abi);
 
   add_core_fns (&alphanbsd_core_fns);
This page took 0.025925 seconds and 4 git commands to generate.