1/* 2 * Copyright 2014, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7#include "SyntheticPrimitiveType.h" 8 9#include <Variant.h> 10 11#include "UiUtils.h" 12 13 14SyntheticPrimitiveType::SyntheticPrimitiveType(uint32 typeConstant) 15 : 16 PrimitiveType(), 17 fTypeConstant(typeConstant), 18 fID(), 19 fName() 20{ 21 _Init(); 22} 23 24 25SyntheticPrimitiveType::~SyntheticPrimitiveType() 26{ 27} 28 29 30uint32 31SyntheticPrimitiveType::TypeConstant() const 32{ 33 return fTypeConstant; 34} 35 36 37image_id 38SyntheticPrimitiveType::ImageID() const 39{ 40 return -1; 41} 42 43 44const BString& 45SyntheticPrimitiveType::ID() const 46{ 47 return fID; 48} 49 50 51const BString& 52SyntheticPrimitiveType::Name() const 53{ 54 return fName; 55} 56 57 58type_kind 59SyntheticPrimitiveType::Kind() const 60{ 61 return TYPE_PRIMITIVE; 62} 63 64 65target_size_t 66SyntheticPrimitiveType::ByteSize() const 67{ 68 return BVariant::SizeOfType(fTypeConstant); 69} 70 71 72status_t 73SyntheticPrimitiveType::ResolveObjectDataLocation( 74 const ValueLocation& objectLocation, ValueLocation*& _location) 75{ 76 _location = NULL; 77 return B_NOT_SUPPORTED; 78} 79 80 81status_t 82SyntheticPrimitiveType::ResolveObjectDataLocation(target_addr_t objectAddress, 83 ValueLocation*& _location) 84{ 85 _location = NULL; 86 return B_NOT_SUPPORTED; 87} 88 89 90void 91SyntheticPrimitiveType::_Init() 92{ 93 fID.SetToFormat("%p", this); 94 fName.SetTo(UiUtils::TypeCodeToString(fTypeConstant)); 95} 96