Skip to content

Commit beef815

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 beef815

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

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

Lines changed: 19 additions & 3 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

@@ -160,8 +171,13 @@ def breakpoint_conditions_python(self):
160171
location = breakpoint.GetLocationAtIndex(0)
161172
self.assertTrue(location and location.IsEnabled(), VALID_BREAKPOINT_LOCATION)
162173

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

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

0 commit comments

Comments
 (0)