X-Git-Url: https://repo.jachan.dev/binutils.git/blobdiff_plain/159a075e55ceb12b6ded208d243beb7ad36e577c..466bdeb2665147c09f7bb8bdbad38f4f6222f0ed:/gdb/coredep.c diff --git a/gdb/coredep.c b/gdb/coredep.c index 87be34992a..87c2228eea 100644 --- a/gdb/coredep.c +++ b/gdb/coredep.c @@ -21,22 +21,25 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ this file is more machine-specific. */ #include "defs.h" -#include "param.h" +#include +#include #include "gdbcore.h" -#include /* These are needed on various systems to expand REGISTER_U_ADDR. */ -#include -#include #ifndef USG #include #include #include #include -#include +#ifndef NO_PTRACE_H +# ifdef PTRACE_IN_WRONG_PLACE +# include +# else /* !PTRACE_IN_WRONG_PLACE */ +# include +# 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. @@ -70,8 +73,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++) { @@ -83,7 +84,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]); }