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>
+#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
-
/* Extract the register values out of the core file and store
them where `read_register' will find them.
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++)
{
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]);
}