This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix emission of empty debug_names for Apple
ClosedPublic

Authored by fdeazeve on Jun 19 2023, 7:11 AM.

Details

Summary

D118754 added a new DICompileUnit::DebugNameTableKind for "Apple", so that,
under DWARF 5, the following combination is used inside DwarfDebug.cpp:

(lldb) p getAccelTableKind()
(llvm::AccelTableKind) $6 = Dwarf
(lldb) p CU.getNameTableKind()
(llvm::DICompileUnit::DebugNameTableKind) $7 = Apple

This creates a problem in the if statements changed, whereby "for non Apple
AccelTableKind" we emit empty tables for any DebugNameTableKind that is not
"Default". We should consider the newly added kind here too.

Note that our existing test could have caught this, if only it had checked the
_contents_ of the table, instead of only checking for the existence of the
section.

Diff Detail

Event Timeline

fdeazeve created this revision.Jun 19 2023, 7:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 7:11 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fdeazeve requested review of this revision.Jun 19 2023, 7:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 7:11 AM
fdeazeve updated this revision to Diff 532677.Jun 19 2023, 8:35 AM

Trying to add context to the review

aprantl accepted this revision.Jun 19 2023, 9:05 AM
This revision is now accepted and ready to land.Jun 19 2023, 9:05 AM
JDevlieghere accepted this revision.Jun 20 2023, 11:10 AM

LGTM. Thanks!

This revision was automatically updated to reflect the committed changes.