var.SetPreferSyntheticValue(True)
return var
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @add_test_categories(["libc++"])
def test(self):
"""Test that std::function as defined by libc++ is correctly printed by LLDB"""
self.build()
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
TestBase.setUp(self)
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that libc++ iterators format properly."""
self.build()
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
-
self.expect('frame variable ivI', substrs=['item = 3'])
self.expect('expr ivI', substrs=['item = 3'])
mydir = TestBase.compute_mydir(__file__)
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
- @add_test_categories(["pyapi"])
+ @add_test_categories(["libc++"])
+ @expectedFailureAndroid(bugnumber="llvm.org/pr32592")
@skipIfDarwin # rdar://25499635
def test_with_run_command(self):
self.build()
# Run the program, it should stop at breakpoint 1.
process = target.LaunchSimple(
None, None, self.get_process_working_directory())
- lldbutil.skip_if_library_missing(
- self, target, lldbutil.PrintableRegex("libc\+\+"))
self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
self.assertEqual(
len(lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)), 1)
mydir = TestBase.compute_mydir(__file__)
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ def setUp(self):
+ TestBase.setUp(self)
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
+
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
-
+ ns = self.namespace
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=['%s::map' % ns,
+ 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=2',
+ substrs=['%s::map' % ns, 'size=2',
'[0] = ',
'first = 0',
'second = 0',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[2] = ',
'first = 2',
'second = 0',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
- substrs=['size=8',
+ substrs=['%s::map' % ns, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
'second = 1'])
self.expect("p ii",
- substrs=['size=8',
+ substrs=['%s::map' % ns, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
self.runCmd("continue")
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
self.runCmd("continue")
self.expect('frame variable si',
- substrs=['size=1',
+ substrs=['%s::map' % ns, 'size=1',
'[0] = ',
'first = \"zero\"',
'second = 0'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
'second = 3'])
self.expect("p si",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
'first = 3'])
self.expect("p is",
- substrs=['size=4',
+ substrs=['%s::map' % ns, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
- substrs=['size=3',
+ substrs=['%s::map' % ns, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
'first = \"gatto\"'])
self.expect("p ss",
- substrs=['size=3',
+ substrs=['%s::map' % ns, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=['%s::map' % ns, 'size=0',
'{}'])
mydir = TestBase.compute_mydir(__file__)
- @skipIfWindows # libc++ not ported to Windows yet
- @skipIf(compiler="gcc")
+ def setUp(self):
+ TestBase.setUp(self)
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
+
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
-
+ multimap = self.namespace + "::multimap"
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=2',
+ substrs=[multimap, 'size=2',
'[0] = ',
'first = 0',
'second = 0',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[2] = ',
'first = 2',
'second = 0',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii",
- substrs=['size=8',
+ substrs=[multimap, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
'second = 1'])
self.expect("p ii",
- substrs=['size=8',
+ substrs=[multimap, 'size=8',
'[5] = ',
'first = 5',
'second = 0',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ii',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
- substrs=['size=1',
+ substrs=[multimap, 'size=1',
'[0] = ',
'first = \"zero\"',
'second = 0'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable si",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
'second = 3'])
self.expect("p si",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'first = \"zero\"',
'second = 0',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable si',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable is",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
'first = 3'])
self.expect("p is",
- substrs=['size=4',
+ substrs=[multimap, 'size=4',
'[0] = ',
'second = \"goofy\"',
'first = 85',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable is',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ss",
- substrs=['size=3',
+ substrs=[multimap, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
'first = \"gatto\"'])
self.expect("p ss",
- substrs=['size=3',
+ substrs=[multimap, 'size=3',
'[0] = ',
'second = \"hello\"',
'first = \"ciao\"',
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect('frame variable ss',
- substrs=['size=0',
+ substrs=[multimap, 'size=0',
'{}'])
mydir = TestBase.compute_mydir(__file__)
- @skipIf(compiler="gcc")
- @skipIfWindows # libc++ not ported to Windows yet
+ def setUp(self):
+ TestBase.setUp(self)
+ ns = 'ndk' if lldbplatformutil.target_is_android() else ''
+ self.namespace = 'std::__' + ns + '1'
+
+ def getVariableType(self, name):
+ var = self.frame().FindVariable(name)
+ self.assertTrue(var.IsValid())
+ return var.GetType().GetCanonicalType().GetName()
+
+ @add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
self.runCmd("run", RUN_SUCCEEDED)
- lldbutil.skip_if_library_missing(
- self, self.target(), lldbutil.PrintableRegex("libc\+\+"))
-
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.expect('image list', substrs=self.getLibcPlusPlusLibs())
+ ii_type = self.getVariableType("ii")
+ self.assertTrue(ii_type.startswith(self.namespace + "::multiset"),
+ "Type: " + ii_type)
self.expect("frame variable ii", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect("frame variable ii", substrs=["size=0", "{}"])
+ ss_type = self.getVariableType("ss")
+ self.assertTrue(ss_type.startswith(self.namespace + "::multiset"),
+ "Type: " + ss_type)
self.expect("frame variable ss", substrs=["size=0", "{}"])
lldbutil.continue_to_breakpoint(self.process(), bkpt)
self.expect(
AddCXXSynthetic(
cpp_category_sp, lldb_private::formatters::LibcxxFunctionFrontEndCreator,
"std::function synthetic value provider",
- ConstString("^std::__1::function<.+>$"), stl_synth_flags, true);
+ ConstString("^std::__(ndk)?1::function<.+>$"), stl_synth_flags, true);
#endif
}