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.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
||||||
* Copryight 2012-2013, Rene Gollent, [email protected].
|
* Copryight 2012-2014, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -242,8 +242,11 @@ status_t
|
|||||||
DwarfType::CreateDerivedAddressType(address_type_kind addressType,
|
DwarfType::CreateDerivedAddressType(address_type_kind addressType,
|
||||||
AddressType*& _resultType)
|
AddressType*& _resultType)
|
||||||
{
|
{
|
||||||
|
BString derivedName;
|
||||||
|
derivedName.SetToFormat("%s%c", fName.String(),
|
||||||
|
addressType == DERIVED_TYPE_POINTER ? '*' : '&');
|
||||||
DwarfAddressType* resultType = new(std::nothrow)
|
DwarfAddressType* resultType = new(std::nothrow)
|
||||||
DwarfAddressType(fTypeContext, fName, NULL, addressType, this);
|
DwarfAddressType(fTypeContext, derivedName, NULL, addressType, this);
|
||||||
|
|
||||||
if (resultType == NULL)
|
if (resultType == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -265,8 +268,10 @@ DwarfType::CreateDerivedArrayType(int64 lowerBound, int64 elementCount,
|
|||||||
resultType = dynamic_cast<DwarfArrayType*>(this);
|
resultType = dynamic_cast<DwarfArrayType*>(this);
|
||||||
|
|
||||||
if (resultType == NULL) {
|
if (resultType == NULL) {
|
||||||
|
BString derivedName;
|
||||||
|
derivedName.SetToFormat("%s[]", fName.String());
|
||||||
resultType = new(std::nothrow)
|
resultType = new(std::nothrow)
|
||||||
DwarfArrayType(fTypeContext, fName, NULL, this);
|
DwarfArrayType(fTypeContext, derivedName, NULL, this);
|
||||||
baseTypeReference.SetTo(resultType, true);
|
baseTypeReference.SetTo(resultType, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user