2011-07-19 03:15:22 +08:00
//===-- SWIG Interface for SBValue ------------------------------*- C++ -*-===//
2011-07-19 03:08:30 +08:00
//
// 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 t h e value of a variable , a r e g i s t e r , or a n e x p r e s s i o n .
S B V a l u e s u p p o r t s i t e r a t i o n through i t s c h i l d , w h i c h in t u r n is r e p r e s e n t e d
as a n S B V a l u e . For e x a m p l e , w e c a n get t h e g e n e r a l p u r p o s e r e g i s t e r s of a
frame as a n S B V a l u e , and i t e r a t e through all t h e r e g i s t e r s ,
r e g i s t e r S e t = frame . G e t R e g i s t e r s ( ) # Returns a n S B V a l u e L i s t .
for r e g s in r e g i s t e r S e t :
if 'general purpose registers' in r e g s . g e t N a m e ( ) . l o w e r ( ) :
G P R s = r e g s
break
p r i n t '%s (number of children = %d):' % ( G P R s . G e t N a m e ( ) , G P R s . G e t N u m C h i l d r e n ( ) )
for r e g in G P R s :
p r i n t 'Name: ', reg.GetName(), ' Value: ' , r e g . G e t V a l u e ( )
p r o d u c e s t h e output :
G e n e r a l P u r p o s e R e g i s t e r s ( n u m b e r of c h i l d r e n = 21 ) :
Name : r a x Value : 0x0000000100000c5c
Name : r b x Value : 0x0000000000000000
Name : r c x Value : 0x00007fff5fbffec0
Name : r d x Value : 0x00007fff5fbffeb8
Name : r d i Value : 0x0000000000000001
Name : r s i Value : 0x00007fff5fbffea8
Name : r b p Value : 0x00007fff5fbffe80
Name : r s p Value : 0x00007fff5fbffe60
Name : r 8 Value : 0x0000000008668682
Name : r 9 Value : 0x0000000000000000
Name : r 10 Value : 0x0000000000001200
Name : r 11 Value : 0x0000000000000206
Name : r 12 Value : 0x0000000000000000
Name : r 13 Value : 0x0000000000000000
Name : r 14 Value : 0x0000000000000000
Name : r 15 Value : 0x0000000000000000
Name : r i p Value : 0x0000000100000dae
Name : r f l a g s Value : 0x0000000000000206
Name : c s Value : 0x0000000000000027
Name : f s Value : 0x0000000000000010
2011-07-26 07:41:08 +08:00
Name : g s Value : 0x0000000000000048
S e e a l s o l i n k e d _ l i s t _ i t e r ( ) for a n o t h e r p e r s p e c t i v e on h o w to i t e r a t e through a n
S B V a l u e i n s t a n c e w h i c h i n t e r p r e t s t h e value o b j e c t as r e p r e s e n t i n g t h e h e a d of a
l i n k e d l i s t . "
2011-07-19 04:13:38 +08:00
) S B V a l u e ;
2011-07-19 03:08:30 +08:00
class S B V a l u e
{
public :
S B V a l u e ( ) ;
S B V a l u e ( c o n s t S B V a l u e &rhs);
~ S B V a l u e ( ) ;
b o o l
2011-09-10 07:04:00 +08:00
I s V a l i d ( ) ;
2011-07-19 03:08:30 +08:00
2011-12-20 04:39:44 +08:00
void
Clear ( ) ;
2011-07-19 03:08:30 +08:00
S B E r r o r
G e t E r r o r ( ) ;
l l d b : : u s e r _ i d _ t
G e t I D ( ) ;
c o n s t char *
G e t N a m e ( ) ;
c o n s t char *
G e t T y p e N a m e ( ) ;
s i z e _ t
G e t B y t e S i z e ( ) ;
b o o l
I s I n S c o p e ( ) ;
l l d b : : Format
2011-09-10 07:04:00 +08:00
G e t F o r m a t ( ) ;
2011-07-19 03:08:30 +08:00
void
S e t F o r m a t ( l l d b : : Format format ) ;
c o n s t char *
G e t V a l u e ( ) ;
2011-08-04 06:57:10 +08:00
i n t 64 _ t
2011-08-04 09:41:02 +08:00
G e t V a l u e A s S i g n e d ( S B E r r o r & error, int64_t fail_value=0);
2011-08-04 06:57:10 +08:00
2011-08-04 09:41:02 +08:00
u i n t 64 _ t
G e t V a l u e A s U n s i g n e d ( S B E r r o r & error, uint64_t fail_value=0);
i n t 64 _ t
G e t V a l u e A s S i g n e d ( i n t 64 _ t f a i l _ v a l u e = 0 ) ;
2011-08-04 06:57:10 +08:00
u i n t 64 _ t
G e t V a l u e A s U n s i g n e d ( u i n t 64 _ t f a i l _ v a l u e = 0 ) ;
2011-07-19 03:08:30 +08:00
V a l u e T y p e
G e t V a l u e T y p e ( ) ;
b o o l
G e t V a l u e D i d C h a n g e ( ) ;
c o n s t char *
G e t S u m m a r y ( ) ;
c o n s t char *
G e t O b j e c t D e s c r i p t i o n ( ) ;
2011-12-09 03:44:08 +08:00
l l d b : : S B V a l u e
G e t D y n a m i c V a l u e ( l l d b : : D y n a m i c V a l u e T y p e u s e _ d y n a m i c ) ;
l l d b : : S B V a l u e
G e t S t a t i c V a l u e ( ) ;
2012-03-27 10:35:13 +08:00
l l d b : : S B V a l u e
G e t N o n S y n t h e t i c V a l u e ( ) ;
2012-10-23 02:18:36 +08:00
l l d b : : D y n a m i c V a l u e T y p e
G e t P r e f e r D y n a m i c V a l u e ( ) ;
void
S e t P r e f e r D y n a m i c V a l u e ( l l d b : : D y n a m i c V a l u e T y p e u s e _ d y n a m i c ) ;
b o o l
G e t P r e f e r S y n t h e t i c V a l u e ( ) ;
void
S e t P r e f e r S y n t h e t i c V a l u e ( b o o l u s e _ s y n t h e t i c ) ;
2012-03-27 10:35:13 +08:00
2011-12-09 03:44:08 +08:00
b o o l
I s D y n a m i c ( ) ;
2012-10-23 02:18:36 +08:00
b o o l
I s S y n t h e t i c ( ) ;
2011-12-09 03:44:08 +08:00
2011-07-19 03:08:30 +08:00
c o n s t char *
G e t L o c a t i o n ( ) ;
b o o l
S e t V a l u e F r o m C S t r i n g ( c o n s t char * v a l u e _ s t r ) ;
2012-05-09 05:25:06 +08:00
b o o l
S e t V a l u e F r o m C S t r i n g ( c o n s t char * v a l u e _ s t r , l l d b : : S B E r r o r & error);
2012-02-17 11:18:30 +08:00
l l d b : : S B T y p e F o r m a t
G e t T y p e F o r m a t ( ) ;
l l d b : : S B T y p e S u m m a r y
G e t T y p e S u m m a r y ( ) ;
l l d b : : S B T y p e F i l t e r
G e t T y p e F i l t e r ( ) ;
l l d b : : S B T y p e S y n t h e t i c
G e t T y p e S y n t h e t i c ( ) ;
2011-07-19 03:08:30 +08:00
l l d b : : S B V a l u e
G e t C h i l d A t I n d e x ( u i n t 32 _ t i d x ) ;
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
/// Get a child value by index from a value.
///
/// Structs, unions, classes, arrays and and pointers have child
/// values that can be access by index.
///
/// Structs and unions access child members using a zero based index
/// for each child member. For
///
/// Classes reserve the first indexes for base classes that have
/// members (empty base classes are omitted), and all members of the
/// current class will then follow the base classes.
///
/// Pointers differ depending on what they point to. If the pointer
/// points to a simple type, the child at index zero
/// is the only child value available, unless \a synthetic_allowed
/// is \b true, in which case the pointer will be used as an array
/// and can create 'synthetic' child values using positive or
/// negative indexes. If the pointer points to an aggregate type
/// (an array, class, union, struct), then the pointee is
/// transparently skipped and any children are going to be the indexes
/// of the child values within the aggregate type. For example if
/// we have a 'Point' type and we have a SBValue that contains a
/// pointer to a 'Point' type, then the child at index zero will be
/// the 'x' member, and the child at index 1 will be the 'y' member
/// (the child at index zero won't be a 'Point' instance).
///
/// Arrays have a preset number of children that can be accessed by
/// index and will returns invalid child values for indexes that are
/// out of bounds unless the \a synthetic_allowed is \b true. In this
/// case the array can create 'synthetic' child values for indexes
/// that aren't in the array bounds using positive or negative
/// indexes.
///
/// @param[in] idx
/// The index of the child value to get
///
/// @param[in] use_dynamic
/// An enumeration that specifies wether to get dynamic values,
/// and also if the target can be run to figure out the dynamic
/// type of the child value.
///
/// @param[in] synthetic_allowed
/// If \b true, then allow child values to be created by index
/// for pointers and arrays for indexes that normally wouldn't
/// be allowed.
///
/// @return
/// A new SBValue object that represents the child member value.
//------------------------------------------------------------------
" ) G e t C h i l d A t I n d e x ;
l l d b : : S B V a l u e
G e t C h i l d A t I n d e x ( u i n t 32 _ t i d x ,
l l d b : : D y n a m i c V a l u e T y p e u s e _ d y n a m i c ,
b o o l c a n _ c r e a t e _ s y n t h e t i c ) ;
2011-07-30 03:53:35 +08:00
l l d b : : S B V a l u e
2011-09-10 07:04:00 +08:00
C r e a t e C h i l d A t O f f s e t ( c o n s t char * name , u i n t 32 _ t o f f s e t , l l d b : : S B T y p e type ) ;
2011-07-30 03:53:35 +08:00
l l d b : : S B V a l u e
2011-09-10 07:04:00 +08:00
S B V a l u e : : Cast ( l l d b : : S B T y p e type ) ;
2011-07-19 03:08:30 +08:00
2011-07-30 03:53:35 +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 e s s i o n ) ;
2012-10-17 05:41:58 +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 e s s i o n , S B E x p r e s s i o n O p t i o n s &options);
2011-07-30 03:53:35 +08:00
l l d b : : S B V a l u e
2011-09-10 07:04:00 +08:00
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 : : a d d r _ t a d d r e s s , l l d b : : S B T y p e type ) ;
2011-07-30 03:53:35 +08:00
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +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 ,
2011-09-10 07:04:00 +08:00
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 ) ;
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
2011-07-30 03:53:35 +08:00
l l d b : : S B T y p e
G e t T y p e ( ) ;
2011-07-19 03:08:30 +08:00
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
/// Returns the child member index.
///
/// Matches children of this object only and will match base classes and
/// member names if this is a clang typed object.
///
/// @param[in] name
/// The name of the child value to get
///
/// @return
/// An index to the child member value.
//------------------------------------------------------------------
" ) G e t I n d e x O f C h i l d W i t h N a m e ;
u i n t 32 _ t
G e t I n d e x O f C h i l d W i t h N a m e ( c o n s t char * name ) ;
l l d b : : S B V a l u e
G e t C h i l d M e m b e r W i t h N a m e ( c o n s t char * name ) ;
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
/// Returns the child member value.
///
/// Matches child members of this object and child members of any base
/// classes.
///
/// @param[in] name
/// The name of the child value to get
///
/// @param[in] use_dynamic
/// An enumeration that specifies wether to get dynamic values,
/// and also if the target can be run to figure out the dynamic
/// type of the child value.
///
/// @return
/// A new SBValue object that represents the child member value.
//------------------------------------------------------------------
" ) G e t C h i l d M e m b e r W i t h N a m e ;
l l d b : : S B V a l u e
G e t C h i l d M e m b e r W i t h N a m e ( c o n s t char * name , l l d b : : D y n a m i c V a l u e T y p e u s e _ d y n a m i c ) ;
% f e a t u r e ( "docstring" , "Expands nested expressions like .a->b[0].c[1]->d."
) G e t V a l u e F o r E x p r e s s i o n P a t h ;
l l d b : : S B V a l u e
G e t V a l u e F o r E x p r e s s i o n P a t h ( c o n s t char * e x p r _ p a t h ) ;
2012-10-11 06:54:17 +08:00
l l d b : : S B D e c l a r a t i o n
G e t D e c l a r a t i o n ( ) ;
2012-10-23 09:50:10 +08:00
b o o l
M i g h t H a v e C h i l d r e n ( ) ;
2011-07-19 03:08:30 +08:00
u i n t 32 _ t
G e t N u m C h i l d r e n ( ) ;
void *
G e t O p a q u e T y p e ( ) ;
l l d b : : S B V a l u e
D e r e f e r e n c e ( ) ;
2011-07-30 03:53:35 +08:00
l l d b : : S B V a l u e
A d d r e s s O f ( ) ;
2011-07-19 03:08:30 +08:00
b o o l
T y p e I s P o i n t e r T y p e ( ) ;
2011-07-30 03:53:35 +08:00
l l d b : : S B T a r g e t
G e t T a r g e t ( ) ;
2011-07-19 03:08:30 +08:00
2011-07-30 03:53:35 +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 ( ) ;
l l d b : : S B T h r e a d
G e t T h r e a d ( ) ;
l l d b : : S B F r a m e
G e t F r a m e ( ) ;
2011-10-14 08:42:25 +08:00
% f e a t u r e ( "docstring" , "
/// Find and watch a variable.
/// It returns an SBWatchpoint, which may be invalid.
" ) W a t c h ;
2011-10-14 02:08:26 +08:00
l l d b : : S B W a t c h p o i n t
2012-06-05 07:19:54 +08:00
W a t c h ( b o o l r e s o l v e _ l o c a t i o n , b o o l r e a d , b o o l write , S B E r r o r &error);
2011-10-14 02:08:26 +08:00
2011-10-14 08:42:25 +08:00
% f e a t u r e ( "docstring" , "
/// Find and watch the location pointed to by a variable.
/// It returns an SBWatchpoint, which may be invalid.
" ) W a t c h P o i n t e e ;
2011-10-14 02:08:26 +08:00
l l d b : : S B W a t c h p o i n t
2012-06-05 07:19:54 +08:00
W a t c h P o i n t e e ( b o o l r e s o l v e _ l o c a t i o n , b o o l r e a d , b o o l write , S B E r r o r &error);
2011-10-14 02:08:26 +08:00
2011-07-19 03:08:30 +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);
b o o l
G e t E x p r e s s i o n P a t h ( l l d b : : S B S t r e a m &description);
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
/// Get an SBData wrapping what this SBValue points to.
///
/// This method will dereference the current SBValue, if its
/// data type is a T* or T[], and extract item_count elements
/// of type T from it, copying their contents in an SBData.
///
/// @param[in] item_idx
/// The index of the first item to retrieve. For an array
/// this is equivalent to array[item_idx], for a pointer
/// to *(pointer + item_idx). In either case, the measurement
/// unit for item_idx is the sizeof(T) rather than the byte
///
/// @param[in] item_count
/// How many items should be copied into the output. By default
/// only one item is copied, but more can be asked for.
///
/// @return
/// An SBData with the contents of the copied items, on success.
/// An empty SBData otherwise.
//------------------------------------------------------------------
" ) G e t P o i n t e e D a t a ;
l l d b : : S B D a t a
G e t P o i n t e e D a t a ( u i n t 32 _ t i t e m _ i d x = 0 ,
u i n t 32 _ t i t e m _ c o u n t = 1 ) ;
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
/// Get an SBData wrapping the contents of this SBValue.
///
/// This method will read the contents of this object in memory
/// and copy them into an SBData for future use.
///
/// @return
/// An SBData with the contents of this SBValue, on success.
/// An empty SBData otherwise.
//------------------------------------------------------------------
" ) G e t D a t a ;
l l d b : : S B D a t a
G e t D a t a ( ) ;
2013-04-13 09:28:33 +08:00
b o o l
S e t D a t a ( l l d b : : S B D a t a &data, lldb::SBError& error);
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +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 A d d r e s s
G e t A d d r e s s ( ) ;
2011-07-19 03:08:30 +08:00
% f e a t u r e ( "docstring" , "Returns an expression path for this value."
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
) G e t E x p r e s s i o n P a t h ;
2011-07-19 03:08:30 +08:00
b o o l
G e t E x p r e s s i o n P a t h ( l l d b : : S B S t r e a m &description, bool qualify_cxx_base_classes);
2012-01-29 14:07:39 +08:00
% p y t h o n c o d e % {
2012-04-12 00:20:15 +08:00
def _ _ g e t _ d y n a m i c _ _ ( self ) :
''' H e l p e r function for t h e "SBValue.dynamic" property . '''
return self . G e t D y n a m i c V a l u e ( e D y n a m i c C a n R u n T a r g e t )
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 value as a string.''' )
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 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 T y p e , None , d o c = '''A read only property that returns a lldb.SBType object that represents the type for this value.''' )
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 value.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "is_in_scope" ] = I s I n S c o p e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : i s _ i n _ s c o p e = property ( I s I n S c o p e , None , d o c = '''A read only property that returns a boolean value that indicates whether this value is currently lexically in scope.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "format" ] = G e t F o r m a t
_ _ s w i g _ s e t m e t h o d s _ _ [ "format" ] = S e t F o r m a t
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : format = property ( G e t N a m e , S e t F o r m a t , d o c = ''' A r e a d / write property t h a t g e t s / s e t s t h e format u s e d for l l d b . S B V a l u e ( ) . G e t V a l u e ( ) for t h i s value . S e e e n u m e r a t i o n s t h a t start with "lldb.eFormat" . ''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "value" ] = G e t V a l u e
_ _ s w i g _ s e t m e t h o d s _ _ [ "value" ] = S e t V a l u e F r o m C S t r i n g
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : value = property ( G e t V a l u e , S e t V a l u e F r o m C S t r i n g , d o c = '''A read/write property that gets/sets value from a string.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "value_type" ] = G e t V a l u e T y p e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : v a l u e _ t y p e = property ( G e t V a l u e 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.eValueType" ) t h a t r e p r e s e n t s t h e type of t h i s value ( l o c a l , a r g u m e n t , global , r e g i s t e r , e t c . ) . ''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "changed" ] = G e t V a l u e D i d C h a n g e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : c h a n g e d = property ( G e t V a l u e D i d C h a n g e , None , d o c = '''A read only property that returns a boolean value that indicates if this value has changed since it was last updated.''' )
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 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 D a t a , None , d o c = '''A read only property that returns an lldb object (lldb.SBData) that represents the bytes that make up the value for this object.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "load_addr" ] = G e t L o a d A d d r e s s
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : l o a d _ a d d r = property ( G e t L o a d A d d r e s s , None , d o c = '''A read only property that returns the load address of this value 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 _ _ [ "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.SBAddress that represents the address of this value if it is in memory.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "deref" ] = D e r e f e r e n c e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : d e r e f = property ( D e r e f e r e n c e , None , d o c = '''A read only property that returns an lldb.SBValue that is created by dereferencing this value.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "address_of" ] = A d d r e s s O f
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : a d d r e s s _ o f = property ( A d d r e s s O f , None , d o c = '''A read only property that returns an lldb.SBValue that represents the address-of this value.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "error" ] = G e t E r r o r
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : error = property ( G e t E r r o r , None , d o c = '''A read only property that returns the lldb.SBError that represents the error from the last time the variable value was calculated.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "summary" ] = G e t S u m m a r y
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : s u m m a r y = property ( G e t S u m m a r y , None , d o c = '''A read only property that returns the summary for this value as a string''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "description" ] = G e t O b j e c t D e s c r i p t i o n
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : d e s c r i p t i o n = property ( G e t O b j e c t D e s c r i p t i o n , None , d o c = '''A read only property that returns the language-specific description of this value as a string''' )
2012-04-12 00:20:15 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "dynamic" ] = _ _ g e t _ d y n a m i c _ _
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : dynamic = property ( _ _ g e t _ d y n a m i c _ _ , None , d o c = '''A read only property that returns an lldb.SBValue that is created by finding the dynamic type of this value.''' )
2012-04-12 00:20:15 +08:00
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "location" ] = G e t L o c a t i o n
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : l o c a t i o n = property ( G e t L o c a t i o n , None , d o c = '''A read only property that returns the location of this value as a string.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "target" ] = G e t T a r g e t
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : target = property ( G e t T a r g e t , None , d o c = '''A read only property that returns the lldb.SBTarget that this value is associated with.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "process" ] = G e t P r o c e s s
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : process = property ( G e t P r o c e s s , None , d o c = '''A read only property that returns the lldb.SBProcess that this value is associated with, the returned value might be invalid and should be tested.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "thread" ] = G e t T h r e a d
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : t h r e a d = property ( G e t T h r e a d , None , d o c = '''A read only property that returns the lldb.SBThread that this value is associated with, the returned value might be invalid and should be tested.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "frame" ] = G e t F r a m e
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : frame = property ( G e t F r a m e , None , d o c = '''A read only property that returns the lldb.SBFrame that this value is associated with, the returned value might be invalid and should be tested.''' )
2012-01-29 14:07:39 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "num_children" ] = G e t N u m C h i l d r e n
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : n u m _ c h i l d r e n = property ( G e t N u m C h i l d r e n , None , d o c = '''A read only property that returns the number of child lldb.SBValues that this value has.''' )
2012-01-29 14:07:39 +08:00
2012-02-03 15:02:37 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "unsigned" ] = G e t V a l u e A s U n s i g n e d
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : u n s i g n e d = property ( G e t V a l u e A s U n s i g n e d , None , d o c = '''A read only property that returns the value of this SBValue as an usigned integer.''' )
2012-02-03 15:02:37 +08:00
_ _ s w i g _ g e t m e t h o d s _ _ [ "signed" ] = G e t V a l u e A s S i g n e d
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : s i g n e d = property ( G e t V a l u e A s S i g n e d , None , d o c = '''A read only property that returns the value of this SBValue as a signed integer.''' )
2012-02-03 15:02:37 +08:00
def g e t _ e x p r _ p a t h ( self ) :
s = S B S t r e a m ( )
self . G e t E x p r e s s i o n P a t h ( s )
return s . G e t D a t a ( )
_ _ s w i g _ g e t m e t h o d s _ _ [ "path" ] = g e t _ e x p r _ p a t h
2012-06-30 06:00:42 +08:00
if _ n e w c l a s s : p a t h = property ( g e t _ e x p r _ p a t h , None , d o c = '''A read only property that returns the expression path that one can use to reach this value in an expression.''' )
2012-01-29 14:07:39 +08:00
% }
2011-07-19 03:08:30 +08:00
} ;
} // namespace lldb