spelling fix.
[deliverable/binutils-gdb.git] / gdb / core-aout.c
index 7103a9c8e1358baa63b4ca07d6028bf7d96670a8..3c1d499256e251ff3ce5f4ff48457540a42145da 100644 (file)
@@ -1,5 +1,5 @@
 /* Extract registers from a "standard" core file, for GDB.
-   Copyright (C) 1988-1995  Free Software Foundation, Inc.
+   Copyright (C) 1988-1998  Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -23,6 +23,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    more machine specific.  */
 
 #include "defs.h"
+
+#ifdef HAVE_PTRACE_H
+# include <ptrace.h>
+#else
+# ifdef HAVE_SYS_PTRACE_H
+#  include <sys/ptrace.h>
+# endif
+#endif
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include "gdbcore.h"
@@ -35,13 +44,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/file.h>
 #include "gdb_stat.h"
 #include <sys/user.h>
-#ifndef NO_PTRACE_H
-# ifdef PTRACE_IN_WRONG_PLACE
-#  include <ptrace.h>
-# else /* !PTRACE_IN_WRONG_PLACE */
-#  include <sys/ptrace.h>
-# endif /* !PTRACE_IN_WRONG_PLACE */
-#endif /* NO_PTRACE_H */
 #endif
 
 #ifndef CORE_REGISTER_ADDR
@@ -52,6 +54,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <sys/core.h>
 #endif
 
+static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
+
+void _initialize_core_aout PARAMS ((void));
+
 /* Extract the register values out of the core file and store
    them where `read_register' will find them.
 
@@ -70,12 +76,12 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      char *core_reg_sect;
      unsigned core_reg_size;
      int which;
-     unsigned reg_addr;
+     CORE_ADDR reg_addr;
 {
-  register int regno;
-  register unsigned int addr;
+  int regno;
+  CORE_ADDR addr;
   int bad_reg = -1;
-  register reg_ptr = -reg_addr;                /* Original u.u_ar0 is -reg_addr. */
+  CORE_ADDR reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
   int numregs = ARCH_NUM_REGS;
 
   /* If u.u_ar0 was an absolute address in the core file, relativize it now,
@@ -84,23 +90,21 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      CORE_REGISTER_ADDR to offset to the other registers.  If this is a modern
      core file without a upage, reg_ptr will be zero and this is all a big
      NOP.  */
-  if (reg_ptr > (int) core_reg_size)
+  if (reg_ptr > core_reg_size)
     reg_ptr -= KERNEL_U_ADDR;
 
   for (regno = 0; regno < numregs; regno++)
     {
       addr = CORE_REGISTER_ADDR (regno, reg_ptr);
-      if (addr >= core_reg_size) {
-       if (bad_reg < 0)
-         bad_reg = regno;
-      } else {
-       supply_register (regno, core_reg_sect + addr);
-      }
+      if (addr >= core_reg_size
+         && bad_reg < 0)
+       bad_reg = regno;
+    else
+      supply_register (regno, core_reg_sect + addr);
     }
+
   if (bad_reg >= 0)
-    {
-      error ("Register %s not found in core file.", reg_names[bad_reg]);
-    }
+    error ("Register %s not found in core file.", REGISTER_NAME (bad_reg));
 }
 
 
@@ -109,12 +113,12 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 /* Return the address in the core dump or inferior of register REGNO.
    BLOCKEND is the address of the end of the user structure.  */
 
-unsigned int
+CORE_ADDR
 register_addr (regno, blockend)
      int regno;
-     int blockend;
+     CORE_ADDR blockend;
 {
-  int addr;
+  CORE_ADDR addr;
 
   if (regno < 0 || regno >= ARCH_NUM_REGS)
     error ("Invalid register number %d.", regno);
This page took 0.025557 seconds and 4 git commands to generate.