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 18class Architecture; 19class BString; 20class CpuState; 21class DataMember; 22class DebuggerInterface; 23class FileSourceCode; 24class FunctionDebugInfo; 25class FunctionInstance; 26class GlobalTypeCache; 27class Image; 28class ImageInfo; 29class LocatableFile; 30class SourceLanguage; 31class SourceLocation; 32class StackFrame; 33class Statement; 34class SymbolInfo; 35class Type; 36class TypeLookupConstraints; 37class ValueLocation; 38 39 40class SpecificImageDebugInfo : public BReferenceable { 41public: 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 94protected: 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