Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Daniel Berlin <dan@dberlin.org>
Cc: Andrew Cagney <ac131313@cygnus.com>,
	Eli Zaretskii <eliz@is.elta.co.il>,
	gdb@sources.redhat.com
Subject: Re: Handling of structure dereferencing
Date: Tue, 05 Feb 2002 10:17:00 -0000	[thread overview]
Message-ID: <20020205131620.A471@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0202051226480.5034-100000@dberlin.org>

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 <drow@mvista.com>
> > >> > 
> > >> > 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


  reply	other threads:[~2002-02-05 18:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-06  9:07 Daniel Jacobowitz
2001-12-06 11:48 ` Eli Zaretskii
2001-12-06 12:43   ` Daniel Jacobowitz
2002-01-02 20:25     ` Andrew Cagney
2002-02-05  9:31       ` Daniel Berlin
2002-02-05 10:17         ` Daniel Jacobowitz [this message]
2001-12-06 15:41 ` Tom Tromey
2001-12-06 23:36   ` Eli Zaretskii
2001-12-06  9:46 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020205131620.A471@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=ac131313@cygnus.com \
    --cc=dan@dberlin.org \
    --cc=eliz@is.elta.co.il \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox