[Dwarf-discuss] tag nesting question

Chris Quenelle Chris.Quenelle
Thu Dec 21 18:58:22 GMT 2006


My understanding (assumption?) is that type nodes should
normally appear inside the scope level where they are visible.
So types defined inside a class should appear as tags inside
the tag that represents the class.

I think it's a little odd that g++ uses DW_TAG_structure to
represent classes instead of DW_TAG_class.  I know they
are basically equivalent in C++, but it would be nice to
say that only DW_TAG_class could contain DW_TAG_member.

FWIW:
I've been working on converting dwarf to XML with the intention
of being able to use XML schemas to do the consistency checking
(then you could easily have different sub-schemas for different
compilers)

Some examples of my experiments are here:
http://blogs.sun.com/quenelle/entry/dwarf_and_xml


Marcel Mettes wrote:
> Hello,
> 
> I have been wondering about the rules of nesting tags within tags. I 
> have noticed that the dwarfdump tool reports constructs like:
> 
>    1. The GNU C++ compiler nests DW_TAG_subprogram inside
>       DW_TAG_structure_type for class member functions.
> 
>    2. The TASKING compiler nests type TAGS like DW_TAG_base_type,
>       DW_TAG_pointer_type, DW_TAG_union_type or DW_TAG_const_type within
>       DW_TAG_structure_type when used by one of the struct's fields.
> 
> Since the dwarfdump tool check reports these, should I worry or are 
> these constructs well within the DWARF specification?
> 
> Have a good one,
> Marcel Mettes.
> 
> _______________________________________________
> Dwarf-discuss mailing list
> Dwarf-discuss at lists.freestandards.org
> http://lists.freestandards.org/mailman/listinfo/dwarf-discuss





More information about the Dwarf-discuss mailing list