vfs: check userland buffers before reading them.
[haiku.git] / headers / private / debugger / model / Image.h
blob0695fba6661a2287d30b13a64d292ec0cd69d000
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef IMAGE_H
6 #define IMAGE_H
8 #include <image.h>
10 #include <Referenceable.h>
11 #include <util/DoublyLinkedList.h>
13 #include "ImageInfo.h"
16 enum image_debug_info_state {
17 IMAGE_DEBUG_INFO_NOT_LOADED,
18 IMAGE_DEBUG_INFO_LOADING,
19 IMAGE_DEBUG_INFO_LOADED,
20 IMAGE_DEBUG_INFO_UNAVAILABLE
24 class ImageDebugInfo;
25 class LocatableFile;
26 class Team;
29 class Image : public BReferenceable, public DoublyLinkedListLinkImpl<Image> {
30 public:
31 Image(Team* team, const ImageInfo& imageInfo,
32 LocatableFile* imageFile);
33 ~Image();
35 status_t Init();
37 Team* GetTeam() const { return fTeam; }
38 image_id ID() const { return fInfo.ImageID(); }
39 const BString& Name() const { return fInfo.Name(); }
40 const ImageInfo& Info() const { return fInfo; }
41 image_type Type() const { return fInfo.Type(); }
42 LocatableFile* ImageFile() const { return fImageFile; }
44 bool ContainsAddress(target_addr_t address) const;
46 // mutable attributes follow (locking required)
47 ImageDebugInfo* GetImageDebugInfo() const { return fDebugInfo; }
48 image_debug_info_state ImageDebugInfoState() const
49 { return fDebugInfoState; }
50 status_t SetImageDebugInfo(ImageDebugInfo* debugInfo,
51 image_debug_info_state state);
53 private:
54 Team* fTeam;
55 ImageInfo fInfo;
56 LocatableFile* fImageFile;
57 // mutable
58 ImageDebugInfo* fDebugInfo;
59 image_debug_info_state fDebugInfoState;
63 typedef DoublyLinkedList<Image> ImageList;
66 #endif // IMAGE_H