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