[Lldb-commits] [lldb] [lldb] Support synthetic SBValues in ScriptedFrame variable enumeration (PR #192474)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 16 08:27:09 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/functionalities/scripted_frame_provider/TestScriptedFrameProvider.py lldb/test/API/functionalities/scripted_frame_provider/test_frame_providers.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
--- TestScriptedFrameProvider.py	2026-04-16 15:16:06.000000 +0000
+++ TestScriptedFrameProvider.py	2026-04-16 15:26:28.817134 +0000
@@ -872,12 +872,11 @@
             locals_vars.GetSize(),
             2,
             "DAP-Locals-style GetVariables should return synthetic locals",
         )
         names = {
-            locals_vars.GetValueAtIndex(i).name
-            for i in range(locals_vars.GetSize())
+            locals_vars.GetValueAtIndex(i).name for i in range(locals_vars.GetSize())
         }
         self.assertIn("synth_local_a", names)
         self.assertIn("synth_local_b", names)
         self.assertEqual(
             locals_vars.GetFirstValueByName("synth_local_a").GetValueAsUnsigned(),
@@ -901,13 +900,11 @@
         self.assertTrue(val.IsValid())
         self.assertEqual(val.GetValueAsUnsigned(), 42)
 
         # CLI: frame variable (no args) lists synthetic locals
         self.runCmd("frame select 0")
-        self.expect(
-            "frame variable", substrs=["synth_local_a", "synth_local_b"]
-        )
+        self.expect("frame variable", substrs=["synth_local_a", "synth_local_b"])
 
         # CLI: frame variable -r regex finds synthetic locals
         self.expect(
             "frame variable -r synth_local",
             substrs=["synth_local_a", "synth_local_b"],
--- test_frame_providers.py	2026-04-16 15:16:06.000000 +0000
+++ test_frame_providers.py	2026-04-16 15:26:28.999020 +0000
@@ -663,11 +663,9 @@
     def get_description():
         return "Frame with synthetic-only values"
 
     def get_frame_at_index(self, index):
         if index == 0:
-            return SyntheticValueFrame(
-                self.thread, 0, 0xF00, "synthetic_value_frame"
-            )
+            return SyntheticValueFrame(self.thread, 0, 0xF00, "synthetic_value_frame")
         elif index - 1 < len(self.input_frames):
             return index - 1
         return None

``````````

</details>


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


More information about the lldb-commits mailing list