diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-09-01 09:12:37 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-09-01 09:12:37 +0000 |
commit | 29872606d220420d53fde7cc5e3bea15f8da62e7 (patch) | |
tree | 47d7a82ccea48a6dd10a2d8ecb6b3c3127724131 /lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints | |
parent | adfdcb9c2652aeee585b9005fd6c67be06af8ea9 (diff) | |
download | bcm5719-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/consecutive_breakpoints')
3 files changed, 0 insertions, 131 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/Makefile deleted file mode 100644 index f89b52a972e..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -LEVEL = ../../../make - -CXX_SOURCES := main.cpp - -ifneq (,$(findstring icc,$(CC))) - CXXFLAGS += -debug inline-debug-info -endif - -include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py deleted file mode 100644 index 6afde150d8d..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py +++ /dev/null @@ -1,104 +0,0 @@ -""" -Test that we handle breakpoints on consecutive instructions correctly. -""" - -from __future__ import print_function - - -import unittest2 -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil - - -class ConsecutiveBreakpointsTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - def prepare_test(self): - self.build() - - (self.target, self.process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint( - self, "Set breakpoint here", lldb.SBFileSpec("main.cpp")) - - # Set breakpoint to the next instruction - frame = self.thread.GetFrameAtIndex(0) - - address = frame.GetPCAddress() - instructions = self.target.ReadInstructions(address, 2) - self.assertTrue(len(instructions) == 2) - self.bkpt_address = instructions[1].GetAddress() - self.breakpoint2 = self.target.BreakpointCreateByAddress( - self.bkpt_address.GetLoadAddress(self.target)) - self.assertTrue( - self.breakpoint2 and self.breakpoint2.GetNumLocations() == 1, - VALID_BREAKPOINT) - - def finish_test(self): - # Run the process until termination - self.process.Continue() - self.assertEquals(self.process.GetState(), lldb.eStateExited) - - @no_debug_info_test - def test_continue(self): - """Test that continue stops at the second breakpoint.""" - self.prepare_test() - - self.process.Continue() - self.assertEquals(self.process.GetState(), lldb.eStateStopped) - # We should be stopped at the second breakpoint - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( - self.process, self.breakpoint2) - self.assertIsNotNone( - self.thread, - "Expected one thread to be stopped at breakpoint 2") - - self.finish_test() - - @no_debug_info_test - def test_single_step(self): - """Test that single step stops at the second breakpoint.""" - self.prepare_test() - - step_over = False - self.thread.StepInstruction(step_over) - - self.assertEquals(self.process.GetState(), lldb.eStateStopped) - self.assertEquals( - self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress( - self.target), self.bkpt_address.GetLoadAddress( - self.target)) - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( - self.process, self.breakpoint2) - self.assertIsNotNone( - self.thread, - "Expected one thread to be stopped at breakpoint 2") - - self.finish_test() - - @no_debug_info_test - def test_single_step_thread_specific(self): - """Test that single step stops, even though the second breakpoint is not valid.""" - self.prepare_test() - - # Choose a thread other than the current one. A non-existing thread is - # fine. - thread_index = self.process.GetNumThreads() + 1 - self.assertFalse(self.process.GetThreadAtIndex(thread_index).IsValid()) - self.breakpoint2.SetThreadIndex(thread_index) - - step_over = False - self.thread.StepInstruction(step_over) - - self.assertEquals(self.process.GetState(), lldb.eStateStopped) - self.assertEquals( - self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress( - self.target), self.bkpt_address.GetLoadAddress( - self.target)) - self.assertEquals( - self.thread.GetStopReason(), - lldb.eStopReasonPlanComplete, - "Stop reason should be 'plan complete'") - - self.finish_test() diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/main.cpp deleted file mode 100644 index 94d0a0415d7..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//===-- main.cpp ------------------------------------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -int -main(int argc, char const *argv[]) -{ - int a = 0; - int b = 1; - a = b + 1; // Set breakpoint here - b = a + 1; - return 0; -} - |