[Lldb-commits] [lldb] LLDB: WatchAddress ignores modify option (PR #124847)

via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 28 13:59:26 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 2e5a5237daf82a657561c490845c406e13657311...afae250c45e769006a5ae7d078e2e0ae39a4d8c0 lldb/test/API/python_api/watchpoint/TestWatchpointRead.py lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- TestWatchpointRead.py	2025-01-28 21:55:17.000000 +0000
+++ TestWatchpointRead.py	2025-01-28 21:58:57.760913 +0000
@@ -18,11 +18,10 @@
         self.source = "main.c"
         # Find the line number to break inside main().
         self.line = line_number(self.source, "// Set break point at this line.")
         self.build()
 
-
     def test_read_watchpoint_watch_address(self):
         exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -40,20 +39,18 @@
         process = target.GetProcess()
         self.assertState(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)
 
-
         value = frame0.FindValue("global", lldb.eValueTypeVariableGlobal)
         local = frame0.FindValue("local", lldb.eValueTypeVariableLocal)
         error = lldb.SBError()
 
-        watchpoint = target.WatchAddress(
-            value.GetLoadAddress(), 1, True, False, error
-        )
+        watchpoint = target.WatchAddress(value.GetLoadAddress(), 1, True, False, error)
         self.assertTrue(
-            value and local and watchpoint, "Successfully found the values and set a watchpoint"
+            value and local and watchpoint,
+            "Successfully found the values and set a watchpoint",
         )
         self.DebugSBValue(value)
         self.DebugSBValue(local)
 
         # Hide stdout if not running with '-t' option.
@@ -68,12 +65,11 @@
 
         if self.TraceOn():
             lldbutil.print_stacktraces(process)
 
         self.assertTrue(
-            local.GetValueAsSigned() > 0,
-            "The local variable has been incremented"
+            local.GetValueAsSigned() > 0, "The local variable has been incremented"
         )
 
     def test_read_watchpoint_watch_create_by_address(self):
         exe = self.getBuildArtifact("a.out")
 
@@ -93,22 +89,22 @@
         process = target.GetProcess()
         self.assertState(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)
 
-
         value = frame0.FindValue("global", lldb.eValueTypeVariableGlobal)
         local = frame0.FindValue("local", lldb.eValueTypeVariableLocal)
         error = lldb.SBError()
 
         wp_opts = lldb.SBWatchpointOptions()
         wp_opts.SetWatchpointTypeRead(True)
         watchpoint = target.WatchpointCreateByAddress(
             value.GetLoadAddress(), 1, wp_opts, error
         )
         self.assertTrue(
-            value and local and watchpoint, "Successfully found the values and set a watchpoint"
+            value and local and watchpoint,
+            "Successfully found the values and set a watchpoint",
         )
         self.DebugSBValue(value)
         self.DebugSBValue(local)
 
         # Hide stdout if not running with '-t' option.
@@ -123,8 +119,7 @@
 
         if self.TraceOn():
             lldbutil.print_stacktraces(process)
 
         self.assertTrue(
-            local.GetValueAsSigned() > 0,
-            "The local variable has been incremented"
+            local.GetValueAsSigned() > 0, "The local variable has been incremented"
         )

``````````

</details>


https://github.com/llvm/llvm-project/pull/124847


More information about the lldb-commits mailing list