xref: /haiku/src/kits/debugger/dwarf/DwarfTargetInterface.h (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef DWARF_TARGET_INTERFACE_H
6 #define DWARF_TARGET_INTERFACE_H
7 
8 
9 #include <Referenceable.h>
10 #include <Variant.h>
11 
12 #include "Types.h"
13 
14 
15 class CfaContext;
16 class Register;
17 
18 
19 class DwarfTargetInterface : public BReferenceable {
20 public:
21 	virtual						~DwarfTargetInterface();
22 
23 	virtual	uint32				CountRegisters() const = 0;
24 	virtual	uint32				RegisterValueType(uint32 index) const = 0;
25 
26 	virtual	bool				GetRegisterValue(uint32 index,
27 									BVariant& _value) const = 0;
28 	virtual	bool				SetRegisterValue(uint32 index,
29 									const BVariant& value) = 0;
30 	virtual	bool				IsCalleePreservedRegister(uint32 index) const
31 									= 0;
32 	virtual status_t			InitRegisterRules(CfaContext& context) const
33 									= 0;
34 
35 	virtual	bool				ReadMemory(target_addr_t address, void* buffer,
36 									size_t size) const = 0;
37 	virtual	bool				ReadValueFromMemory(target_addr_t address,
38 									uint32 valueType, BVariant& _value) const
39 										= 0;
40 	virtual	bool				ReadValueFromMemory(target_addr_t addressSpace,
41 									target_addr_t address,
42 									uint32 valueType, BVariant& _value) const
43 										= 0;
44 };
45 
46 
47 #endif	// DWARF_TARGET_INTERFACE_H
48