From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1557 invoked by alias); 5 Feb 2002 18:17:03 -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 1363 invoked from network); 5 Feb 2002 18:16:49 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 5 Feb 2002 18:16:49 -0000 Received: from drow by nevyn.them.org with local (Exim 3.34 #1 (Debian)) id 16YA8i-0000Ai-00; Tue, 05 Feb 2002 13:16:20 -0500 Date: Tue, 05 Feb 2002 10:17:00 -0000 From: Daniel Jacobowitz To: Daniel Berlin Cc: Andrew Cagney , Eli Zaretskii , gdb@sources.redhat.com Subject: Re: Handling of structure dereferencing Message-ID: <20020205131620.A471@nevyn.them.org> Mail-Followup-To: Daniel Berlin , Andrew Cagney , Eli Zaretskii , gdb@sources.redhat.com References: <3C33DD48.2050801@cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2002-02/txt/msg00107.txt.bz2 On Tue, Feb 05, 2002 at 12:30:41PM -0500, Daniel Berlin wrote: > On Thu, 3 Jan 2002, Andrew Cagney wrote: > > > > On Thu, Dec 06, 2001 at 09:47:50PM +0200, Eli Zaretskii wrote: > > > > > >> > Date: Thu, 6 Dec 2001 12:07:39 -0500 > > >> > From: Daniel Jacobowitz > > >> > > > >> > Right now, and historically, gdb has accepted things like: > > >> > struct foo {char a} *b, **c, ***d; > > >> > > > >> > (gdb) print b.a > > >> > (gdb) print d->a > > > > > > b->a and b.a are probably commonly used - don't some languages even > > accept both forms? As for ``d.a'', I don't have an opinion - hmm, now > > that I know about it I might just start using it :-( > > > I switch them all the time. > For pointers, i usually start by printing [0] of it, then [0].some > member[0], etc. > I almost never use ->. > Why should I have to care whether the object is really a pointer or not to > be able to print a member? > I only care about printing the member, or else i wouldn't have asked for > it. > > Is there some good reason to not allow either to work? > IE is allowing it breaking something else, or preventing something else > from being implemented? > If not, why make it *harder* for users to do what they want? > > I don't want to have to remember whether in the expression "a.x.d.b.c", > whether b is a poiner or not. I only care about seeing c. > > If this is changed, it would, at least for me (and i imagine a large > number > of others) make gdb a lot harder to use. OK, this issue is closed then. People seem to use it as a feature. I may look in to allowing it -only- from the prompt though. It's just a messiness issue; in functions that deal with values internally, it is unclear what they should do if they get a pointer, and when they can expect a pointer, etc. Some day I'll have the free time to bash on value handling and I'll look on moving the behavior up to the frontend. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer