Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com)
[binutils-gdb.git] / gdb / coredep.c
index 81fb3a42d50ec8a8e3eb251c4b37c5bf9c5b22f4..059d23e73ab19caa249c94cdc247b4f6a878fae1 100644 (file)
@@ -21,23 +21,19 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    this file is more machine-specific.  */
 
 #include "defs.h"
-#include "param.h"
+#include <sys/types.h>
+#include <sys/param.h>
 #include "gdbcore.h"
-#include <stdio.h>
 
-/* Some of these are needed on various systems, perhaps, to expand
-   REGISTER_U_ADDR appropriately?  */
-/* #include <sys/core.h> */
-#include <sys/param.h>
+/* These are needed on various systems to expand REGISTER_U_ADDR.  */
+#ifndef USG
 #include <sys/dir.h>
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/user.h>
-#ifndef USG
 #include <sys/ptrace.h>
 #endif
 
-
 /* Extract the register values out of the core file and store
    them where `read_register' will find them.
 
@@ -71,8 +67,6 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      NOP.  */
   if (reg_ptr > core_reg_size)
     reg_ptr -= KERNEL_U_ADDR;
-  if (reg_ptr > core_reg_size)
-    fprintf (stderr, "Can't find registers in core file\n");
 
   for (regno = 0; regno < NUM_REGS; regno++)
     {
@@ -84,7 +78,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
        supply_register (regno, core_reg_sect + addr);
       }
     }
-  if (bad_reg > 0)
+  if (bad_reg >= 0)
     {
       error ("Register %s not found in core file.", reg_names[bad_reg]);
     }