[PATCH]: Generate namespace info for dwarf2

Jason Merrill jason@redhat.com
Mon Dec 1 18:59:00 GMT 2003


On Sun, 30 Nov 2003 11:36:51 -0500 (EST), Daniel Berlin <dberlin@dberlin.org> wrote:

> Here's an updated namespace patch that incorporates Jason's comments from
> last year. :P

Thanks.  Looking up those comments, I noticed some comments from 2001, as
well:

  http://gcc.gnu.org/ml/gcc-patches/2001-11/msg00438.html

Would you mind adding -gdwarf-3, as discussed?

> -class_scope_p (dw_die_ref context_die)
> +class_or_namespace_scope_p (dw_die_ref context_die)

So we're going to declare functions inside namespaces and define them at CU
scope, like we do for classes?  Seems reasonable, especially for
compatibility with older debuggers, but please mention that in a comment
somewhere.

Looks like you still need to handle splitting classes like you do functions
and variables.

> +      /* Anonymous namespaces shouldn't have a DW_AT_name.  */
> +      if (DECL_NAME (decl) == anonymous_namespace_name)
> +	add_src_coords_attributes (namespace_die, decl);

Hmm, I don't like moving anonymous_namespace_name to tree.c.  I'm testing a
patch to leave DECL_NAME null for the anonymous namespace.

Have you (or Benjamin) run the gdb regression tests with this patch?

Jason



More information about the Gcc-patches mailing list