Skip to content

Commit 4285ea5

Browse files
author
kendal
committed
[lldb][test][x86_64][win] TestBreakpointConditions set condition on breakpoint instead of location
On windows x86_64 this test stops on the set breakpoint when val == 1 when the breakpoint condition is set on the SBBreakpointLocation rather than the SBBreakpoint directly. Setting the condition on the breakpoint itself, seems to fix the issue. This PR also splits the test assertion that verifies we're on the correct line and have the correct value of val to make the error message more clear. At present it just shows Assertion error: True != False
1 parent 29d5a57 commit 4285ea5

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ def test_breakpoint_condition_inline_and_run_command(self):
2121

2222
@add_test_categories(["pyapi"])
2323
def test_breakpoint_condition_and_python_api(self):
24+
"""Use Python APIs to set breakpoint conditions."""
25+
self.build()
26+
self.breakpoint_conditions_python(set_breakpoint_on_location=False)
27+
28+
@add_test_categories(["pyapi"])
29+
@expectedFailureAll(
30+
oslist=["windows"],
31+
archs=["x86_64"],
32+
bugnumber="https://github.com/llvm/llvm-project/issues/100486",
33+
)
34+
def test_breakpoint_condition_on_location_and_python_api(self):
2435
"""Use Python APIs to set breakpoint conditions."""
2536
self.build()
2637
self.breakpoint_conditions_python()
@@ -124,7 +135,7 @@ def breakpoint_conditions(self, inline=False):
124135

125136
self.runCmd("process kill")
126137

127-
def breakpoint_conditions_python(self):
138+
def breakpoint_conditions_python(self, set_breakpoint_on_location=True):
128139
"""Use Python APIs to set breakpoint conditions."""
129140
target = self.createTestTarget()
130141

@@ -158,10 +169,14 @@ def breakpoint_conditions_python(self):
158169
# Get the breakpoint location from breakpoint after we verified that,
159170
# indeed, it has one location.
160171
location = breakpoint.GetLocationAtIndex(0)
161-
self.assertTrue(location and location.IsEnabled(), VALID_BREAKPOINT_LOCATION)
162172

163-
# Set the condition on the breakpoint location.
164-
location.SetCondition("val == 3")
173+
# Set the condition.
174+
if set_breakpoint_on_location:
175+
location.SetCondition("val == 3")
176+
else:
177+
breakpoint.SetCondition("val == 3")
178+
179+
self.assertTrue(location and location.IsEnabled(), VALID_BREAKPOINT_LOCATION)
165180
self.expect(location.GetCondition(), exe=False, startstr="val == 3")
166181

167182
# Now launch the process, and do not stop at entry point.

0 commit comments

Comments
 (0)