https://github.com/kendalharland created https://github.com/llvm/llvm-project/pull/100487
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 >From 29d5a57eb8cc344e1a93787fe9cb333761923927 Mon Sep 17 00:00:00 2001 From: kendal <kendal@thebrowser.company> Date: Tue, 23 Jul 2024 10:24:24 -0700 Subject: [PATCH 1/2] [lldb][test][x86_64][win] Split TestBreakpointConditions assertion to clarify failure message When this test fails we see an assertion error `False != True` This clarifies the error by showing, for example, if `1 != 3` when comparing `var` to the string "3". --- .../breakpoint_conditions/TestBreakpointConditions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py index 50ba0317fd094..4e7a8ccb9fbeb 100644 --- a/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py +++ b/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py @@ -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) >From 11ee9346ee8ef928e5f31982747557604ba8f91b Mon Sep 17 00:00:00 2001 From: kendal <kendal@thebrowser.company> Date: Tue, 23 Jul 2024 10:47:26 -0700 Subject: [PATCH 2/2] [lldb][test][x86_64][win] TestBreakpointConditions set condition on breakpoint instead of location On windows x86_64 this test seems to stop on the breakpoint when val == 3 iff the condition is set on the breakpoint rather than the location. Setting the condition on the breakpoint should work for all platforms, but the fact that setting the condition on the location doens't work on Windows x86_64 is considered a bug. --- .../breakpoint_conditions/TestBreakpointConditions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/API/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py index 4e7a8ccb9fbeb..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. _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits