Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lldb/source/DataFormatters/FormatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ void FormatManager::GetPossibleMatches(

if (compiler_type.IsPointerType()) {
CompilerType non_ptr_type = compiler_type.GetPointeeType();
GetPossibleMatches(valobj, non_ptr_type, use_dynamic, entries,
current_flags.WithStrippedPointer());
if (!current_flags.stripped_pointer)
GetPossibleMatches(valobj, non_ptr_type, use_dynamic, entries,
current_flags.WithStrippedPointer(), false);
if (non_ptr_type.IsTypedefType()) {
CompilerType deffed_pointed_type =
non_ptr_type.GetTypedefedType().GetPointerType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,15 @@ def cleanup():
# the match.
self.expect("frame variable y", substrs=["(Foo &", ") y = 0x", "IntLRef"])
self.expect("frame variable z", substrs=["(Foo &&", ") z = 0x", "IntRRef"])

# Test lldb doesn't dereference pointer more than once.
# xp has type Foo**, so it can only uses summary for Foo* or int*, not
# summary for Foo or int.
self.expect("frame variable xp", substrs=["(Foo **) xp = 0x", "IntPointer"])

self.runCmd('type summary delete "int *"')
self.runCmd('type summary add --cascade true -s "MyInt" "int"')
self.expect("frame variable xp", substrs=["(Foo **) xp = 0x"])

self.runCmd('type summary add --cascade true -s "FooPointer" "Foo *"')
self.expect("frame variable xp", substrs=["(Foo **) xp = 0x", "FooPointer"])
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
typedef int Foo;

int main() {
int lval = 1;
Foo* x = &lval;
Foo& y = lval;
Foo&& z = 1;
return 0; // Set breakpoint here
}
int lval = 1;
Foo *x = &lval;
Foo &y = lval;
Foo &&z = 1;

// Test lldb doesn't dereference pointer more than once.
Foo **xp = &x;
return 0; // Set breakpoint here
}
Loading