This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Use LLVM's implementation of AppleTables for apple_debug_types
ClosedPublic

Authored by fdeazeve on Jun 27 2023, 5:55 AM.

Details

Summary

This commit is replacing really old LLDB code, and we've found some odd
behavior while doing this replacement. While the changes here are largely NFC,
there are some subtle changes that fix such odd behavior.

The most curious example of this is the method FindCompleteObjCClassName,
which has a flag must_be_implementation. This flag was _only_ being respected
for accelerator tables containing the atom type_flags, which seems
counter-intuitive. The implementation for DWARF 5 tables does not do that and
neither does the code introduced in this patch.

There were other weird cases, for example, we found boolean logic that was
always true in a code path: look for a if !has_qualified_name... deleted
line; that condition was true by simple if/else analysis.

Diff Detail

Event Timeline

fdeazeve created this revision.Jun 27 2023, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 5:55 AM
Herald added a subscriber: arphaman. · View Herald Transcript
fdeazeve requested review of this revision.Jun 27 2023, 5:55 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 27 2023, 5:55 AM
JDevlieghere accepted this revision.Jun 27 2023, 11:39 AM

LGTM

lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
225

I assume we always have at least one entry (or that's the assumption here). I was going to suggest adding an assert here but then I looked at the lldb_private::DWARFDeclContext::operator[] implementation and I think the assert should probably go there. That's orthogonal to this patch though.

246–251

Reflow.

This revision is now accepted and ready to land.Jun 27 2023, 11:39 AM
JDevlieghere added inline comments.
lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
225
fdeazeve added inline comments.Jun 27 2023, 3:32 PM
lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
225

I assume we always have at least one entry (or that's the assumption here).

I believe so. We had this assumption previously, so I didn't want to change that in this already tricky patch

This revision was landed with ongoing or failed builds.Jun 28 2023, 6:19 AM
This revision was automatically updated to reflect the committed changes.