aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-01-24 21:34:45 +0000
committerMark Kettenis <kettenis@gnu.org>2004-01-24 21:34:45 +0000
commit690668cc17e520a86c33bdab8badc91926e5a410 (patch)
treea530c2b7ff0fb2c28c897235144373c7f6538878 /gdb/sparc-tdep.c
parent7e5e9f880f7dffe5c9efb63af88fe2819f758350 (diff)
downloadgdb-690668cc17e520a86c33bdab8badc91926e5a410.zip
gdb-690668cc17e520a86c33bdab8badc91926e5a410.tar.gz
gdb-690668cc17e520a86c33bdab8badc91926e5a410.tar.bz2
* sparc-tdep.c (sparc_fetch_instruction): Return zero if we can't
read the instruction at PC.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index c2f3cfb..fcaf0f4 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++)