summaryrefslogtreecommitdiff
path: root/gdb/s390-tdep.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-12-20 08:50:47 +0000
committerJim Blandy <jimb@codesourcery.com>2001-12-20 08:50:47 +0000
commit030aee049d1b481bc7e3d4444c484d18784a380d (patch)
tree8b3f51d96c946ed6d151fcc6eca119650434e770 /gdb/s390-tdep.c
parent0767a5fc129b40bcc78b4bbe31d87a12532de983 (diff)
downloadgdb-030aee049d1b481bc7e3d4444c484d18784a380d.tar.gz
* s390-tdep.c (s390_readinstruction): Don't call
info->read_memory_func to read zero bytes. Some targets' xfer_memory functions can't cope with that.
Diffstat (limited to 'gdb/s390-tdep.c')
-rw-r--r--gdb/s390-tdep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 02786ece5e3..db7692b4472 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -132,8 +132,11 @@ s390_readinstruction (bfd_byte instr[], CORE_ADDR at,
if ((*info->read_memory_func) (at, &instr[0], 2, info))
return -1;
instrlen = s390_instrlen[instr[0] >> 6];
- if ((*info->read_memory_func) (at + 2, &instr[2], instrlen - 2, info))
- return -1;
+ if (instrlen > 2)
+ {
+ if ((*info->read_memory_func) (at + 2, &instr[2], instrlen - 2, info))
+ return -1;
+ }
return instrlen;
}