* target.h (struct section_table): Rename to ...
[deliverable/binutils-gdb.git] / gdb / mipsnbsd-tdep.c
index c572409c1ba52402fdc640ad8316654dc6f8645c..b9e05473186f8b2b10993519100b257f05269f22 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for NetBSD/mips.
 
-   Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008
+   Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    Contributed by Wasabi Systems, Inc.
@@ -286,25 +286,26 @@ mipsnbsd_sigtramp_offset (struct frame_info *this_frame)
    success.  */
 
 #define NBSD_MIPS_JB_PC                        (2 * 4)
-#define NBSD_MIPS_JB_ELEMENT_SIZE      mips_isa_regsize (current_gdbarch)
-#define NBSD_MIPS_JB_OFFSET            (NBSD_MIPS_JB_PC * \
-                                        NBSD_MIPS_JB_ELEMENT_SIZE)
+#define NBSD_MIPS_JB_ELEMENT_SIZE(gdbarch)     mips_isa_regsize (gdbarch)
+#define NBSD_MIPS_JB_OFFSET(gdbarch)           (NBSD_MIPS_JB_PC * \
+                                        NBSD_MIPS_JB_ELEMENT_SIZE (gdbarch))
 
 static int
 mipsnbsd_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
   CORE_ADDR jb_addr;
   char *buf;
 
-  buf = alloca (NBSD_MIPS_JB_ELEMENT_SIZE);
+  buf = alloca (NBSD_MIPS_JB_ELEMENT_SIZE (gdbarch));
 
   jb_addr = get_frame_register_unsigned (frame, MIPS_A0_REGNUM);
 
-  if (target_read_memory (jb_addr + NBSD_MIPS_JB_OFFSET, buf,
-                         NBSD_MIPS_JB_ELEMENT_SIZE))
+  if (target_read_memory (jb_addr + NBSD_MIPS_JB_OFFSET (gdbarch), buf,
+                         NBSD_MIPS_JB_ELEMENT_SIZE (gdbarch)))
     return 0;
 
-  *pc = extract_unsigned_integer (buf, NBSD_MIPS_JB_ELEMENT_SIZE);
+  *pc = extract_unsigned_integer (buf, NBSD_MIPS_JB_ELEMENT_SIZE (gdbarch));
 
   return 1;
 }
@@ -416,6 +417,9 @@ mipsnbsd_core_osabi_sniffer (bfd *abfd)
   return GDB_OSABI_UNKNOWN;
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_mipsnbsd_tdep;
+
 void
 _initialize_mipsnbsd_tdep (void)
 {
This page took 0.025927 seconds and 4 git commands to generate.