summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp
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/cpp
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/cpp')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/Makefile9
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py112
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp82
3 files changed, 0 insertions, 203 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/Makefile
deleted file mode 100644
index f89b52a972e..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/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/cpp/TestCPPBreakpointLocations.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
deleted file mode 100644
index be21c6eea13..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
+++ /dev/null
@@ -1,112 +0,0 @@
-"""
-Test lldb breakpoint ids.
-"""
-
-from __future__ import print_function
-
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class TestCPPBreakpointLocations(TestBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
- def test(self):
- self.build()
- self.breakpoint_id_tests()
-
- def verify_breakpoint_locations(self, target, bp_dict):
-
- name = bp_dict['name']
- names = bp_dict['loc_names']
- bp = target.BreakpointCreateByName(name)
- self.assertEquals(
- bp.GetNumLocations(),
- len(names),
- "Make sure we find the right number of breakpoint locations")
-
- bp_loc_names = list()
- for bp_loc in bp:
- bp_loc_names.append(bp_loc.GetAddress().GetFunction().GetName())
-
- for name in names:
- found = name in bp_loc_names
- if not found:
- print("Didn't find '%s' in: %s" % (name, bp_loc_names))
- self.assertTrue(found, "Make sure we find all required locations")
-
- def breakpoint_id_tests(self):
-
- # Create a target by the debugger.
- exe = self.getBuildArtifact("a.out")
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
- bp_dicts = [
- {'name': 'func1', 'loc_names': ['a::c::func1()', 'b::c::func1()']},
- {'name': 'func2', 'loc_names': ['a::c::func2()', 'c::d::func2()']},
- {'name': 'func3', 'loc_names': ['a::c::func3()', 'b::c::func3()', 'c::d::func3()']},
- {'name': 'c::func1', 'loc_names': ['a::c::func1()', 'b::c::func1()']},
- {'name': 'c::func2', 'loc_names': ['a::c::func2()']},
- {'name': 'c::func3', 'loc_names': ['a::c::func3()', 'b::c::func3()']},
- {'name': 'a::c::func1', 'loc_names': ['a::c::func1()']},
- {'name': 'b::c::func1', 'loc_names': ['b::c::func1()']},
- {'name': 'c::d::func2', 'loc_names': ['c::d::func2()']},
- {'name': 'a::c::func1()', 'loc_names': ['a::c::func1()']},
- {'name': 'b::c::func1()', 'loc_names': ['b::c::func1()']},
- {'name': 'c::d::func2()', 'loc_names': ['c::d::func2()']},
- ]
-
- for bp_dict in bp_dicts:
- self.verify_breakpoint_locations(target, bp_dict)
-
- @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
- def test_destructors(self):
- self.build()
- exe = self.getBuildArtifact("a.out")
- target = self.dbg.CreateTarget(exe)
-
- # Don't skip prologue, so we can check the breakpoint address more
- # easily
- self.runCmd("settings set target.skip-prologue false")
- try:
- names = ['~c', 'c::~c', 'c::~c()']
- loc_names = {'a::c::~c()', 'b::c::~c()'}
- # TODO: For windows targets we should put windows mangled names
- # here
- symbols = [
- '_ZN1a1cD1Ev',
- '_ZN1a1cD2Ev',
- '_ZN1b1cD1Ev',
- '_ZN1b1cD2Ev']
-
- for name in names:
- bp = target.BreakpointCreateByName(name)
-
- bp_loc_names = {bp_loc.GetAddress().GetFunction().GetName()
- for bp_loc in bp}
- self.assertEquals(
- bp_loc_names,
- loc_names,
- "Breakpoint set on the correct symbol")
-
- bp_addresses = {bp_loc.GetLoadAddress() for bp_loc in bp}
- symbol_addresses = set()
- for symbol in symbols:
- sc_list = target.FindSymbols(symbol, lldb.eSymbolTypeCode)
- self.assertEquals(
- sc_list.GetSize(), 1, "Found symbol " + symbol)
- symbol = sc_list.GetContextAtIndex(0).GetSymbol()
- symbol_addresses.add(
- symbol.GetStartAddress().GetLoadAddress(target))
-
- self.assertEquals(
- symbol_addresses,
- bp_addresses,
- "Breakpoint set on correct address")
- finally:
- self.runCmd("settings clear target.skip-prologue")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp
deleted file mode 100644
index 4afabcbd36e..00000000000
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/main.cpp
+++ /dev/null
@@ -1,82 +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
-//
-//===----------------------------------------------------------------------===//
-#include <stdio.h>
-#include <stdint.h>
-
-namespace a {
- class c {
- public:
- c();
- ~c();
- void func1()
- {
- puts (__PRETTY_FUNCTION__);
- }
- void func2()
- {
- puts (__PRETTY_FUNCTION__);
- }
- void func3()
- {
- puts (__PRETTY_FUNCTION__);
- }
- };
-
- c::c() {}
- c::~c() {}
-}
-
-namespace b {
- class c {
- public:
- c();
- ~c();
- void func1()
- {
- puts (__PRETTY_FUNCTION__);
- }
- void func3()
- {
- puts (__PRETTY_FUNCTION__);
- }
- };
-
- c::c() {}
- c::~c() {}
-}
-
-namespace c {
- class d {
- public:
- d () {}
- ~d() {}
- void func2()
- {
- puts (__PRETTY_FUNCTION__);
- }
- void func3()
- {
- puts (__PRETTY_FUNCTION__);
- }
- };
-}
-
-int main (int argc, char const *argv[])
-{
- a::c ac;
- b::c bc;
- c::d cd;
- ac.func1();
- ac.func2();
- ac.func3();
- bc.func1();
- bc.func3();
- cd.func2();
- cd.func3();
- return 0;
-}
OpenPOWER on IntegriCloud