[Lldb-commits] [lldb] [lldb][test][x86_64][win] Set breakpoint condition on breakpoint instead of location in TestBreakpointConditions (PR #100487)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 24 17:01:55 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Kendal Harland (kendalharland)
<details>
<summary>Changes</summary>
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`
https://github.com/llvm/llvm-project/issues/100486
---
Full diff: https://github.com/llvm/llvm-project/pull/100487.diff
1 Files Affected:
- (modified) lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py (+9-5)
``````````diff
diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
index 50ba0317fd094..625ca916d20f1 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
@@ -155,13 +155,13 @@ def breakpoint_conditions_python(self):
breakpoint.GetThreadIndex(), 1, "The thread index has been set correctly"
)
+ # Set the condition on the breakpoint.
+ breakpoint.SetCondition("val == 3")
+
# Get the breakpoint location from breakpoint after we verified that,
# indeed, it has one location.
location = breakpoint.GetLocationAtIndex(0)
self.assertTrue(location and location.IsEnabled(), VALID_BREAKPOINT_LOCATION)
-
- # Set the condition on the breakpoint location.
- location.SetCondition("val == 3")
self.expect(location.GetCondition(), exe=False, startstr="val == 3")
# Now launch the process, and do not stop at entry point.
@@ -176,11 +176,15 @@ def breakpoint_conditions_python(self):
thread.IsValid(),
"There should be a thread stopped due to breakpoint condition",
)
+
frame0 = thread.GetFrameAtIndex(0)
var = frame0.FindValue("val", lldb.eValueTypeVariableArgument)
- self.assertTrue(
- frame0.GetLineEntry().GetLine() == self.line1 and var.GetValue() == "3"
+ self.assertEqual(
+ frame0.GetLineEntry().GetLine(),
+ self.line1,
+ "The debugger stopped on the correct line",
)
+ self.assertEqual(var.GetValue(), "3")
# The hit count for the breakpoint should be 1.
self.assertEqual(breakpoint.GetHitCount(), 1)
``````````
</details>
https://github.com/llvm/llvm-project/pull/100487
More information about the lldb-commits
mailing list