Skip to content

Commit 4a030f5

Browse files
author
walter erquinigo
committed
[lldb-vscode][NFC] Access a pointee type in a simpler way
The new code is a bit simpler bit achieves the same goal. A small test was added just in case.
1 parent 9b57b16 commit 4a030f5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lldb/test/API/tools/lldb-vscode/evaluate/TestVSCode_evaluate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def run_test_evaluate_expressions(
6262
self.assertEvaluate(
6363
"struct1", "{foo:15}" if enableAutoVariableSummaries else "my_struct @ 0x"
6464
)
65+
self.assertEvaluate(
66+
"struct2", "{foo:16}" if enableAutoVariableSummaries else "0x.*"
67+
)
6568
self.assertEvaluate("struct1.foo", "15")
6669
self.assertEvaluate("struct2->foo", "16")
6770

lldb/tools/lldb-vscode/JSONUtils.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,9 @@ static bool ShouldBeDereferencedForSummary(lldb::SBValue &v) {
203203
if (!v.GetType().IsPointerType() && !v.GetType().IsReferenceType())
204204
return false;
205205

206-
// If it's a pointer to a pointer, we don't dereference to avoid confusing
206+
// If we are referencing a pointer, we don't dereference to avoid confusing
207207
// the user with the addresses that could shown in the summary.
208-
if (v.GetType().IsPointerType() &&
209-
v.GetType().GetDereferencedType().IsPointerType())
208+
if (v.Dereference().GetType().IsPointerType())
210209
return false;
211210

212211
// If it's synthetic or a pointer to a basic type that provides a summary, we

0 commit comments

Comments
 (0)