[Dwarf-Discuss] DW_AT_specification chains

Marcel Mettes marcelm at altium.nl
Thu Apr 24 08:10:17 PDT 2008


Thanks for all replies, I do have an improved understanding of the matter.

As request here a real example, this time with a C++ class member 
function instead of a variable.

This is the output of our prototype C++ tool-chain. We are kind-of 
forced to split the debug info into multiple compilation units due to 
using multiple independent tools in the tool-chain to perform the 
complete compilation process.

Best regards,
Marcel
-----------------------------------------------
Concerns the debug info for the method "extra_class_method"

class A
{
public:
       A() {}

       int intra_class_method(void) { return 1; }
       int extra_class_method(void);
       virtual int virtual_intra_class_method(void) { return 3; }
};

int A::extra_class_method(void)
{ return 2; }


Snippets of debug info:

===============================================================
0x11 DW_TAG_compile_unit
offset 0x1826
abbrev ID 0x1
      0x03 DW_AT_name                    0x08 DW_FORM_string   : 
"method1.cpp"
      0x25 DW_AT_producer                0x08 DW_FORM_string   : 
"TASKING ARM VIPER C++ compiler (debug)"
      0x1B DW_AT_comp_dir                0x08 DW_FORM_string   : 
"/usr/src/arm/usr/marcelm/cpp/symtab-work/"
      0x13 DW_AT_language                0x0F DW_FORM_udata    : 0x4
                 DW_LANG_C_plus_plus
      0x55 DW_AT_ranges                  0x06 DW_FORM_data4    : 0x90
             base address: 0x00000000
             start offset: 0xFFFFFFFF
             end offset  : 0x00001614
             new base adr: 0x00001614
             start offset: 0x00000000 (abs: 0x00001614)
             end offset  : 0x00000008 (abs: 0x0000161C)
             start offset: 0x00000000
             end offset  : 0x00000000
      0x10 DW_AT_stmt_list               0x06 DW_FORM_data4    : 0x32D
...
+ 0x2E DW_TAG_subprogram
| offset 0x1893
| abbrev ID 0x3
|        0x47 DW_AT_specification           0x10 DW_FORM_ref_addr : 0x30DE
|        0x36 DW_AT_calling_convention      0x0F DW_FORM_udata    : 0x1
|                   DW_CC_normal
|        0x11 DW_AT_low_pc                  0x01 DW_FORM_addr     : 0x1614
|        0x12 DW_AT_high_pc                 0x01 DW_FORM_addr     : 0x161C
|        0x40 DW_AT_frame_base              0x06 DW_FORM_data4    : 0x1AD
|               base address: 0x00000000
|               start offset: 0xFFFFFFFF
|               end offset  : 0x00001614
|               new base adr: 0x00001614
|               start offset: 0x00000000 (abs: 0x00001614)
|               end offset  : 0x00000008 (abs: 0x0000161C)
|                   length=0x0002
|                   0x7D DW_OP_breg13  0
|               ------------------------
|               base address: 0x00001614
|               start offset: 0x00000000
|               end offset  : 0x00000000
|
...

===============================================================
0x11 DW_TAG_compile_unit
offset 0x2E4B
abbrev ID 0x1
      0x03 DW_AT_name                    0x08 DW_FORM_string   : 
"method1.cpp"
      0x1B DW_AT_comp_dir                0x08 DW_FORM_string   : 
"/usr/src/arm/usr/marcelm/cpp/symtab-work"
      0x25 DW_AT_producer                0x08 DW_FORM_string   : 
"TASKING ARM VIPER C++ compiler (debug)"
      0x13 DW_AT_language                0x0F DW_FORM_udata    : 0x4
                 DW_LANG_C_plus_plus
    0x2300 DW_AT_ALTIUM_loclist          0x0C DW_FORM_flag     : 1
      0x10 DW_AT_stmt_list               0x06 DW_FORM_data4    : 0x3AD

+ 0x02 DW_TAG_class_type
| offset 0x2FEB
| abbrev ID 0xF
|        0x03 DW_AT_name                    0x08 DW_FORM_string   : "A"
|        0x0B DW_AT_byte_size               0x0F DW_FORM_udata    : 0x4
|        0x3A DW_AT_decl_file               0x0F DW_FORM_udata    : 0x2
|        0x3B DW_AT_decl_line               0x0F DW_FORM_udata    : 0x5
|        0x39 DW_AT_decl_column             0x0F DW_FORM_udata    : 0x7
|
| + 0x2E DW_TAG_subprogram
| | offset 0x3039
| | abbrev ID 0x13
| |        0x03 DW_AT_name                    0x08 DW_FORM_string   : 
"extra_class_method"
| |        0x49 DW_AT_type                    0x13 DW_FORM_ref4     : 
0x2EE3
| |        0x27 DW_AT_prototyped              0x0C DW_FORM_flag     : 1
| |        0x32 DW_AT_accessibility           0x0F DW_FORM_udata    : 0x1
| |                   DW_ACCESS_public
| |        0x3F DW_AT_external                0x0C DW_FORM_flag     : 1
| |        0x3A DW_AT_decl_file               0x0F DW_FORM_udata    : 0x2
| |        0x3B DW_AT_decl_line               0x0F DW_FORM_udata    : 0xB
| |        0x39 DW_AT_decl_column             0x0F DW_FORM_udata    : 0x6
| |        0x3C DW_AT_declaration             0x0C DW_FORM_flag     : 1
| |
...
|
+ 0x2E DW_TAG_subprogram
| offset 0x30DE
| abbrev ID 0x16
|        0x47 DW_AT_specification           0x13 DW_FORM_ref4     : 0x3039

===============================================================





More information about the Dwarf-Discuss mailing list