From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Eli Zaretskii <eliz@is.elta.co.il>, gdb@sources.redhat.com
Subject: Re: Handling of structure dereferencing
Date: Wed, 02 Jan 2002 20:25:00 -0000 [thread overview]
Message-ID: <3C33DD48.2050801@cygnus.com> (raw)
In-Reply-To: <20011206154348.D11234@nevyn.them.org>
> 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 :-(
Do you know which code was involved? I can dig up a little bit more of
the history.
> Yes, exactly.
>
>
>> > So, straw poll: how would people feel about:
>> > - not letting this happen; only explicit dereferencing
>
>>
>> I don't mind in this specific case, but I wonder whether there isn't
>> some iceberg of which this is only a tip. We do want GDB to continue
>> to print a string when you say "p str", and str is a pointer to a
>> string, right? It's quite possible that the same machinery which
>> supports printing arrays also causes the above.
>
>
> I don't think that's the case; printing a char* does not involve
> implicit dereferencing (if it did, you'd only get the first character).
GDB certainly does pull some magic though - ``(gdb) print (char*)foo''
prints a string up to NUL. I know this cos I've a fuzzy memory of one
version of GDB breaking this behavour and the bug report triggering a
long argument over the advantages/disadvantages of such features.
Andrew
next prev parent reply other threads:[~2002-01-03 4:25 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 [this message]
2002-02-05 9:31 ` Daniel Berlin
2002-02-05 10:17 ` Daniel Jacobowitz
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=3C33DD48.2050801@cygnus.com \
--to=ac131313@cygnus.com \
--cc=drow@mvista.com \
--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