1 """Test that a forward-declared class works when its complete definition is in a library"""
3 from __future__ import print_function
9 from lldbsuite.test.lldbtest import *
10 import lldbsuite.test.lldbutil as lldbutil
12 class ForwardDeclTestCase(TestBase):
14 mydir = TestBase.compute_mydir(__file__)
17 # Call super's setUp().
19 # Find the line number to break inside main().
20 self.source = 'main.m'
21 self.line = line_number(self.source, '// Set breakpoint 0 here.')
22 self.shlib_names = ["Container"]
28 # Create a target by the debugger.
29 target = self.dbg.CreateTarget("a.out")
30 self.assertTrue(target, VALID_TARGET)
32 # Create the breakpoint inside function 'main'.
33 breakpoint = target.BreakpointCreateByLocation(self.source, self.line)
34 self.assertTrue(breakpoint, VALID_BREAKPOINT)
36 # Register our shared libraries for remote targets so they get automatically uploaded
37 environment = self.registerSharedLibrariesWithTarget(target, self.shlib_names)
39 # Now launch the process, and do not stop at entry point.
40 process = target.LaunchSimple (None, environment, self.get_process_working_directory())
41 self.assertTrue(process, PROCESS_IS_VALID)
43 # The stop reason of the thread should be breakpoint.
44 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
46 'stop reason = breakpoint'])
48 # The breakpoint should have a hit count of 1.
49 self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
50 substrs = [' resolved, hit count = 1'])
52 # This should display correctly.
53 self.expect("expression [j getMember]", VARIABLES_DISPLAYED_CORRECTLY,