1/*
2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef DISASSEMBLER_X86_64_H
7#define DISASSEMBLER_X86_64_H
8
9#include <String.h>
10
11#include "Types.h"
12
13
14class CpuState;
15class InstructionInfo;
16
17
18class DisassemblerX8664 {
19public:
20								DisassemblerX8664();
21	virtual						~DisassemblerX8664();
22
23	virtual	status_t			Init(target_addr_t address, const void* code,
24									size_t codeSize);
25
26	virtual	status_t			GetNextInstruction(BString& line,
27									target_addr_t& _address,
28									target_size_t& _size,
29									bool& _breakpointAllowed);
30	virtual	status_t			GetPreviousInstruction(
31									target_addr_t nextAddress,
32									target_addr_t& _address,
33									target_size_t& _size);
34	virtual	status_t			GetNextInstructionInfo(
35									InstructionInfo& _info,
36									CpuState* state);
37
38private:
39			target_addr_t		GetInstructionTargetAddress(
40									CpuState* state) const;
41private:
42			struct UdisData;
43
44private:
45			target_addr_t		fAddress;
46			const uint8*		fCode;
47			size_t				fCodeSize;
48			UdisData*			fUdisData;
49};
50
51
52#endif	// DISASSEMBLER_X86_64_H
53