From: Jim Blandy Date: Thu, 20 Dec 2001 08:50:47 +0000 (+0000) Subject: * s390-tdep.c (s390_readinstruction): Don't call X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5e243bbc4b8448f588b175364eed888a2f56a2a;p=binutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index deb527ac887..d4888d3c78a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2001-12-19 Jim Blandy + * 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. + * gdbarch.sh (TARGET_CHAR_SIGNED): New macro. * gdbarch.c, gdbarch.h: Regenerated. * gdbtypes.c (build_gdbtypes): If TARGET_CHAR_SIGNED is zero, 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; }