From: Stan Shebs <shebs@apple.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb <gdb@sources.redhat.com>, Daniel Jacobowitz <drow@mvista.com>
Subject: Re: how canonical are template names?
Date: Fri, 10 Jan 2003 23:34:00 -0000 [thread overview]
Message-ID: <3E1F582E.2040408@apple.com> (raw)
In-Reply-To: <ro1u1ggd6mo.fsf@jackfruit.Stanford.EDU>
David Carlton wrote:
>I'm testing a patch on my branch that tries to figure out when a class
>lives inside a namespace by looking at the demangled names of the
>methods of the classes.
>
>When I tested the patch, I saw some regressions in
>gdb.c++/templates.exp. But, on looking at the situation further, I'm
>not sure that they qualify as regressions. Basically, there are
>different ways to write the same types; it turns out that G++'s debug
>info and the demangler choose different ways in some circumstances.
>
>In an ideal world, maybe GDB would always print types in one canonical
>way and allow users as much flexibility as possible in how they input
>types. But, for now, it seems quite reasonable to allow GDB to print
>types however it wishes and to require users to input types the same
>way that GDB outputs them in some circumstances. Usually, users can
>figure out what name GDB thinks a templated class has by calling
>'ptype' on a variable of the appropriate type.
>
One goal for all GDB expression and type evaluation is to pass
the cut-n-paste test - the debugger should be able to take anything
in the source code and come up with the same interpretation as the
compiler. Anything less is a quick trip to user hell - manually
expanding macros, trying to guess how to phrase a cast, executing
function bodies line by line because function calls don't work.
Of course, we'll always fall short of the ideal. In the specific
cases you mention, it sounds like some parser smartening is in
order, and all the faults should be PRs.
Stan
next prev parent reply other threads:[~2003-01-10 23:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-10 21:42 David Carlton
2003-01-10 21:55 ` Daniel Jacobowitz
2003-01-10 22:44 ` David Carlton
2003-01-10 23:34 ` Stan Shebs [this message]
2003-01-10 23:47 ` David Carlton
-- strict thread matches above, loose matches on Subject: below --
2003-01-11 1:07 Michael Elizabeth Chastain
2003-01-11 3:42 ` Daniel Jacobowitz
2003-01-11 0:59 Michael Elizabeth Chastain
2003-01-10 21:19 David Carlton
2003-01-10 21:21 ` David Carlton
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=3E1F582E.2040408@apple.com \
--to=shebs@apple.com \
--cc=carlton@math.stanford.edu \
--cc=drow@mvista.com \
--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