1 """Test that forward declarations don't cause bogus conflicts in namespaced types"""
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test.decorators import *
9 import lldbsuite.test.lldbutil as lldbutil
12 class NamespaceDefinitionsTestCase(TestBase):
14 mydir = TestBase.compute_mydir(__file__)
17 bugnumber="llvm.org/pr28948",
23 bugnumber="llvm.org/pr28948",
24 oslist=['linux'], compiler="gcc", archs=['arm','aarch64'])
25 @expectedFailureAll(oslist=["windows"])
26 @expectedFailureNetBSD
32 "expression -- Foo::MyClass()",
33 VARIABLES_DISPLAYED_CORRECTLY,
37 # Call super's setUp().
39 # Find the line number to break inside main().
40 self.source = 'main.cpp'
41 self.line = line_number(self.source, '// Set breakpoint here')
42 self.shlib_names = ["a", "b"]
44 def common_setup(self):
45 # Run in synchronous mode
46 self.dbg.SetAsync(False)
48 # Create a target by the debugger.
49 target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
50 self.assertTrue(target, VALID_TARGET)
52 # Break inside the foo function which takes a bar_ptr argument.
53 lldbutil.run_break_set_by_file_and_line(
54 self, self.source, self.line, num_expected_locations=1, loc_exact=True)
56 # Register our shared libraries for remote targets so they get
57 # automatically uploaded
58 environment = self.registerSharedLibrariesWithTarget(
59 target, self.shlib_names)
61 # Now launch the process, and do not stop at entry point.
62 process = target.LaunchSimple(
63 None, environment, self.get_process_working_directory())
64 self.assertTrue(process, PROCESS_IS_VALID)
66 # The stop reason of the thread should be breakpoint.
67 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
69 'stop reason = breakpoint'])
71 # The breakpoint should have a hit count of 1.
72 self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
73 substrs=[' resolved, hit count = 1'])