diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 18:01:57 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 18:01:57 +0000 |
commit | 88c643b6fec27eec436c8d138fee6346e92337d6 (patch) | |
tree | 82cd13b2f3cde1c9e5f79689ba4e6ba67694843f /packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands | |
parent | 94994d372d014ce4c8758b9605d63fae651bd8aa (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands')
3 files changed, 0 insertions, 167 deletions
diff --git a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/Makefile b/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/Makefile deleted file mode 100644 index 1d1f38f7fd0e..000000000000 --- a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -LEVEL = ../../../make - -CXX_SOURCES := nested.cpp - -include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py b/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py deleted file mode 100644 index a12051014dab..000000000000 --- a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -Test lldb breakpoint command for CPP methods & functions in a namespace. -""" - -from __future__ import print_function - - -import os -import time -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class CPPBreakpointCommandsTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - def make_breakpoint(self, name, type, expected_num_locations): - bkpt = self.target.BreakpointCreateByName(name, - type, - self.a_out_module, - self.nested_comp_unit) - num_locations = bkpt.GetNumLocations() - self.assertTrue( - num_locations == expected_num_locations, - "Wrong number of locations for '%s', expected: %d got: %d" % - (name, - expected_num_locations, - num_locations)) - return bkpt - - def test_cpp_breakpoint_cmds(self): - """Test a sequence of breakpoint command add, list, and delete.""" - self.build() - - exe = self.getBuildArtifact("a.out") - - # Create a target from the debugger. - - self.target = self.dbg.CreateTarget(exe) - self.assertTrue(self.target, VALID_TARGET) - - self.a_out_module = lldb.SBFileSpecList() - self.a_out_module.Append(lldb.SBFileSpec(exe)) - - self.nested_comp_unit = lldb.SBFileSpecList() - self.nested_comp_unit.Append(lldb.SBFileSpec("nested.cpp")) - - # First provide ONLY the method name. This should get everybody... - self.make_breakpoint("Function", - lldb.eFunctionNameTypeAuto, - 5) - - # Now add the Baz class specifier. This should get the version contained in Bar, - # AND the one contained in :: - self.make_breakpoint("Baz::Function", - lldb.eFunctionNameTypeAuto, - 2) - - # Then add the Bar::Baz specifier. This should get the version - # contained in Bar only - self.make_breakpoint("Bar::Baz::Function", - lldb.eFunctionNameTypeAuto, - 1) - - self.make_breakpoint("Function", - lldb.eFunctionNameTypeMethod, - 3) - - self.make_breakpoint("Baz::Function", - lldb.eFunctionNameTypeMethod, - 2) - - self.make_breakpoint("Bar::Baz::Function", - lldb.eFunctionNameTypeMethod, - 1) - - self.make_breakpoint("Function", - lldb.eFunctionNameTypeBase, - 2) - - self.make_breakpoint("Bar::Function", - lldb.eFunctionNameTypeBase, - 1) diff --git a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/nested.cpp b/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/nested.cpp deleted file mode 100644 index 740649622cab..000000000000 --- a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/nested.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include <stdio.h> - -namespace Foo -{ - namespace Bar - { - class Baz - { - public: - Baz (int value):m_value(value) {} - int Function () - { - printf ("%s returning: %d.\n", __FUNCTION__, m_value); - return m_value + 1; - } - private: - int m_value; - }; - - class Baz2 - { - public: - Baz2 (int value):m_value(value) {} - int Function () - { - printf ("%s returning: %d.\n", __FUNCTION__, m_value); - return m_value + 2; - } - private: - int m_value; - }; - - static int bar_value = 20; - int Function () - { - printf ("%s returning: %d.\n", __FUNCTION__, bar_value); - return bar_value + 3; - } - } -} - -class Baz -{ -public: - Baz (int value):m_value(value) {} - int Function () - { - printf ("%s returning: %d.\n", __FUNCTION__, m_value); - return m_value + 4; - } -private: - int m_value; -}; - -int -Function () -{ - printf ("I am a global function, I return 333.\n"); - return 333; -} - -int main () -{ - Foo::Bar::Baz mine(200); - Foo::Bar::Baz2 mine2(300); - ::Baz bare_baz (500); - - printf ("Yup, got %d from Baz.\n", mine.Function()); - printf ("Yup, got %d from Baz.\n", mine2.Function()); - printf ("Yup, got %d from Baz.\n", bare_baz.Function()); - printf ("And got %d from Bar.\n", Foo::Bar::Function()); - printf ("And got %d from ::.\n", ::Function()); - - return 0; - -} |