Johnny Chen | 5cb6cab | 2011-07-19 22:41:47 +0000 | [diff] [blame] | 1 | //===-- SWIG Interface for SBInstruction ------------------------*- 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 | #include <stdio.h> |
| 11 | |
| 12 | // There's a lot to be fixed here, but need to wait for underlying insn implementation |
| 13 | // to be revised & settle down first. |
| 14 | |
| 15 | namespace lldb { |
| 16 | |
| 17 | class SBInstruction |
| 18 | { |
| 19 | public: |
| 20 | |
| 21 | SBInstruction (); |
| 22 | |
| 23 | SBInstruction (const SBInstruction &rhs); |
| 24 | |
| 25 | ~SBInstruction (); |
| 26 | |
| 27 | bool |
| 28 | IsValid(); |
| 29 | |
| 30 | SBAddress |
| 31 | GetAddress(); |
| 32 | |
Greg Clayton | 23b8abb | 2011-09-26 07:11:27 +0000 | [diff] [blame] | 33 | const char * |
Greg Clayton | d9b4425 | 2011-09-27 00:58:45 +0000 | [diff] [blame] | 34 | GetMnemonic (lldb::SBTarget target); |
Greg Clayton | 23b8abb | 2011-09-26 07:11:27 +0000 | [diff] [blame] | 35 | |
| 36 | const char * |
Greg Clayton | d9b4425 | 2011-09-27 00:58:45 +0000 | [diff] [blame] | 37 | GetOperands (lldb::SBTarget target); |
Greg Clayton | 23b8abb | 2011-09-26 07:11:27 +0000 | [diff] [blame] | 38 | |
| 39 | const char * |
| 40 | GetComment (lldb::SBTarget target); |
| 41 | |
| 42 | lldb::SBData |
| 43 | GetData (lldb::SBTarget target); |
| 44 | |
Johnny Chen | 5cb6cab | 2011-07-19 22:41:47 +0000 | [diff] [blame] | 45 | size_t |
| 46 | GetByteSize (); |
| 47 | |
| 48 | bool |
| 49 | DoesBranch (); |
| 50 | |
| 51 | void |
| 52 | Print (FILE *out); |
| 53 | |
| 54 | bool |
| 55 | GetDescription (lldb::SBStream &description); |
| 56 | |
| 57 | bool |
| 58 | EmulateWithFrame (lldb::SBFrame &frame, uint32_t evaluate_options); |
| 59 | |
| 60 | bool |
| 61 | DumpEmulation (const char * triple); // triple is to specify the architecture, e.g. 'armv6' or 'arm-apple-darwin' |
| 62 | |
| 63 | bool |
| 64 | TestEmulation (lldb::SBStream &output_stream, const char *test_file); |
Greg Clayton | 1b92520 | 2012-01-29 06:07:39 +0000 | [diff] [blame] | 65 | |
| 66 | %pythoncode %{ |
Greg Clayton | b302dff | 2012-02-01 08:09:32 +0000 | [diff] [blame^] | 67 | def __mnemonic_property__ (self): |
| 68 | return self.GetMnemonic (target) |
| 69 | def __operands_property__ (self): |
| 70 | return self.GetOperands (target) |
| 71 | def __comment_property__ (self): |
| 72 | return self.GetComment (target) |
| 73 | def __file_addr_property__ (self): |
| 74 | return self.GetAddress ().GetFileAddress() |
| 75 | def __load_adrr_property__ (self): |
| 76 | return self.GetComment (target) |
| 77 | |
| 78 | __swig_getmethods__["mnemonic"] = __mnemonic_property__ |
| 79 | if _newclass: x = property(__mnemonic_property__, None) |
| 80 | |
| 81 | __swig_getmethods__["operands"] = __operands_property__ |
| 82 | if _newclass: x = property(__operands_property__, None) |
| 83 | |
| 84 | __swig_getmethods__["comment"] = __comment_property__ |
| 85 | if _newclass: x = property(__comment_property__, None) |
| 86 | |
Greg Clayton | 1b92520 | 2012-01-29 06:07:39 +0000 | [diff] [blame] | 87 | __swig_getmethods__["addr"] = GetAddress |
| 88 | if _newclass: x = property(GetAddress, None) |
| 89 | |
| 90 | __swig_getmethods__["size"] = GetByteSize |
| 91 | if _newclass: x = property(GetByteSize, None) |
| 92 | |
| 93 | __swig_getmethods__["is_branch"] = DoesBranch |
| 94 | if _newclass: x = property(DoesBranch, None) |
| 95 | %} |
| 96 | |
| 97 | |
Johnny Chen | 5cb6cab | 2011-07-19 22:41:47 +0000 | [diff] [blame] | 98 | }; |
| 99 | |
| 100 | } // namespace lldb |