[PATCH] D137139: [DWARF] Fix handling of .debug_aranges with -g1
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 27 15:15:59 PST 2023
dblaikie added a comment.
In D137139#4087260 <https://reviews.llvm.org/D137139#4087260>, @clayborg wrote:
> In D137139#4084505 <https://reviews.llvm.org/D137139#4084505>, @dblaikie wrote:
>
>> In D137139#4084468 <https://reviews.llvm.org/D137139#4084468>, @clayborg wrote:
>>
>>> If the only time clang is not emitting .debug_aranges correctly is when we use -g1, then fixing that issue (by either fixing or removing .debug_arnages) would be fine by me. That being said, we have a clang that has been producing bad .debug_aranges, so unless we fix LLDB it won't fix the issue for binaries already out in the wild.
>>
>> What sort of fix for LLDB are you picturing? One way to fix LLDB would be to teach it to ignore .debug_aranges - which would hurt perf on inputs with correct .debug_aranges but no CU ranges, but we don't seem to have anyone clamouring for support for that scenario.
>
> If I did a fix I would:
>
> - use CU ranges always if they are available
> - fall back to .debug_aranges if there
> - do expensive manual parsing for ranges
That still doesn't address the existing broken aranges though, yeah? So to make LLDB robust to existing debug info, the only correct thing would be to ignore aranges - and we don't have any known examples where this hurts performance anyway (no known aranges-but-no-cu-ranges emitters), so seems like a pretty painless thing to do?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137139/new/
https://reviews.llvm.org/D137139
More information about the llvm-commits
mailing list