From: kettenis Date: Sat, 24 Jan 2004 21:34:45 +0000 (+0000) Subject: * sparc-tdep.c (sparc_fetch_instruction): Return zero if we can't X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=311ab829345d00095b061b89690197f8656e9963;p=pf3gnuchains%2Fpf3gnuchains3x.git * sparc-tdep.c (sparc_fetch_instruction): Return zero if we can't read the instruction at PC. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 08e5395495..a77b6b2973 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2004-01-24 Mark Kettenis + * sparc-tdep.c (sparc_fetch_instruction): Return zero if we can't + read the instruction at PC. + * sparcnbsd-tdep.c (GDB_OSABI_NETBSD_CORE): Define, based on the value of GDB_OSABI_DEFAULT. (sparcnbsd_core_osabi_sniffer): Return GDB_OSABI_NETBSD_CORE diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index c2f3cfb1f6..fcaf0f437b 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -96,7 +96,9 @@ sparc_fetch_instruction (CORE_ADDR pc) unsigned long insn; int i; - read_memory (pc, buf, sizeof (buf)); + /* If we can't read the instruction at PC, return zero. */ + if (target_read_memory (pc, buf, sizeof (buf))) + return 0; insn = 0; for (i = 0; i < sizeof (buf); i++)