[Lldb-commits] [PATCH] D68655: Trust the arange accelerator tables in dSYMs

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 11 15:46:03 PST 2023


jasonmolenda added a comment.

In D68655#4045423 <https://reviews.llvm.org/D68655#4045423>, @clayborg wrote:

> There have also been some bugs in .debug_aranges and some folks want to get rid of .debug_aranges all together and rely only upon the DW_TAG_compile_unit's DW_AT_ranges. Tons of details in this patch:
>
> https://reviews.llvm.org/D136395
>
> So long story short, some people believe we should not produce or use .debug_aranges anymore, and want LLDB changed to ignore it.

I'm honestly curious how the DW_TAG_compile_unit's DW_AT_ranges (or DW_AT_high/low_pc) would be authoritative, but the ranges for the CU in debug_aranges would be incorrect.  If the linker is allowed to reorder functions (does this not happen on linux?), then the compiler can't know the address ranges of the CU, only the linker (or post-linker) can know what address ranges are owned by this compile unit.  So the linker had to create the DW_TAG_compile_unit's DW_AT_ranges list after linking is complete, and the linker is also the part of the toolchain that creates debug_aranges.  If it is creating an incorrect debug_aranges entry, how can it possibly do the correct thing when rewriting the DW_TAG_compile_unit's DW_AT_ranges?

On Darwin, we usually get a DW_AT_high/low_pc on the compile_unit in the .o files, where all of the functions are contiguous.  When dsymutil links the debug information into the dSYM, it includes the address ranges of every DW_TAG_subprogram that was included in the final executable in the debug_aranges.  It doesn't modify DW_AT_high/low_pc in the compile_unit, it merely updates the addresses to their linked addresses.  But lldb doesn't use those for anything - either it trusts the debug_aranges entries, or lldb scans all of the subprograms itself to construct the aranges (same thing dsymutil did).

tl;dr I don't see what using DW_AT_ranges in the compile_unit accomplishes versus debug_aranges.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68655/new/

https://reviews.llvm.org/D68655



More information about the lldb-commits mailing list