[PATCH] D118754: [DebugInfo] Always emit `.debug_names` with dwarf 5 for Apple platforms

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 4 15:29:52 PST 2022


JDevlieghere added a comment.

In D118754#3297482 <https://reviews.llvm.org/D118754#3297482>, @dblaikie wrote:

> In D118754#3294987 <https://reviews.llvm.org/D118754#3294987>, @JDevlieghere wrote:
>
>> In D118754#3294781 <https://reviews.llvm.org/D118754#3294781>, @dblaikie wrote:
>>
>>> Rather than having to change the LLVM code in this patch - what if the frontend change in CGDebugInfo.cpp hardcoded Apple for MachO < DWARFv5, and Default for MachO >= DWARFv5? I don't mind /too/ much either way, but that seems like it'd be more accurately expressive in the IR as to what's going on. Remove the Apple special case, etc.
>>>
>>> Oh, hmm, Apple isn't a kind at the moment at all? How is this encoded today - no name table kind is specified (None) for Apple, and the backend overrides and produces the apple accelerator tables? Except in DWARFv5 where the apple names are disabled and the DWARFv5 names are meant to be enabled but aren't because the nameTableKind is still None?
>>
>> Exactly!
>
> OK - then maybe this is a backend only change? You've pointed to the code that opts debug_names out if NameTableKind is not Default, but could you point to the code where the apple names /aren't/ emitted in DWARFv5? Perhaps it's just that that change is missing the symmetric change to always emit debug_names?

In the frontend, NameTableKind is only set to "Default" if you enable pubnames. In the backend, dwarf debug names are only emitted if NameTableKind is set to "Default".  Also in the backend, on an Apple platform, we emit Apple accelerator tables with <DWARFv4 and debug names with >=DWARFv5.

So on an Apple platform, regardless of the dwarf version, if you don't pass pubnames, we set NameTableKind to None in the frontend. If we're compiling with DWARFv4, then we emit the Apple accelerator tables unconditionally, without checking the NameTableKind. If we're compiling with DWARFv5, then in the backend we correctly decide to emit the debug name accelerator tables, but the debug names implementation does check the NameTableKind. It skips every CU that has NameTableKind set to anything different than "Default" and we end up without any accelerator tables at all.


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

https://reviews.llvm.org/D118754



More information about the llvm-commits mailing list