The DWARF spec says that a function's entry instruction is either marked by DW_AT_entry_pc or is the lowest address in the function. GCC likes to split up functions, so the old method of just checking for DW_AT_low_pc and DW_AT_high_pc wasn't finding all of them. This patch checks DW_AT_entry_pc for an explicit entry point, and falls back to iterating through the function ranges if it's missing. GCC also likes to separate a function's name and address range into different DIEs linked by DW_AT_abstract_origin, so we check that in addition to DW_AT_specification to match even more functions.
The DWARF spec says that a function's entry instruction is either marked by
DW_AT_entry_pc
or is the lowest address in the function. GCC likes to split up functions, so the old method of just checking forDW_AT_low_pc
andDW_AT_high_pc
wasn't finding all of them. This patch checksDW_AT_entry_pc
for an explicit entry point, and falls back to iterating through the function ranges if it's missing. GCC also likes to separate a function's name and address range into different DIEs linked byDW_AT_abstract_origin
, so we check that in addition toDW_AT_specification
to match even more functions.