From: Daniel Berlin <dberlin@dberlin.org>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb-patches@sources.redhat.com,
Elena Zannoni <ezannoni@redhat.com>, Jim Blandy <jimb@redhat.com>
Subject: Re: [rfc/rfa] accept DW_TAG_namespace and friends, possibly on 5.3
Date: Tue, 22 Oct 2002 14:17:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.44.0210221710400.10022-100000@dberlin.org> (raw)
In-Reply-To: <ro1smyy5hs6.fsf@jackfruit.Stanford.EDU>
On 22 Oct 2002, David Carlton wrote:
> The current situation around C++ namespace debugging info is that GCC
> isn't generating it because, if it were generating it, it would
> produce debugging info that GDB really can't handle. Basically,
> DW_TAG_namespace entries have children that are important, so GDB has
> to know a little bit about those nodes in order not to miss large
> chunks of debugging info. (This is true whether or not GDB wants to
> do anything particularly namespace-specific with that debugging info.)
>
> So it seems to me like it would be a good idea to change GDB as
> quickly as possible to not get confused by DW_TAG_namespace (as well
> as DW_TAG_imported_declaration and DW_TAG_imported_module): we
> shouldn't wait until adding more namespace functionality to GDB. For
> example, if that support makes it into GDB 5.3, then maybe GCC 3.3
> will be able to generate the appropriate debugging info, so when a GDB
> 5.4 (or whatever) rolls around that handles namespaces better, users
> will be able to take advantage of it immediately (instead of having to
> wait for the next GCC release).
>
> Here are some patches to let GDB accept that debugging information: I
> think it would be a good idea to get it into 5.3 as well as mainline,
> if possible. They're quite minimal changes: they make sure that, when
> reading partial symbols, we descend into DW_TAG_namespace entries,
> that when reading full symbols, we read children of DW_TAG_namespace
> entries (but we don't keep around any more namespace information than
> we do currently: e.g. we still get names from
> DW_AT_MIPS_linkage_name), and that we don't complain about the
> presence of DW_TAG_imported_declaration or DW_TAG_imported_module (but
> we also don't do anything useful about that info).
>
> I've tested this using current GCC, using GCC as patched according to
> <http://sources.redhat.com/ml/gdb/2002-08/msg00312.html>, and using
> GCC as patched according to that message plus the following patch:
>
> --- dwarf2out.c-danielb Fri Oct 18 11:39:46 2002
> +++ dwarf2out.c Fri Oct 18 11:38:46 2002
> @@ -11453,7 +11453,11 @@ gen_namespace_die (decl, context_die)
> {
> /* Output a real namespace */
> dw_die_ref namespace_die = new_die (DW_TAG_namespace, context_die, decl);
> - add_name_and_src_coords_attributes (namespace_die, decl);
> + /* Anonymous namespaces shouldn't have a DW_AT_name. */
> + if (strncmp (dwarf2_name (decl, 0), "_GLOBAL__N", 10) == 0)
> + add_src_coords_attributes (namespace_die, decl);
> + else
> + add_name_and_src_coords_attributes (namespace_die, decl);
> equate_decl_number_to_die (decl, namespace_die);
> }
> else
Just FYI, the real fix is to move anonymous_namespace_name from
cp/cp-tree.h to c-common.h, and the actual declaration from cp/decl.c to
c-common.c , and pointer compare DECL_NAME (decl) to anonymous_namespace_name.
>
> In all cases, there are no new regressions. Unfortunately, I don't
> currently have a version of GCC that emits many
> DW_TAG_imported_declarations or any DW_TAG_imported_modules; I hope
> that I'll have one soon (Daniel Berlin is working on it but he's busy;
> maybe I'll try to work on it myself, too),
I should have it done in a few hours, actually.
next prev parent reply other threads:[~2002-10-22 21:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-22 13:40 David Carlton
2002-10-22 13:51 ` Daniel Jacobowitz
2002-10-22 14:25 ` Andrew Cagney
2002-10-22 14:17 ` Daniel Berlin [this message]
2002-10-22 14:40 ` David Carlton
2002-10-22 15:09 ` Daniel Berlin
2002-10-22 15:33 ` David Carlton
2002-10-22 16:48 ` Daniel Berlin
2002-10-22 15:29 ` Elena Zannoni
2002-10-22 16:02 ` David Carlton
2002-10-22 16:10 ` Elena Zannoni
2002-10-22 16:14 ` David Carlton
2002-10-23 11:36 ` 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=Pine.LNX.4.44.0210221710400.10022-100000@dberlin.org \
--to=dberlin@dberlin.org \
--cc=carlton@math.stanford.edu \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@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