[Lldb-commits] [lldb] [lldb] Fix CommandInterpreter::GetExecutionContext (PR #199922)

via lldb-commits lldb-commits at lists.llvm.org
Wed May 27 03:38:12 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/test/API/python_api/interpreter/TestCommandInterpreterAPI.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
--- TestCommandInterpreterAPI.py	2026-05-27 10:27:07.000000 +0000
+++ TestCommandInterpreterAPI.py	2026-05-27 10:37:35.033344 +0000
@@ -294,11 +294,13 @@
         )
 
     def test_handle_command_with_execution_context_override(self):
         """Test that HandleCommand with an override context works correctly and does not bypass non-dummy targets."""
         self.build()
-        target, process, thread, _ = lldbutil.run_to_line_breakpoint(self, lldb.SBFileSpec("main.c"), self.line)
+        target, process, thread, _ = lldbutil.run_to_line_breakpoint(
+            self, lldb.SBFileSpec("main.c"), self.line
+        )
         frame = thread.GetSelectedFrame()
         self.assertTrue(frame.IsValid())
         exe_ctx = lldb.SBExecutionContext(frame)
 
         # With an dummy override target, the command should fail -- it should not use valid target selected in the debugger.
@@ -321,6 +323,8 @@
         # Now try vice-versa. The command should successfully use the target from the override context.
         self.dbg.SetSelectedTarget(target)
         exe_ctx = lldb.SBExecutionContext(frame)
         res = lldb.SBCommandReturnObject()
         self.ci.HandleCommand("frame variable", exe_ctx, res)
-        self.assertTrue(res.Succeeded(), "HandleCommand with override context succeeded")
+        self.assertTrue(
+            res.Succeeded(), "HandleCommand with override context succeeded"
+        )

``````````

</details>


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


More information about the lldb-commits mailing list