1 """Test that the 'add-dsym', aka 'target symbols add', succeeds in the middle of debug session."""
3 from __future__ import print_function
10 from lldbsuite.test.decorators import *
11 from lldbsuite.test.lldbtest import *
12 from lldbsuite.test import lldbutil
16 class AddDsymMidExecutionCommandCase(TestBase):
18 mydir = TestBase.compute_mydir(__file__)
21 # Call super's setUp().
23 self.source = 'main.c'
25 @no_debug_info_test # Prevent the genaration of the dwarf version of this test
26 def test_add_dsym_mid_execution(self):
27 """Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
28 self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
29 exe = self.getBuildArtifact("a.out")
31 self.target = self.dbg.CreateTarget(exe)
32 self.assertTrue(self.target, VALID_TARGET)
34 main_bp = self.target.BreakpointCreateByName("main", "a.out")
35 self.assertTrue(main_bp, VALID_BREAKPOINT)
37 self.runCmd("settings set target.disable-aslr false")
38 self.process = self.target.LaunchSimple(
39 None, None, self.get_process_working_directory())
40 self.assertTrue(self.process, PROCESS_IS_VALID)
42 # The stop reason of the thread should be breakpoint.
43 self.assertTrue(self.process.GetState() == lldb.eStateStopped,
44 STOPPED_DUE_TO_BREAKPOINT)
46 self.runCmd("add-dsym " +
47 self.getBuildArtifact("hide.app/Contents/a.out.dSYM"))
49 self.expect("frame select",
50 substrs=['a.out`main at main.c'])