[Lldb-commits] [lldb] [lldb-dap] Updating VariableDescription to use GetDescription() as a fallback. (PR #77026)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 9 11:49:03 PST 2024


================
@@ -242,19 +254,57 @@ def do_test_scopes_variables_setVariable_evaluate(
             },
             "pt": {
                 "equals": {"type": "PointType"},
-                "startswith": {
-                    "result": "{x:11, y:22}"
+                "equals": {
+                    "result": "{x:11, y:22, buffer:{...}}"
                     if enableAutoVariableSummaries
-                    else "PointType @ 0x"
+                    else """(PointType) pt = {
+  x = 11
+  y = 22
+  buffer = {
+    [0] = 0
+    [1] = 1
+    [2] = 2
+    [3] = 3
+    [4] = 4
+    [5] = 5
+    [6] = 6
+    [7] = 7
+    [8] = 8
+    [9] = 9
+    [10] = 10
+    [11] = 11
+    [12] = 12
+    [13] = 13
+    [14] = 14
+    [15] = 15
+  }
+}"""
                 },
                 "hasVariablesReference": True,
             },
             "pt.buffer": {
                 "equals": {"type": "int[32]"},
-                "startswith": {
+                "equals": {
                     "result": "{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...}"
                     if enableAutoVariableSummaries
-                    else "int[32] @ 0x"
----------------
ashgti wrote:

In the UI it will look like in the variable view:
<img width="414" alt="Screenshot 2024-01-09 at 11 36 21 AM" src="https://github.com/llvm/llvm-project/assets/22535/edbc2f5e-4e54-47b5-af66-fc0e62f137f9">

Hover in the variable view:
<img width="272" alt="Screenshot 2024-01-09 at 11 36 30 AM" src="https://github.com/llvm/llvm-project/assets/22535/4a7b1d08-7475-44bf-a5d2-e36b983dbca1">
 
Debug Console:
<img width="239" alt="Screenshot 2024-01-09 at 11 47 52 AM" src="https://github.com/llvm/llvm-project/assets/22535/2629431d-e0b5-455f-824a-5b5eba83fbc8">

Debug Console Hover:
<img width="348" alt="Screenshot 2024-01-09 at 11 48 02 AM" src="https://github.com/llvm/llvm-project/assets/22535/a689b35e-f721-4d42-933f-47e7bddb8bf9">


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


More information about the lldb-commits mailing list