2011-07-20 06:41:47 +08:00
//===-- SWIG Interface for SBInstruction ------------------------*- C++ -*-===//
//
2019-01-19 16:50:56 +08:00
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2011-07-20 06:41:47 +08:00
//
//===----------------------------------------------------------------------===//
# i n c l u d e < s t d i o . h >
// There's a lot to be fixed here, but need to wait for underlying insn implementation
// to be revised & settle down first.
n a m e s p a c e l l d b {
class S B I n s t r u c t i o n
{
public :
S B I n s t r u c t i o n ( ) ;
S B I n s t r u c t i o n ( c o n s t S B I n s t r u c t i o n &rhs);
~ S B I n s t r u c t i o n ( ) ;
b o o l
I s V a l i d ( ) ;
2012-04-13 08:07:34 +08:00
l l d b : : S B A d d r e s s
2011-07-20 06:41:47 +08:00
G e t A d d r e s s ( ) ;
2012-04-13 08:07:34 +08:00
2011-09-26 15:11:27 +08:00
c o n s t char *
2011-09-27 08:58:45 +08:00
G e t M n e m o n i c ( l l d b : : S B T a r g e t target ) ;
2011-09-26 15:11:27 +08:00
c o n s t char *
2011-09-27 08:58:45 +08:00
G e t O p e r a n d s ( l l d b : : S B T a r g e t target ) ;
2011-09-26 15:11:27 +08:00
c o n s t char *
G e t C o m m e n t ( l l d b : : S B T a r g e t target ) ;
l l d b : : S B D a t a
G e t D a t a ( l l d b : : S B T a r g e t target ) ;
2011-07-20 06:41:47 +08:00
s i z e _ t
G e t B y t e S i z e ( ) ;
b o o l
D o e s B r a n c h ( ) ;
2016-01-27 18:16:30 +08:00
b o o l
H a s D e l a y S l o t ( ) ;
2017-05-04 19:34:42 +08:00
b o o l
C a n S e t B r e a k p o i n t ( ) ;
2011-07-20 06:41:47 +08:00
void
P r i n t ( FILE * o u t ) ;
b o o l
G e t D e s c r i p t i o n ( l l d b : : S B S t r e a m &description);
b o o l
E m u l a t e W i t h F r a m e ( l l d b : : S B F r a m e &frame, uint32_t evaluate_options);
b o o l
2012-05-08 09:45:38 +08:00
D u m p E m u l a t i o n ( c o n s t char * t r i p l e ) ; // triple is to specify the architecture, e.g. 'armv6' or 'armv7-apple-ios'
2011-07-20 06:41:47 +08:00
b o o l
T e s t E m u l a t i o n ( l l d b : : S B S t r e a m &output_stream, const char *test_file);
2012-01-29 14:07:39 +08:00
% p y t h o n c o d e % {
2012-02-01 16:09:32 +08:00
def _ _ m n e m o n i c _ p r o p e r t y _ _ ( self ) :
return self . G e t M n e m o n i c ( target )
def _ _ o p e r a n d s _ p r o p e r t y _ _ ( self ) :
return self . G e t O p e r a n d s ( target )
def _ _ c o m m e n t _ p r o p e r t y _ _ ( self ) :
return self . G e t C o m m e n t ( target )
def _ _ f i l e _ a d d r _ p r o p e r t y _ _ ( self ) :
return self . G e t A d d r e s s ( ) . G e t F i l e A d d r e s s ( )
def _ _ l o a d _ a d r r _ p r o p e r t y _ _ ( self ) :
return self . G e t C o m m e n t ( target )
_ _ s w i g _ g e t m e t h o d s _ _ [ "mnemonic" ] = _ _ m n e m o n i c _ p r o p e r t y _ _
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : m n e m o n i c = property ( _ _ m n e m o n i c _ p r o p e r t y _ _ , None , d o c = '''A read only property that returns the mnemonic for this instruction as a string.''' )
2012-02-01 16:09:32 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "operands" ] = _ _ o p e r a n d s _ p r o p e r t y _ _
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : o p e r a n d s = property ( _ _ o p e r a n d s _ p r o p e r t y _ _ , None , d o c = '''A read only property that returns the operands for this instruction as a string.''' )
2012-02-01 16:09:32 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "comment" ] = _ _ c o m m e n t _ p r o p e r t y _ _
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : c o m m e n t = property ( _ _ c o m m e n t _ p r o p e r t y _ _ , None , d o c = '''A read only property that returns the comment for this instruction as a string.''' )
2012-02-01 16:09:32 +08:00
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "addr" ] = G e t A d d r e s s
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : a d d r = property ( G e t A d d r e s s , None , d o c = '''A read only property that returns an lldb object that represents the address (lldb.SBAddress) for this instruction.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "size" ] = G e t B y t e S i z e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : size = property ( G e t B y t e S i z e , None , d o c = '''A read only property that returns the size in bytes for this instruction as an integer.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "is_branch" ] = D o e s B r a n c h
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : i s _ b r a n c h = property ( D o e s B r a n c h , None , d o c = '''A read only property that returns a boolean value that indicates if this instruction is a branch instruction.''' )
2012-01-29 14:07:39 +08:00
% }
2011-07-20 06:41:47 +08:00
} ;
} // namespace lldb