When running llvm-dwarfdump --verify Application.axf I get many "DIE address ranges are not contained in its parent's ranges" and "DIEs have overlapping address ranges" errors.
llvm-dwarfdump --verify Application.axf
DIE address ranges are not contained in its parent's ranges
DIEs have overlapping address ranges
The first one seems to be due to incomplete entries in the .debug_ranges section, e.g.:
.debug_ranges
error: DIE address ranges are not contained in its parent's ranges: 0x000ef369: DW_TAG_compile_unit DW_AT_producer ("Component: Arm Compiler for Embedded 6.18 Tool: armclang [5e4cc700]") DW_AT_language (DW_LANG_C_plus_plus_14) DW_AT_name ("foo.cpp") DW_AT_stmt_list (0x00019750) DW_AT_comp_dir ("/src") DW_AT_low_pc (0x0000000000000000) DW_AT_ranges (0x00006388 [0x00108764, 0x00108770) [0x001062fc, 0x001063c2)) 0x000f2545: DW_TAG_subprogram DW_AT_low_pc (0x0000000000107e28) DW_AT_high_pc (0x0000000000107e52) DW_AT_frame_base (DW_OP_reg13) DW_AT_GNU_all_call_sites (true) DW_AT_linkage_name ("_GLOBAL__sub_I_foo.cpp") DW_AT_artificial (true)
Also, there are many entries in .debug_ranges that only contain <End of list>.
<End of list>
The second error is due to many functions reported to be located at address 0:
error: DIEs have overlapping address ranges: 0x000f271e: DW_TAG_subprogram DW_AT_low_pc (0x0000000000000000) DW_AT_high_pc (0x0000000000000010) DW_AT_frame_base (DW_OP_reg13) DW_AT_GNU_all_call_sites (true) DW_AT_linkage_name ("_ZN4Edma15BarEj") DW_AT_name ("Bar") DW_AT_decl_file ("/src/bar.cpp") DW_AT_decl_line (114) DW_AT_type (0x000f7203 "bool") DW_AT_external (true) 0x000f2676: DW_TAG_subprogram DW_AT_low_pc (0x0000000000000000) DW_AT_high_pc (0x0000000000000022) DW_AT_frame_base (DW_OP_reg13) DW_AT_GNU_all_call_sites (true) DW_AT_abstract_origin (0x000f2698 "_ZN4SomethingEi")
I believe this is the reason that various implementations of the addr2line utility, GDB and LLDB cannot resolve the source code line numbers for certain addresses.
addr2line
Might this be a bug in Arm Compiler 6 or am I missing something?
Any help is highly appreciated.
Cheers,
Ezra