[Dwarf-discuss] regarding listing class members

David Anderson davea42@earthlink.net
Wed Mar 7 17:21:01 GMT 2007


gireesh subramaniam wrote:
> hello all,
>   i read the information in section 2.3 of the DWARF document,but however
> contrary to the notion of  the members of a class forming a graph ,i 
> am not
> able to find the exact link between the class ,the supposed owner,and the
> members.Here i have included one part of the dwarfdump for asource file
>
> in this file:
> CLASS name:base
> member        :int i
>
> i have pasted the .debug_info sections of the dwarfdump corresponding to
> this.
>
>
> <1><5b>: Abbrev Number: 2 (DW_TAG_structure_type)
>     DW_AT_sibling     : <f3>
>     DW_AT_name        : base
>     DW_AT_byte_size   : 4
>     DW_AT_decl_file   : 1
>     DW_AT_decl_line   : 3
> <2><68>: Abbrev Number: 3 (DW_TAG_member)
>     DW_AT_name        : i
>     DW_AT_decl_file   : 1
>     DW_AT_decl_line   : 5
>     DW_AT_type        : <f3>
>     DW_AT_data_member_location: 2 byte block: 23 0     
> (DW_OP_plus_uconst:
> 0)
>     DW_AT_accessibility: 3    (private)
>

Ah. A small hint:

The leading <2> in 
    <2><68>: Abbrev Number: 3 (DW_TAG_member)
means that this is 'level 2' of the tree.

So the level-2 member is owned by the preceeding level-1 
DW_TAG_structure_type.

Because DIEs can be quite deeply nested, dwarfdump does not
indent it's output (generally).

Try
    dwarfdump -i -d
which not only puts each DIE on a single line, it
indents slightly.

DavidAnderson








More information about the Dwarf-discuss mailing list