All the following was obtained via dwarfdump.
I have the following DIE (one of many showing the call to inline function foo):
0x0004076c: DW_TAG_inlined_subroutine
DW_AT_ranges (0x00002730
[0x0000000000a5cda7, 0x0000000000a5cdb0)
[0x0000000000a5cdb5, 0x0000000000a5ce50))
DW_AT_abstract_origin (0x00040817 "foo")
DW_AT_call_line (154)
DW_AT_call_column (0x09)
DW_AT_call_file ("file.C")
So this is telling me that function foo
was called in file.C at line 154, which is correct. There are 2 entries for foo
(not sure why one is inline and the other isn't). They are:
0x00040817: DW_TAG_subprogram
DW_AT_decl_line (172)
DW_AT_decl_file ("file.C")
DW_AT_declaration (0x01)
DW_AT_name ("foo")
DW_AT_MIPS_linkage_name ("foo")
DW_AT_external (0x01)
DW_AT_inline (DW_INL_declared_inlined)
and
0x00040deb: DW_TAG_subprogram
DW_AT_decl_line (172)
DW_AT_decl_file ("file.C")
DW_AT_declaration (0x01)
DW_AT_MIPS_linkage_name ("foo")
DW_AT_name ("foo")
DW_AT_external (0x01)
And indeed foo
is defined in file.C
at line 172. The first line of this function is 174. If I look in the debug_line section (via objdump --dwarf=decodedline) and grep for line 174, I get the following:
file.C 174 0x4ffaf7
file.C 174 0x4ffbb7
file.C 174 0x4ffc77
file.C 174 0x1fa72f7
file.C 174 0x1fa73b7
file.C 174 0x1fa7477
file.C 174 0xa04897
file.C 174 0xa04957
file.C 174 0xa04a17
file.C 174 0x52e6d7
file.C 174 0x52e797
file.C 174 0x52e857
I would have expected to see at least one of those addresses in the the ranges value. I'm not sure what is wrong if there is some additional arithmetic I have to do to make this make sense. Any help would be appreciated.