2009-06-16 04:25:36 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef IMAGE_H
|
|
|
|
#define IMAGE_H
|
|
|
|
|
|
|
|
#include <image.h>
|
|
|
|
|
2009-06-17 01:47:49 +04:00
|
|
|
#include <Referenceable.h>
|
2009-06-16 04:25:36 +04:00
|
|
|
#include <util/DoublyLinkedList.h>
|
|
|
|
|
2009-06-18 21:57:37 +04:00
|
|
|
#include "ImageInfo.h"
|
|
|
|
|
2009-06-16 04:25:36 +04:00
|
|
|
|
2009-06-27 20:49:55 +04:00
|
|
|
enum image_debug_info_state {
|
|
|
|
IMAGE_DEBUG_INFO_NOT_LOADED,
|
|
|
|
IMAGE_DEBUG_INFO_LOADING,
|
|
|
|
IMAGE_DEBUG_INFO_LOADED,
|
|
|
|
IMAGE_DEBUG_INFO_UNAVAILABLE
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-06-20 21:20:49 +04:00
|
|
|
class ImageDebugInfo;
|
2009-07-02 02:09:33 +04:00
|
|
|
class LocatableFile;
|
2009-06-18 04:35:12 +04:00
|
|
|
class Team;
|
|
|
|
|
|
|
|
|
2010-12-16 16:50:30 +03:00
|
|
|
class Image : public BReferenceable, public DoublyLinkedListLinkImpl<Image> {
|
2009-06-16 04:25:36 +04:00
|
|
|
public:
|
2009-07-02 02:09:33 +04:00
|
|
|
Image(Team* team, const ImageInfo& imageInfo,
|
|
|
|
LocatableFile* imageFile);
|
2009-06-16 04:25:36 +04:00
|
|
|
~Image();
|
|
|
|
|
|
|
|
status_t Init();
|
|
|
|
|
2009-06-20 21:20:49 +04:00
|
|
|
Team* GetTeam() const { return fTeam; }
|
|
|
|
image_id ID() const { return fInfo.ImageID(); }
|
2009-07-24 06:35:30 +04:00
|
|
|
const BString& Name() const { return fInfo.Name(); }
|
2009-06-20 21:20:49 +04:00
|
|
|
const ImageInfo& Info() const { return fInfo; }
|
2009-07-03 18:23:19 +04:00
|
|
|
image_type Type() const { return fInfo.Type(); }
|
2009-07-02 02:09:33 +04:00
|
|
|
LocatableFile* ImageFile() const { return fImageFile; }
|
2009-06-20 21:20:49 +04:00
|
|
|
|
|
|
|
bool ContainsAddress(target_addr_t address) const;
|
2009-06-16 04:25:36 +04:00
|
|
|
|
2009-06-27 20:49:55 +04:00
|
|
|
// mutable attributes follow (locking required)
|
|
|
|
ImageDebugInfo* GetImageDebugInfo() const { return fDebugInfo; }
|
|
|
|
image_debug_info_state ImageDebugInfoState() const
|
|
|
|
{ return fDebugInfoState; }
|
2009-07-08 00:47:39 +04:00
|
|
|
status_t SetImageDebugInfo(ImageDebugInfo* debugInfo,
|
2009-06-27 20:49:55 +04:00
|
|
|
image_debug_info_state state);
|
|
|
|
|
2009-06-16 04:25:36 +04:00
|
|
|
private:
|
2009-06-18 04:35:12 +04:00
|
|
|
Team* fTeam;
|
2009-06-18 21:57:37 +04:00
|
|
|
ImageInfo fInfo;
|
2009-07-02 02:09:33 +04:00
|
|
|
LocatableFile* fImageFile;
|
2009-06-27 20:49:55 +04:00
|
|
|
// mutable
|
2009-06-20 21:20:49 +04:00
|
|
|
ImageDebugInfo* fDebugInfo;
|
2009-06-27 20:49:55 +04:00
|
|
|
image_debug_info_state fDebugInfoState;
|
2009-06-16 04:25:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef DoublyLinkedList<Image> ImageList;
|
|
|
|
|
|
|
|
|
|
|
|
#endif // IMAGE_H
|