2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Copyright 2011-2015, Rene Gollent, rene@gollent.com.
5 * Distributed under the terms of the MIT License.
7 #ifndef ARCHITECTURE_X86_64_H
8 #define ARCHITECTURE_X86_64_H
13 #include "Architecture.h"
20 class ArchitectureX8664
: public Architecture
{
22 ArchitectureX8664(TeamMemory
* teamMemory
);
23 virtual ~ArchitectureX8664();
25 virtual status_t
Init();
27 virtual int32
StackGrowthDirection() const;
29 virtual int32
CountRegisters() const;
30 virtual const Register
* Registers() const;
31 virtual status_t
InitRegisterRules(CfaContext
& context
) const;
33 virtual status_t
GetDwarfRegisterMaps(RegisterMap
** _toDwarf
,
34 RegisterMap
** _fromDwarf
) const;
36 virtual status_t
GetCpuFeatures(uint32
& flags
);
38 virtual status_t
CreateCpuState(CpuState
*& _state
);
39 virtual status_t
CreateCpuState(const void* cpuStateData
,
40 size_t size
, CpuState
*& _state
);
41 virtual status_t
CreateStackFrame(Image
* image
,
42 FunctionDebugInfo
* function
,
43 CpuState
* cpuState
, bool isTopFrame
,
44 StackFrame
*& _previousFrame
,
45 CpuState
*& _previousCpuState
);
46 virtual void UpdateStackFrameCpuState(
47 const StackFrame
* frame
,
49 FunctionDebugInfo
* previousFunction
,
50 CpuState
* previousCpuState
);
52 virtual status_t
ReadValueFromMemory(target_addr_t address
,
53 uint32 valueType
, BVariant
& _value
) const;
54 virtual status_t
ReadValueFromMemory(target_addr_t addressSpace
,
55 target_addr_t address
, uint32 valueType
,
56 BVariant
& _value
) const;
58 virtual status_t
DisassembleCode(FunctionDebugInfo
* function
,
59 const void* buffer
, size_t bufferSize
,
60 DisassembledCode
*& _sourceCode
);
61 virtual status_t
GetStatement(FunctionDebugInfo
* function
,
62 target_addr_t address
,
63 Statement
*& _statement
);
64 virtual status_t
GetInstructionInfo(target_addr_t address
,
65 InstructionInfo
& _info
, CpuState
* state
);
66 virtual status_t
ResolvePICFunctionAddress(target_addr_t
69 target_addr_t
& _targetAddress
);
71 virtual status_t
GetWatchpointDebugCapabilities(
72 int32
& _maxRegisterCount
,
73 int32
& _maxBytesPerRegister
,
74 uint8
& _watchpointCapabilityFlags
);
76 virtual status_t
GetReturnAddressLocation(
77 StackFrame
* frame
, target_size_t valueSize
,
78 ValueLocation
*& _location
);
81 struct ToDwarfRegisterMap
;
82 struct FromDwarfRegisterMap
;
85 void _AddRegister(int32 index
, const char* name
,
86 uint32 bitSize
, uint32 valueType
,
87 register_type type
, bool calleePreserved
);
88 void _AddIntegerRegister(int32 index
,
89 const char* name
, uint32 valueType
,
90 register_type type
, bool calleePreserved
);
91 void _AddFPRegister(int32 index
,
93 void _AddSIMDRegister(int32 index
,
94 const char* name
, uint32 byteSize
);
95 bool _HasFunctionPrologue(
96 FunctionDebugInfo
* function
) const;
98 Array
<Register
> fRegisters
;
99 SourceLanguage
* fAssemblyLanguage
;
100 ToDwarfRegisterMap
* fToDwarfRegisterMap
;
101 FromDwarfRegisterMap
* fFromDwarfRegisterMap
;
105 #endif // ARCHITECTURE_X86_64_H