diff --git a/src/apps/debugger/Jamfile b/src/apps/debugger/Jamfile index f6b0694ce63..75a30b9efe4 100644 --- a/src/apps/debugger/Jamfile +++ b/src/apps/debugger/Jamfile @@ -250,6 +250,7 @@ Application Debugger : GraphicalUserInterface.cpp # user_interface/gui/model + SyntheticPrimitiveType.cpp VariablesViewState.cpp VariablesViewStateHistory.cpp diff --git a/src/apps/debugger/user_interface/gui/model/SyntheticPrimitiveType.cpp b/src/apps/debugger/user_interface/gui/model/SyntheticPrimitiveType.cpp new file mode 100644 index 00000000000..52c6c78c979 --- /dev/null +++ b/src/apps/debugger/user_interface/gui/model/SyntheticPrimitiveType.cpp @@ -0,0 +1,95 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + + +#include "SyntheticPrimitiveType.h" + +#include + +#include "UiUtils.h" + + +SyntheticPrimitiveType::SyntheticPrimitiveType(uint32 typeConstant) + : + PrimitiveType(), + fTypeConstant(typeConstant), + fID(), + fName() +{ + _Init(); +} + + +SyntheticPrimitiveType::~SyntheticPrimitiveType() +{ +} + + +uint32 +SyntheticPrimitiveType::TypeConstant() const +{ + return fTypeConstant; +} + + +image_id +SyntheticPrimitiveType::ImageID() const +{ + return -1; +} + + +const BString& +SyntheticPrimitiveType::ID() const +{ + return fID; +} + + +const BString& +SyntheticPrimitiveType::Name() const +{ + return fName; +} + + +type_kind +SyntheticPrimitiveType::Kind() const +{ + return TYPE_PRIMITIVE; +} + + +target_size_t +SyntheticPrimitiveType::ByteSize() const +{ + return BVariant::SizeOfType(fTypeConstant); +} + + +status_t +SyntheticPrimitiveType::ResolveObjectDataLocation( + const ValueLocation& objectLocation, ValueLocation*& _location) +{ + _location = NULL; + return B_NOT_SUPPORTED; +} + + +status_t +SyntheticPrimitiveType::ResolveObjectDataLocation(target_addr_t objectAddress, + ValueLocation*& _location) +{ + _location = NULL; + return B_NOT_SUPPORTED; +} + + +void +SyntheticPrimitiveType::_Init() +{ + fID.SetToFormat("%p", this); + fName.SetTo(UiUtils::TypeCodeToString(fTypeConstant)); +} diff --git a/src/apps/debugger/user_interface/gui/model/SyntheticPrimitiveType.h b/src/apps/debugger/user_interface/gui/model/SyntheticPrimitiveType.h new file mode 100644 index 00000000000..19dae5875b5 --- /dev/null +++ b/src/apps/debugger/user_interface/gui/model/SyntheticPrimitiveType.h @@ -0,0 +1,44 @@ +/* + * Copyright 2014, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef SYNTHETIC_PRIMITIVE_TYPE_H +#define SYNTHETIC_PRIMITIVE_TYPE_H + + +#include "Type.h" + +#include + + +class SyntheticPrimitiveType : public PrimitiveType { +public: + SyntheticPrimitiveType(uint32 typeConstant); + virtual ~SyntheticPrimitiveType(); + + virtual uint32 TypeConstant() const; + + virtual image_id ImageID() const; + virtual const BString& ID() const; + virtual const BString& Name() const; + virtual type_kind Kind() const; + virtual target_size_t ByteSize() const; + + virtual status_t ResolveObjectDataLocation( + const ValueLocation& objectLocation, + ValueLocation*& _location); + virtual status_t ResolveObjectDataLocation( + target_addr_t objectAddress, + ValueLocation*& _location); + +private: + void _Init(); + +private: + uint32 fTypeConstant; + BString fID; + BString fName; +}; + + +#endif // SYNTHETIC_PRIMITIVE_TYPE