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 origin/main...HEAD
lldb/test/API/python_api/sbtarget_extensions/TestSBTargetExtensions.py
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- TestSBTargetExtensions.py 2025-12-24 10:37:09.000000 +0000
+++ TestSBTargetExtensions.py 2025-12-24 10:42:22.373100 +0000
@@ -5,11 +5,10 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
class SBTargetExtensionsTestCase(TestBase):
-
def test_equality(self):
"""Test the equality operator for SBTarget."""
self.build()
exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
@@ -66,31 +65,37 @@
self.build()
exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target.IsValid())
- breakpoint = target.BreakpointCreateBySourceRegex("Set breakpoint
here", lldb.SBFileSpec("main.c"))
+ breakpoint = target.BreakpointCreateBySourceRegex(
+ "Set breakpoint here", lldb.SBFileSpec("main.c")
+ )
self.assertTrue(breakpoint.IsValid())
self.assertEqual(target.num_breakpoints, 1)
self.assertEqual(len(target.breakpoints), 1)
# target.breakpoint[i] uses INDEX, not ID.
self.assertEqual(target.breakpoint[0].GetID(),
target.breakpoints[0].GetID())
# To verify ID lookup works via the standard API:
-
self.assertEqual(target.FindBreakpointByID(breakpoint.GetID()).GetID(),
breakpoint.GetID())
+ self.assertEqual(
+ target.FindBreakpointByID(breakpoint.GetID()).GetID(),
breakpoint.GetID()
+ )
def test_watchpoints(self):
"""Test watchpoint access via extensions."""
self.build()
exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target.IsValid())
# 1. Set a breakpoint so the process stops and stays alive.
- breakpoint = target.BreakpointCreateBySourceRegex("Set breakpoint
here", lldb.SBFileSpec("main.c"))
+ breakpoint = target.BreakpointCreateBySourceRegex(
+ "Set breakpoint here", lldb.SBFileSpec("main.c")
+ )
self.assertTrue(breakpoint.IsValid())
# 2. Launch the process.
process = target.LaunchSimple(None, None,
self.get_process_working_directory())
self.assertTrue(process.IsValid())
@@ -103,11 +108,13 @@
global_variable = variables.GetValueAtIndex(0)
error = lldb.SBError()
# 4. Now we can set the watchpoint.
- watchpoint = target.WatchAddress(global_variable.GetLoadAddress(), 4,
False, True, error)
+ watchpoint = target.WatchAddress(
+ global_variable.GetLoadAddress(), 4, False, True, error
+ )
self.assertTrue(error.Success(), f"Watchpoint failed:
{error.GetCString()}")
self.assertTrue(target.num_watchpoints > 0)
self.assertEqual(len(target.watchpoints), target.num_watchpoints)
@@ -124,11 +131,14 @@
self.assertTrue(target.executable.IsValid())
self.assertEqual(target.debugger.GetID(), self.dbg.GetID())
self.assertTrue(target.broadcaster.IsValid())
- self.assertIn(target.byte_order, [lldb.eByteOrderLittle,
lldb.eByteOrderBig, lldb.eByteOrderInvalid])
+ self.assertIn(
+ target.byte_order,
+ [lldb.eByteOrderLittle, lldb.eByteOrderBig,
lldb.eByteOrderInvalid],
+ )
self.assertTrue(target.addr_size > 0)
self.assertIsNotNone(target.triple)
self.assertIsNotNone(target.arch_name)
self.assertTrue(target.data_byte_size > 0)
``````````
</details>
https://github.com/llvm/llvm-project/pull/173473
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits