From b0b1ea36e748ab9037521ab94a002759060a0fdf Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Fri, 4 Mar 2016 11:26:44 +0000 Subject: 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 --- .../lldbsuite/test/source-manager/TestSourceManager.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py') 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']) -- cgit v1.2.3