Fix a bug in "target.source-map" where we would resolve unmapped paths incorrectly
authorGreg Clayton <gclayton@apple.com>
Thu, 15 Mar 2018 05:13:15 +0000 (05:13 +0000)
committerGreg Clayton <gclayton@apple.com>
Thu, 15 Mar 2018 05:13:15 +0000 (05:13 +0000)
commit9cc222c80de913d62b8a8d16c1c1dcc9665febb0
tree7f99b7208fdc153cf0880f88faef883281b344e3
parent1f8da3ae19fa91780218e6c6430aba52ef429936
Fix a bug in "target.source-map" where we would resolve unmapped paths incorrectly

When using:

(lldb) settings set target.source-map ./ /path/to/source
LLDB would fail to set a source file and line breakpoint with:

(lldb) breakpoint set --file /path/to/source/main.c --line 2
Because code in the target was undoing the remapping of "/path/to/source/main.c" to "./main.c" and then it would resolve this path, which would append the current working directory to the path. We don't want to resolve paths that we unmap.

Test case added.

Differential Revision: https://reviews.llvm.org/D44502

llvm-svn: 327600
lldb/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/functionalities/source-map/a.yaml [new file with mode: 0644]
lldb/source/Target/Target.cpp