2011-07-17 05:15:39 +08:00
//===-- SWIG Interface for SBTarget -----------------------------*- 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-17 05:15:39 +08:00
//
//===----------------------------------------------------------------------===//
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 t h e target p r o g r a m r u n n i n g u n d e r t h e debugger .
2021-01-15 21:43:26 +08:00
S B T a r g e t s u p p o r t s m o d u l e , b r e a k p o i n t , and w a t c h p o i n t i t e r a t i o n s . For e x a m p l e , : :
2011-07-17 05:15:39 +08:00
for m in target . m o d u l e _ i t e r ( ) :
p r i n t m
2021-01-18 17:47:16 +08:00
p r o d u c e s : : :
2011-07-17 05:15:39 +08:00
2021-01-15 21:43:26 +08:00
( x 86 _ 64 ) / 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 / l l d b u t i l / i t e r / a . o u t
( x 86 _ 64 ) / u s r / l i b / d y l d
( x 86 _ 64 ) / u s r / l i b / l i b s t d c + + . 6 . d y l i b
( x 86 _ 64 ) / u s r / l i b / l i b S y s t e m . B . d y l i b
( x 86 _ 64 ) / u s r / l i b / s y s t e m / l i b m a t h C o m m o n . A . d y l i b
( x 86 _ 64 ) / u s r / l i b / l i b S y s t e m . B . d y l i b ( _ _ c o m m p a g e )
2011-07-17 05:15:39 +08:00
2021-01-15 21:43:26 +08:00
and , : :
2011-07-17 05:15:39 +08:00
for b in target . b r e a k p o i n t _ i t e r ( ) :
p r i n t b
2021-01-15 21:43:26 +08:00
p r o d u c e s : : :
2011-07-17 05:15:39 +08:00
2021-01-15 21:43:26 +08:00
S B B r e a k p o i n t : i d = 1 , file = 'main.cpp' , line = 66 , l o c a t i o n s = 1
S B B r e a k p o i n t : i d = 2 , file = 'main.cpp' , line = 85 , l o c a t i o n s = 1
2011-09-27 09:19:20 +08:00
2021-01-15 21:43:26 +08:00
and , : :
2011-09-27 09:19:20 +08:00
2011-10-14 08:42:25 +08:00
for w p _ l o c in target . w a t c h p o i n t _ i t e r ( ) :
2011-09-27 09:19:20 +08:00
p r i n t w p _ l o c
2021-01-15 21:43:26 +08:00
p r o d u c e s : : :
2011-09-27 09:19:20 +08:00
2021-01-15 21:43:26 +08:00
W a t c h p o i n t 1 : a d d r = 0x1034ca048 size = 4 s t a t e = e n a b l e d type = r w
declare @ '/Volumes/data/lldb/svn/trunk/test/python_api/watchpoint/main.c:12'
h w _ i n d e x = 0 h i t _ c o u n t = 2 i g n o r e _ c o u n t = 0 "
2011-07-19 04:13:38 +08:00
) S B T a r g e t ;
2011-07-17 05:15:39 +08:00
class S B T a r g e t
{
public :
//------------------------------------------------------------------
// Broadcaster bits.
//------------------------------------------------------------------
enum
{
e B r o a d c a s t B i t B r e a k p o i n t C h a n g e d = ( 1 < < 0 ) ,
e B r o a d c a s t B i t M o d u l e s L o a d e d = ( 1 < < 1 ) ,
2012-12-18 10:03:49 +08:00
e B r o a d c a s t B i t M o d u l e s U n l o a d e d = ( 1 < < 2 ) ,
2013-04-06 02:49:06 +08:00
e B r o a d c a s t B i t W a t c h p o i n t C h a n g e d = ( 1 < < 3 ) ,
e B r o a d c a s t B i t S y m b o l s L o a d e d = ( 1 < < 4 )
2011-07-17 05:15:39 +08:00
} ;
//------------------------------------------------------------------
// Constructors
//------------------------------------------------------------------
S B T a r g e t ( ) ;
S B T a r g e t ( c o n s t l l d b : : S B T a r g e t & rhs);
//------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------
~ S B T a r g e t ( ) ;
2012-02-16 14:50:00 +08:00
static c o n s t char *
G e t B r o a d c a s t e r C l a s s N a m e ( ) ;
2018-06-12 05:19:26 +08:00
2011-07-17 05:15:39 +08:00
b o o l
I s V a l i d ( ) c o n s t ;
Add "operator bool" to SB APIs
Summary:
Our python version of the SB API has (the python equivalent of)
operator bool, but the C++ version doesn't.
This is because our python operators are added by modify-python-lldb.py,
which performs postprocessing on the swig-generated interface files.
In this patch, I add the "operator bool" to all SB classes which have an
IsValid method (which is the same logic used by modify-python-lldb.py).
This way, we make the two interfaces more constent, and it allows us to
rely on swig's automatic syntesis of python __nonzero__ methods instead
of doing manual fixups.
Reviewers: zturner, jingham, clayborg, jfb, serge-sans-paille
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D58792
llvm-svn: 355824
2019-03-11 21:58:46 +08:00
explicit o p e r a t o r b o o l ( ) c o n s t ;
2015-03-24 05:50:21 +08:00
static b o o l
E v e n t I s T a r g e t E v e n t ( c o n s t l l d b : : S B E v e n t &event);
static l l d b : : S B T a r g e t
G e t T a r g e t F r o m E v e n t ( c o n s t l l d b : : S B E v e n t &event);
static u i n t 32 _ t
G e t N u m M o d u l e s F r o m E v e n t ( c o n s t l l d b : : S B E v e n t &event);
static l l d b : : S B M o d u l e
G e t M o d u l e A t I n d e x F r o m E v e n t ( c o n s t u i n t 32 _ t i d x , c o n s t l l d b : : S B E v e n t &event);
2011-07-17 05:15:39 +08:00
l l d b : : S B P r o c e s s
G e t P r o c e s s ( ) ;
2014-10-22 15:22:56 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Return t h e p l a t f o r m o b j e c t a s s o c i a t e d with t h e target .
A f t e r return , t h e p l a t f o r m o b j e c t s h o u l d b e checked for
v a l i d i t y .
@ return
A p l a t f o r m o b j e c t . " ) G e t P l a t f o r m ;
2014-10-22 15:22:56 +08:00
l l d b : : S B P l a t f o r m
G e t P l a t f o r m ( ) ;
2011-07-17 05:15:39 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
I n s t a l l any b i n a r i e s t h a t n e e d to b e i n s t a l l e d .
T h i s function d o e s n o t h i n g when d e b u g g i n g on t h e h o s t s y s t e m .
When connected to remote p l a t f o r m s , t h e target ' s m a i n e x e c u t a b l e
and any m o d u l e s t h a t h a v e t h e i r i n s t a l l p a t h set w i l l b e
i n s t a l l e d on t h e remote p l a t f o r m . If t h e m a i n e x e c u t a b l e d o e s n ' t
h a v e a n i n s t a l l l o c a t i o n set , i t w i l l b e i n s t a l l e d in t h e remote
p l a t f o r m ' s w o r k i n g d i r e c t o r y .
@ return
A n error d e s c r i b i n g a n y t h i n g t h a t w e n t w r o n g d u r i n g
i n s t a l l a t i o n . " ) I n s t a l l ;
2013-11-21 05:07:01 +08:00
l l d b : : S B E r r o r
I n s t a l l ( ) ;
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
L a u n c h a new process .
L a u n c h a new process by s p a w n i n g a new process using t h e
target o b j e c t 's executable module' s file as t h e file to l a u n c h .
2019-04-23 18:04:22 +08:00
A r g u m e n t s a r e g i v e n in a r g v , and t h e e n v i r o n m e n t v a r i a b l e s
a r e in e n v p . S t a n d a r d input and output f i l e s c a n b e
o p t i o n a l l y r e - d i r e c t e d to s t d i n _ p a t h , s t d o u t _ p a t h , and
s t d e r r _ p a t h .
2019-04-19 00:23:33 +08:00
@ param [ in ] l i s t e n e r
A n o p t i o n a l l i s t e n e r t h a t w i l l r e c e i v e all process events .
2019-04-23 18:04:22 +08:00
If l i s t e n e r is v a l i d then l i s t e n e r w i l l l i s t e n to all
2019-04-19 00:23:33 +08:00
process events . If not v a l i d , then t h i s target ' s debugger
( S B T a r g e t : : G e t D e b u g g e r ( ) ) w i l l l i s t e n to all process events .
@ param [ in ] a r g v
T h e a r g u m e n t a r r a y .
@ param [ in ] e n v p
T h e e n v i r o n m e n t a r r a y .
@ param [ in ] l a u n c h _ f l a g s
F l a g s to m o d i f y t h e l a u n c h ( @ s e e l l d b : : L a u n c h F l a g s )
@ param [ in ] s t d i n _ p a t h
T h e p a t h to use when r e - d i r e c t i n g t h e S T D I N of t h e new
process . If all s t d X X _ p a t h a r g u m e n t s a r e NULL , a p s e u d o
terminal w i l l b e u s e d .
@ param [ in ] s t d o u t _ p a t h
T h e p a t h to use when r e - d i r e c t i n g t h e S T D O U T of t h e new
process . If all s t d X X _ p a t h a r g u m e n t s a r e NULL , a p s e u d o
terminal w i l l b e u s e d .
@ param [ in ] s t d e r r _ p a t h
T h e p a t h to use when r e - d i r e c t i n g t h e S T D E R R of t h e new
process . If all s t d X X _ p a t h a r g u m e n t s a r e NULL , a p s e u d o
terminal w i l l b e u s e d .
@ param [ in ] w o r k i n g _ d i r e c t o r y
T h e w o r k i n g d i r e c t o r y to h a v e t h e c h i l d process run in
@ param [ in ] l a u n c h _ f l a g s
Some l a u n c h o p t i o n s s p e c i f i e d by logical OR ' i n g
l l d b : : L a u n c h F l a g s e n u m e r a t i o n values t o g e t h e r .
@ param [ in ] s t o p _ a t _ e n t r y
If false do not stop t h e i n f e r i o r at t h e entry p o i n t .
@ param [ o u t ]
A n error o b j e c t . Contains t h e r e a s o n if t h e r e is some f a i l u r e .
@ return
A process o b j e c t for t h e n e w l y c r e a t e d process .
2011-07-17 05:15:39 +08:00
For e x a m p l e ,
process = target . L a u n c h ( self . d b g . G e t L i s t e n e r ( ) , None , None ,
None , '/tmp/stdout.txt' , None ,
None , 0 , False , error )
l a u n c h e s a new process by p a s s i n g n o t h i n g for b o t h t h e a r g s and t h e e n v s
and r e d i r e c t t h e s t a n d a r d output of t h e i n f e r i o r to t h e / t m p / s t d o u t . t x t
file . I t d o e s not s p e c i f y a w o r k i n g d i r e c t o r y s o t h a t t h e debug server
w i l l use i t s i d e a of w h a t t h e current w o r k i n g d i r e c t o r y is for t h e
i n f e r i o r . A l s o , w e a s k t h e debugger not to stop t h e i n f e r i o r at t h e
entry p o i n t . If no b r e a k p o i n t is s p e c i f i e d for t h e i n f e r i o r , i t s h o u l d
2019-04-19 00:23:33 +08:00
run to c o m p l e t i o n if no user i n t e r a c t i o n is r e q u i r e d . " ) L a u n c h ;
2011-07-17 05:15:39 +08:00
l l d b : : S B P r o c e s s
2018-06-12 05:19:26 +08:00
L a u n c h ( S B L i s t e n e r &listener,
2011-07-17 05:15:39 +08:00
char c o n s t * * a r g v ,
char c o n s t * * e n v p ,
c o n s t char * s t d i n _ p a t h ,
c o n s t char * s t d o u t _ p a t h ,
c o n s t char * s t d e r r _ p a t h ,
c o n s t char * w o r k i n g _ d i r e c t o r y ,
u i n t 32 _ t l a u n c h _ f l a g s , // See LaunchFlags
b o o l s t o p _ a t _ e n t r y ,
l l d b : : S B E r r o r & error);
2018-06-12 05:19:26 +08:00
2011-07-17 05:15:39 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
L a u n c h a new process with s e n s i b l e d e f a u l t s .
2021-01-18 17:47:16 +08:00
: param a r g v : T h e a r g u m e n t a r r a y .
: param e n v p : T h e e n v i r o n m e n t a r r a y .
: param w o r k i n g _ d i r e c t o r y : T h e w o r k i n g d i r e c t o r y to h a v e t h e c h i l d process run in
: return : T h e n e w l y c r e a t e d process .
: r t y p e : S B P r o c e s s
2019-04-19 00:23:33 +08:00
2021-01-18 17:47:16 +08:00
A p s e u d o terminal w i l l b e u s e d as s t d i n / s t d o u t / s t d e r r .
No l a u n c h f l a g s a r e p a s s e d and t h e target ' s d e b u g e r is u s e d as a l i s t e n e r .
2019-04-19 00:23:33 +08:00
2021-01-18 17:47:16 +08:00
For e x a m p l e , : :
2011-07-17 05:15:39 +08:00
process = target . L a u n c h S i m p l e ( [ 'X', 'Y', 'Z' ] , None , o s . g e t c w d ( ) )
l a u n c h e s a new process by p a s s i n g 'X', 'Y', 'Z' as t h e a r g s to t h e
2019-04-19 00:23:33 +08:00
e x e c u t a b l e . " ) L a u n c h S i m p l e ;
2011-07-17 05:15:39 +08:00
l l d b : : S B P r o c e s s
2018-06-12 05:19:26 +08:00
L a u n c h S i m p l e ( c o n s t char * * a r g v ,
2011-07-17 05:15:39 +08:00
c o n s t char * * e n v p ,
c o n s t char * w o r k i n g _ d i r e c t o r y ) ;
2018-06-12 05:19:26 +08:00
2012-02-24 13:03:03 +08:00
l l d b : : S B P r o c e s s
L a u n c h ( l l d b : : S B L a u n c h I n f o &launch_info, lldb::SBError& error);
2013-03-26 06:40:51 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Load a c o r e file
@ param [ in ] c o r e _ f i l e
File p a t h of t h e c o r e dump .
@ param [ o u t ] error
A n error e x p l a i n i n g w h a t w e n t w r o n g if t h e o p e r a t i o n f a i l s .
( O p t i o n a l )
@ return
A process o b j e c t for t h e n e w l y c r e a t e d c o r e file .
2013-03-26 06:40:51 +08:00
For e x a m p l e ,
process = target . L o a d C o r e ( './a.out.core' )
2019-04-19 00:23:33 +08:00
l o a d s a new c o r e file and returns t h e process o b j e c t . " ) L o a d C o r e ;
2013-03-26 06:40:51 +08:00
l l d b : : S B P r o c e s s
L o a d C o r e ( c o n s t char * c o r e _ f i l e ) ;
2018-06-12 05:19:26 +08:00
2012-02-24 13:03:03 +08:00
l l d b : : S B P r o c e s s
2018-06-12 05:19:26 +08:00
L o a d C o r e ( c o n s t char * c o r e _ f i l e , l l d b : : S B E r r o r &error);
l l d b : : S B P r o c e s s
A t t a c h ( l l d b : : S B A t t a c h I n f o &attach_info, lldb::SBError& error);
2012-02-24 13:03:03 +08:00
2011-07-17 05:15:39 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
A t t a c h to process with p i d .
@ param [ in ] l i s t e n e r
A n o p t i o n a l l i s t e n e r t h a t w i l l r e c e i v e all process events .
2019-04-23 18:04:22 +08:00
If l i s t e n e r is v a l i d then l i s t e n e r w i l l l i s t e n to all
2019-04-19 00:23:33 +08:00
process events . If not v a l i d , then t h i s target ' s debugger
( S B T a r g e t : : G e t D e b u g g e r ( ) ) w i l l l i s t e n to all process events .
@ param [ in ] p i d
T h e process I D to a t t a c h to .
@ param [ o u t ]
A n error e x p l a i n i n g w h a t w e n t w r o n g if a t t a c h f a i l s .
@ return
A process o b j e c t for t h e a t t a c h e d process . " ) A t t a c h T o P r o c e s s W i t h I D ;
2011-07-17 05:15:39 +08:00
l l d b : : S B P r o c e s s
A t t a c h T o P r o c e s s W i t h I D ( S B L i s t e n e r &listener,
l l d b : : p i d _ t p i d ,
l l d b : : S B E r r o r & error);
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
A t t a c h to process with name .
@ param [ in ] l i s t e n e r
A n o p t i o n a l l i s t e n e r t h a t w i l l r e c e i v e all process events .
2019-04-23 18:04:22 +08:00
If l i s t e n e r is v a l i d then l i s t e n e r w i l l l i s t e n to all
2019-04-19 00:23:33 +08:00
process events . If not v a l i d , then t h i s target ' s debugger
( S B T a r g e t : : G e t D e b u g g e r ( ) ) w i l l l i s t e n to all process events .
@ param [ in ] name
B a s e n a m e of process to a t t a c h to .
@ param [ in ] w a i t _ f o r
If true wait for a new i n s t a n c e of 'name' to b e l a u n c h e d .
@ param [ o u t ]
A n error e x p l a i n i n g w h a t w e n t w r o n g if a t t a c h f a i l s .
@ return
A process o b j e c t for t h e a t t a c h e d process . " ) A t t a c h T o P r o c e s s W i t h N a m e ;
2011-07-17 05:15:39 +08:00
l l d b : : S B P r o c e s s
A t t a c h T o P r o c e s s W i t h N a m e ( S B L i s t e n e r &listener,
c o n s t char * name ,
b o o l w a i t _ f o r ,
l l d b : : S B E r r o r & error);
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Connect to a remote debug server with url .
@ param [ in ] l i s t e n e r
A n o p t i o n a l l i s t e n e r t h a t w i l l r e c e i v e all process events .
2019-04-23 18:04:22 +08:00
If l i s t e n e r is v a l i d then l i s t e n e r w i l l l i s t e n to all
2019-04-19 00:23:33 +08:00
process events . If not v a l i d , then t h i s target ' s debugger
( S B T a r g e t : : G e t D e b u g g e r ( ) ) w i l l l i s t e n to all process events .
@ param [ in ] url
T h e url to connect to , e . g . , 'connect://localhost:12345' .
@ param [ in ] p l u g i n _ n a m e
T h e p l u g i n name to b e u s e d ; c a n b e NULL .
@ param [ o u t ]
A n error e x p l a i n i n g w h a t w e n t w r o n g if t h e connect f a i l s .
@ return
A process o b j e c t for t h e connected process . " ) C o n n e c t R e m o t e ;
2011-07-17 05:15:39 +08:00
l l d b : : S B P r o c e s s
C o n n e c t R e m o t e ( S B L i s t e n e r &listener,
c o n s t char * url ,
c o n s t char * p l u g i n _ n a m e ,
S B E r r o r & error);
2018-06-12 05:19:26 +08:00
2011-07-17 05:15:39 +08:00
l l d b : : S B F i l e S p e c
G e t E x e c u t a b l e ( ) ;
2018-08-08 05:41:59 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Append t h e p a t h m a p p i n g ( from - > to ) to t h e target ' s p a t h s m a p p i n g l i s t . " ) A p p e n d I m a g e S e a r c h P a t h ;
2018-08-08 04:23:57 +08:00
void
A p p e n d I m a g e S e a r c h P a t h ( c o n s t char * from ,
c o n s t char * to ,
S B E r r o r &error);
2011-09-24 08:52:29 +08:00
b o o l
A d d M o d u l e ( l l d b : : S B M o d u l e &module);
l l d b : : S B M o d u l e
A d d M o d u l e ( c o n s t char * p a t h ,
c o n s t char * t r i p l e ,
c o n s t char * u u i d ) ;
2012-04-24 04:23:39 +08:00
l l d b : : S B M o d u l e
A d d M o d u l e ( c o n s t char * p a t h ,
c o n s t char * t r i p l e ,
c o n s t char * u u i d _ c s t r ,
c o n s t char * s y m f i l e ) ;
Added a way to extract the module specifications from a file. A module specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files).
There are two new classes:
lldb::SBModuleSpec
lldb::SBModuleSpecList
The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList.
llvm-svn: 185877
2013-07-09 06:22:41 +08:00
l l d b : : S B M o d u l e
A d d M o d u l e ( c o n s t S B M o d u l e S p e c &module_spec);
2011-07-17 05:15:39 +08:00
u i n t 32 _ t
G e t N u m M o d u l e s ( ) c o n s t ;
l l d b : : S B M o d u l e
G e t M o d u l e A t I n d e x ( u i n t 32 _ t i d x ) ;
2011-09-24 08:52:29 +08:00
b o o l
R e m o v e M o d u l e ( l l d b : : S B M o d u l e m o d u l e ) ;
2011-07-17 05:15:39 +08:00
l l d b : : S B D e b u g g e r
G e t D e b u g g e r ( ) c o n s t ;
l l d b : : S B M o d u l e
F i n d M o d u l e ( c o n s t l l d b : : S B F i l e S p e c &file_spec);
2018-07-03 22:22:44 +08:00
% f e a t u r e ( "docstring" , "
2021-01-18 17:47:16 +08:00
Find compile u n i t s r e l a t e d to t h i s target and p a s s e d source
2019-04-19 00:23:33 +08:00
file .
2021-01-18 17:47:16 +08:00
: param s b _ f i l e _ s p e c : A : p y : class : ` l l d b : : S B F i l e S p e c ` o b j e c t t h a t contains source file
2019-04-19 00:23:33 +08:00
s p e c i f i c a t i o n .
2021-01-18 17:47:16 +08:00
: return : T h e s y m b o l c o n t e x t s for all t h e matches .
: r t y p e : S B S y m b o l C o n t e x t L i s t " ) F i n d C o m p i l e U n i t s ;
2018-07-03 22:22:44 +08:00
l l d b : : S B S y m b o l C o n t e x t L i s t
F i n d C o m p i l e U n i t s ( c o n s t l l d b : : S B F i l e S p e c &sb_file_spec);
2012-01-29 14:07:39 +08:00
l l d b : : B y t e O r d e r
G e t B y t e O r d e r ( ) ;
2018-06-12 05:19:26 +08:00
2012-01-29 14:07:39 +08:00
u i n t 32 _ t
G e t A d d r e s s B y t e S i z e ( ) ;
2018-06-12 05:19:26 +08:00
2012-01-29 14:07:39 +08:00
c o n s t char *
G e t T r i p l e ( ) ;
2014-10-22 15:22:56 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
A r c h i t e c t u r e d a t a b y t e width a c c e s s o r
2021-01-18 17:47:16 +08:00
: return : T h e size in 8 - b i t ( h o s t ) b y t e s of a minimum a d d r e s s a b l e u n i t from t h e A r c h i t e c t u r e ' s d a t a b u s .
" ) G e t D a t a B y t e S i z e ;
2014-10-22 15:22:56 +08:00
u i n t 32 _ t
G e t D a t a B y t e S i z e ( ) ;
% f e a t u r e ( "docstring" , "
2021-01-18 17:47:16 +08:00
A r c h i t e c t u r e code b y t e width a c c e s s o r .
2019-04-19 00:23:33 +08:00
2021-01-18 17:47:16 +08:00
: return : T h e size in 8 - b i t ( h o s t ) b y t e s of a minimum a d d r e s s a b l e u n i t from t h e A r c h i t e c t u r e ' s code b u s .
" ) G e t C o d e B y t e S i z e ;
2014-10-22 15:22:56 +08:00
u i n t 32 _ t
G e t C o d e B y t e S i z e ( ) ;
2011-09-24 08:52:29 +08:00
l l d b : : S B E r r o r
S e t S e c t i o n L o a d A d d r e s s ( l l d b : : S B S e c t i o n section ,
l l d b : : a d d r _ t s e c t i o n _ b a s e _ a d d r ) ;
l l d b : : S B E r r o r
C l e a r S e c t i o n L o a d A d d r e s s ( l l d b : : S B S e c t i o n section ) ;
l l d b : : S B E r r o r
S e t M o d u l e L o a d A d d r e s s ( l l d b : : S B M o d u l e m o d u l e ,
i n t 64 _ t s e c t i o n s _ o f f s e t ) ;
l l d b : : S B E r r o r
C l e a r M o d u l e L o a d A d d r e s s ( l l d b : : S B M o d u l e m o d u l e ) ;
2011-07-17 05:15:39 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Find f u n c t i o n s by name .
2021-01-18 17:47:16 +08:00
: param name : T h e name of t h e function w e a r e l o o k i n g for .
2019-04-19 00:23:33 +08:00
2021-01-18 17:47:16 +08:00
: param n a m e _ t y p e _ m a s k :
2019-04-19 00:23:33 +08:00
A logical OR of o n e or m o r e F u n c t i o n N a m e T y p e enum b i t s t h a t
i n d i c a t e w h a t k i n d of n a m e s s h o u l d b e u s e d when d o i n g t h e
lookup . B i t s i n c l u d e f u l l y q u a l i f i e d n a m e s , b a s e n a m e s ,
C + + m e t h o d s , or O b j C s e l e c t o r s .
S e e F u n c t i o n N a m e T y p e for m o r e d e t a i l s .
2021-01-18 17:47:16 +08:00
: return :
2019-04-19 00:23:33 +08:00
A l l d b : : S B S y m b o l C o n t e x t L i s t t h a t g e t s filled in with all of
t h e s y m b o l c o n t e x t s for all t h e matches . " ) F i n d F u n c t i o n s ;
Removed all of the "#ifndef SWIG" from the SB header files since we are using
interface (.i) files for each class.
Changed the FindFunction class from:
uint32_t
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)
uint32_t
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)
To:
lldb::SBSymbolContextList
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
lldb::SBSymbolContextList
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
This makes the API easier to use from python. Also added the ability to
append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList.
Exposed properties for lldb.SBSymbolContextList in python:
lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list
lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list
lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list
lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list
lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list
lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list
This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...)
and then the result can be used to extract the desired information:
sc_list = lldb.target.FindFunctions("erase")
for function in sc_list.functions:
print function
for symbol in sc_list.symbols:
print symbol
Exposed properties for the lldb.SBSymbolContext objects in python:
lldb.SBSymbolContext.module => lldb.SBModule
lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit
lldb.SBSymbolContext.function => lldb.SBFunction
lldb.SBSymbolContext.block => lldb.SBBlock
lldb.SBSymbolContext.line_entry => lldb.SBLineEntry
lldb.SBSymbolContext.symbol => lldb.SBSymbol
Exposed properties for the lldb.SBBlock objects in python:
lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains
lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block
lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block
lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column
lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents
lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block)
lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned
lldb.SBBlock.ranges => an array or all address ranges for this block
lldb.SBBlock.num_ranges => the number of address ranges for this blcok
SBFunction objects can now get the SBType and the SBBlock that represents the
top scope of the function.
SBBlock objects can now get the variable list from the current block. The value
list returned allows varaibles to be viewed prior with no process if code
wants to check the variables in a function. There are two ways to get a variable
list from a SBBlock:
lldb::SBValueList
SBBlock::GetVariables (lldb::SBFrame& frame,
bool arguments,
bool locals,
bool statics,
lldb::DynamicValueType use_dynamic);
lldb::SBValueList
SBBlock::GetVariables (lldb::SBTarget& target,
bool arguments,
bool locals,
bool statics);
When a SBFrame is used, the values returned will be locked down to the frame
and the values will be evaluated in the context of that frame.
When a SBTarget is used, global an static variables can be viewed without a
running process.
llvm-svn: 149853
2012-02-06 09:44:54 +08:00
l l d b : : S B S y m b o l C o n t e x t L i s t
2018-06-12 05:19:26 +08:00
F i n d F u n c t i o n s ( c o n s t char * name ,
Removed all of the "#ifndef SWIG" from the SB header files since we are using
interface (.i) files for each class.
Changed the FindFunction class from:
uint32_t
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)
uint32_t
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)
To:
lldb::SBSymbolContextList
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
lldb::SBSymbolContextList
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
This makes the API easier to use from python. Also added the ability to
append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList.
Exposed properties for lldb.SBSymbolContextList in python:
lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list
lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list
lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list
lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list
lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list
lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list
This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...)
and then the result can be used to extract the desired information:
sc_list = lldb.target.FindFunctions("erase")
for function in sc_list.functions:
print function
for symbol in sc_list.symbols:
print symbol
Exposed properties for the lldb.SBSymbolContext objects in python:
lldb.SBSymbolContext.module => lldb.SBModule
lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit
lldb.SBSymbolContext.function => lldb.SBFunction
lldb.SBSymbolContext.block => lldb.SBBlock
lldb.SBSymbolContext.line_entry => lldb.SBLineEntry
lldb.SBSymbolContext.symbol => lldb.SBSymbol
Exposed properties for the lldb.SBBlock objects in python:
lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains
lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block
lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block
lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column
lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents
lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block)
lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned
lldb.SBBlock.ranges => an array or all address ranges for this block
lldb.SBBlock.num_ranges => the number of address ranges for this blcok
SBFunction objects can now get the SBType and the SBBlock that represents the
top scope of the function.
SBBlock objects can now get the variable list from the current block. The value
list returned allows varaibles to be viewed prior with no process if code
wants to check the variables in a function. There are two ways to get a variable
list from a SBBlock:
lldb::SBValueList
SBBlock::GetVariables (lldb::SBFrame& frame,
bool arguments,
bool locals,
bool statics,
lldb::DynamicValueType use_dynamic);
lldb::SBValueList
SBBlock::GetVariables (lldb::SBTarget& target,
bool arguments,
bool locals,
bool statics);
When a SBFrame is used, the values returned will be locked down to the frame
and the values will be evaluated in the context of that frame.
When a SBTarget is used, global an static variables can be viewed without a
running process.
llvm-svn: 149853
2012-02-06 09:44:54 +08:00
u i n t 32 _ t n a m e _ t y p e _ m a s k = l l d b : : e F u n c t i o n N a m e T y p e A n y ) ;
2018-06-12 05:19:26 +08:00
2011-07-30 03:53:35 +08:00
l l d b : : S B T y p e
F i n d F i r s t T y p e ( c o n s t char * type ) ;
2018-06-12 05:19:26 +08:00
2011-07-30 03:53:35 +08:00
l l d b : : S B T y p e L i s t
F i n d T y p e s ( c o n s t char * type ) ;
2011-07-17 05:15:39 +08:00
2012-12-06 05:24:42 +08:00
l l d b : : S B T y p e
G e t B a s i c T y p e ( l l d b : : B a s i c T y p e type ) ;
2011-09-13 08:29:56 +08:00
l l d b : : S B S o u r c e M a n a g e r
G e t S o u r c e M a n a g e r ( ) ;
2011-07-17 05:15:39 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Find global and static v a r i a b l e s by name .
@ param [ in ] name
T h e name of t h e global or static variable w e a r e l o o k i n g
for .
@ param [ in ] m a x _ m a t c h e s
2019-04-23 18:04:22 +08:00
A l l o w t h e n u m b e r of matches to b e l i m i t e d to m a x _ m a t c h e s .
2019-04-19 00:23:33 +08:00
@ return
A l i s t of m a t c h e d v a r i a b l e s in a n S B V a l u e L i s t . " ) F i n d G l o b a l V a r i a b l e s ;
2011-07-17 05:15:39 +08:00
l l d b : : S B V a l u e L i s t
2018-06-12 05:19:26 +08:00
F i n d G l o b a l V a r i a b l e s ( c o n s t char * name ,
2011-07-17 05:15:39 +08:00
u i n t 32 _ t m a x _ m a t c h e s ) ;
2013-01-17 02:53:52 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Find t h e first global ( or static ) variable by name .
@ param [ in ] name
T h e name of t h e global or static variable w e a r e l o o k i n g
for .
@ return
A n S B V a l u e t h a t g e t s filled in with t h e f o u n d variable ( if any ) . " ) F i n d F i r s t G l o b a l V a r i a b l e ;
2013-01-17 02:53:52 +08:00
l l d b : : S B V a l u e
F i n d F i r s t G l o b a l V a r i a b l e ( c o n s t char * name ) ;
2018-06-12 05:19:26 +08:00
2014-09-20 04:12:24 +08:00
l l d b : : S B V a l u e L i s t
F i n d G l o b a l V a r i a b l e s ( c o n s t char * name ,
u i n t 32 _ t m a x _ m a t c h e s ,
M a t c h T y p e m a t c h t y p e ) ;
l l d b : : S B S y m b o l C o n t e x t L i s t
F i n d G l o b a l F u n c t i o n s ( c o n s t char * name ,
u i n t 32 _ t m a x _ m a t c h e s ,
M a t c h T y p e m a t c h t y p e ) ;
2011-07-17 05:15:39 +08:00
void
Clear ( ) ;
2014-10-22 15:22:56 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
R e s o l v e a current file a d d r e s s into a section o f f s e t a d d r e s s .
@ param [ in ] f i l e _ a d d r
@ return
A n S B A d d r e s s w h i c h w i l l b e v a l i d if . . . " ) R e s o l v e F i l e A d d r e s s ;
2014-10-22 15:22:56 +08:00
l l d b : : S B A d d r e s s
R e s o l v e F i l e A d d r e s s ( l l d b : : a d d r _ t f i l e _ a d d r ) ;
2011-07-23 00:46:35 +08:00
l l d b : : S B A d d r e s s
R e s o l v e L o a d A d d r e s s ( l l d b : : a d d r _ t v m _ a d d r ) ;
2018-06-12 05:19:26 +08:00
2013-12-06 09:12:00 +08:00
l l d b : : S B A d d r e s s
R e s o l v e P a s t L o a d A d d r e s s ( u i n t 32 _ t s t o p _ i d , l l d b : : a d d r _ t v m _ a d d r ) ;
2011-07-17 05:15:39 +08:00
S B S y m b o l C o n t e x t
2018-06-12 05:19:26 +08:00
R e s o l v e S y m b o l C o n t e x t F o r A d d r e s s ( c o n s t S B A d d r e s s & addr,
2011-07-17 05:15:39 +08:00
u i n t 32 _ t r e s o l v e _ s c o p e ) ;
2014-10-22 15:22:56 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
R e a d target m e m o r y . If a target process is r u n n i n g then m e m o r y
is r e a d from h e r e . Otherwise t h e m e m o r y is r e a d from t h e o b j e c t
f i l e s . For a target w h o s e b y t e s a r e s i z e d as a multiple of h o s t
b y t e s , t h e d a t a r e a d back w i l l p r e s e r v e t h e target ' s b y t e o r d e r .
@ param [ in ] a d d r
A target a d d r e s s to r e a d from .
@ param [ o u t ] b u f
T h e buffer to r e a d m e m o r y into .
@ param [ in ] size
T h e maximum n u m b e r of h o s t b y t e s to r e a d in t h e buffer p a s s e d
into t h i s call
@ param [ o u t ] error
Error information is w r i t t e n h e r e if t h e m e m o r y r e a d f a i l s .
@ return
T h e a m o u n t of d a t a r e a d in h o s t b y t e s . " ) R e a d M e m o r y ;
2014-10-22 15:22:56 +08:00
s i z e _ t
R e a d M e m o r y ( c o n s t S B A d d r e s s a d d r , void * b u f , s i z e _ t size , l l d b : : S B E r r o r &error);
2011-07-17 05:15:39 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y L o c a t i o n ( c o n s t char * file , u i n t 32 _ t line ) ;
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y L o c a t i o n ( c o n s t l l d b : : S B F i l e S p e c &file_spec, uint32_t line);
2016-03-10 02:59:13 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y L o c a t i o n ( c o n s t l l d b : : S B F i l e S p e c &file_spec, uint32_t line, lldb::addr_t offset);
2016-09-21 06:54:49 +08:00
l l d b : : S B B r e a k p o i n t
2018-06-12 05:19:26 +08:00
B r e a k p o i n t C r e a t e B y L o c a t i o n ( c o n s t l l d b : : S B F i l e S p e c &file_spec, uint32_t line,
2016-09-21 06:54:49 +08:00
l l d b : : a d d r _ t o f f s e t , S B F i l e S p e c L i s t &module_list);
2018-08-30 23:11:00 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y L o c a t i o n ( c o n s t l l d b : : S B F i l e S p e c &file_spec, uint32_t line,
u i n t 32 _ t column , l l d b : : a d d r _ t o f f s e t ,
S B F i l e S p e c L i s t &module_list);
2020-12-15 10:40:47 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y L o c a t i o n ( c o n s t l l d b : : S B F i l e S p e c &file_spec, uint32_t line,
u i n t 32 _ t column , l l d b : : a d d r _ t o f f s e t ,
S B F i l e S p e c L i s t &module_list,
b o o l m o v e _ t o _ n e a r e s t _ c o d e ) ;
2011-07-17 05:15:39 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y N a m e ( c o n s t char * s y m b o l _ n a m e , c o n s t char * m o d u l e _ n a m e = NULL ) ;
2011-10-11 09:18:55 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y N a m e ( c o n s t char * s y m b o l _ n a m e ,
u i n t 32 _ t f u n c _ n a m e _ t y p e , // Logical OR one or more FunctionNameType enum bits
2018-06-12 05:19:26 +08:00
c o n s t S B F i l e S p e c L i s t &module_list,
2011-10-11 09:18:55 +08:00
c o n s t S B F i l e S p e c L i s t &comp_unit_list);
2015-11-07 06:48:59 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y N a m e ( c o n s t char * s y m b o l _ n a m e ,
u i n t 32 _ t f u n c _ n a m e _ t y p e , // Logical OR one or more FunctionNameType enum bits
l l d b : : L a n g u a g e T y p e s y m b o l _ l a n g u a g e ,
2018-06-12 05:19:26 +08:00
c o n s t S B F i l e S p e c L i s t &module_list,
2015-11-07 06:48:59 +08:00
c o n s t S B F i l e S p e c L i s t &comp_unit_list);
2019-12-10 01:33:32 +08:00
# i f def S W I G P Y T H O N
2016-03-10 02:59:13 +08:00
% t y p e m a p ( in ) ( c o n s t char * * s y m b o l _ n a m e , u i n t 32 _ t n u m _ n a m e s ) {
using n a m e s p a c e l l d b _ p r i v a t e ;
/* C h e c k i f i s a l i s t */
if ( P y t h o n L i s t : : Check ( $ input ) ) {
P y t h o n L i s t l i s t ( P y R e f T y p e : : B o r r o w e d , $ input ) ;
$ 2 = l i s t . G e t S i z e ( ) ;
int i = 0 ;
$ 1 = ( char * * ) m a l l o c ( ( $ 2 + 1 ) * s i z e o f ( char * ) ) ;
for ( i = 0 ; i < $ 2 ; i + + ) {
P y t h o n S t r i n g p y _ s t r = l i s t . G e t I t e m A t I n d e x ( i ) . A s T y p e < P y t h o n S t r i n g > ( ) ;
if ( ! p y _ s t r . I s A l l o c a t e d ( ) ) {
P y E r r _ S e t S t r i n g ( P y E x c _ T y p e E r r o r , "list must contain strings and blubby" ) ;
f r e e ( $ 1 ) ;
return n u l l p t r ;
}
$ 1 [ i ] = c o n s t _ c a s t < char * > ( p y _ s t r . G e t S t r i n g ( ) . d a t a ( ) ) ;
}
$ 1 [ i ] = 0 ;
} else if ( $ input = = P y _ N o n e ) {
$ 1 = NULL ;
} else {
P y E r r _ S e t S t r i n g ( P y E x c _ T y p e E r r o r , "not a list" ) ;
return NULL ;
}
}
2019-12-10 01:33:32 +08:00
# e n d i f
2016-03-10 02:59:13 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y N a m e s ( c o n s t char * * s y m b o l _ n a m e ,
u i n t 32 _ t n u m _ n a m e s ,
u i n t 32 _ t n a m e _ t y p e _ m a s k , // Logical OR one or more FunctionNameType enum bits
c o n s t S B F i l e S p e c L i s t &module_list,
c o n s t S B F i l e S p e c L i s t &comp_unit_list);
2015-11-07 06:48:59 +08:00
l l d b : : S B B r e a k p o i n t
2016-03-10 02:59:13 +08:00
B r e a k p o i n t C r e a t e B y N a m e s ( c o n s t char * * s y m b o l _ n a m e ,
2015-11-07 06:48:59 +08:00
u i n t 32 _ t n u m _ n a m e s ,
u i n t 32 _ t n a m e _ t y p e _ m a s k , // Logical OR one or more FunctionNameType enum bits
2016-03-10 02:59:13 +08:00
l l d b : : L a n g u a g e T y p e s y m b o l _ l a n g u a g e ,
2015-11-07 06:48:59 +08:00
c o n s t S B F i l e S p e c L i s t &module_list,
c o n s t S B F i l e S p e c L i s t &comp_unit_list);
2012-03-06 08:37:27 +08:00
l l d b : : S B B r e a k p o i n t
2016-03-10 02:59:13 +08:00
B r e a k p o i n t C r e a t e B y N a m e s ( c o n s t char * * s y m b o l _ n a m e ,
2012-03-06 08:37:27 +08:00
u i n t 32 _ t n u m _ n a m e s ,
u i n t 32 _ t n a m e _ t y p e _ m a s k , // Logical OR one or more FunctionNameType enum bits
2015-11-07 06:48:59 +08:00
l l d b : : L a n g u a g e T y p e s y m b o l _ l a n g u a g e ,
2016-03-10 02:59:13 +08:00
l l d b : : a d d r _ t o f f s e t ,
2012-03-06 08:37:27 +08:00
c o n s t S B F i l e S p e c L i s t &module_list,
c o n s t S B F i l e S p e c L i s t &comp_unit_list);
2011-07-17 05:15:39 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y R e g e x ( c o n s t char * s y m b o l _ n a m e _ r e g e x , c o n s t char * m o d u l e _ n a m e = NULL ) ;
2015-11-07 06:48:59 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y R e g e x ( c o n s t char * s y m b o l _ n a m e _ r e g e x ,
l l d b : : L a n g u a g e T y p e s y m b o l _ l a n g u a g e ,
2018-06-12 05:19:26 +08:00
c o n s t S B F i l e S p e c L i s t &module_list,
2015-11-07 06:48:59 +08:00
c o n s t S B F i l e S p e c L i s t &comp_unit_list);
2011-09-21 09:17:13 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y S o u r c e R e g e x ( c o n s t char * s o u r c e _ r e g e x , c o n s t l l d b : : S B F i l e S p e c &source_file, const char *module_name = NULL);
2015-02-13 01:37:46 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y S o u r c e R e g e x ( c o n s t char * s o u r c e _ r e g e x , c o n s t l l d b : : S B F i l e S p e c L i s t &module_list, const lldb::SBFileSpecList &file_list);
2016-04-28 09:40:57 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y S o u r c e R e g e x ( c o n s t char * s o u r c e _ r e g e x ,
c o n s t S B F i l e S p e c L i s t &module_list,
c o n s t S B F i l e S p e c L i s t &source_file,
c o n s t S B S t r i n g L i s t &func_names);
2012-03-06 08:37:27 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e F o r E x c e p t i o n ( l l d b : : L a n g u a g e T y p e language ,
b o o l c a t c h _ b p ,
b o o l t h r o w _ b p ) ;
2011-07-17 05:15:39 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y A d d r e s s ( a d d r _ t a d d r e s s ) ;
2020-03-21 10:31:33 +08:00
l l d b : : S B E n v i r o n m e n t
G e t E n v i r o n m e n t ( ) ;
2015-11-17 11:39:13 +08:00
l l d b : : S B B r e a k p o i n t
B r e a k p o i n t C r e a t e B y S B A d d r e s s ( S B A d d r e s s &sb_address);
2019-04-19 00:23:33 +08:00
2018-09-14 05:35:32 +08:00
% f e a t u r e ( "docstring" , "
2019-04-21 20:48:53 +08:00
Create a b r e a k p o i n t using a s c r i p t e d r e s o l v e r .
2019-07-03 06:18:35 +08:00
2019-04-21 20:48:53 +08:00
@ param [ in ] c l a s s _ n a m e
T h i s is t h e name of t h e class t h a t implements a s c r i p t e d r e s o l v e r .
2021-01-18 17:47:16 +08:00
T h e class s h o u l d h a v e t h e f o l l o w i n g signature : : :
class R e s o l v e r :
def _ _ i n i t _ _ ( self , b k p t , e x t r a _ a r g s ) :
# b k p t - t h e b r e a k p o i n t for w h i c h t h i s is t h e r e s o l v e r . When
# t h e r e s o l v e r f i n d s a n i n t e r e s t i n g a d d r e s s , call A d d L o c a t i o n
# on t h i s b r e a k p o i n t to add i t .
#
# e x t r a _ a r g s - a n S B S t r u c t u r e d D a t a t h a t c a n b e u s e d to
# p a r a m e t r i z e t h i s i n s t a n c e . S a m e as t h e e x t r a _ a r g s p a s s e d
# to B r e a k p o i n t C r e a t e F r o m S c r i p t .
def _ _ g e t _ d e p t h _ _ ( self ) :
# T h i s is o p t i o n a l , b u t if defined , y o u s h o u l d return t h e
# d e p t h at w h i c h y o u w a n t t h e c a l l b a c k to b e c a l l e d . T h e
# available o p t i o n s a r e :
# l l d b . e S e a r c h D e p t h M o d u l e
# l l d b . e S e a r c h D e p t h C o m p U n i t
# T h e default if y o u d o n ' t i m p l e m e n t t h i s method is
# e S e a r c h D e p t h M o d u l e .
def _ _ c a l l b a c k _ _ ( self , s y m _ c t x ) :
# s y m _ c t x - a n S B S y m b o l C o n t e x t t h a t is t h e cursor in t h e
# search through t h e p r o g r a m to r e s o l v e b r e a k p o i n t s .
# T h e s y m _ c t x w i l l b e filled o u t to t h e d e p t h r e q u e s t e d in
# _ _ g e t _ d e p t h _ _ .
# L o o k in t h i s s y m _ c t x for new b r e a k p o i n t l o c a t i o n s ,
# and if f o u n d use b k p t . A d d L o c a t i o n to add t h e m .
# N o t e , y o u w i l l o n l y get c a l l e d for m o d u l e s / c o m p i l e _ u n i t s t h a t
# p a s s t h e S e a r c h F i l t e r p r o v i d e d by t h e m o d u l e _ l i s t & file_list
# p a s s e d into B r e a k p o i n t C r e a t e F r o m S c r i p t .
def g e t _ s h o r t _ h e l p ( self ) :
# O p t i o n a l , b u t if i m p l e m e n t e d return a s h o r t string t h a t w i l l
# b e p r i n t e d at t h e b e g i n n i n g of t h e break l i s t output for t h e
# b r e a k p o i n t .
2019-07-03 06:18:35 +08:00
2019-04-21 20:48:53 +08:00
@ param [ in ] e x t r a _ a r g s
T h i s is a n S B S t r u c t u r e d D a t a o b j e c t t h a t w i l l get p a s s e d to t h e
constructor of t h e class in c l a s s _ n a m e . Y o u c a n use t h i s to
r e u s e t h e s a m e class , p a r a m e t r i z i n g i t with e n t r i e s from t h i s
dictionary .
2019-07-03 06:18:35 +08:00
2019-04-21 20:48:53 +08:00
@ param m o d u l e _ l i s t
If t h i s is n o n - e m p t y , t h i s w i l l b e u s e d as t h e m o d u l e f i l t e r in t h e
S e a r c h F i l t e r c r e a t e d for t h i s b r e a k p o i n t .
2019-07-03 06:18:35 +08:00
2019-04-21 20:48:53 +08:00
@ param f i l e _ l i s t
If t h i s is n o n - e m p t y , t h i s w i l l b e u s e d as t h e c o m p u n i t f i l t e r in t h e
S e a r c h F i l t e r c r e a t e d for t h i s b r e a k p o i n t .
2019-07-03 06:18:35 +08:00
2019-04-21 20:48:53 +08:00
@ return
A n S B B r e a k p o i n t t h a t w i l l set l o c a t i o n s b a s e d on t h e l o g i c in t h e
r e s o l v e r ' s search c a l l b a c k . " ) B r e a k p o i n t C r e a t e F r o m S c r i p t ;
2018-09-14 05:35:32 +08:00
l l d b : : S B B r e a k p o i n t B r e a k p o i n t C r e a t e F r o m S c r i p t (
c o n s t char * c l a s s _ n a m e ,
S B S t r u c t u r e d D a t a &extra_args,
c o n s t S B F i l e S p e c L i s t &module_list,
c o n s t S B F i l e S p e c L i s t &file_list,
b o o l r e q u e s t _ h a r d w a r e = false ) ;
2015-11-17 11:39:13 +08:00
2011-07-17 05:15:39 +08:00
u i n t 32 _ t
G e t N u m B r e a k p o i n t s ( ) c o n s t ;
l l d b : : S B B r e a k p o i n t
G e t B r e a k p o i n t A t I n d e x ( u i n t 32 _ t i d x ) c o n s t ;
b o o l
B r e a k p o i n t D e l e t e ( b r e a k _ i d _ t b r e a k _ i d ) ;
l l d b : : S B B r e a k p o i n t
F i n d B r e a k p o i n t B y I D ( b r e a k _ i d _ t b r e a k _ i d ) ;
2018-06-12 05:19:26 +08:00
2016-09-21 09:21:19 +08:00
b o o l F i n d B r e a k p o i n t s B y N a m e ( c o n s t char * name , S B B r e a k p o i n t L i s t &bkpt_list);
2017-09-15 04:22:49 +08:00
void D e l e t e B r e a k p o i n t N a m e ( c o n s t char * name ) ;
void G e t B r e a k p o i n t N a m e s ( S B S t r i n g L i s t &names);
2011-07-17 05:15:39 +08:00
b o o l
E n a b l e A l l B r e a k p o i n t s ( ) ;
b o o l
D i s a b l e A l l B r e a k p o i n t s ( ) ;
b o o l
D e l e t e A l l B r e a k p o i n t s ( ) ;
2016-09-23 06:20:28 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
R e a d b r e a k p o i n t s from s o u r c e _ f i l e and return t h e n e w l y c r e a t e d
b r e a k p o i n t s in b k p t _ l i s t .
@ param [ in ] s o u r c e _ f i l e
T h e file from w h i c h to r e a d t h e b r e a k p o i n t s
@ param [ o u t ] b k p t _ l i s t
A l i s t of t h e n e w l y c r e a t e d b r e a k p o i n t s .
@ return
A n S B E r r o r d e t a i l i n g any e r r o r s in r e a d i n g in t h e b r e a k p o i n t s . " ) B r e a k p o i n t s C r e a t e F r o m F i l e ;
2016-09-15 03:07:35 +08:00
l l d b : : S B E r r o r
2018-06-12 05:19:26 +08:00
B r e a k p o i n t s C r e a t e F r o m F i l e ( S B F i l e S p e c &source_file,
2016-09-15 03:07:35 +08:00
S B B r e a k p o i n t L i s t &bkpt_list);
2016-09-23 06:20:28 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
R e a d b r e a k p o i n t s from s o u r c e _ f i l e and return t h e n e w l y c r e a t e d
b r e a k p o i n t s in b k p t _ l i s t .
@ param [ in ] s o u r c e _ f i l e
T h e file from w h i c h to r e a d t h e b r e a k p o i n t s
@ param [ in ] m a t c h i n g _ n a m e s
O n l y r e a d in b r e a k p o i n t s w h o s e n a m e s m a t c h o n e of t h e n a m e s in t h i s
l i s t .
@ param [ o u t ] b k p t _ l i s t
A l i s t of t h e n e w l y c r e a t e d b r e a k p o i n t s .
@ return
A n S B E r r o r d e t a i l i n g any e r r o r s in r e a d i n g in t h e b r e a k p o i n t s . " ) B r e a k p o i n t s C r e a t e F r o m F i l e ;
2016-09-23 06:20:28 +08:00
l l d b : : S B E r r o r B r e a k p o i n t s C r e a t e F r o m F i l e ( S B F i l e S p e c &source_file,
S B S t r i n g L i s t &matching_names,
S B B r e a k p o i n t L i s t &new_bps);
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Write b r e a k p o i n t s to d e s t _ f i l e .
@ param [ in ] d e s t _ f i l e
T h e file to w h i c h to write t h e b r e a k p o i n t s .
@ return
A n S B E r r o r d e t a i l i n g any e r r o r s in w r i t i n g in t h e b r e a k p o i n t s . " ) B r e a k p o i n t s C r e a t e F r o m F i l e ;
2016-09-15 03:07:35 +08:00
l l d b : : S B E r r o r
B r e a k p o i n t s W r i t e T o F i l e ( S B F i l e S p e c &dest_file);
2018-06-12 05:19:26 +08:00
2016-09-23 06:20:28 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Write b r e a k p o i n t s l i s t e d in b k p t _ l i s t to d e s t _ f i l e .
@ param [ in ] d e s t _ f i l e
T h e file to w h i c h to write t h e b r e a k p o i n t s .
@ param [ in ] b k p t _ l i s t
O n l y write b r e a k p o i n t s from t h i s l i s t .
@ param [ in ] append
2019-04-23 18:04:22 +08:00
If true , append t h e b r e a k p o i n t s in b k p t _ l i s t to t h e o t h e r s
2019-04-19 00:23:33 +08:00
s e r i a l i z e d in d e s t _ f i l e . If d e s t _ f i l e d o e s n ' t e x i s t , then a new
file w i l l b e c r e a t e d and t h e b r e a k p o i n t s in b k p t _ l i s t w r i t t e n to i t .
@ return
A n S B E r r o r d e t a i l i n g any e r r o r s in w r i t i n g in t h e b r e a k p o i n t s . " ) B r e a k p o i n t s C r e a t e F r o m F i l e ;
2016-09-15 03:07:35 +08:00
l l d b : : S B E r r o r
2018-06-12 05:19:26 +08:00
B r e a k p o i n t s W r i t e T o F i l e ( S B F i l e S p e c &dest_file,
2016-09-23 07:42:42 +08:00
S B B r e a k p o i n t L i s t &bkpt_list,
b o o l append = false ) ;
2016-09-15 03:07:35 +08:00
2011-09-27 09:19:20 +08:00
u i n t 32 _ t
2011-10-14 02:08:26 +08:00
G e t N u m W a t c h p o i n t s ( ) c o n s t ;
2018-06-12 05:19:26 +08:00
2011-10-14 02:08:26 +08:00
l l d b : : S B W a t c h p o i n t
G e t W a t c h p o i n t A t I n d e x ( u i n t 32 _ t i d x ) c o n s t ;
2018-06-12 05:19:26 +08:00
2011-09-27 09:19:20 +08:00
b o o l
2011-10-14 02:08:26 +08:00
D e l e t e W a t c h p o i n t ( l l d b : : w a t c h _ i d _ t w a t c h _ i d ) ;
2018-06-12 05:19:26 +08:00
2011-10-14 02:08:26 +08:00
l l d b : : S B W a t c h p o i n t
F i n d W a t c h p o i n t B y I D ( l l d b : : w a t c h _ i d _ t w a t c h _ i d ) ;
2018-06-12 05:19:26 +08:00
2011-09-27 09:19:20 +08:00
b o o l
2011-10-14 02:08:26 +08:00
E n a b l e A l l W a t c h p o i n t s ( ) ;
2018-06-12 05:19:26 +08:00
2011-09-27 09:19:20 +08:00
b o o l
2011-10-14 02:08:26 +08:00
D i s a b l e A l l W a t c h p o i n t s ( ) ;
2018-06-12 05:19:26 +08:00
2011-09-27 09:19:20 +08:00
b o o l
2011-10-14 02:08:26 +08:00
D e l e t e A l l W a t c h p o i n t s ( ) ;
l l d b : : S B W a t c h p o i n t
2018-06-12 05:19:26 +08:00
W a t c h A d d r e s s ( l l d b : : a d d r _ t a d d r ,
s i z e _ t size ,
b o o l r e a d ,
2012-06-05 07:19:54 +08:00
b o o l write ,
S B E r r o r &error);
2018-06-12 05:19:26 +08:00
2011-09-27 09:19:20 +08:00
2011-07-17 05:15:39 +08:00
l l d b : : S B B r o a d c a s t e r
G e t B r o a d c a s t e r ( ) c o n s t ;
2018-06-12 05:19:26 +08:00
2015-12-05 04:16:51 +08:00
% f e a t u r e ( "docstring" , "
2019-04-19 00:23:33 +08:00
Create a n S B V a l u e with t h e g i v e n name by t r e a t i n g t h e m e m o r y s t a r t i n g at a d d r as a n e n t i t y of type .
@ param [ in ] name
T h e name of t h e r e s u l t a n t S B V a l u e
@ param [ in ] a d d r
T h e a d d r e s s of t h e start of t h e m e m o r y r e g i o n to b e u s e d .
@ param [ in ] type
T h e type to use to i n t e r p r e t t h e m e m o r y s t a r t i n g at a d d r .
@ return
A n S B V a l u e of t h e g i v e n type , m a y b e i n v a l i d if t h e r e w a s a n error r e a d i n g
t h e u n d e r l y i n g m e m o r y . " ) C r e a t e V a l u e F r o m A d d r e s s ;
2013-10-09 05:49:02 +08:00
l l d b : : S B V a l u e
C r e a t e V a l u e F r o m A d d r e s s ( c o n s t char * name , l l d b : : S B A d d r e s s a d d r , l l d b : : S B T y p e type ) ;
2014-11-18 13:43:11 +08:00
2014-12-18 05:18:43 +08:00
l l d b : : S B V a l u e
C r e a t e V a l u e F r o m D a t a ( c o n s t char * name , l l d b : : S B D a t a d a t a , l l d b : : S B T y p e type ) ;
2018-06-12 05:19:26 +08:00
2014-12-18 05:18:43 +08:00
l l d b : : S B V a l u e
C r e a t e V a l u e F r o m E x p r e s s i o n ( c o n s t char * name , c o n s t char * e x p r ) ;
2018-06-12 05:19:26 +08:00
2014-11-18 13:43:11 +08:00
% f e a t u r e ( "docstring" , "
D i s a s s e m b l e a s p e c i f i e d n u m b e r of i n s t r u c t i o n s s t a r t i n g at a n a d d r e s s .
2021-01-18 17:47:16 +08:00
: param b a s e _ a d d r : t h e a d d r e s s to start d i s a s s e m b l y from .
: param count : t h e n u m b e r of i n s t r u c t i o n s to d i s a s s e m b l e .
: param f l a v o r _ s t r i n g : m a y b e 'intel' or 'att' on x 86 t a r g e t s to s p e c i f y t h a t s t y l e of d i s a s s e m b l y .
: r t y p e : S B I n s t r u c t i o n L i s t
" )
2014-11-18 13:43:11 +08:00
R e a d I n s t r u c t i o n s ;
2012-03-07 06:24:44 +08:00
l l d b : : S B I n s t r u c t i o n L i s t
2018-06-12 05:19:26 +08:00
R e a d I n s t r u c t i o n s ( l l d b : : S B A d d r e s s b a s e _ a d d r , u i n t 32 _ t count ) ;
2012-03-07 06:24:44 +08:00
2013-03-02 08:26:47 +08:00
l l d b : : S B I n s t r u c t i o n L i s t
R e a d I n s t r u c t i o n s ( l l d b : : S B A d d r e s s b a s e _ a d d r , u i n t 32 _ t count , c o n s t char * f l a v o r _ s t r i n g ) ;
2014-11-18 13:43:11 +08:00
% f e a t u r e ( "docstring" , "
D i s a s s e m b l e t h e b y t e s in a buffer and return t h e m in a n S B I n s t r u c t i o n L i s t .
2021-01-18 17:47:16 +08:00
: param b a s e _ a d d r : u s e d for s y m b o l i c a t i n g t h e o f f s e t s in t h e b y t e stream when d i s a s s e m b l i n g .
: param b u f : b y t e s to b e d i s a s s e m b l e d .
: param size : ( C + + ) size of t h e buffer .
: r t y p e : S B I n s t r u c t i o n L i s t
" )
2014-11-18 13:43:11 +08:00
G e t I n s t r u c t i o n s ;
2011-12-15 07:49:37 +08:00
l l d b : : S B I n s t r u c t i o n L i s t
G e t I n s t r u c t i o n s ( l l d b : : S B A d d r e s s b a s e _ a d d r , c o n s t void * b u f , s i z e _ t size ) ;
2014-11-18 13:43:11 +08:00
% f e a t u r e ( "docstring" , "
D i s a s s e m b l e t h e b y t e s in a buffer and return t h e m in a n S B I n s t r u c t i o n L i s t , with a s u p p l i e d f l a v o r .
2021-01-18 17:47:16 +08:00
: param b a s e _ a d d r : u s e d for s y m b o l i c a t i n g t h e o f f s e t s in t h e b y t e stream when d i s a s s e m b l i n g .
: param f l a v o r : m a y b e 'intel' or 'att' on x 86 t a r g e t s to s p e c i f y t h a t s t y l e of d i s a s s e m b l y .
: param b u f : b y t e s to b e d i s a s s e m b l e d .
: param size : ( C + + ) size of t h e buffer .
: r t y p e : S B I n s t r u c t i o n L i s t
" )
2014-11-18 13:43:11 +08:00
G e t I n s t r u c t i o n s W i t h F l a v o r ;
2013-03-02 08:26:47 +08:00
l l d b : : S B I n s t r u c t i o n L i s t
G e t I n s t r u c t i o n s W i t h F l a v o r ( l l d b : : S B A d d r e s s b a s e _ a d d r , c o n s t char * f l a v o r _ s t r i n g , c o n s t void * b u f , s i z e _ t size ) ;
2018-06-12 05:19:26 +08:00
2012-12-04 10:22:16 +08:00
l l d b : : S B S y m b o l C o n t e x t L i s t
F i n d S y m b o l s ( c o n s t char * name , l l d b : : S y m b o l T y p e type = e S y m b o l T y p e A n y ) ;
2011-07-17 05:15:39 +08:00
b o o l
2011-11-13 14:57:31 +08:00
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, lldb::DescriptionLevel description_level);
2018-06-12 05:19:26 +08:00
2013-02-01 08:47:49 +08:00
l l d b : : a d d r _ t
G e t S t a c k R e d Z o n e S i z e ( ) ;
2021-02-01 19:14:10 +08:00
% f e a t u r e ( "docstring" , "
Returns true if t h e m o d u l e h a s b e e n l o a d e d in t h i s ` S B T a r g e t ` .
A m o d u l e c a n b e l o a d e d e i t h e r by t h e dynamic l o a d e r or by b e i n g m a n u a l l y
a d d e d to t h e target ( s e e ` S B T a r g e t . A d d M o d u l e ` and t h e ` target m o d u l e add ` command ) .
: r t y p e : b o o l
" ) I s L o a d e d ;
b o o l
I s L o a d e d ( c o n s t l l d b : : S B M o d u l e &module) const;
2015-03-24 05:50:21 +08:00
l l d b : : S B L a u n c h I n f o
G e t L a u n c h I n f o ( ) c o n s t ;
void
S e t L a u n c h I n f o ( c o n s t l l d b : : S B L a u n c h I n f o &launch_info);
2018-09-29 07:27:54 +08:00
void S e t C o l l e c t i n g S t a t s ( b o o l v ) ;
b o o l G e t C o l l e c t i n g S t a t s ( ) ;
2018-04-17 06:55:34 +08:00
l l d b : : S B S t r u c t u r e d D a t a G e t S t a t i s t i c s ( ) ;
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 T a r g e 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 T a r g e t &rhs) const;
2015-07-08 06:12:17 +08:00
l l d b : : S B V a l u e
E v a l u a t e E x p r e s s i o n ( c o n s t char * e x p r ) ;
2013-01-05 02:10:18 +08:00
l l d b : : S B V a l u e
E v a l u a t e E x p r e s s i o n ( c o n s t char * e x p r , c o n s t l l d b : : S B E x p r e s s i o n O p t i o n s &options);
2015-07-08 06:12:17 +08:00
2020-01-09 08:13:03 +08:00
S T R I N G _ E X T E N S I O N _ L E V E L ( S B T a r g e t , l l d b : : e D e s c r i p t i o n L e v e l B r i e f )
2020-01-09 05:34:55 +08:00
2019-12-09 06:46:48 +08:00
# i f def S W I G P Y T H O N
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
class m o d u l e s _ a c c e s s ( o b j e c t ) :
'''A helper object that will lazily hand out lldb.SBModule objects for a target when supplied an index, or by full or partial path.'''
def _ _ i n i t _ _ ( self , s b t a r g e t ) :
self . s b t a r g e t = s b t a r g e t
2018-06-12 05:19:26 +08:00
2012-02-01 16:09:32 +08:00
def _ _ l e n _ _ ( self ) :
if self . s b t a r g e t :
2012-05-12 04:39:42 +08:00
return int ( self . s b t a r g e t . G e t N u m M o d u l e s ( ) )
2012-02-01 16:09:32 +08:00
return 0
2018-06-12 05:19:26 +08:00
2012-02-01 16:09:32 +08:00
def _ _ g e t i t e m _ _ ( self , key ) :
n u m _ m o d u l e s = self . s b t a r g e t . G e t N u m M o d u l e s ( )
if type ( key ) is int :
if key < n u m _ m o d u l e s :
return self . s b t a r g e t . G e t M o d u l e A t I n d e x ( key )
e l i f type ( key ) is s t r :
if key . find ( '/' ) = = - 1 :
for i d x in r a n g e ( n u m _ m o d u l e s ) :
m o d u l e = self . s b t a r g e t . G e t M o d u l e A t I n d e x ( i d x )
if m o d u l e . file . b a s e n a m e = = key :
return m o d u l e
else :
for i d x in r a n g e ( n u m _ m o d u l e s ) :
m o d u l e = self . s b t a r g e t . G e t M o d u l e A t I n d e x ( i d x )
if m o d u l e . file . f u l l p a t h = = key :
return m o d u l e
# S e e if t h e string is a U U I D
2013-03-07 10:58:47 +08:00
t r y :
t h e _ u u i d = u u i d . U U I D ( key )
if t h e _ u u i d :
for i d x in r a n g e ( n u m _ m o d u l e s ) :
m o d u l e = self . s b t a r g e t . G e t M o d u l e A t I n d e x ( i d x )
if m o d u l e . u u i d = = t h e _ u u i d :
return m o d u l e
except :
return None
2012-02-01 16:09:32 +08:00
e l i f type ( key ) is u u i d . U U I D :
for i d x in r a n g e ( n u m _ m o d u l e s ) :
m o d u l e = self . s b t a r g e t . G e t M o d u l e A t I n d e x ( i d x )
if m o d u l e . u u i d = = key :
return m o d u l e
e l i f type ( key ) is r e . S R E _ P a t t e r n :
m a t c h i n g _ m o d u l e s = [ ]
for i d x in r a n g e ( n u m _ m o d u l e s ) :
m o d u l e = self . s b t a r g e t . G e t M o d u l e A t I n d e x ( i d x )
r e _ m a t c h = key . search ( m o d u l e . p a t h . f u l l p a t h )
if r e _ m a t c h :
m a t c h i n g _ m o d u l e s . append ( m o d u l e )
return m a t c h i n g _ m o d u l e s
else :
2015-10-17 01:52:32 +08:00
p r i n t ( "error: unsupported item type: %s" % type ( key ) )
2012-02-01 16:09:32 +08:00
return None
2018-06-12 05:19:26 +08:00
2012-02-01 16:09:32 +08:00
def g e t _ m o d u l e s _ a c c e s s _ o b j e c t ( self ) :
2012-02-03 11:22:53 +08:00
'''An accessor function that returns a modules_access() object which allows lazy module access from a lldb.SBTarget object.'''
2012-02-01 16:09:32 +08:00
return self . m o d u l e s _ a c c e s s ( self )
2018-06-12 05:19:26 +08:00
2012-02-01 16:09:32 +08:00
def g e t _ m o d u l e s _ a r r a y ( self ) :
2012-02-03 11:22:53 +08:00
'''An accessor function that returns a list() that contains all modules in a lldb.SBTarget object.'''
2012-02-01 16:09:32 +08:00
m o d u l e s = [ ]
for i d x in r a n g e ( self . G e t N u m M o d u l e s ( ) ) :
m o d u l e s . append ( self . G e t M o d u l e A t I n d e x ( i d x ) )
return m o d u l e s
2019-04-03 19:48:38 +08:00
def m o d u l e _ i t e r ( self ) :
''' Returns a n i t e r a t o r o v e r all m o d u l e s in a l l d b . S B T a r g e t
o b j e c t . '''
return l l d b _ i t e r ( self , 'GetNumModules', 'GetModuleAtIndex' )
def b r e a k p o i n t _ i t e r ( self ) :
''' Returns a n i t e r a t o r o v e r all b r e a k p o i n t s in a l l d b . S B T a r g e t
o b j e c t . '''
return l l d b _ i t e r ( self , 'GetNumBreakpoints', 'GetBreakpointAtIndex' )
def w a t c h p o i n t _ i t e r ( self ) :
''' Returns a n i t e r a t o r o v e r all w a t c h p o i n t s in a l l d b . S B T a r g e t
o b j e c t . '''
return l l d b _ i t e r ( self , 'GetNumWatchpoints', 'GetWatchpointAtIndex' )
2019-07-03 06:18:35 +08:00
m o d u l e s = property ( g e t _ m o d u l e s _ a r r a y , None , d o c = '''A read only property that returns a list() of lldb.SBModule objects contained in this target. This list is a list all modules that the target currently is tracking (the main executable and all dependent shared libraries).''' )
m o d u l e = property ( g e t _ m o d u l e s _ a c c e s s _ o b j e c t , None , d o c = r '''A read only property that returns an object that implements python operator overloading with the square brackets().\n target.module[<int>] allows array access to any modules.\n target.module[<str>] allows access to modules by basename, full path, or uuid string value.\n target.module[uuid.UUID()] allows module access by UUID.\n target.module[re] allows module access using a regular expression that matches the module full path.''' )
process = property ( G e t P r o c e s s , None , d o c = '''A read only property that returns an lldb object that represents the process (lldb.SBProcess) that this target owns.''' )
e x e c u t a b l e = property ( G e t E x e c u t a b l e , None , d o c = '''A read only property that returns an lldb object that represents the main executable module (lldb.SBModule) for this target.''' )
debugger = property ( G e t D e b u g g e r , None , d o c = '''A read only property that returns an lldb object that represents the debugger (lldb.SBDebugger) that owns this target.''' )
n u m _ b r e a k p o i n t s = property ( G e t N u m B r e a k p o i n t s , None , d o c = '''A read only property that returns the number of breakpoints that this target has as an integer.''' )
n u m _ w a t c h p o i n t s = property ( G e t N u m W a t c h p o i n t s , None , d o c = '''A read only property that returns the number of watchpoints that this target has as an integer.''' )
b r o a d c a s t e r = property ( G e t B r o a d c a s t e r , None , d o c = '''A read only property that an lldb object that represents the broadcaster (lldb.SBBroadcaster) for this target.''' )
b y t e _ o r d e r = property ( G e t B y t e O r d e r , None , d o c = '''A read only property that returns an lldb enumeration value (lldb.eByteOrderLittle, lldb.eByteOrderBig, lldb.eByteOrderInvalid) that represents the byte order for this target.''' )
a d d r _ s i z e = property ( G e t A d d r e s s B y t e S i z e , None , d o c = '''A read only property that returns the size in bytes of an address for this target.''' )
t r i p l e = property ( G e t T r i p l e , None , d o c = '''A read only property that returns the target triple (arch-vendor-os) for this target as a string.''' )
d a t a _ b y t e _ s i z e = property ( G e t D a t a B y t e S i z e , None , d o c = '''A read only property that returns the size in host bytes of a byte in the data address space for this target.''' )
c o d e _ b y t e _ s i z e = property ( G e t C o d e B y t e S i z e , None , d o c = '''A read only property that returns the size in host bytes of a byte in the code address space for this target.''' )
p l a t f o r m = property ( G e t P l a t f o r m , None , d o c = '''A read only property that returns the platform associated with with this target.''' )
2012-01-29 14:07:39 +08:00
% }
2019-12-09 06:46:48 +08:00
# e n d i f
2011-07-17 05:15:39 +08:00
} ;
} // namespace lldb