diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-12-20 08:50:47 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-12-20 08:50:47 +0000 |
commit | c5e243bbc4b8448f588b175364eed888a2f56a2a (patch) | |
tree | b4ce0085602a6be115310a5f6c1ce58cd98ee461 /gdb/s390-tdep.c | |
parent | 2e7db62a77bdb3dc27338454cc8c170ebcb19092 (diff) | |
download | gdb-c5e243bbc4b8448f588b175364eed888a2f56a2a.zip gdb-c5e243bbc4b8448f588b175364eed888a2f56a2a.tar.gz gdb-c5e243bbc4b8448f588b175364eed888a2f56a2a.tar.bz2 |
* 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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 02786ec..db7692b 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; } |