forked from OSchip/llvm-project
[lldb/test] Added lldbutil function to test a breakpoint
Testing the breakpoint itself rather than the lldb string. Differential Revision: https://reviews.llvm.org/D111899
This commit is contained in:
parent
f5ca3ac748
commit
9f0b5f9a39
|
@ -730,6 +730,57 @@ def check_breakpoint_result(
|
||||||
(out_module_name,
|
(out_module_name,
|
||||||
module_name))
|
module_name))
|
||||||
|
|
||||||
|
def check_breakpoint(
|
||||||
|
test,
|
||||||
|
bpno,
|
||||||
|
expected_locations = None,
|
||||||
|
expected_resolved_count = None,
|
||||||
|
expected_hit_count = None,
|
||||||
|
location_id = None,
|
||||||
|
expected_location_resolved = True,
|
||||||
|
expected_location_hit_count = None):
|
||||||
|
"""
|
||||||
|
Test breakpoint or breakpoint location.
|
||||||
|
Breakpoint resolved count is always checked. If not specified the assumption is that all locations
|
||||||
|
should be resolved.
|
||||||
|
To test a breakpoint location, breakpoint number (bpno) and location_id must be set. In this case
|
||||||
|
the resolved count for a breakpoint is not tested by default. The location is expected to be resolved,
|
||||||
|
unless expected_location_resolved is set to False.
|
||||||
|
test - test context
|
||||||
|
bpno - breakpoint number to test
|
||||||
|
expected_locations - expected number of locations for this breakpoint. If 'None' this parameter is not tested.
|
||||||
|
expected_resolved_count - expected resolved locations number for the breakpoint. If 'None' - all locations should be resolved.
|
||||||
|
expected_hit_count - expected hit count for this breakpoint. If 'None' this parameter is not tested.
|
||||||
|
location_id - If not 'None' sets the location ID for the breakpoint to test.
|
||||||
|
expected_location_resolved - Extected resolved status for the location_id (True/False). Default - True.
|
||||||
|
expected_location_hit_count - Expected hit count for the breakpoint at location_id. Must be set if the location_id parameter is set.
|
||||||
|
"""
|
||||||
|
|
||||||
|
bkpt = test.target().FindBreakpointByID(bpno)
|
||||||
|
test.assertTrue(bkpt.IsValid(), "Breakpoint is not valid.")
|
||||||
|
|
||||||
|
if expected_locations is not None:
|
||||||
|
test.assertEquals(expected_locations, bkpt.GetNumLocations())
|
||||||
|
|
||||||
|
if expected_resolved_count is not None:
|
||||||
|
test.assertEquals(expected_resolved_count, bkpt.GetNumResolvedLocations())
|
||||||
|
else:
|
||||||
|
expected_resolved_count = bkpt.GetNumLocations()
|
||||||
|
if location_id is None:
|
||||||
|
test.assertEquals(expected_resolved_count, bkpt.GetNumResolvedLocations())
|
||||||
|
|
||||||
|
if expected_hit_count is not None:
|
||||||
|
test.assertEquals(expected_hit_count, bkpt.GetHitCount())
|
||||||
|
|
||||||
|
if location_id is not None:
|
||||||
|
loc_bkpt = bkpt.FindLocationByID(location_id)
|
||||||
|
test.assertTrue(loc_bkpt.IsValid(), "Breakpoint location is not valid.")
|
||||||
|
test.assertEquals(loc_bkpt.IsResolved(), expected_location_resolved)
|
||||||
|
if expected_location_hit_count is not None:
|
||||||
|
test.assertEquals(expected_location_hit_count, loc_bkpt.GetHitCount())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ==================================================
|
# ==================================================
|
||||||
# Utility functions related to Threads and Processes
|
# Utility functions related to Threads and Processes
|
||||||
# ==================================================
|
# ==================================================
|
||||||
|
|
|
@ -37,7 +37,6 @@ class AproposWithProcessTestCase(TestBase):
|
||||||
substrs=['stopped', 'stop reason = breakpoint'])
|
substrs=['stopped', 'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.runCmd('apropos env')
|
self.runCmd('apropos env')
|
||||||
|
|
|
@ -37,8 +37,7 @@ class NestedAliasTestCase(TestBase):
|
||||||
substrs=['stopped', 'stop reason = breakpoint'])
|
substrs=['stopped', 'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# This is the function to remove the custom aliases in order to have a
|
# This is the function to remove the custom aliases in order to have a
|
||||||
# clean slate for the next test case.
|
# clean slate for the next test case.
|
||||||
|
|
|
@ -242,8 +242,7 @@ class BreakpointCommandTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 2.
|
# The breakpoint should have a hit count of 2.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_TWICE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 2)
|
||||||
substrs=['resolved, hit count = 2'])
|
|
||||||
|
|
||||||
def breakpoint_command_script_parameters(self):
|
def breakpoint_command_script_parameters(self):
|
||||||
"""Test that the frame and breakpoint location are being properly passed to the script breakpoint command function."""
|
"""Test that the frame and breakpoint location are being properly passed to the script breakpoint command function."""
|
||||||
|
@ -264,7 +263,7 @@ class BreakpointCommandTestCase(TestBase):
|
||||||
|
|
||||||
self.expect(side_effect.frame, exe=False, startstr="frame #0:")
|
self.expect(side_effect.frame, exe=False, startstr="frame #0:")
|
||||||
self.expect(side_effect.bp_loc, exe=False,
|
self.expect(side_effect.bp_loc, exe=False,
|
||||||
patterns=["1.* where = .*main .* resolved, hit count = 1"])
|
patterns=["1.* where = .*main .* resolved,( hardware,)? hit count = 1"])
|
||||||
|
|
||||||
def breakpoint_commands_on_creation(self):
|
def breakpoint_commands_on_creation(self):
|
||||||
"""Test that setting breakpoint commands when creating the breakpoint works"""
|
"""Test that setting breakpoint commands when creating the breakpoint works"""
|
||||||
|
|
|
@ -76,9 +76,7 @@ class BreakpointIgnoreCountTestCase(TestBase):
|
||||||
|
|
||||||
# Also check the hit count, which should be 2, due to ignore count of
|
# Also check the hit count, which should be 2, due to ignore count of
|
||||||
# 1.
|
# 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_THRICE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 2)
|
||||||
substrs=["resolved = 1",
|
|
||||||
"hit count = 2"])
|
|
||||||
|
|
||||||
# The frame #0 should correspond to main.c:37, the executable statement
|
# The frame #0 should correspond to main.c:37, the executable statement
|
||||||
# in function name 'c'. And frame #2 should point to main.c:45.
|
# in function name 'c'. And frame #2 should point to main.c:45.
|
||||||
|
@ -97,9 +95,7 @@ class BreakpointIgnoreCountTestCase(TestBase):
|
||||||
|
|
||||||
# Also check the hit count, which should be 2, due to ignore count of
|
# Also check the hit count, which should be 2, due to ignore count of
|
||||||
# 1.
|
# 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_THRICE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 4)
|
||||||
substrs=["resolved = 1",
|
|
||||||
"hit count = 4"])
|
|
||||||
|
|
||||||
# The frame #0 should correspond to main.c:37, the executable statement
|
# The frame #0 should correspond to main.c:37, the executable statement
|
||||||
# in function name 'c'. And frame #2 should point to main.c:45.
|
# in function name 'c'. And frame #2 should point to main.c:45.
|
||||||
|
|
|
@ -187,10 +187,7 @@ class BreakpointLocationsTestCase(TestBase):
|
||||||
|
|
||||||
# At this point, 1.1 has a hit count of 0 and the other a hit count of
|
# At this point, 1.1 has a hit count of 0 and the other a hit count of
|
||||||
# 1".
|
# 1".
|
||||||
self.expect(
|
lldbutil.check_breakpoint(self, bpno = 1, expected_locations = 3, expected_resolved_count = 2, expected_hit_count = 2)
|
||||||
"breakpoint list -f",
|
lldbutil.check_breakpoint(self, bpno = 1, location_id = 1, expected_location_resolved = False, expected_location_hit_count = 0)
|
||||||
"The breakpoints should report correct hit counts",
|
lldbutil.check_breakpoint(self, bpno = 1, location_id = 2, expected_location_resolved = True, expected_location_hit_count = 1)
|
||||||
patterns=[
|
lldbutil.check_breakpoint(self, bpno = 1, location_id = 3, expected_location_resolved = True, expected_location_hit_count = 1)
|
||||||
"1\.1: .+ unresolved, hit count = 0 +Options: disabled",
|
|
||||||
"1\.2: .+ resolved, hit count = 1",
|
|
||||||
"1\.3: .+ resolved, hit count = 1"])
|
|
||||||
|
|
|
@ -42,8 +42,7 @@ class DeadStripTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f 1", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.runCmd("continue")
|
self.runCmd("continue")
|
||||||
|
|
||||||
|
@ -54,5 +53,4 @@ class DeadStripTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f 3", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 3, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -316,8 +316,7 @@ class LoadUnloadTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Issue the 'continue' command. We should stop agaian at a_function.
|
# Issue the 'continue' command. We should stop agaian at a_function.
|
||||||
# The stop reason of the thread should be breakpoint and at a_function.
|
# The stop reason of the thread should be breakpoint and at a_function.
|
||||||
|
@ -331,8 +330,7 @@ class LoadUnloadTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 2.
|
# The breakpoint should have a hit count of 2.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 2)
|
||||||
substrs=[' resolved, hit count = 2'])
|
|
||||||
|
|
||||||
def test_step_over_load(self):
|
def test_step_over_load(self):
|
||||||
self.setSvr4Support(False)
|
self.setSvr4Support(False)
|
||||||
|
|
|
@ -38,8 +38,7 @@ class MemoryCacheTestCase(TestBase):
|
||||||
substrs=['stopped', 'stop reason = breakpoint'])
|
substrs=['stopped', 'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Read a chunk of memory containing &my_ints[0]. The number of bytes read
|
# Read a chunk of memory containing &my_ints[0]. The number of bytes read
|
||||||
# must be greater than m_L2_cache_line_byte_size to make sure the L1
|
# must be greater than m_L2_cache_line_byte_size to make sure the L1
|
||||||
|
|
|
@ -37,8 +37,7 @@ class MemoryFindTestCase(TestBase):
|
||||||
substrs=['stopped', 'stop reason = breakpoint'])
|
substrs=['stopped', 'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Test the memory find commands.
|
# Test the memory find commands.
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,7 @@ class MemoryReadTestCase(TestBase):
|
||||||
substrs=['stopped', 'stop reason = breakpoint'])
|
substrs=['stopped', 'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f",
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
BREAKPOINT_HIT_ONCE,
|
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
@no_debug_info_test
|
@no_debug_info_test
|
||||||
def test_memory_read(self):
|
def test_memory_read(self):
|
||||||
|
|
|
@ -166,5 +166,4 @@ class AnonymousTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -42,8 +42,7 @@ class ArrayTypesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=['resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Issue 'variable list' command on several array-type variables.
|
# Issue 'variable list' command on several array-type variables.
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,7 @@ class TestConflictingSymbols(TestBase):
|
||||||
substrs=['stopped',
|
substrs=['stopped',
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# This should display correctly.
|
# This should display correctly.
|
||||||
self.expect(
|
self.expect(
|
||||||
|
@ -63,8 +62,7 @@ class TestConflictingSymbols(TestBase):
|
||||||
substrs=['stopped',
|
substrs=['stopped',
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.expect(
|
self.expect(
|
||||||
"expr (unsigned long long)conflicting_symbol",
|
"expr (unsigned long long)conflicting_symbol",
|
||||||
|
@ -79,8 +77,7 @@ class TestConflictingSymbols(TestBase):
|
||||||
substrs=['stopped',
|
substrs=['stopped',
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.expect(
|
self.expect(
|
||||||
"expr (unsigned long long)conflicting_symbol",
|
"expr (unsigned long long)conflicting_symbol",
|
||||||
|
|
|
@ -35,8 +35,7 @@ class ConstVariableTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.runCmd("next")
|
self.runCmd("next")
|
||||||
self.runCmd("next")
|
self.runCmd("next")
|
||||||
|
|
|
@ -58,8 +58,7 @@ class EnumTypesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Look up information about the 'enum_test_days' enum type.
|
# Look up information about the 'enum_test_days' enum type.
|
||||||
# Check for correct display.
|
# Check for correct display.
|
||||||
|
|
|
@ -30,8 +30,7 @@ class ForwardDeclarationTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# This should display correctly.
|
# This should display correctly.
|
||||||
# Note that the member fields of a = 1 and b = 2 is by design.
|
# Note that the member fields of a = 1 and b = 2 is by design.
|
||||||
|
|
|
@ -82,5 +82,4 @@ class FunctionTypesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -65,8 +65,7 @@ class GlobalVariablesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Test that the statically initialized variable can also be
|
# Test that the statically initialized variable can also be
|
||||||
# inspected *with* a process.
|
# inspected *with* a process.
|
||||||
|
|
|
@ -48,8 +48,7 @@ class LocalVariablesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.expect("frame variable i", VARIABLES_DISPLAYED_CORRECTLY,
|
self.expect("frame variable i", VARIABLES_DISPLAYED_CORRECTLY,
|
||||||
substrs=['(unsigned int) i = 10'])
|
substrs=['(unsigned int) i = 10'])
|
||||||
|
|
|
@ -39,8 +39,7 @@ class CModulesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Enable logging of the imported AST.
|
# Enable logging of the imported AST.
|
||||||
log_file = self.getBuildArtifact("lldb-ast-log.txt")
|
log_file = self.getBuildArtifact("lldb-ast-log.txt")
|
||||||
|
|
|
@ -50,8 +50,7 @@ class RegisterVariableTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Try some variables that should be visible
|
# Try some variables that should be visible
|
||||||
frame = self.dbg.GetSelectedTarget().GetProcess(
|
frame = self.dbg.GetSelectedTarget().GetProcess(
|
||||||
|
@ -77,8 +76,7 @@ class RegisterVariableTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Try some variables that should be visible
|
# Try some variables that should be visible
|
||||||
frame = self.dbg.GetSelectedTarget().GetProcess(
|
frame = self.dbg.GetSelectedTarget().GetProcess(
|
||||||
|
@ -104,8 +102,7 @@ class RegisterVariableTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Try some variables that should be visible
|
# Try some variables that should be visible
|
||||||
frame = self.dbg.GetSelectedTarget().GetProcess(
|
frame = self.dbg.GetSelectedTarget().GetProcess(
|
||||||
|
|
|
@ -52,8 +52,7 @@ class SetValuesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# main.c:15
|
# main.c:15
|
||||||
# Check that 'frame variable --show-types' displays the correct data
|
# Check that 'frame variable --show-types' displays the correct data
|
||||||
|
|
|
@ -95,5 +95,4 @@ class SharedLibTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -84,5 +84,4 @@ class SharedLibStrippedTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -44,8 +44,7 @@ class ClassTypesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# We should be stopped on the ctor function of class C.
|
# We should be stopped on the ctor function of class C.
|
||||||
self.expect(
|
self.expect(
|
||||||
|
@ -141,8 +140,7 @@ class ClassTypesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Continue on inside the ctor() body...
|
# Continue on inside the ctor() body...
|
||||||
self.runCmd("register read pc")
|
self.runCmd("register read pc")
|
||||||
|
|
|
@ -54,5 +54,4 @@ class InlinesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -66,5 +66,4 @@ class NamespaceDefinitionsTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -47,8 +47,7 @@ class SignedTypesTestCase(TestBase):
|
||||||
substrs=['stopped', 'stop reason = breakpoint'])
|
substrs=['stopped', 'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# Execute the puts().
|
# Execute the puts().
|
||||||
self.runCmd("thread step-over")
|
self.runCmd("thread step-over")
|
||||||
|
|
|
@ -31,8 +31,7 @@ class TestRealDefinition(TestBase):
|
||||||
substrs=['stopped',
|
substrs=['stopped',
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# This should display correctly.
|
# This should display correctly.
|
||||||
self.expect(
|
self.expect(
|
||||||
|
|
|
@ -47,8 +47,7 @@ class ForwardDeclTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# This should display correctly.
|
# This should display correctly.
|
||||||
self.expect("expression [j getMember]", VARIABLES_DISPLAYED_CORRECTLY,
|
self.expect("expression [j getMember]", VARIABLES_DISPLAYED_CORRECTLY,
|
||||||
|
|
|
@ -110,8 +110,7 @@ class HiddenIvarsTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
def expr(self, strip):
|
def expr(self, strip):
|
||||||
self.common_setup(strip)
|
self.common_setup(strip)
|
||||||
|
|
|
@ -38,8 +38,7 @@ class ObjCModulesAutoImportTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.runCmd("settings set target.auto-import-clang-modules true")
|
self.runCmd("settings set target.auto-import-clang-modules true")
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,7 @@ class IncompleteModulesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.runCmd(
|
self.runCmd(
|
||||||
"settings set target.clang-module-search-paths \"" +
|
"settings set target.clang-module-search-paths \"" +
|
||||||
|
|
|
@ -38,8 +38,7 @@ class ObjCModulesTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.expect("expr @import Darwin; 3", VARIABLES_DISPLAYED_CORRECTLY,
|
self.expect("expr @import Darwin; 3", VARIABLES_DISPLAYED_CORRECTLY,
|
||||||
substrs=["int", "3"])
|
substrs=["int", "3"])
|
||||||
|
|
|
@ -23,7 +23,4 @@ class ObjCNewSyntaxTest(TestBase):
|
||||||
substrs=['stopped', 'stop reason = breakpoint'])
|
substrs=['stopped', 'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect(
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
"breakpoint list -f",
|
|
||||||
BREAKPOINT_HIT_ONCE,
|
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
|
@ -32,14 +32,12 @@ class TestRealDefinition(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# Run and stop at Foo
|
# Run and stop at Foo
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.runCmd("continue", RUN_SUCCEEDED)
|
self.runCmd("continue", RUN_SUCCEEDED)
|
||||||
|
|
||||||
# Run at stop at main
|
# Run at stop at main
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# This should display correctly.
|
# This should display correctly.
|
||||||
self.expect(
|
self.expect(
|
||||||
|
@ -69,14 +67,12 @@ class TestRealDefinition(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# Run and stop at Foo
|
# Run and stop at Foo
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
self.runCmd("continue", RUN_SUCCEEDED)
|
self.runCmd("continue", RUN_SUCCEEDED)
|
||||||
|
|
||||||
# Run at stop at main
|
# Run at stop at main
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
# This should display correctly.
|
# This should display correctly.
|
||||||
self.expect(
|
self.expect(
|
||||||
|
|
|
@ -57,8 +57,7 @@ class ObjCSingleEntryDictionaryTestCase(TestBase):
|
||||||
'stop reason = breakpoint'])
|
'stop reason = breakpoint'])
|
||||||
|
|
||||||
# The breakpoint should have a hit count of 1.
|
# The breakpoint should have a hit count of 1.
|
||||||
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
|
lldbutil.check_breakpoint(self, bpno = 1, expected_hit_count = 1)
|
||||||
substrs=[' resolved, hit count = 1'])
|
|
||||||
|
|
||||||
d1 = self.frame().FindVariable("d1")
|
d1 = self.frame().FindVariable("d1")
|
||||||
d1.SetPreferSyntheticValue(True)
|
d1.SetPreferSyntheticValue(True)
|
||||||
|
|
Loading…
Reference in New Issue