2011-07-19 06:11:53 +08:00
//===-- SWIG Interface for SBCompileUnit ------------------------*- 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" ,
" R e p r e s e n t s a c o m p i l a t i o n u n i t , or c o m p i l e d source file .
S B C o m p i l e U n i t s u p p o r t s line entry i t e r a t i o n . For e x a m p l e ,
2011-07-28 02:28:07 +08:00
# Now get t h e S B S y m b o l C o n t e x t from t h i s frame . W e w a n t e v e r y t h i n g . : - )
context = f r a m e 0 . G e t S y m b o l C o n t e x t ( l l d b . e S y m b o l C o n t e x t E v e r y t h i n g )
. . .
c o m p i l e U n i t = context . G e t C o m p i l e U n i t ( )
2011-07-19 06:11:53 +08:00
for l i n e E n t r y in c o m p i l e U n i t :
2015-10-17 01:52:32 +08:00
p r i n t ( 'line entry: %s:%d' % ( s t r ( l i n e E n t r y . G e t F i l e S p e c ( ) ) ,
l i n e E n t r y . G e t L i n e ( ) ) )
p r i n t ( 'start addr: %s' % s t r ( l i n e E n t r y . G e t S t a r t A d d r e s s ( ) ) )
p r i n t ( 'end addr: %s' % s t r ( l i n e E n t r y . G e t E n d A d d r e s s ( ) ) )
2011-07-19 06:11:53 +08:00
p r o d u c e s :
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 20
start a d d r : a . o u t [ 0x100000d98 ]
end a d d r : a . o u t [ 0x100000da3 ]
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 21
start a d d r : a . o u t [ 0x100000da3 ]
end a d d r : a . o u t [ 0x100000da9 ]
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 22
start a d d r : a . o u t [ 0x100000da9 ]
end a d d r : a . o u t [ 0x100000db6 ]
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 23
start a d d r : a . o u t [ 0x100000db6 ]
end a d d r : a . o u t [ 0x100000dbc ]
. . .
2011-07-28 02:28:07 +08:00
S e e a l s o S B S y m b o l C o n t e x t and S B L i n e E n t r y "
) S B C o m p i l e U n i t ;
2011-07-19 06:11:53 +08:00
class S B C o m p i l e U n i t
{
public :
S B C o m p i l e U n i t ( ) ;
S B C o m p i l e U n i t ( c o n s t l l d b : : S B C o m p i l e U n i t &rhs);
~ S B C o m p i l e U n i t ( ) ;
b o o l
I s V a l i d ( ) c o n s t ;
l l d b : : S B F i l e S p e c
G e t F i l e S p e c ( ) c o n s t ;
u i n t 32 _ t
G e t N u m L i n e E n t r i e s ( ) c o n s t ;
l l d b : : S B L i n e E n t r y
G e t L i n e E n t r y A t I n d e x ( u i n t 32 _ t i d x ) c o n s t ;
u i n t 32 _ t
F i n d L i n e E n t r y I n d e x ( u i n t 32 _ t s t a r t _ i d x ,
u i n t 32 _ t line ,
l l d b : : S B F i l e S p e c * i n l i n e _ f i l e _ s p e c ) c o n s t ;
2011-09-23 08:54:11 +08:00
u i n t 32 _ t
F i n d L i n e E n t r y I n d e x ( u i n t 32 _ t s t a r t _ i d x ,
u i n t 32 _ t line ,
l l d b : : S B F i l e S p e c * i n l i n e _ f i l e _ s p e c ,
b o o l e x a c t ) c o n s t ;
2012-03-17 05:55:42 +08:00
S B F i l e S p e c
G e t S u p p o r t F i l e A t I n d e x ( u i n t 32 _ t i d x ) c o n s t ;
u i n t 32 _ t
G e t N u m S u p p o r t F i l e s ( ) c o n s t ;
u i n t 32 _ t
F i n d S u p p o r t F i l e I n d e x ( u i n t 32 _ t s t a r t _ i d x , c o n s t S B F i l e S p e c &sb_file, bool full);
2013-06-19 06:51:05 +08:00
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
/// Get all types matching \a type_mask from debug info in this
/// compile unit.
///
/// @param[in] type_mask
/// A bitfield that consists of one or more bits logically OR'ed
/// together from the lldb::TypeClass enumeration. This allows
/// you to request only structure types, or only class, struct
/// and union types. Passing in lldb::eTypeClassAny will return
/// all types found in the debug information for this compile
/// unit.
///
/// @return
/// A list of types in this compile unit that match \a type_mask
//------------------------------------------------------------------
" ) G e t T y p e s ;
l l d b : : S B T y p e L i s t
G e t T y p e s ( u i n t 32 _ t t y p e _ m a s k = l l d b : : e T y p e C l a s s A n y ) ;
2014-11-18 07:06:20 +08:00
l l d b : : L a n g u a g e T y p e
G e t L a n g u a g e ( ) ;
2011-07-19 06:11:53 +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);
2012-01-29 14:07:39 +08:00
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 C o m p i l e U n i t &rhs) const;
b o o l
o p e r a t o r ! = ( c o n s t l l d b : : S B C o m p i l e U n i t &rhs) const;
2012-01-29 14:07:39 +08:00
% p y t h o n c o d e % {
_ _ s w i g _ g e t m e t h o d s _ _ [ "file" ] = G e t F i l e S p e c
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : file = property ( G e t F i l e S p e c , None , d o c = '''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "num_line_entries" ] = G e t N u m L i n e E n t r i e s
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : n u m _ l i n e _ e n t r i e s = property ( G e t N u m L i n e E n t r i e s , None , d o c = '''A read only property that returns the number of line entries in a compile unit as an integer.''' )
2012-01-29 14:07:39 +08:00
% }
2011-07-19 06:11:53 +08:00
} ;
} // namespace lldb