llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.69k stars 11.87k forks source link

llvm-dwarfdump: CU base IP sometimes not added to rangelist offsets #56342

Open sevaa opened 2 years ago

sevaa commented 2 years ago

Consider the binary in #56339 . Run the following:

llvm-dwarfdump-11 --debug-rnglists --verbose dwarf_v5ops.so.elf

Normally, in the verbose output the first pair of values for a rangelist entry displays the untranslated offsets, as seen in the entry, and the second pair displays the actual PC values in a loaded binary. For DW_RLE_offset_pair type entries like the ones in my binary, the translation involves adding the base PC of the compile unit, as seen in the top DIE's DW_AT_low_pc attribute.

Notice the contents of the last CU's rangelists, the one that starts at 0x000105e9 in debug_rnglists. In that CU, the first and the second pair of values are identical thoughout, as if the tool fails to find the corresponding CU and/or its DW_AT_low_pc. Meanwhile, the CU is perfectly present at offset 0x6b7b9 in debug_info, and the DIE at 0x6cfac contains the DW_AT_ranges with value 0x105f5, which points right at the first rangelist in this CU's block.

The top DIE in said CU contains DW_AT_low_pc with value 0x4b040.

llvmbot commented 2 years ago

@llvm/issue-subscribers-tools-llvm-dwarfdump

EugeneZelenko commented 2 years ago

Could you please try main? 11 is very old version.

sevaa commented 2 years ago

Still an issue in main.