forked from OSchip/llvm-project
[lldb-vscode] Fix TestVSCode_module
For some reason this works on the original author's machine, but not on my. So I'm using a safer approach of using an unstripped dynamic library to place breakpoints on. The author was placing a breakpoint on the main symbol of a stripped library and for some reason it worked on their machine, but it shouldn't have... Offender diff: D82477
This commit is contained in:
parent
03ef61033f
commit
881af6eb00
|
@ -1,6 +1,8 @@
|
|||
DYLIB_NAME := foo
|
||||
DYLIB_CXX_SOURCES := foo.cpp
|
||||
CXX_SOURCES := main.cpp
|
||||
|
||||
all: a.out.stripped
|
||||
all: a.out.stripped
|
||||
|
||||
include Makefile.rules
|
||||
|
||||
|
@ -8,4 +10,4 @@ a.out.stripped: a.out.dSYM
|
|||
strip -o a.out.stripped a.out
|
||||
ifneq "$(CODESIGN)" ""
|
||||
$(CODESIGN) -fs - a.out.stripped
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -20,9 +20,7 @@ class TestVSCode_module(lldbvscode_testcase.VSCodeTestCaseBase):
|
|||
program_basename = "a.out.stripped"
|
||||
program= self.getBuildArtifact(program_basename)
|
||||
self.build_and_launch(program)
|
||||
source = "main.cpp"
|
||||
main_source_path = self.getSourcePath(source)
|
||||
functions = ['main']
|
||||
functions = ['foo']
|
||||
breakpoint_ids = self.set_function_breakpoints(functions)
|
||||
self.assertEquals(len(breakpoint_ids), len(functions),
|
||||
'expect one breakpoint')
|
||||
|
@ -37,7 +35,7 @@ class TestVSCode_module(lldbvscode_testcase.VSCodeTestCaseBase):
|
|||
self.assertTrue('symbolFilePath' not in program_module, 'Make sure a.out.stripped has no debug info')
|
||||
self.assertEqual('Symbols not found.', program_module['symbolStatus'])
|
||||
symbol_path = self.getBuildArtifact("a.out")
|
||||
response = self.vscode.request_evaluate('`%s' % ('target symbols add -s "%s" "%s"' % (program, symbol_path)))
|
||||
self.vscode.request_evaluate('`%s' % ('target symbols add -s "%s" "%s"' % (program, symbol_path)))
|
||||
active_modules = self.vscode.get_active_modules()
|
||||
program_module = active_modules[program_basename]
|
||||
self.assertEqual(program_basename, program_module['name'])
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
int foo() {
|
||||
return 12;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
int foo();
|
|
@ -1,3 +1,6 @@
|
|||
#include "foo.h"
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
foo();
|
||||
return 0; // breakpoint 1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue