rainers / cv2pdb

converter of DMD CodeView/DWARF debug information to PDB files
Artistic License 2.0
466 stars 110 forks source link

Label more functions #49

Closed Marc-Aldorasi-Imprivata closed 5 years ago

Marc-Aldorasi-Imprivata commented 5 years ago

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.