[Lldb-commits] [lldb] [lldb] Fix ScripteFrame thread member init assignment (PR #191297)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 9 14:16:28 PDT 2026


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/examples/python/templates/scripted_process.py lldb/test/API/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py lldb/test/API/functionalities/scripted_frame_provider/test_frame_providers.py lldb/test/API/functionalities/scripted_process/TestScriptedProcess.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
--- test/API/functionalities/scripted_process/TestScriptedProcess.py	2026-04-09 21:13:26.000000 +0000
+++ test/API/functionalities/scripted_process/TestScriptedProcess.py	2026-04-09 21:15:57.575524 +0000
@@ -293,22 +293,27 @@
         # thread index, the lookup returns an invalid SBThread. Downstream,
         # resolving the execution context from an SBFrame backed by this
         # invalid thread yields a null Process, and calling
         # ProcessModID::IsRunningExpression() on it crashes.
         tid = thread.GetThreadID()
-        self.assertTrue(process_0.GetThreadByID(tid).IsValid(),
-                        "GetThreadByID(tid) should find the thread")
-        self.assertFalse(process_0.GetThreadByIndexID(tid).IsValid(),
-                         "GetThreadByIndexID(tid) should NOT find the thread "
-                         "(index ID != thread ID)")
+        self.assertTrue(
+            process_0.GetThreadByID(tid).IsValid(),
+            "GetThreadByID(tid) should find the thread",
+        )
+        self.assertFalse(
+            process_0.GetThreadByIndexID(tid).IsValid(),
+            "GetThreadByIndexID(tid) should NOT find the thread "
+            "(index ID != thread ID)",
+        )
 
         # Construct a new ScriptedFrame with the SBThread (which carries the
         # real thread ID) and verify its thread member is valid. This exercises
         # the SBThread branch in ScriptedFrame.__init__ where thread.id is
         # used with GetThreadByID.
         post_launch_frame = dummy_scripted_process.DummyScriptedFrame(
             thread, lldb.SBStructuredData(), 42, "test_frame"
         )
-        self.assertTrue(post_launch_frame.thread.IsValid(),
-                        "ScriptedFrame.thread should be valid after thread "
-                        "registration")
+        self.assertTrue(
+            post_launch_frame.thread.IsValid(),
+            "ScriptedFrame.thread should be valid after thread " "registration",
+        )
         self.assertEqual(post_launch_frame.thread.GetThreadID(), tid)

``````````

</details>


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


More information about the lldb-commits mailing list