Author: Ebuka Ezike Date: 2025-12-18T18:08:16Z New Revision: b34dd38784c94444e2686189b43e5a22ffae07b4
URL: https://github.com/llvm/llvm-project/commit/b34dd38784c94444e2686189b43e5a22ffae07b4 DIFF: https://github.com/llvm/llvm-project/commit/b34dd38784c94444e2686189b43e5a22ffae07b4.diff LOG: [lldb-dap] Do not show memory address on types with no summary (#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. Added: Modified: lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py lldb/tools/lldb-dap/JSONUtils.cpp Removed: ################################################################################ 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; } } _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
