1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef INSTRUCTION_INFO_H 6 #define INSTRUCTION_INFO_H 7 8 #include <String.h> 9 10 #include "Types.h" 11 12 13 enum instruction_type { 14 INSTRUCTION_TYPE_SUBROUTINE_CALL, 15 INSTRUCTION_TYPE_JUMP, 16 INSTRUCTION_TYPE_OTHER 17 }; 18 19 20 class InstructionInfo { 21 public: 22 InstructionInfo(); 23 InstructionInfo(target_addr_t address, 24 target_addr_t targetAddress, 25 target_size_t size, instruction_type type, 26 bool breakpointAllowed, 27 const BString& disassembledLine); 28 29 bool SetTo(target_addr_t address, 30 target_addr_t targetAddress, 31 target_size_t size, 32 instruction_type type, 33 bool breakpointAllowed, 34 const BString& disassembledLine); 35 36 target_addr_t Address() const { return fAddress; } 37 target_addr_t TargetAddress() const 38 { return fTargetAddress; } 39 target_size_t Size() const { return fSize; } 40 instruction_type Type() const { return fType; } 41 bool IsBreakpointAllowed() const 42 { return fBreakpointAllowed; } 43 const char* DisassembledLine() const 44 { return fDisassembledLine.String(); } 45 46 47 private: 48 target_addr_t fAddress; 49 target_addr_t fTargetAddress; 50 target_size_t fSize; 51 instruction_type fType; 52 bool fBreakpointAllowed; 53 BString fDisassembledLine; 54 }; 55 56 57 #endif // INSTRUCTION_INFO_H 58