-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[lldb-dap] Do not show memory address on types with no summary #172670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
@llvm/pr-subscribers-lldb Author: Ebuka Ezike (da-viper) ChangesMajority 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). can always fall back to the debug console or watch pane to view the information if necessary.
Full diff: https://github.com/llvm/llvm-project/pull/172670.diff 3 Files Affected:
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;
}
}
|



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.