From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21113 invoked by alias); 6 Sep 2005 15:35:27 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 21079 invoked by uid 22791); 6 Sep 2005 15:35:23 -0000 Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 06 Sep 2005 15:35:23 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1ECfTd-0007sU-8P for gdb@sources.redhat.com; Tue, 06 Sep 2005 19:35:19 +0400 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1ECfTd-0007sR-5M for gdb@sources.redhat.com; Tue, 06 Sep 2005 19:35:13 +0400 From: Vladimir Prus To: gdb@sources.redhat.com Subject: Re: The 'x' command: size problem Date: Tue, 06 Sep 2005 15:35:00 -0000 User-Agent: KMail/1.7.2 References: <20050906152448.GA2444@nevyn.them.org> In-Reply-To: <20050906152448.GA2444@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509061935.12549.ghost@cs.msu.su> X-SW-Source: 2005-09/txt/msg00032.txt.bz2 On Tuesday 06 September 2005 19:24, Daniel Jacobowitz wrote: > On Tue, Sep 06, 2005 at 07:00:28PM +0400, Vladimir Prus wrote: > > works. In fact, the x_command function in printcmd.c expects the the size > > argument be always given as literal. > > > > This limitation makes it somewhat harder to implement "show this > > variable/expression in binary" command in a GUI. Are there any easy > > workarounds? > > Not as far as I know. But you're in a GUI, i.e. hopefully something > with logic and capable of parsing GDB's responses. Is it really that > hard to get the size and print out the right bytes? > > -data-evaluate-expression "sizeof(i)" > ^done,value="4" > (gdb) > > -data-read-memory "&i" t 1 1 4 > ^done,addr="0xbf82ec04",nr-bytes="4",total-bytes="4",next-row="0xbf82ec08", >prev-row="0xbf82ec00",next-page="0xbf82ec08",prev-page="0xbf82ec00",memory=[ >{addr="0xbf82ec04",data=["10011100","01011110","11101111","10110111"]}] > (gdb) No, it's not very hard. But given anynchronious nature of communication with gdb I'm trying to limit the number of queries to minimum, to minimize the amount of data I have to keep. - Volodya