2011-07-19 03:15:22 +08:00
//===-- SWIG Interface for SBValue ------------------------------*- C++ -*-===//
2011-07-19 03:08:30 +08:00
//
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-19 03:08:30 +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 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 ,
2017-08-25 02:01:50 +08:00
r e g i s t e r S e t = frame . r e g i s t e r s # Returns a n S B V a l u e L i s t .
2011-07-19 03:08:30 +08:00
for r e g s in r e g i s t e r S e t :
2017-08-25 02:01:50 +08:00
if 'general purpose registers' in r e g s . name . l o w e r ( ) :
2011-07-19 03:08:30 +08:00
G P R s = r e g s
break
2017-08-25 02:01:50 +08:00
p r i n t ( '%s (number of children = %d):' % ( G P R s . name , G P R s . n u m _ c h i l d r e n ) )
2011-07-19 03:08:30 +08:00
for r e g in G P R s :
2017-08-25 02:01:50 +08:00
p r i n t ( 'Name: ', reg.name, ' Value: ' , r e g . value )
2011-07-19 03:08:30 +08:00
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 ( ) ;
Introduce the concept of a "display name" for types
Rationale:
Pretty simply, the idea is that sometimes type names are way too long and contain way too many details for the average developer to care about. For instance, a plain ol' vector of int might be shown as
std::__1::vector<int, std::__1::allocator<....
rather than the much simpler std::vector<int> form, which is what most developers would actually type in their code
Proposed solution:
Introduce a notion of "display name" and a corresponding API GetDisplayTypeName() to return such a crafted for visual representation type name
Obviously, the display name and the fully qualified (or "true") name are not necessarily the same - that's the whole point
LLDB could choose to pick the "display name" as its one true notion of a type name, and if somebody really needs the fully qualified version of it, let them deal with the problem
Or, LLDB could rename what it currently calls the "type name" to be the "display name", and add new APIs for the fully qualified name, making the display name the default choice
The choice that I am making here is that the type name will keep meaning the same, and people who want a type name suited for display will explicitly ask for one
It is the less risky/disruptive choice - and it should eventually make it fairly obvious when someone is asking for the wrong type
Caveats:
- for now, GetDisplayTypeName() == GetTypeName(), there is no logic to produce customized display type names yet.
- while the fully-qualified type name is still the main key to the kingdom of data formatters, if we start showing custom names to people, those should match formatters
llvm-svn: 209072
2014-05-18 03:14:17 +08:00
c o n s t char *
G e t D i s p l a y T y p e N a m e ( ) ;
2011-07-19 03:08:30 +08:00
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 ( ) ;
2014-11-07 05:23:20 +08:00
c o n s t char *
2014-11-19 07:36:25 +08:00
G e t S u m m a r y ( l l d b : : S B S t r e a m & stream,
l l d b : : S B T y p e S u m m a r y O p t i o n s & options);
2014-11-07 05:23:20 +08:00
2011-07-19 03:08:30 +08:00
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 ( ) ;
2014-09-06 09:30:04 +08:00
c o n s t char *
G e t T y p e V a l i d a t o r R e s u l t ( ) ;
2011-07-19 03:08:30 +08:00
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 ( ) ;
Because of our lifetime rules w.r.t. ValueObjects and ClusterManagers, synthetic children caching is a tricky area:
- if a synthetic child comes from the same hierarchy as its parent object, then it can't be cached by SharedPointer inside the synthetic provider, or it will cause a reference loop;
- but, if a synthetic child is made from whole cloth (e.g. from an expression, a memory region, ...), then it better be cached by SharedPointer, or it will be cleared out and cause an assert() to fail if used at a later point
For most cases of self-rooted synthetic children, we have a flag we set "IsSyntheticChildrenGenerated", but we were not using it to track caching. So, what ended up happening is each provider would set up its own cache, and if it got it wrong, a hard to diagnose crash would ensue
This patch fixes that by centralizing caching in ValueObjectSynthetic - if a provider returns a self-rooted child (as per the flag), then it gets cached centrally by the ValueObject itself
This cache is used only for lifetime management and not later retrieval of child values - a different cache handles that (because we might have a mix of self-rooted and properly nested child values for the same parent, we can't trivially use this lifetime cache for retrieval)
Fixes rdar://26480007
llvm-svn: 274683
2016-07-07 05:24:28 +08:00
b o o l
I s S y n t h e t i c C h i l d r e n G e n e r a t e d ( ) ;
void
S e t S y n t h e t i c C h i l d r e n G e n e r a t e d ( b o o l ) ;
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.
///
2014-07-02 05:22:11 +08:00
/// Structs, unions, classes, arrays and pointers have child
2011-07-19 03:08:30 +08:00
/// 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).
///
2015-12-05 06:51:19 +08:00
/// If you actually need an SBValue that represents the type pointed
/// to by a SBValue for which GetType().IsPointeeType() returns true,
/// regardless of the pointee type, you can do that with the SBValue.Dereference
/// method (or the equivalent deref property).
///
2011-07-19 03:08:30 +08:00
/// 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
2014-07-02 05:22:11 +08:00
/// An enumeration that specifies whether to get dynamic values,
2011-07-19 03:08:30 +08:00
/// 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 ) ;
2015-10-22 03:28:08 +08:00
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
2018-05-04 09:31:47 +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 ) ;
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
2014-07-02 05:22:11 +08:00
/// An enumeration that specifies whether to get dynamic values,
2011-07-19 03:08:30 +08:00
/// 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 ( ) ;
2015-02-11 10:35:39 +08:00
b o o l
I s R u n t i m e S u p p o r t V a l u e ( ) ;
2012-10-23 09:50:10 +08:00
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 ( ) ;
2015-10-22 03:28:08 +08:00
% f e a t u r e ( "doctstring" , "
//------------------------------------------------------------------
/// Returns the number for children.
///
/// @param[in] max
/// If max is less the lldb.UINT32_MAX, then the returned value is
/// capped to max.
///
/// @return
/// An integer value capped to the argument max.
//------------------------------------------------------------------
" ) G e t N u m C h i l d r e n ;
u i n t 32 _ t
G e t N u m C h i l d r e n ( u i n t 32 _ t max ) ;
2011-07-19 03:08:30 +08:00
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
2018-05-04 09:31:47 +08:00
% f e a t u r e ( "docstring" , "
//------------------------------------------------------------------
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
/// 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.
//------------------------------------------------------------------
2018-05-04 09:31:47 +08:00
" ) 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 ) ;
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" , "
2018-05-04 09:31:47 +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
/// 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.
//------------------------------------------------------------------
2018-05-04 09:31:47 +08:00
" ) G e t D a t a ;
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 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
2018-05-04 09:31:47 +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 ( ) ;
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
2018-05-04 09:31:47 +08:00
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
2014-12-09 07:13:56 +08:00
l l d b : : S B V a l u e
Persist ( ) ;
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);
2019-02-05 17:14:36 +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 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 S B E x p r e s s i o n O p t i o n s &options) const;
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 S B E x p r e s s i o n O p t i o n s &options,
c o n s t char * name ) c o n s t ;
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 )
2018-05-04 09:31:47 +08:00
class c h i l d r e n _ a c c e s s ( o b j e c t ) :
'''A helper object that will lazily hand out thread for a process when supplied an index.'''
def _ _ i n i t _ _ ( self , s b v a l u e ) :
self . s b v a l u e = s b v a l u e
def _ _ l e n _ _ ( self ) :
if self . s b v a l u e :
return int ( self . s b v a l u e . G e t N u m C h i l d r e n ( ) )
return 0
def _ _ g e t i t e m _ _ ( self , key ) :
if type ( key ) is int and key < l e n ( self ) :
return self . s b v a l u e . G e t C h i l d A t I n d e x ( key )
return None
def g e t _ c h i l d _ a c c e s s _ o b j e c t ( self ) :
'''An accessor function that returns a children_access() object which allows lazy member variable access from a lldb.SBValue object.'''
return self . c h i l d r e n _ a c c e s s ( self )
def g e t _ v a l u e _ c h i l d _ l i s t ( self ) :
'''An accessor function that returns a list() that contains all children in a lldb.SBValue object.'''
c h i l d r e n = [ ]
a c c e s s o r = self . g e t _ c h i l d _ a c c e s s _ o b j e c t ( )
for i d x in r a n g e ( l e n ( a c c e s s o r ) ) :
c h i l d r e n . append ( a c c e s s o r [ i d x ] )
return c h i l d r e n
_ _ s w i g _ g e t m e t h o d s _ _ [ "children" ] = g e t _ v a l u e _ c h i l d _ l i s t
if _ n e w c l a s s : c h i l d r e n = property ( g e t _ v a l u e _ c h i l d _ l i s t , None , d o c = '''A read only property that returns a list() of lldb.SBValue objects for the children of the value.''' )
_ _ s w i g _ g e t m e t h o d s _ _ [ "child" ] = g e t _ c h i l d _ a c c e s s _ o b j e c t
if _ n e w c l a s s : c h i l d = property ( g e t _ c h i l d _ a c c e s s _ o b j e c t , None , d o c = '''A read only property that returns an object that can access children of a variable by index (child_value = value.children[12]).''' )
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.''' )
Because of our lifetime rules w.r.t. ValueObjects and ClusterManagers, synthetic children caching is a tricky area:
- if a synthetic child comes from the same hierarchy as its parent object, then it can't be cached by SharedPointer inside the synthetic provider, or it will cause a reference loop;
- but, if a synthetic child is made from whole cloth (e.g. from an expression, a memory region, ...), then it better be cached by SharedPointer, or it will be cleared out and cause an assert() to fail if used at a later point
For most cases of self-rooted synthetic children, we have a flag we set "IsSyntheticChildrenGenerated", but we were not using it to track caching. So, what ended up happening is each provider would set up its own cache, and if it got it wrong, a hard to diagnose crash would ensue
This patch fixes that by centralizing caching in ValueObjectSynthetic - if a provider returns a self-rooted child (as per the flag), then it gets cached centrally by the ValueObject itself
This cache is used only for lifetime management and not later retrieval of child values - a different cache handles that (because we might have a mix of self-rooted and properly nested child values for the same parent, we can't trivially use this lifetime cache for retrieval)
Fixes rdar://26480007
llvm-svn: 274683
2016-07-07 05:24:28 +08:00
def s y n t h e t i c _ c h i l d _ f r o m _ e x p r e s s i o n ( self , name , e x p r , o p t i o n s = None ) :
if o p t i o n s is None : o p t i o n s = l l d b . S B E x p r e s s i o n O p t i o n s ( )
c h i l d = self . 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 ( name , e x p r , o p t i o n s )
c h i l d . S e t S y n t h e t i c C h i l d r e n G e n e r a t e d ( True )
return c h i l d
def s y n t h e t i c _ c h i l d _ f r o m _ d a t a ( self , name , d a t a , type ) :
c h i l d = self . C r e a t e V a l u e F r o m D a t a ( name , d a t a , type )
c h i l d . S e t S y n t h e t i c C h i l d r e n G e n e r a t e d ( True )
return c h i l d
def s y n t h e t i c _ c h i l d _ f r o m _ a d d r e s s ( self , name , a d d r , type ) :
c h i l d = self . C r e a t e V a l u e F r o m A d d r e s s ( name , a d d r , type )
c h i l d . S e t S y n t h e t i c C h i l d r e n G e n e r a t e d ( True )
return c h i l d
2012-01-29 14:07:39 +08:00
% }
2011-07-19 03:08:30 +08:00
} ;
} // namespace lldb