]> Git Repo - binutils.git/blobdiff - gdb/i386bsd-tdep.c
2003-05-14 Elena Zannoni <[email protected]>
[binutils.git] / gdb / i386bsd-tdep.c
index 368fa5631aee5b53acf3b7e18dc5336a132f7a2a..c0c544de52d039573317690aaa1608939ad7e58c 100644 (file)
@@ -1,5 +1,5 @@
 /* Target-dependent code for i386 BSD's.
-   Copyright 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,6 +23,7 @@
 #include "frame.h"
 #include "gdbcore.h"
 #include "regcache.h"
+#include "osabi.h"
 
 #include "gdb_string.h"
 
@@ -49,11 +50,13 @@ i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
 CORE_ADDR
 i386bsd_sigcontext_addr (struct frame_info *frame)
 {
-  if (frame->next)
+  struct frame_info *next_frame = get_next_frame (frame);
+
+  if (next_frame)
     /* If this isn't the top frame, the next frame must be for the
        signal handler itself.  A pointer to the sigcontext structure
        is passed as the third argument to the signal handler.  */
-    return read_memory_unsigned_integer (frame->next->frame + 16, 4);
+    return read_memory_unsigned_integer (get_frame_base (next_frame) + 16, 4);
 
   /* This is the top frame.  We'll have to find the address of the
      sigcontext structure by looking at the stack pointer.  */
@@ -100,6 +103,10 @@ i386bsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   set_gdbarch_pc_in_sigtramp (gdbarch, i386bsd_pc_in_sigtramp);
 
+  /* Allow the recognition of sigtramps as a function named <sigtramp>.  */
+  set_gdbarch_sigtramp_start (gdbarch, i386bsd_sigtramp_start);
+  set_gdbarch_sigtramp_end (gdbarch, i386bsd_sigtramp_end);
+
   /* Assume SunOS-style shared libraries.  */
   set_gdbarch_in_solib_call_trampoline (gdbarch,
                                        i386bsd_aout_in_solib_call_trampoline);
@@ -191,8 +198,8 @@ _initialize_i386bsd_tdep (void)
   gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_aout_flavour,
                                  i386bsd_aout_osabi_sniffer);
 
-  gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_AOUT,
+  gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_AOUT,
                          i386fbsdaout_init_abi);
-  gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_ELF,
+  gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_ELF,
                          i386fbsd4_init_abi);
 }
This page took 0.0282559999999999 seconds and 4 git commands to generate.