From 1c1ffc46d517963f8ed7a317092bb2a5ea3cd2db Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 12 Dec 2014 16:57:32 -0500 Subject: [PATCH] Debugger: Minor tweak to DwarfType. - When creating a derived type, adjust the name accordingly to indicate the additional qualifiers. Fixes a problem where casted type names would be displayed as their base type only, even if they included pointers or array subscripts. --- src/apps/debugger/debug_info/DwarfTypes.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/apps/debugger/debug_info/DwarfTypes.cpp b/src/apps/debugger/debug_info/DwarfTypes.cpp index 9b322318db..641c7d8c05 100644 --- a/src/apps/debugger/debug_info/DwarfTypes.cpp +++ b/src/apps/debugger/debug_info/DwarfTypes.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copryight 2012-2013, Rene Gollent, rene@gollent.com. + * Copryight 2012-2014, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -242,8 +242,11 @@ status_t DwarfType::CreateDerivedAddressType(address_type_kind addressType, AddressType*& _resultType) { + BString derivedName; + derivedName.SetToFormat("%s%c", fName.String(), + addressType == DERIVED_TYPE_POINTER ? '*' : '&'); DwarfAddressType* resultType = new(std::nothrow) - DwarfAddressType(fTypeContext, fName, NULL, addressType, this); + DwarfAddressType(fTypeContext, derivedName, NULL, addressType, this); if (resultType == NULL) return B_NO_MEMORY; @@ -265,8 +268,10 @@ DwarfType::CreateDerivedArrayType(int64 lowerBound, int64 elementCount, resultType = dynamic_cast(this); if (resultType == NULL) { + BString derivedName; + derivedName.SetToFormat("%s[]", fName.String()); resultType = new(std::nothrow) - DwarfArrayType(fTypeContext, fName, NULL, this); + DwarfArrayType(fTypeContext, derivedName, NULL, this); baseTypeReference.SetTo(resultType, true); }