1/* 2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef IMAGE_H 6#define IMAGE_H 7 8#include "SharedImage.h" 9 10 11class Image : public BReferenceable { 12public: 13 Image(SharedImage* image, 14 const image_info& info, team_id owner, 15 int32 creationEvent); 16 ~Image(); 17 18 inline SharedImage* GetSharedImage() const { return fImage; } 19 20 inline const image_id ID() const; 21 inline const char* Name() const; 22 inline team_id Owner() const; 23 inline addr_t LoadDelta() const { return fLoadDelta; } 24 25 inline int32 CreationEvent() const; 26 inline int32 DeletionEvent() const; 27 inline void SetDeletionEvent(int32 event); 28 29 inline Symbol** Symbols() const; 30 inline int32 SymbolCount() const; 31 32 inline bool ContainsAddress(addr_t address) const; 33 inline int32 FindSymbol(addr_t address) const; 34 35private: 36 SharedImage* fImage; 37 image_id fID; 38 team_id fOwner; 39 addr_t fLoadDelta; 40 int32 fCreationEvent; 41 int32 fDeletionEvent; 42}; 43 44 45// #pragma mark - 46 47 48const image_id 49Image::ID() const 50{ 51 return fID; 52} 53 54 55const char* 56Image::Name() const 57{ 58 return fImage->Name(); 59} 60 61 62team_id 63Image::Owner() const 64{ 65 return fOwner; 66} 67 68 69int32 70Image::CreationEvent() const 71{ 72 return fCreationEvent; 73} 74 75 76int32 77Image::DeletionEvent() const 78{ 79 return fDeletionEvent; 80} 81 82 83void 84Image::SetDeletionEvent(int32 event) 85{ 86 fDeletionEvent = event; 87} 88 89 90Symbol** 91Image::Symbols() const 92{ 93 return fImage->Symbols(); 94} 95 96 97int32 98Image::SymbolCount() const 99{ 100 return fImage->SymbolCount(); 101} 102 103 104bool 105Image::ContainsAddress(addr_t address) const 106{ 107 return fImage->ContainsAddress(address - fLoadDelta); 108} 109 110 111int32 112Image::FindSymbol(addr_t address) const 113{ 114 return fImage->FindSymbol(address - fLoadDelta); 115} 116 117 118#endif // IMAGE_H 119