[Lldb-commits] [lldb] [lldb-dap] do not show memory address on types with no summary (PR #172670)
Ebuka Ezike via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 17 06:49:49 PST 2025
https://github.com/da-viper created https://github.com/llvm/llvm-project/pull/172670
Majority of the time users are less interested on the memory address of a type. It is mostly useful for pointer types (the memory address is shown).
It makes the view more bloated without adding useful information.
can always fall back to the debug console or watch pane to view the information if necessary.
Memory Address | No Memory Address
:-------------------------:|:-------------------------:
 | 
>From a891c695e3149f2127e309fc938bcbfc61eecb0b Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Wed, 17 Dec 2025 00:02:54 +0000
Subject: [PATCH] [lldb-dap] do not show memory address on types with no
summary
majority of the time users are less interested on the memory address
of a type. It is mostly useful for pointer types (the memory address
is shown). It makes the view more bloated without adding useful
information.
---
.../API/tools/lldb-dap/evaluate/TestDAP_evaluate.py | 12 ++----------
.../tools/lldb-dap/variables/TestDAP_variables.py | 10 +++++-----
lldb/tools/lldb-dap/JSONUtils.cpp | 9 ++-------
3 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py b/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
index 95573780e94bd..95ad0f06d9a06 100644
--- a/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
+++ b/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
@@ -168,11 +168,7 @@ def run_test_evaluate_expressions(
else:
self.assertEvaluate(
"struct1",
- (
- re.escape("{foo:15}")
- if enableAutoVariableSummaries
- else "my_struct @ 0x"
- ),
+ (re.escape("{foo:15}") if enableAutoVariableSummaries else "my_struct"),
want_varref=True,
)
self.assertEvaluate(
@@ -243,11 +239,7 @@ def run_test_evaluate_expressions(
else:
self.assertEvaluate(
"struct1",
- (
- re.escape("{foo:15}")
- if enableAutoVariableSummaries
- else "my_struct @ 0x"
- ),
+ (re.escape("{foo:15}") if enableAutoVariableSummaries else "my_struct"),
want_type="my_struct",
want_varref=True,
)
diff --git a/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py b/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
index 977d6ce9dac8a..05445af40aea5 100644
--- a/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
+++ b/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
@@ -255,7 +255,7 @@ def do_test_scopes_variables_setVariable_evaluate(
"result": (
"{x:11, y:22, buffer:{...}}"
if enableAutoVariableSummaries
- else "PointType @ 0x"
+ else "PointType"
)
},
"hasVariablesReference": True,
@@ -266,7 +266,7 @@ def do_test_scopes_variables_setVariable_evaluate(
"result": (
"{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...}"
if enableAutoVariableSummaries
- else "int[16] @ 0x"
+ else "int[16]"
)
},
"hasVariablesReference": True,
@@ -502,7 +502,7 @@ def do_test_scopes_and_evaluate_expansion(self, enableAutoVariableSummaries: boo
"result": (
"{x:11, y:22, buffer:{...}}"
if enableAutoVariableSummaries
- else "PointType @ 0x"
+ else "PointType"
)
},
"missing": ["indexedVariables"],
@@ -514,7 +514,7 @@ def do_test_scopes_and_evaluate_expansion(self, enableAutoVariableSummaries: boo
"result": (
"{x:11, y:22, buffer:{...}}"
if enableAutoVariableSummaries
- else "PointType @ 0x"
+ else "PointType"
)
},
"missing": ["indexedVariables"],
@@ -526,7 +526,7 @@ def do_test_scopes_and_evaluate_expansion(self, enableAutoVariableSummaries: boo
"result": (
"{x:11, y:22, buffer:{...}}"
if enableAutoVariableSummaries
- else "PointType @ 0x"
+ else "PointType"
)
},
"missing": ["indexedVariables"],
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp b/lldb/tools/lldb-dap/JSONUtils.cpp
index 1f9719110cedb..1beee416bf333 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -814,13 +814,8 @@ VariableDescription::VariableDescription(lldb::SBValue v,
os_display_value << *effective_summary;
// As last resort, we print its type and address if available.
- } else {
- if (!raw_display_type_name.empty()) {
- os_display_value << raw_display_type_name;
- lldb::addr_t address = v.GetLoadAddress();
- if (address != LLDB_INVALID_ADDRESS)
- os_display_value << " @ " << llvm::format_hex(address, 0);
- }
+ } else if (!raw_display_type_name.empty()) {
+ os_display_value << raw_display_type_name;
}
}
More information about the lldb-commits
mailing list