From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2347 invoked by alias); 7 Sep 2005 06:40:07 -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 2259 invoked by uid 22791); 7 Sep 2005 06:40:00 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 07 Sep 2005 06:40:00 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ECta5-00053C-Ha for gdb@sources.redhat.com; Wed, 07 Sep 2005 08:38:49 +0200 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Sep 2005 08:38:49 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Sep 2005 08:38:49 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: The 'x' command: size problem Date: Wed, 07 Sep 2005 06:40:00 -0000 Message-ID: References: <20050906152448.GA2444@nevyn.them.org> <20050906192927.GA10362@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-SW-Source: 2005-09/txt/msg00044.txt.bz2 Daniel Jacobowitz wrote: > On Tue, Sep 06, 2005 at 10:16:56PM +0300, Eli Zaretskii wrote: >> > Date: Tue, 6 Sep 2005 11:24:48 -0400 >> > From: Daniel Jacobowitz >> > Cc: gdb@sources.redhat.com >> > >> > 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. >> >> Is that a bug, and if so, should we fix it ASAP? > > Personally, I don't think it's a bug. > > It can't unambiguously accept x/sizeof(i), because of x/s. I suppose > we could allow convenience variables here, but I don't think the > benefit is substantial. For a frontend, it shouldn't be hard to find > the right size as a literal. For a user, ditto. By the same argumentation, it should not be too hard to find the address, so 'x' should accept literal address only, that is: x/4 &g should be disallowed and user will be required to write: print &g x/4 0xWHATEVER It's a bit inconsistent that arbitrary expression is allowed to address, but not for size. - Volodya