[rfc/rfa] accept DW_TAG_namespace and friends, possibly on 5.3

David Carlton carlton@math.stanford.edu
Tue Oct 22 14:40:00 GMT 2002


On Tue, 22 Oct 2002 17:17:49 -0400 (EDT), Daniel Berlin
<dberlin@dberlin.org> said:
> On 22 Oct 2002, David Carlton wrote:

>> 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.

Lovely.  I was sure you could come up with a better fix than mine;
that strncmp gave me the willies.

>> 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.

Great!  My hero. :-)

David Carlton
carlton@math.stanford.edu



More information about the Gdb-patches mailing list