summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-09-01 09:12:37 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-09-01 09:12:37 +0000
commit29872606d220420d53fde7cc5e3bea15f8da62e7 (patch)
tree47d7a82ccea48a6dd10a2d8ecb6b3c3127724131 /lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints
parentadfdcb9c2652aeee585b9005fd6c67be06af8ea9 (diff)
downloadbcm5719-llvm-29872606d220420d53fde7cc5e3bea15f8da62e7.tar.gz
bcm5719-llvm-29872606d220420d53fde7cc5e3bea15f8da62e7.zip
[lldb] Restructure test folders to match LLDB command hierarchy
Summary: As discussed on lldb-dev, this patch moves some LLDB tests into a hierarchy that more closely resembles the commands we use in the LLDB interpreter. This patch should only move tests that use the command interpreter and shouldn't touch any tests that primarily test the SB API. Reviewers: #lldb, jfb, JDevlieghere Reviewed By: #lldb, JDevlieghere Subscribers: dexonsmith, arphaman, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67033 llvm-svn: 370605
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/Makefile5
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py67
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp178
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/int.cpp9
4 files changed, 0 insertions, 259 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/Makefile
deleted file mode 100644
index 5b73ae626f3..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-LEVEL = ../../../make
-
-CXX_SOURCES := int.cpp
-
-include $(LEVEL)/Makefile.rules
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
deleted file mode 100644
index 9f184fb0ff4..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
+++ /dev/null
@@ -1,67 +0,0 @@
-"""
-Test that inlined breakpoints (breakpoint set on a file/line included from
-another source file) works correctly.
-"""
-
-from __future__ import print_function
-
-
-import lldb
-from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
-
-
-class InlinedBreakpointsTestCase(TestBase):
- """Bug fixed: rdar://problem/8464339"""
-
- mydir = TestBase.compute_mydir(__file__)
-
- def test_with_run_command(self):
- """Test 'b basic_types.cpp:176' does break (where int.cpp includes basic_type.cpp)."""
- self.build()
- self.inlined_breakpoints()
-
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
- # Find the line number to break inside basic_type.cpp.
- self.line = line_number(
- 'basic_type.cpp',
- '// Set break point at this line.')
-
- def inlined_breakpoints(self):
- """Test 'b basic_types.cpp:176' does break (where int.cpp includes basic_type.cpp)."""
- exe = self.getBuildArtifact("a.out")
- self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
- # With the inline-breakpoint-strategy, our file+line breakpoint should
- # not resolve to a location.
- self.runCmd('settings set target.inline-breakpoint-strategy headers')
-
- # Set a breakpoint and fail because it is in an inlined source
- # implemenation file
- lldbutil.run_break_set_by_file_and_line(
- self, "basic_type.cpp", self.line, num_expected_locations=0)
-
- # Now enable breakpoints in implementation files and see the breakpoint
- # set succeed
- self.runCmd('settings set target.inline-breakpoint-strategy always')
- # And add hooks to restore the settings during tearDown().
- self.addTearDownHook(lambda: self.runCmd(
- "settings set target.inline-breakpoint-strategy always"))
-
- lldbutil.run_break_set_by_file_and_line(
- self,
- "basic_type.cpp",
- self.line,
- num_expected_locations=1,
- loc_exact=True)
-
- self.runCmd("run", RUN_SUCCEEDED)
-
- # The stop reason of the thread should be breakpoint.
- # And it should break at basic_type.cpp:176.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped',
- 'stop reason = breakpoint',
- 'basic_type.cpp:%d' % self.line])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp
deleted file mode 100644
index 75d2c3690c8..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-// This file must have the following defined before it is included:
-// T defined to the type to test (int, float, etc)
-// T_CSTR a C string representation of the type T ("int", "float")
-// T_VALUE_1 defined to a valid initializer value for TEST_TYPE (7 for int, 2.0 for float)
-// T_VALUE_2, T_VALUE_3, T_VALUE_4 defined to a valid initializer value for TEST_TYPE that is different from TEST_VALUE_1
-// T_PRINTF_FORMAT defined if T can be printed with printf
-//
-// An example for integers is below
-#if 0
-
-#define T int
-#define T_CSTR "int"
-#define T_VALUE_1 11001110
-#define T_VALUE_2 22002220
-#define T_VALUE_3 33003330
-#define T_VALUE_4 44044440
-#define T_PRINTF_FORMAT "%i"
-
-#include "basic_type.cpp"
-
-#endif
-
-#include <cstdint>
-#include <cstdio>
-
-class a_class
-{
-public:
- a_class (const T& a, const T& b) :
- m_a (a),
- m_b (b)
- {
- }
-
- ~a_class ()
- {
- }
-
- const T&
- get_a()
- {
- return m_a;
- }
-
- void
- set_a (const T& a)
- {
- m_a = a;
- }
-
- const T&
- get_b()
- {
- return m_b;
- }
-
- void
- set_b (const T& b)
- {
- m_b = b;
- }
-
-protected:
- T m_a;
- T m_b;
-};
-
-typedef struct a_struct_tag {
- T a;
- T b;
-} a_struct_t;
-
-
-typedef union a_union_zero_tag {
- T a;
- double a_double;
-} a_union_zero_t;
-
-typedef struct a_union_nonzero_tag {
- double a_double;
- a_union_zero_t u;
-} a_union_nonzero_t;
-
-
-void Puts(char const *msg)
-{
- std::puts(msg);
-}
-
-int
-main (int argc, char const *argv[])
-{
- T a = T_VALUE_1;
- T* a_ptr = &a;
- T& a_ref = a;
- T a_array_bounded[2] = { T_VALUE_1, T_VALUE_2 };
- T a_array_unbounded[] = { T_VALUE_1, T_VALUE_2 };
-
- a_class a_class_instance (T_VALUE_1, T_VALUE_2);
- a_class *a_class_ptr = &a_class_instance;
- a_class &a_class_ref = a_class_instance;
-
- a_struct_t a_struct = { T_VALUE_1, T_VALUE_2 };
- a_struct_t *a_struct_ptr = &a_struct;
- a_struct_t &a_struct_ref = a_struct;
-
- // Create a union with type T at offset zero
- a_union_zero_t a_union_zero;
- a_union_zero.a = T_VALUE_1;
- a_union_zero_t *a_union_zero_ptr = &a_union_zero;
- a_union_zero_t &a_union_zero_ref = a_union_zero;
-
- // Create a union with type T at a non-zero offset
- a_union_nonzero_t a_union_nonzero;
- a_union_nonzero.u.a = T_VALUE_1;
- a_union_nonzero_t *a_union_nonzero_ptr = &a_union_nonzero;
- a_union_nonzero_t &a_union_nonzero_ref = a_union_nonzero;
-
- a_struct_t a_struct_array_bounded[2] = {{ T_VALUE_1, T_VALUE_2 }, { T_VALUE_3, T_VALUE_4 }};
- a_struct_t a_struct_array_unbounded[] = {{ T_VALUE_1, T_VALUE_2 }, { T_VALUE_3, T_VALUE_4 }};
- a_union_zero_t a_union_zero_array_bounded[2];
- a_union_zero_array_bounded[0].a = T_VALUE_1;
- a_union_zero_array_bounded[1].a = T_VALUE_2;
- a_union_zero_t a_union_zero_array_unbounded[] = {{ T_VALUE_1 }, { T_VALUE_2 }};
-
-#ifdef T_PRINTF_FORMAT
- std::printf ("%s: a = '" T_PRINTF_FORMAT "'\n", T_CSTR, a);
- std::printf ("%s*: %p => *a_ptr = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_ptr, *a_ptr);
- std::printf ("%s&: @%p => a_ref = '" T_PRINTF_FORMAT "'\n", T_CSTR, &a_ref, a_ref);
-
- std::printf ("%s[2]: a_array_bounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[0]);
- std::printf ("%s[2]: a_array_bounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[1]);
-
- std::printf ("%s[]: a_array_unbounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[0]);
- std::printf ("%s[]: a_array_unbounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[1]);
-
- std::printf ("(a_class) a_class_instance.m_a = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_a());
- std::printf ("(a_class) a_class_instance.m_b = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_b());
- std::printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_a = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_a());
- std::printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_b = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_b());
- std::printf ("(a_class&) a_class_ref = %p, a_class_ref.m_a = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_a());
- std::printf ("(a_class&) a_class_ref = %p, a_class_ref.m_b = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_b());
-
- std::printf ("(a_struct_t) a_struct.a = '" T_PRINTF_FORMAT "'\n", a_struct.a);
- std::printf ("(a_struct_t) a_struct.b = '" T_PRINTF_FORMAT "'\n", a_struct.b);
- std::printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->a = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->a);
- std::printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->b = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->b);
- std::printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.a = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.a);
- std::printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.b = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.b);
-
- std::printf ("(a_union_zero_t) a_union_zero.a = '" T_PRINTF_FORMAT "'\n", a_union_zero.a);
- std::printf ("(a_union_zero_t*) a_union_zero_ptr = %p, a_union_zero_ptr->a = '" T_PRINTF_FORMAT "'\n", a_union_zero_ptr, a_union_zero_ptr->a);
- std::printf ("(a_union_zero_t&) a_union_zero_ref = %p, a_union_zero_ref.a = '" T_PRINTF_FORMAT "'\n", &a_union_zero_ref, a_union_zero_ref.a);
-
- std::printf ("(a_union_nonzero_t) a_union_nonzero.u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero.u.a);
- std::printf ("(a_union_nonzero_t*) a_union_nonzero_ptr = %p, a_union_nonzero_ptr->u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero_ptr, a_union_nonzero_ptr->u.a);
- std::printf ("(a_union_nonzero_t&) a_union_nonzero_ref = %p, a_union_nonzero_ref.u.a = '" T_PRINTF_FORMAT "'\n", &a_union_nonzero_ref, a_union_nonzero_ref.u.a);
-
- std::printf ("(a_struct_t[2]) a_struct_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].a);
- std::printf ("(a_struct_t[2]) a_struct_array_bounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].b);
- std::printf ("(a_struct_t[2]) a_struct_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].a);
- std::printf ("(a_struct_t[2]) a_struct_array_bounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].b);
-
- std::printf ("(a_struct_t[]) a_struct_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].a);
- std::printf ("(a_struct_t[]) a_struct_array_unbounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].b);
- std::printf ("(a_struct_t[]) a_struct_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].a);
- std::printf ("(a_struct_t[]) a_struct_array_unbounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].b);
-
- std::printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[0].a);
- std::printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[1].a);
-
- std::printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[0].a);
- std::printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[1].a);
-
-#endif
- Puts("About to exit, break here to check values..."); // Set break point at this line.
- return 0;
-}
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/int.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/int.cpp
deleted file mode 100644
index 922398b1c6e..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/int.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#define T int
-#define T_CSTR "int"
-#define T_VALUE_1 11001110
-#define T_VALUE_2 22002220
-#define T_VALUE_3 33003330
-#define T_VALUE_4 44004440
-#define T_PRINTF_FORMAT "%i"
-
-#include "basic_type.cpp"
OpenPOWER on IntegriCloud