diff options
author | Tamas Berghammer <tberghammer@google.com> | 2016-03-04 11:26:44 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2016-03-04 11:26:44 +0000 |
commit | b0b1ea36e748ab9037521ab94a002759060a0fdf (patch) | |
tree | 8d81ea2b848d355a30a03c6f7b10dae91ed1df5c /lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py | |
parent | b4b90fb8d64300add9d1bad696b27275453eb40b (diff) | |
download | bcm5719-llvm-b0b1ea36e748ab9037521ab94a002759060a0fdf.tar.gz bcm5719-llvm-b0b1ea36e748ab9037521ab94a002759060a0fdf.zip |
Add reverse file remapping for breakpoint set
LLDB can remap a source file to a new directory based on the
"target.sorce-map" to handle the usecase when the source code moved
between the compliation and the debugging. Previously the remapping
was only used to display the content of the file. This CL fixes the
scenario when a breakpoint is set based on the new an absolute path
with adding an inverse remapping step before looking up the breakpoint
location.
Differential revision: http://reviews.llvm.org/D17848
llvm-svn: 262711
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py b/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py index 1a59fe46e90..b4bffaf6863 100644 --- a/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py +++ b/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py @@ -170,3 +170,21 @@ class SourceManagerTestCase(TestBase): # Display the source code again. We should see the updated line. self.expect("source list -f main.c -l %d" % self.line, SOURCE_DISPLAYED_CORRECTLY, substrs = ['Hello lldb']) + + def test_set_breakpoint_with_absloute_path(self): + self.build() + self.runCmd("settings set target.source-map %s %s" % (os.getcwd(), os.path.join(os.getcwd(), "hidden"))) + + exe = os.path.join(os.getcwd(), "a.out") + main = os.path.join(os.getcwd(), "hidden", "main.c") + self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + + lldbutil.run_break_set_by_file_and_line (self, main, self.line, num_expected_locations=1, loc_exact=False) + + self.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'main.c:%d' % self.line, + 'stop reason = breakpoint']) |