aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py')
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py39
1 files changed, 36 insertions, 3 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
index dea206b9e9d2..c2aa597214ed 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
@@ -8,14 +8,15 @@ from __future__ import print_function
import os, time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
-import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test import lldbutil
class TestCPPBreakpointLocations(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @expectedFailureWindows("llvm.org/pr24764")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
def test (self):
self.build ()
self.breakpoint_id_tests ()
@@ -25,7 +26,7 @@ class TestCPPBreakpointLocations(TestBase):
name = bp_dict['name']
names = bp_dict['loc_names']
bp = target.BreakpointCreateByName (name)
- self.assertTrue (bp.GetNumLocations() == len(names), "Make sure we find the right number of breakpoint locations")
+ 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:
@@ -60,3 +61,35 @@ class TestCPPBreakpointLocations(TestBase):
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 = os.path.join(os.getcwd(), "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")