This is an archive of the discontinued LLVM Phabricator instance.

[source maps] fix source mapping when there are multiple matching rules
ClosedPublic

Authored by wallace on Jul 23 2021, 4:23 PM.

Details

Summary

D104406 introduced an error in which, if there are multiple matchings rules for a given path, lldb was only checking for the validity in the filesystem of the first match instead of looking exhaustively one by one until a valid file is found.

Besides that, a call to consume_front was being done incorrectly, as it was modifying the input, which renders subsequent matches incorrect.

I added a test that checks for both cases.

Diff Detail

Event Timeline

wallace requested review of this revision.Jul 23 2021, 4:23 PM
wallace created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2021, 4:23 PM
wallace updated this revision to Diff 361388.Jul 23 2021, 5:36 PM
wallace edited the summary of this revision. (Show Details)

Fixed another bug and added tests

clayborg added inline comments.Jul 23 2021, 5:44 PM
lldb/include/lldb/Target/PathMappingList.h
75

"only_if_exists" be a better name for "check_filesystem"

lldb/source/Target/PathMappingList.cpp
167–168

Would "only_if_exists" be a better name for "check_filesystem"?

220–221

"only_if_exists" be a better name for "check_filesystem

As a note, the test is an lldb-vscode test, because I already have a set up for source maps in this kind of scenario, from breakpoints to frames, so it was easy.

wallace updated this revision to Diff 361389.Jul 23 2021, 5:48 PM

improve the variable name

clayborg accepted this revision.Jul 23 2021, 5:50 PM
This revision is now accepted and ready to land.Jul 23 2021, 5:50 PM
This revision was landed with ongoing or failed builds.Jul 23 2021, 5:53 PM
This revision was automatically updated to reflect the committed changes.