From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7043 invoked by alias); 8 Apr 2009 19:01:39 -0000 Received: (qmail 6929 invoked by uid 22791); 8 Apr 2009 19:01:38 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e24smtp01.br.ibm.com (HELO e24smtp01.br.ibm.com) (32.104.18.85) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Apr 2009 19:01:33 +0000 Received: from mailhub1.br.ibm.com (mailhub1.br.ibm.com [9.18.232.109]) by e24smtp01.br.ibm.com (8.13.1/8.13.1) with ESMTP id n38JFFmC019605 for ; Wed, 8 Apr 2009 16:15:15 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n38J1kL01110142 for ; Wed, 8 Apr 2009 16:01:46 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n38J1Quk028442 for ; Wed, 8 Apr 2009 16:01:26 -0300 Received: from [9.8.10.215] ([9.8.10.215]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n38J1Qco028423; Wed, 8 Apr 2009 16:01:26 -0300 Subject: Re: [RFC] problem with read_memory_string (reads 8 bytes at a time) From: Thiago Jung Bauermann To: Joel Brobecker Cc: gdb-patches@sourceware.org In-Reply-To: <20090408182650.GE7535@adacore.com> References: <20090408182650.GE7535@adacore.com> Content-Type: text/plain; charset=utf-8 Date: Wed, 08 Apr 2009 19:01:00 -0000 Message-Id: <1239217285.8871.90.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00156.txt.bz2 El mié, 08-04-2009 a las 11:26 -0700, Joel Brobecker escribió: > b. Read 8 bytes from 0x1002e0 + 8 = 0x1002e8: > i. The section ends at 0x001102ec, so bfd returns only 4 bytes read. > ii. We find out that only 4 bytes were read, so we still need to > read another 4 bytes for the 8byte read to be complete > iii. the next 4byte read doesn't find a section from which to > read the 4bytes, and so returns 0 signifying an error. > > I don't really know how to fix this issue except by reading the string > one byte at a time :-(. Any suggestion? I suggest using target_read_string. If I understand its code correctly, it handles the corner case you hit. I thought that valprint.c:read_string also handled that, but now that I read the code again, it looks like it would fail too. :-( -- []'s Thiago Jung Bauermann IBM Linux Technology Center