Add support for creating derived types to DwarfType.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
* Copyright 2009-2012, Ingo Weinhold, [email protected].
|
||||||
|
* Copryight 2012, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -225,6 +226,21 @@ DwarfType::ByteSize() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
DwarfType::CreateDerivedAddressType(address_type_kind addressType,
|
||||||
|
AddressType*& _resultType)
|
||||||
|
{
|
||||||
|
DwarfAddressType* resultType = new(std::nothrow)
|
||||||
|
DwarfAddressType(fTypeContext, fName, NULL, addressType, this);
|
||||||
|
|
||||||
|
if (resultType == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
_resultType = resultType;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
DwarfType::ResolveObjectDataLocation(const ValueLocation& objectLocation,
|
DwarfType::ResolveObjectDataLocation(const ValueLocation& objectLocation,
|
||||||
ValueLocation*& _location)
|
ValueLocation*& _location)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
|
* Copryight 2012, Rene Gollent, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef DWARF_TYPES_H
|
#ifndef DWARF_TYPES_H
|
||||||
@@ -107,6 +108,10 @@ public:
|
|||||||
virtual const BString& Name() const;
|
virtual const BString& Name() const;
|
||||||
virtual target_size_t ByteSize() const;
|
virtual target_size_t ByteSize() const;
|
||||||
|
|
||||||
|
virtual status_t CreateDerivedAddressType(
|
||||||
|
address_type_kind kind,
|
||||||
|
AddressType*& _resultType);
|
||||||
|
|
||||||
virtual status_t ResolveObjectDataLocation(
|
virtual status_t ResolveObjectDataLocation(
|
||||||
const ValueLocation& objectLocation,
|
const ValueLocation& objectLocation,
|
||||||
ValueLocation*& _location);
|
ValueLocation*& _location);
|
||||||
|
|||||||
@@ -87,6 +87,15 @@ Type::ResolveRawType(bool nextOneOnly) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
Type::CreateDerivedAddressType(address_type_kind kind,
|
||||||
|
AddressType*& _resultType)
|
||||||
|
{
|
||||||
|
_resultType = NULL;
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - PrimitiveType
|
// #pragma mark - PrimitiveType
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class AddressType;
|
||||||
class ArrayIndexPath;
|
class ArrayIndexPath;
|
||||||
class BString;
|
class BString;
|
||||||
class Type;
|
class Type;
|
||||||
@@ -117,6 +118,12 @@ public:
|
|||||||
// strips modifiers and typedefs (only one,
|
// strips modifiers and typedefs (only one,
|
||||||
// if requested)
|
// if requested)
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: also need the ability to derive array types
|
||||||
|
virtual status_t CreateDerivedAddressType(
|
||||||
|
address_type_kind kind,
|
||||||
|
AddressType*& _resultType);
|
||||||
|
|
||||||
virtual status_t ResolveObjectDataLocation(
|
virtual status_t ResolveObjectDataLocation(
|
||||||
const ValueLocation& objectLocation,
|
const ValueLocation& objectLocation,
|
||||||
ValueLocation*& _location) = 0;
|
ValueLocation*& _location) = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user