xref: /haiku/src/kits/debugger/debug_info/DwarfStackFrameDebugInfo.h (revision 815212800210a100d07c2c3d8dfea18360426319)
1fce4895dSRene Gollent /*
2fce4895dSRene Gollent  * Copyright 2012, Rene Gollent, rene@gollent.com.
3fce4895dSRene Gollent  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4fce4895dSRene Gollent  * Distributed under the terms of the MIT License.
5fce4895dSRene Gollent  */
6fce4895dSRene Gollent #ifndef DWARF_STACK_FRAME_DEBUG_INFO_H
7fce4895dSRene Gollent #define DWARF_STACK_FRAME_DEBUG_INFO_H
8fce4895dSRene Gollent 
9fce4895dSRene Gollent 
10fce4895dSRene Gollent #include <image.h>
11fce4895dSRene Gollent #include <String.h>
12fce4895dSRene Gollent 
13fce4895dSRene Gollent #include "StackFrameDebugInfo.h"
14fce4895dSRene Gollent 
15fce4895dSRene Gollent 
16fce4895dSRene Gollent class CompilationUnit;
17fce4895dSRene Gollent class CpuState;
18fce4895dSRene Gollent class DIEFormalParameter;
19fce4895dSRene Gollent class DIESubprogram;
20fce4895dSRene Gollent class DIEType;
21fce4895dSRene Gollent class DIEVariable;
22fce4895dSRene Gollent class DwarfFile;
23fce4895dSRene Gollent class DwarfTargetInterface;
24fce4895dSRene Gollent class DwarfTypeContext;
25fce4895dSRene Gollent class DwarfTypeFactory;
26fce4895dSRene Gollent class FunctionID;
27fce4895dSRene Gollent class GlobalTypeCache;
28fce4895dSRene Gollent class GlobalTypeLookup;
29*81521280SX512 struct LocationDescription;
30fce4895dSRene Gollent class ObjectID;
31fce4895dSRene Gollent class RegisterMap;
32fce4895dSRene Gollent class Variable;
33fce4895dSRene Gollent 
34fce4895dSRene Gollent 
35fce4895dSRene Gollent class DwarfStackFrameDebugInfo : public StackFrameDebugInfo {
36fce4895dSRene Gollent public:
37fce4895dSRene Gollent 								DwarfStackFrameDebugInfo(
38fce4895dSRene Gollent 									Architecture* architecture,
39fce4895dSRene Gollent 									image_id imageID, DwarfFile* file,
40fce4895dSRene Gollent 									CompilationUnit* compilationUnit,
41fce4895dSRene Gollent 									DIESubprogram* subprogramEntry,
42fce4895dSRene Gollent 									GlobalTypeLookup* typeLookup,
43fce4895dSRene Gollent 									GlobalTypeCache* typeCache,
44fce4895dSRene Gollent 									target_addr_t instructionPointer,
45fce4895dSRene Gollent 									target_addr_t framePointer,
46fce4895dSRene Gollent 									target_addr_t relocationDelta,
47fce4895dSRene Gollent 									DwarfTargetInterface* targetInterface,
48fce4895dSRene Gollent 									RegisterMap* fromDwarfRegisterMap);
49fce4895dSRene Gollent 								~DwarfStackFrameDebugInfo();
50fce4895dSRene Gollent 
51fce4895dSRene Gollent 			status_t			Init();
52fce4895dSRene Gollent 
53fce4895dSRene Gollent 			status_t			CreateParameter(FunctionID* functionID,
54fce4895dSRene Gollent 									DIEFormalParameter* parameterEntry,
55fce4895dSRene Gollent 									Variable*& _parameter);
56fce4895dSRene Gollent 									// returns reference
57fce4895dSRene Gollent 			status_t			CreateLocalVariable(FunctionID* functionID,
58fce4895dSRene Gollent 									DIEVariable* variableEntry,
59fce4895dSRene Gollent 									Variable*& _variable);
60fce4895dSRene Gollent 									// returns reference
61fce4895dSRene Gollent 			status_t			CreateReturnValue(FunctionID* functionID,
62fce4895dSRene Gollent 									DIEType* returnType,
63fce4895dSRene Gollent 									ValueLocation* location,
64fce4895dSRene Gollent 									CpuState* state,
65fce4895dSRene Gollent 									Variable*& _variable);
66fce4895dSRene Gollent 									// returns reference
67fce4895dSRene Gollent 
68fce4895dSRene Gollent private:
69fce4895dSRene Gollent 			struct DwarfFunctionParameterID;
70fce4895dSRene Gollent 			struct DwarfLocalVariableID;
71fce4895dSRene Gollent 			struct DwarfReturnValueID;
72fce4895dSRene Gollent 
73fce4895dSRene Gollent private:
74fce4895dSRene Gollent 			status_t			_CreateVariable(ObjectID* id,
75fce4895dSRene Gollent 									const BString& name, DIEType* typeEntry,
76fce4895dSRene Gollent 									LocationDescription* locationDescription,
77fce4895dSRene Gollent 									Variable*& _variable);
78fce4895dSRene Gollent 
79fce4895dSRene Gollent 	template<typename EntryType>
80fce4895dSRene Gollent 	static	DIEType*			_GetDIEType(EntryType* entry);
81fce4895dSRene Gollent 
82fce4895dSRene Gollent private:
83fce4895dSRene Gollent 			DwarfTypeContext*	fTypeContext;
84fce4895dSRene Gollent 			GlobalTypeLookup*	fTypeLookup;
85fce4895dSRene Gollent 			GlobalTypeCache*	fTypeCache;
86fce4895dSRene Gollent 			DwarfTypeFactory*	fTypeFactory;
87fce4895dSRene Gollent };
88fce4895dSRene Gollent 
89fce4895dSRene Gollent 
90fce4895dSRene Gollent #endif	// DWARF_STACK_FRAME_DEBUG_INFO_H
91