From 2fab6ab72851a5497eca957db137829fe6d0b7b6 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 18 Jul 2013 21:33:28 -0400 Subject: [PATCH] Debugger: Fix handling of contained type attribute. The DIEs generated by gcc sometimes pass a modified type for DIEPointerToMember's containing type. As such, we need to resolve the passed in type down to its base type before verifying that it's indeed a compound type. --- src/apps/debugger/dwarf/DebugInfoEntries.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp b/src/apps/debugger/dwarf/DebugInfoEntries.cpp index c8c8852950..b4f620a1bc 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp @@ -1431,7 +1431,12 @@ status_t DIEPointerToMemberType::AddAttribute_containing_type(uint16 attributeName, const AttributeValue& value) { - fContainingType = dynamic_cast(value.reference); + DebugInfoEntry* type = value.reference; + DIEModifiedType* modifiedType; + while ((modifiedType = dynamic_cast(type)) != NULL) + type = modifiedType->GetType(); + + fContainingType = dynamic_cast(type); return fContainingType != NULL ? B_OK : B_BAD_DATA; }