vfs: check userland buffers before reading them.
[haiku.git] / headers / private / debugger / debug_info / SpecificImageDebugInfo.h
blob00110d30b2b0274f14df7b0a200f11b0fec75243
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2013-2014, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
5 */
6 #ifndef SPECIFIC_IMAGE_DEBUG_INFO_H
7 #define SPECIFIC_IMAGE_DEBUG_INFO_H
10 #include <ObjectList.h>
11 #include <Referenceable.h>
13 #include "AddressSectionTypes.h"
14 #include "ReturnValueInfo.h"
15 #include "Types.h"
18 class Architecture;
19 class BString;
20 class CpuState;
21 class DataMember;
22 class DebuggerInterface;
23 class FileSourceCode;
24 class FunctionDebugInfo;
25 class FunctionInstance;
26 class GlobalTypeCache;
27 class Image;
28 class ImageInfo;
29 class LocatableFile;
30 class SourceLanguage;
31 class SourceLocation;
32 class StackFrame;
33 class Statement;
34 class SymbolInfo;
35 class Type;
36 class TypeLookupConstraints;
37 class ValueLocation;
40 class SpecificImageDebugInfo : public BReferenceable {
41 public:
42 virtual ~SpecificImageDebugInfo();
44 virtual status_t GetFunctions(
45 const BObjectList<SymbolInfo>& symbols,
46 BObjectList<FunctionDebugInfo>& functions)
47 = 0;
48 // returns references
50 virtual status_t GetType(GlobalTypeCache* cache,
51 const BString& name,
52 const TypeLookupConstraints& constraints,
53 Type*& _type) = 0;
54 // returns a reference
55 virtual bool HasType(const BString& name,
56 const TypeLookupConstraints& constraints)
57 const = 0;
59 virtual AddressSectionType GetAddressSectionType(target_addr_t address)
60 = 0;
62 virtual status_t CreateFrame(Image* image,
63 FunctionInstance* functionInstance,
64 CpuState* cpuState,
65 bool getFullFrameInfo,
66 ReturnValueInfoList* returnValueInfos,
67 StackFrame*& _Frame,
68 CpuState*& _previousCpuState) = 0;
69 // returns reference to previous frame
70 // and CPU state; returned CPU state
71 // can be NULL; can return B_UNSUPPORTED
72 // getFullFrameInfo: try to retrieve
73 // variables/parameters if true
74 // (and supported)
75 virtual status_t GetStatement(FunctionDebugInfo* function,
76 target_addr_t address,
77 Statement*& _statement) = 0;
78 // returns reference
79 virtual status_t GetStatementAtSourceLocation(
80 FunctionDebugInfo* function,
81 const SourceLocation& sourceLocation,
82 Statement*& _statement) = 0;
83 // returns reference
85 virtual status_t GetSourceLanguage(FunctionDebugInfo* function,
86 SourceLanguage*& _language) = 0;
88 virtual ssize_t ReadCode(target_addr_t address, void* buffer,
89 size_t size) = 0;
91 virtual status_t AddSourceCodeInfo(LocatableFile* file,
92 FileSourceCode* sourceCode) = 0;
94 protected:
95 static status_t GetFunctionsFromSymbols(
96 const BObjectList<SymbolInfo>& symbols,
97 BObjectList<FunctionDebugInfo>& functions,
98 DebuggerInterface* interface,
99 const ImageInfo& imageInfo,
100 SpecificImageDebugInfo* info);
105 #endif // SPECIFIC_IMAGE_DEBUG_INFO_H