This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: S/390: don't try to read zero bytes



2001-12-20  Jim Blandy  <jimb@redhat.com>

	* 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.

Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/s390-tdep.c,v
retrieving revision 2.33
diff -c -r2.33 s390-tdep.c
*** gdb/s390-tdep.c	2001/12/20 03:25:51	2.33
--- gdb/s390-tdep.c	2001/12/20 07:41:37
***************
*** 132,139 ****
    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;
    return instrlen;
  }
  
--- 132,142 ----
    if ((*info->read_memory_func) (at, &instr[0], 2, info))
      return -1;
    instrlen = s390_instrlen[instr[0] >> 6];
!   if (instrlen > 2)
!     {
!       if ((*info->read_memory_func) (at + 2, &instr[2], instrlen - 2, info))
!         return -1;
!     }
    return instrlen;
  }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]