SBInstruction.h revision 7dd5c51fbab8384b18f20ecc125f9a1bb3c9bcb2
1//===-- SBInstruction.h -----------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef LLDB_SBInstruction_h_ 11#define LLDB_SBInstruction_h_ 12 13#include "lldb/API/SBDefines.h" 14#include "lldb/API/SBData.h" 15 16#include <stdio.h> 17 18// There's a lot to be fixed here, but need to wait for underlying insn implementation 19// to be revised & settle down first. 20 21namespace lldb { 22 23class SBInstruction 24{ 25public: 26 27 SBInstruction (); 28 29 SBInstruction (const SBInstruction &rhs); 30 31 const SBInstruction & 32 operator = (const SBInstruction &rhs); 33 34 ~SBInstruction (); 35 36 bool 37 IsValid(); 38 39 SBAddress 40 GetAddress(); 41 42 const char * 43 GetMnemonic (lldb::SBTarget target); 44 45 const char * 46 GetOperands (lldb::SBTarget target); 47 48 const char * 49 GetComment (lldb::SBTarget target); 50 51 lldb::SBData 52 GetData (lldb::SBTarget target); 53 54 size_t 55 GetByteSize (); 56 57 bool 58 DoesBranch (); 59 60 void 61 Print (FILE *out); 62 63 bool 64 GetDescription (lldb::SBStream &description); 65 66 bool 67 EmulateWithFrame (lldb::SBFrame &frame, uint32_t evaluate_options); 68 69 bool 70 DumpEmulation (const char * triple); // triple is to specify the architecture, e.g. 'armv6' or 'arm-apple-darwin' 71 72 bool 73 TestEmulation (lldb::SBStream &output_stream, const char *test_file); 74 75protected: 76 friend class SBInstructionList; 77 78 SBInstruction (const lldb::InstructionSP &inst_sp); 79 80 void 81 SetOpaque (const lldb::InstructionSP &inst_sp); 82 83private: 84 85 lldb::InstructionSP m_opaque_sp; 86}; 87 88 89} // namespace lldb 90 91#endif // LLDB_SBInstruction_h_ 92