This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCI] Use llvm's libDebugInfo for DebugRanges
ClosedPublic

Authored by fdeazeve on May 11 2023, 7:13 AM.

Details

Reviewers
JDevlieghere
Group Reviewers
Restricted Project
Commits
rG70aad4ec90f2: [lldb][NFCI] Use llvm's libDebugInfo for DebugRanges
Summary

In an effort to unify the different dwarf parsers available in the codebase,
this commit removes LLDB's custom parsing for the .debug_ranges DWARF section,
instead calling into LLVM's parser.

Subsequent work should look into unifying llvm::DWARDebugRangeList (whose
entries are pairs of (start, end) addresses) with lldb::DWARFRangeList (whose
entries are pairs of (start, length)). The lists themselves are also different
data structures, but functionally equivalent.

Depends on D150363

Diff Detail

Event Timeline

fdeazeve created this revision.May 11 2023, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 7:13 AM
fdeazeve requested review of this revision.May 11 2023, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 7:13 AM
fdeazeve added a reviewer: Restricted Project.May 11 2023, 7:14 AM

Ok, this looks like it's doing the same thing to me which is good. My understanding of this change is that you're changing lldb::DWARFDebugRanges::Extract to use llvm::DWARFDebugRangeList instead of lldb::DWARFRangeList.

Out of curiosity, do you have an idea of the change to performance (if any)? I wouldn't expect it to be very different if at all because I don't think the algorithms between lldb and llvm are different but it would be nice to make sure.

Ok, this looks like it's doing the same thing to me which is good. My understanding of this change is that you're changing lldb::DWARFDebugRanges::Extract to use llvm::DWARFDebugRangeList instead of lldb::DWARFRangeList.

Out of curiosity, do you have an idea of the change to performance (if any)? I wouldn't expect it to be very different if at all because I don't think the algorithms between lldb and llvm are different but it would be nice to make sure.

I ran an experiment with a C++ project that forced LLDB to parse roughly 30,000 range entries and no significant differences were detected:

// LLDB's implementation
 Time (mean ± σ):     695.2 ms ±   7.9 ms    [User: 157.8 ms, System: 69.0 ms]
 Range (min … max):   678.7 ms … 703.1 ms    10 runs
// LLVM's implementation
 Time (mean ± σ):     694.9 ms ±   9.7 ms    [User: 158.8 ms, System: 70.5 ms]
 Range (min … max):   675.2 ms … 711.7 ms    10 runs
This revision is now accepted and ready to land.May 15 2023, 11:59 AM
This revision was automatically updated to reflect the committed changes.