From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [patch/rfc] gdb.c++/templates.exp, pr gdb/1063
Date: Wed, 26 Feb 2003 00:15:00 -0000 [thread overview]
Message-ID: <20030226001536.GB31684@nevyn.them.org> (raw)
In-Reply-To: <ro1znoksz7e.fsf@jackfruit.Stanford.EDU>
On Tue, Feb 25, 2003 at 03:44:05PM -0800, David Carlton wrote:
> I'm starting to clean up FAILs and XFAILs in gdb.c++/templates.exp. I
> see several (especially in DWARF-2), with various causes, and they're
> kind of subtle, so I'll probably do multiple patches for this.
> (Frankly, the whole file is full of HP'isms and regexps that I'm
> suspicious of, but never mind that.)
>
> Anyways: there are 5 tests that were all originally XFAILed that all
> exhibit the same behavior. Basically, there's a templated classes C,
> with a few instantiations. Then the test does 'ptype C'.
>
> Right now, with GCC 3.1/DWARF-2, GDB arbitrarily picks one of the
> instantiations and does ptype of that. (Though not always, as I
> commented in PR gdb/1063.) With GCC 2.95.3/stabs+, however, GDB says
> that there's no type in question. What the testsuite is requesting is
> that GDB actually know that it's a templated type, and print out
> something related to that.
>
> For example, say that C is:
>
> template <class T>
> class C {
> T x;
> };
>
> Then if you do 'ptype C', then in some circumstances, GDB will print
> out the type of C<int>, in some circumstances GDB won't print out
> anything (presumably because it knows about the types C<int>, C<char>,
> or whatever, but not about just C), and the test suite wants output
> that looks like what I wrote above.
Note that we can't print out the above in stabs or dwarf-2; neither of
them puts the abstract type in the debug info, only the referenced
type. DWARF-2 can say a bit more than it does now - specifically, that
"int" is a template paramater for C - but "DWARF does not represent the
generic template definition, but does represent each instantiation"
according to the v3 draft.
The reason we often print out one of the instantiations is because each
C<T> contains a nested typedef for C in the DWARF-2. We don't handle
nested types right yet.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-02-26 0:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-26 0:35 David Carlton
2003-02-26 0:15 ` Daniel Jacobowitz [this message]
2003-02-26 1:35 ` David Carlton
2003-02-26 0:34 ` Daniel Jacobowitz
2003-02-26 1:03 ` David Carlton
2003-02-26 20:27 ` David Carlton
2003-02-26 1:15 Michael Elizabeth Chastain
2003-02-26 1:23 ` David Carlton
2003-02-26 2:00 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=20030226001536.GB31684@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@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