* linux-low.c (my_waitpid): Delete unnecessary prototype.
[deliverable/binutils-gdb.git] / gdb / irix5-nat.c
index 58630bad9ba47e24700a3f60a3e7bf14459dc266..42b4d5c426aa35b61ddccfea8e3e0bc74fb1026c 100644 (file)
@@ -1,7 +1,8 @@
 /* Native support for the SGI Iris running IRIX version 5, for GDB.
 
    Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
-   1999, 2000, 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2004, 2006, 2007, 2008, 2009
+   Free Software Foundation, Inc.
 
    Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
@@ -28,6 +29,7 @@
 #include "gdbcore.h"
 #include "target.h"
 #include "regcache.h"
+#include "procfs.h"
 
 #include "gdb_string.h"
 #include <sys/time.h>
@@ -82,6 +84,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
   greg_t *regp = &(*gregsetp)[0];
   gdb_byte buf[MAX_REGISTER_SIZE];
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   /* Under Irix6, if GDB is built with N32 ABI and is debugging an O32
      executable, we have to sign extend the registers to 64 bits before
@@ -92,7 +95,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
       {
        size = register_size (gdbarch, regi);
        regcache_raw_collect (regcache, regi, buf);
-       *(regp + regi) = extract_signed_integer (buf, size);
+       *(regp + regi) = extract_signed_integer (buf, size, byte_order);
       }
 
   if ((regno == -1) || (regno == gdbarch_pc_regnum (gdbarch)))
@@ -100,7 +103,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
       regi = mips_regnum (gdbarch)->pc;
       size = register_size (gdbarch, regi);
       regcache_raw_collect (regcache, regi, buf);
-      *(regp + CTX_EPC) = extract_signed_integer (buf, size);
+      *(regp + CTX_EPC) = extract_signed_integer (buf, size, byte_order);
     }
 
   if ((regno == -1) || (regno == mips_regnum (gdbarch)->cause))
@@ -108,7 +111,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
       regi = mips_regnum (gdbarch)->cause;
       size = register_size (gdbarch, regi);
       regcache_raw_collect (regcache, regi, buf);
-      *(regp + CTX_CAUSE) = extract_signed_integer (buf, size);
+      *(regp + CTX_CAUSE) = extract_signed_integer (buf, size, byte_order);
     }
 
   if ((regno == -1) || (regno == mips_regnum (gdbarch)->hi))
@@ -116,7 +119,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
       regi = mips_regnum (gdbarch)->hi;
       size = register_size (gdbarch, regi);
       regcache_raw_collect (regcache, regi, buf);
-      *(regp + CTX_MDHI) = extract_signed_integer (buf, size);
+      *(regp + CTX_MDHI) = extract_signed_integer (buf, size, byte_order);
     }
 
   if ((regno == -1) || (regno == mips_regnum (gdbarch)->lo))
@@ -124,7 +127,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
       regi = mips_regnum (gdbarch)->lo;
       size = register_size (gdbarch, regi);
       regcache_raw_collect (regcache, regi, buf);
-      *(regp + CTX_MDLO) = extract_signed_integer (buf, size);
+      *(regp + CTX_MDLO) = extract_signed_integer (buf, size, byte_order);
     }
 }
 
@@ -255,8 +258,17 @@ static struct core_fns irix5_core_fns =
   NULL                                 /* next */
 };
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_irix5_nat;
+
 void
-_initialize_core_irix5 (void)
+_initialize_irix5_nat (void)
 {
+  struct target_ops *t;
+
+  t = procfs_target ();
+  procfs_use_watchpoints (t);
+  add_target (t);
+
   deprecated_add_core_fns (&irix5_core_fns);
 }
This page took 0.024871 seconds and 4 git commands to generate.