Page MenuHomePhabricator

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

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



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

"only_if_exists" be a better name for "check_filesystem"


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


"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.