diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
4 files changed, 21 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/main.c b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/main.c index 556bda3c17d..41a6a46c926 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/main.c +++ b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/main.c @@ -1,8 +1,8 @@ -void stop() {} +void relative(); int main() { - stop(); - // Hello World! + relative(); + // Hello Absolute! return 0; } diff --git a/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/relative.c b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/relative.c new file mode 100644 index 00000000000..02331834cf2 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/relative.c @@ -0,0 +1,5 @@ +void stop() {} +void relative() { + stop(); + // Hello Relative! +} diff --git a/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Makefile b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Makefile index f36a8dc1e67..8c82c73b13f 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Makefile +++ b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Makefile @@ -1,5 +1,10 @@ BOTDIR = $(BUILDDIR)/buildbot USERDIR = $(BUILDDIR)/user C_SOURCES = $(BOTDIR)/main.c +LD_EXTRAS = $(BOTDIR)/relative.o include Makefile.rules + +$(EXE): relative.o +relative.o: $(BOTDIR)/relative.c + cd $(BOTDIR) && $(CC) -c $(CFLAGS) -o $@ relative.c diff --git a/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/TestDSYMSourcePathRemapping.py b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/TestDSYMSourcePathRemapping.py index d13a0474867..2ee37915039 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/TestDSYMSourcePathRemapping.py +++ b/lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/TestDSYMSourcePathRemapping.py @@ -17,7 +17,7 @@ class TestDSYMSourcePathRemapping(lldbtest.TestBase): lldbutil.mkdir_p(botdir) lldbutil.mkdir_p(userdir) import shutil - for f in ['main.c']: + for f in ['main.c', 'relative.c']: shutil.copyfile(os.path.join(inputs, f), os.path.join(botdir, f)) shutil.copyfile(os.path.join(inputs, f), os.path.join(userdir, f)) @@ -52,5 +52,10 @@ class TestDSYMSourcePathRemapping(lldbtest.TestBase): @skipIf(debug_info=no_match("dsym")) def test(self): self.build() - lldbutil.run_to_name_breakpoint(self, 'main') - self.expect("source list", substrs=["Hello World"]) + + target, process, _, _ = lldbutil.run_to_name_breakpoint( + self, 'main') + self.expect("source list -n main", substrs=["Hello Absolute"]) + bkpt = target.BreakpointCreateByName('relative') + lldbutil.continue_to_breakpoint(process, bkpt) + self.expect("source list -n relative", substrs=["Hello Relative"]) |