From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10088 invoked by alias); 20 Dec 2001 08:56:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10037 invoked from network); 20 Dec 2001 08:56:06 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 20 Dec 2001 08:56:06 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id B6FA35E9D8; Thu, 20 Dec 2001 03:57:26 -0500 (EST) From: Jim Blandy To: gdb-patches@sources.redhat.com Subject: PATCH: S/390: don't try to read zero bytes Message-Id: <20011220085726.B6FA35E9D8@zwingli.cygnus.com> Date: Thu, 20 Dec 2001 00:56:00 -0000 X-SW-Source: 2001-12/txt/msg00499.txt.bz2 2001-12-20 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. 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; }