Merge pull request #17665 from allevato/debug-prefix-map-wip #18215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Note: This is my first release branch cherry-pick PR, so I hope I've done this correctly. As with the response file PRs that were previously merged into 4.2, this would unblock and greatly improve the user experience for many of our Swift developers if it's not too late to get into this release. Thanks!]
Explanation: Add the
-debug-prefix-map
flag to remap paths in debug info.Scope: This is the Swift implementation of the corresponding Clang
-fdebug-prefix-map
, which allows users to remap absolute paths in debug info to different (perhaps relative) paths that can be used verbatim or reverse-mapped by LLDB. This makes such builds reproducible and, more importantly, makes it possible for users to debug Swift binaries that have been built remotely on machines whose directory layout does not match that on their local machine.SR Issue: SR-5694
Risk: I believe it to be low. There is a minor behavioral change w.r.t. debug info generation even when the flag is not in use (details) but I do not anticipate any regressions (see Testing below).
Testing: The existing LLDB tests run during the PR cycle verify that the change did not cause regressions for existing debugging scenarios (i.e., where the
-debug-prefix-map
flag is not used). I have manually tested some scenarios debugging an executable built using the flag and am working on a follow-up PR to swift-lldb to add a test to cover this.Reviewers: @jrose-apple and @dcci (Implement -debug-prefix-map flag. #17665).