Home | History | Annotate | Download | only in interface
      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     lldb::SBAddress
     31     GetAddress();
     32 
     33     lldb::AddressClass
     34     GetAddressClass ();
     35 
     36     const char *
     37     GetMnemonic (lldb::SBTarget target);
     38 
     39     const char *
     40     GetOperands (lldb::SBTarget target);
     41 
     42     const char *
     43     GetComment (lldb::SBTarget target);
     44 
     45     lldb::SBData
     46     GetData (lldb::SBTarget target);
     47 
     48     size_t
     49     GetByteSize ();
     50 
     51     bool
     52     DoesBranch ();
     53 
     54     void
     55     Print (FILE *out);
     56 
     57     bool
     58     GetDescription (lldb::SBStream &description);
     59 
     60     bool
     61     EmulateWithFrame (lldb::SBFrame &frame, uint32_t evaluate_options);
     62 
     63     bool
     64     DumpEmulation (const char * triple); // triple is to specify the architecture, e.g. 'armv6' or 'armv7-apple-ios'
     65 
     66     bool
     67     TestEmulation (lldb::SBStream &output_stream, const char *test_file);
     68 
     69     %pythoncode %{
     70         def __mnemonic_property__ (self):
     71             return self.GetMnemonic (target)
     72         def __operands_property__ (self):
     73             return self.GetOperands (target)
     74         def __comment_property__ (self):
     75             return self.GetComment (target)
     76         def __file_addr_property__ (self):
     77             return self.GetAddress ().GetFileAddress()
     78         def __load_adrr_property__ (self):
     79             return self.GetComment (target)
     80 
     81         __swig_getmethods__["mnemonic"] = __mnemonic_property__
     82         if _newclass: mnemonic = property(__mnemonic_property__, None, doc='''A read only property that returns the mnemonic for this instruction as a string.''')
     83 
     84         __swig_getmethods__["operands"] = __operands_property__
     85         if _newclass: operands = property(__operands_property__, None, doc='''A read only property that returns the operands for this instruction as a string.''')
     86 
     87         __swig_getmethods__["comment"] = __comment_property__
     88         if _newclass: comment = property(__comment_property__, None, doc='''A read only property that returns the comment for this instruction as a string.''')
     89 
     90         __swig_getmethods__["addr"] = GetAddress
     91         if _newclass: addr = property(GetAddress, None, doc='''A read only property that returns an lldb object that represents the address (lldb.SBAddress) for this instruction.''')
     92 
     93         __swig_getmethods__["size"] = GetByteSize
     94         if _newclass: size = property(GetByteSize, None, doc='''A read only property that returns the size in bytes for this instruction as an integer.''')
     95 
     96         __swig_getmethods__["is_branch"] = DoesBranch
     97         if _newclass: is_branch = property(DoesBranch, None, doc='''A read only property that returns a boolean value that indicates if this instruction is a branch instruction.''')
     98     %}
     99 
    100 
    101 };
    102 
    103 } // namespace lldb
    104