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 8 9 10 #include <ObjectList.h> 11 #include <Referenceable.h> 12 13 #include "AddressSectionTypes.h" 14 #include "ReturnValueInfo.h" 15 #include "Types.h" 16 17 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; 38 39 40 class SpecificImageDebugInfo : public BReferenceable { 41 public: 42 virtual ~SpecificImageDebugInfo(); 43 44 virtual status_t GetFunctions( 45 const BObjectList<SymbolInfo>& symbols, 46 BObjectList<FunctionDebugInfo>& functions) 47 = 0; 48 // returns references 49 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; 58 59 virtual AddressSectionType GetAddressSectionType(target_addr_t address) 60 = 0; 61 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 84 85 virtual status_t GetSourceLanguage(FunctionDebugInfo* function, 86 SourceLanguage*& _language) = 0; 87 88 virtual ssize_t ReadCode(target_addr_t address, void* buffer, 89 size_t size) = 0; 90 91 virtual status_t AddSourceCodeInfo(LocatableFile* file, 92 FileSourceCode* sourceCode) = 0; 93 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); 101 102 }; 103 104 105 #endif // SPECIFIC_IMAGE_DEBUG_INFO_H 106