From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12208 invoked by alias); 6 Sep 2005 15:25:05 -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 12158 invoked by uid 22791); 6 Sep 2005 15:24:51 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 06 Sep 2005 15:24:51 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1ECfJY-0000gu-B5; Tue, 06 Sep 2005 11:24:48 -0400 Date: Tue, 06 Sep 2005 15:25:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: The 'x' command: size problem Message-ID: <20050906152448.GA2444@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-09/txt/msg00030.txt.bz2 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) -- Daniel Jacobowitz CodeSourcery, LLC