From: Daniel Jacobowitz <drow@false.org>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [1/4] RFC: skip DIEs which only declare an enum
Date: Fri, 15 Jul 2011 18:50:00 -0000 [thread overview]
Message-ID: <CAN9gPaGvXL=300R7HeGPhyAk7EzpZg=xFg7GpOfrO07eMQQHWA@mail.gmail.com> (raw)
In-Reply-To: <m3pqlbbepo.fsf@fleche.redhat.com>
On Fri, Jul 15, 2011 at 2:06 PM, Tom Tromey <tromey@redhat.com> wrote:
> With -gdwarf-4:
>
> -PASS: gdb.cp/classes.exp: print ('ClassWithEnum::PrivEnum') 42
> -PASS: gdb.cp/classes.exp: print (ClassWithEnum::PrivEnum) 42
> +FAIL: gdb.cp/classes.exp: print ('ClassWithEnum::PrivEnum') 42
> +FAIL: gdb.cp/classes.exp: print (ClassWithEnum::PrivEnum) 42
>
> What happens here is that gcc emits multiple .debug_type CUs. While
> reading one such CU, we see an empty declaration for PrivEnum. This
> gets turned into a symbol, and later we end up with an incomplete type.
>
> This patch fixes the problem by simply skipping declaration-only enums.
> This makes it so only the full definition is put into the symbol table,
> letting check_typedef work.
>
> This is one of the patches I am less sure about. Is it really safe? It
> also may change the error a user sees in some obscure case -- but to my
> mind there is not much practical difference between "type not found" and
> "type found but useless".
Generally speaking, I agree with your sentiment. Can't you
forward-declare enums in the latest C++ draft, though? If the
declaration is all we have, something like (enum X) 42 is more useful
than <unknown type> (both examples made up; I don't know what we
print.
We ought to be able to resolve the incomplete type if we have both.
But I know that doesn't always work right.
--
Thanks,
Daniel
next prev parent reply other threads:[~2011-07-15 18:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 18:08 Tom Tromey
2011-07-15 18:50 ` Daniel Jacobowitz [this message]
2011-07-18 18:02 ` Tom Tromey
2011-07-18 20:14 ` Tom Tromey
2011-07-20 15:19 ` Tom Tromey
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='CAN9gPaGvXL=300R7HeGPhyAk7EzpZg=xFg7GpOfrO07eMQQHWA@mail.gmail.com' \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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