2011-09-24 09:32:22 +08:00
//===-- SWIG Interface for SBSection ----------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
n a m e s p a c e l l d b {
% f e a t u r e ( "docstring" ,
2011-09-24 12:51:43 +08:00
" R e p r e s e n t s a n e x e c u t a b l e image section .
S B S e c t i o n s u p p o r t s i t e r a t i o n through i t s s u b s e c t i o n , r e p r e s e n t e d as S B S e c t i o n
2011-10-04 07:06:33 +08:00
as w e l l . For e x a m p l e ,
for s e c in e x e _ m o d u l e :
if s e c . G e t N a m e ( ) = = '__TEXT' :
p r i n t s e c
break
p r i n t I N D E N T + 'Number of subsections: %d' % s e c . G e t N u m S u b S e c t i o n s ( )
for s u b s e c in s e c :
p r i n t I N D E N T + r e p r ( s u b s e c )
p r o d u c e s :
[ 0x0000000100000000 - 0x0000000100002000 ) a . o u t . _ _ T E X T
N u m b e r of s u b s e c t i o n s : 6
[ 0x0000000100001780 - 0x0000000100001d5c ) a . o u t . _ _ T E X T . _ _ t e x t
[ 0x0000000100001d5c - 0x0000000100001da4 ) a . o u t . _ _ T E X T . _ _ s t u b s
[ 0x0000000100001da4 - 0x0000000100001e2c ) a . o u t . _ _ T E X T . _ _ s t u b _ h e l p e r
[ 0x0000000100001e2c - 0x0000000100001f10 ) a . o u t . _ _ T E X T . _ _ c s t r i n g
[ 0x0000000100001f10 - 0x0000000100001f68 ) a . o u t . _ _ T E X T . _ _ u n w i n d _ i n f o
[ 0x0000000100001f68 - 0x0000000100001ff8 ) a . o u t . _ _ T E X T . _ _ e h _ f r a m e
S e e a l s o S B M o d u l e . "
2011-09-24 09:32:22 +08:00
) S B S e c t i o n ;
class S B S e c t i o n
{
public :
S B S e c t i o n ( ) ;
S B S e c t i o n ( c o n s t l l d b : : S B S e c t i o n &rhs);
~ S B S e c t i o n ( ) ;
b o o l
I s V a l i d ( ) c o n s t ;
2011-09-24 09:37:21 +08:00
c o n s t char *
G e t N a m e ( ) ;
2013-06-14 05:23:23 +08:00
l l d b : : S B S e c t i o n
G e t P a r e n t ( ) ;
2011-09-24 09:32:22 +08:00
l l d b : : S B S e c t i o n
F i n d S u b S e c t i o n ( c o n s t char * s e c t _ n a m e ) ;
s i z e _ t
G e t N u m S u b S e c t i o n s ( ) ;
l l d b : : S B S e c t i o n
G e t S u b S e c t i o n A t I n d e x ( s i z e _ t i d x ) ;
l l d b : : a d d r _ t
G e t F i l e A d d r e s s ( ) ;
2012-06-28 06:22:28 +08:00
l l d b : : a d d r _ t
G e t L o a d A d d r e s s ( l l d b : : S B T a r g e t &target);
2011-09-24 09:32:22 +08:00
l l d b : : a d d r _ t
G e t B y t e S i z e ( ) ;
u i n t 64 _ t
G e t F i l e O f f s e t ( ) ;
u i n t 64 _ t
G e t F i l e B y t e S i z e ( ) ;
2011-09-24 13:04:40 +08:00
l l d b : : S B D a t a
G e t S e c t i o n D a t a ( ) ;
2011-09-24 09:32:22 +08:00
l l d b : : S B D a t a
G e t S e c t i o n D a t a ( u i n t 64 _ t o f f s e t ,
u i n t 64 _ t size ) ;
S e c t i o n T y p e
G e t S e c t i o n T y p e ( ) ;
2016-09-08 20:22:56 +08:00
u i n t 32 _ t
G e t P e r m i s s i o n s ( ) c o n s t ;
2014-10-22 15:22:56 +08:00
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
/// Return the size of a target's byte represented by this section
/// in numbers of host bytes. Note that certain architectures have
/// varying minimum addressable unit (i.e. byte) size for their
/// CODE or DATA buses.
///
/// @return
/// The number of host (8-bit) bytes needed to hold a target byte
//------------------------------------------------------------------
" ) G e t T a r g e t B y t e S i z e ;
u i n t 32 _ t
G e t T a r g e t B y t e S i z e ( ) ;
2011-09-24 09:32:22 +08:00
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);
2013-05-03 09:29:27 +08:00
b o o l
o p e r a t o r = = ( c o n s t l l d b : : S B S e c t i o n &rhs);
b o o l
o p e r a t o r ! = ( c o n s t l l d b : : S B S e c t i o n &rhs);
2012-01-29 14:07:39 +08:00
% p y t h o n c o d e % {
2012-02-04 10:58:17 +08:00
def g e t _ a d d r ( self ) :
return S B A d d r e s s ( self , 0 )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "name" ] = G e t N a m e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : name = property ( G e t N a m e , None , d o c = '''A read only property that returns the name of this section as a string.''' )
2012-01-29 14:07:39 +08:00
2012-02-04 10:58:17 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "addr" ] = g e t _ a d d r
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 , None , d o c = '''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this section.''' )
2012-02-04 10:58:17 +08:00
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "file_addr" ] = G e t F i l e A d d r e s s
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : f i l e _ a d d r = property ( G e t F i l e A d d r e s s , None , d o c = ''' A r e a d o n l y property t h a t returns a n integer t h a t r e p r e s e n t s t h e s t a r t i n g "file" a d d r e s s for t h i s section , or t h e a d d r e s s of t h e section in t h e o b j e c t file in w h i c h i t is defined . ''' )
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 of this section 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 _ _ [ "file_offset" ] = G e t F i l e O f f s e t
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : f i l e _ o f f s e t = property ( G e t F i l e O f f s e t , None , d o c = '''A read only property that returns the file offset in bytes of this section 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 _ _ [ "file_size" ] = G e t F i l e 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 : f i l e _ s i z e = property ( G e t F i l e B y t e S i z e , None , d o c = '''A read only property that returns the file size in bytes of this section 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 _ _ [ "data" ] = G e t S e c t i o n D a t a
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : d a t a = property ( G e t S e c t i o n D a t a , None , d o c = '''A read only property that returns an lldb object that represents the bytes for this section (lldb.SBData) for this section.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "type" ] = G e t S e c t i o n T y p e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : type = property ( G e t S e c t i o n T y p e , None , d o c = ''' A r e a d o n l y property t h a t returns a n l l d b e n u m e r a t i o n value ( s e e e n u m e r a t i o n s t h a t start with "lldb.eSectionType" ) t h a t r e p r e s e n t s t h e type of t h i s section ( code , d a t a , e t c . ) . ''' )
2012-01-29 14:07:39 +08:00
2014-10-22 15:22:56 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "target_byte_size" ] = G e t T a r g e t B y t e S i z e
if _ n e w c l a s s : t a r g e t _ b y t e _ s i z e = property ( G e t T a r g e t B y t e S i z e , None , d o c = '''A read only property that returns the size of a target byte represented by this section as a number of host bytes.''' )
2012-01-29 14:07:39 +08:00
% }
2011-09-24 09:32:22 +08:00
private :
2013-04-19 06:45:39 +08:00
s t d : : u n i q u e _ p t r < l l d b _ p r i v a t e : : S e c t i o n I m p l > m _ o p a q u e _ a p ;
2011-09-24 09:32:22 +08:00
} ;
} // namespace lldb