summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/interface/SBValue.i
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/interface/SBValue.i')
-rw-r--r--lldb/scripts/interface/SBValue.i358
1 files changed, 169 insertions, 189 deletions
diff --git a/lldb/scripts/interface/SBValue.i b/lldb/scripts/interface/SBValue.i
index eca83d5d426..812a20bdfed 100644
--- a/lldb/scripts/interface/SBValue.i
+++ b/lldb/scripts/interface/SBValue.i
@@ -67,22 +67,22 @@ public:
IsValid();
explicit operator bool() const;
-
+
void
Clear();
-
+
SBError
GetError();
lldb::user_id_t
GetID ();
-
+
const char *
GetName();
const char *
GetTypeName ();
-
+
const char *
GetDisplayTypeName ();
@@ -94,7 +94,7 @@ public:
lldb::Format
GetFormat ();
-
+
void
SetFormat (lldb::Format format);
@@ -106,10 +106,10 @@ public:
uint64_t
GetValueAsUnsigned(SBError& error, uint64_t fail_value=0);
-
+
int64_t
GetValueAsSigned(int64_t fail_value=0);
-
+
uint64_t
GetValueAsUnsigned(uint64_t fail_value=0);
@@ -121,47 +121,47 @@ public:
const char *
GetSummary ();
-
+
const char *
GetSummary (lldb::SBStream& stream,
lldb::SBTypeSummaryOptions& options);
-
+
const char *
GetObjectDescription ();
-
+
const char *
GetTypeValidatorResult ();
lldb::SBValue
GetDynamicValue (lldb::DynamicValueType use_dynamic);
-
+
lldb::SBValue
GetStaticValue ();
-
+
lldb::SBValue
GetNonSyntheticValue ();
lldb::DynamicValueType
GetPreferDynamicValue ();
-
+
void
SetPreferDynamicValue (lldb::DynamicValueType use_dynamic);
-
+
bool
GetPreferSyntheticValue ();
-
+
void
SetPreferSyntheticValue (bool use_synthetic);
-
+
bool
IsDynamic();
-
+
bool
IsSynthetic ();
-
+
bool
IsSyntheticChildrenGenerated ();
-
+
void
SetSyntheticChildrenGenerated (bool);
@@ -176,13 +176,13 @@ public:
lldb::SBTypeFormat
GetTypeFormat ();
-
+
lldb::SBTypeSummary
GetTypeSummary ();
-
+
lldb::SBTypeFilter
GetTypeFilter ();
-
+
lldb::SBTypeSynthetic
GetTypeSynthetic ();
@@ -190,82 +190,79 @@ public:
GetChildAtIndex (uint32_t idx);
%feature("docstring", "
- //------------------------------------------------------------------
- /// Get a child value by index from a value.
- ///
- /// Structs, unions, classes, arrays 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).
- ///
- /// 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).
- ///
- /// 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 whether 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.
- //------------------------------------------------------------------
- ") GetChildAtIndex;
+ Get a child value by index from a value.
+
+ Structs, unions, classes, arrays 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).
+
+ 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).
+
+ 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 whether 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.") GetChildAtIndex;
lldb::SBValue
- GetChildAtIndex (uint32_t idx,
+ GetChildAtIndex (uint32_t idx,
lldb::DynamicValueType use_dynamic,
bool can_create_synthetic);
lldb::SBValue
CreateChildAtOffset (const char *name, uint32_t offset, lldb::SBType type);
-
+
lldb::SBValue
SBValue::Cast (lldb::SBType type);
lldb::SBValue
CreateValueFromExpression (const char *name, const char* expression);
-
+
lldb::SBValue
CreateValueFromExpression (const char *name, const char* expression, SBExpressionOptions &options);
lldb::SBValue
CreateValueFromAddress(const char* name, lldb::addr_t address, lldb::SBType type);
-
+
lldb::SBValue
CreateValueFromData (const char* name,
lldb::SBData data,
@@ -273,21 +270,18 @@ public:
lldb::SBType
GetType();
-
+
%feature("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.
- //------------------------------------------------------------------
- ") GetIndexOfChildWithName;
+ 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.") GetIndexOfChildWithName;
uint32_t
GetIndexOfChildWithName (const char *name);
@@ -295,27 +289,24 @@ public:
GetChildMemberWithName (const char *name);
%feature("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 whether 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.
- //------------------------------------------------------------------
- ") GetChildMemberWithName;
+ 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 whether 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.") GetChildMemberWithName;
lldb::SBValue
GetChildMemberWithName (const char *name, lldb::DynamicValueType use_dynamic);
-
+
%feature("docstring", "Expands nested expressions like .a->b[0].c[1]->d."
) GetValueForExpressionPath;
lldb::SBValue
@@ -323,10 +314,10 @@ public:
lldb::SBDeclaration
GetDeclaration ();
-
+
bool
MightHaveChildren ();
-
+
bool
IsRuntimeSupportValue ();
@@ -334,17 +325,14 @@ public:
GetNumChildren ();
%feature("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.
- //------------------------------------------------------------------
- ") GetNumChildren;
+ 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.") GetNumChildren;
uint32_t
GetNumChildren (uint32_t max);
@@ -356,33 +344,31 @@ public:
lldb::SBValue
AddressOf();
-
+
bool
TypeIsPointerType ();
-
+
lldb::SBTarget
GetTarget();
lldb::SBProcess
GetProcess();
-
+
lldb::SBThread
GetThread();
-
+
lldb::SBFrame
GetFrame();
-
+
%feature("docstring", "
- /// Find and watch a variable.
- /// It returns an SBWatchpoint, which may be invalid.
- ") Watch;
+ Find and watch a variable.
+ It returns an SBWatchpoint, which may be invalid.") Watch;
lldb::SBWatchpoint
Watch (bool resolve_location, bool read, bool write, SBError &error);
%feature("docstring", "
- /// Find and watch the location pointed to by a variable.
- /// It returns an SBWatchpoint, which may be invalid.
- ") WatchPointee;
+ Find and watch the location pointed to by a variable.
+ It returns an SBWatchpoint, which may be invalid.") WatchPointee;
lldb::SBWatchpoint
WatchPointee (bool resolve_location, bool read, bool write, SBError &error);
@@ -393,47 +379,41 @@ public:
GetExpressionPath (lldb::SBStream &description);
%feature("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.
- //------------------------------------------------------------------
- ") GetPointeeData;
+ 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.") GetPointeeData;
lldb::SBData
GetPointeeData (uint32_t item_idx = 0,
uint32_t item_count = 1);
%feature("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.
- //------------------------------------------------------------------
- ") GetData;
+ 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.") GetData;
lldb::SBData
GetData ();
-
+
bool
SetData (lldb::SBData &data, lldb::SBError& error);
@@ -442,10 +422,10 @@ public:
lldb::SBAddress
GetAddress();
-
+
lldb::SBValue
Persist ();
-
+
%feature("docstring", "Returns an expression path for this value."
) GetExpressionPath;
bool
@@ -467,13 +447,13 @@ public:
def __get_dynamic__ (self):
'''Helper function for the "SBValue.dynamic" property.'''
return self.GetDynamicValue (eDynamicCanRunTarget)
-
+
class children_access(object):
'''A helper object that will lazily hand out thread for a process when supplied an index.'''
-
+
def __init__(self, sbvalue):
self.sbvalue = sbvalue
-
+
def __len__(self):
if self.sbvalue:
return int(self.sbvalue.GetNumChildren())
@@ -483,11 +463,11 @@ public:
if type(key) is int and key < len(self):
return self.sbvalue.GetChildAtIndex(key)
return None
-
+
def get_child_access_object(self):
'''An accessor function that returns a children_access() object which allows lazy member variable access from a lldb.SBValue object.'''
return self.children_access (self)
-
+
def get_value_child_list(self):
'''An accessor function that returns a list() that contains all children in a lldb.SBValue object.'''
children = []
@@ -503,10 +483,10 @@ public:
def __len__(self):
'''Return the number of child values of a lldb.SBValue object.'''
return self.GetNumChildren()
-
+
__swig_getmethods__["children"] = get_value_child_list
if _newclass: children = property(get_value_child_list, None, doc='''A read only property that returns a list() of lldb.SBValue objects for the children of the value.''')
-
+
__swig_getmethods__["child"] = get_child_access_object
if _newclass: child = property(get_child_access_object, None, doc='''A read only property that returns an object that can access children of a variable by index (child_value = value.children[12]).''')
@@ -553,16 +533,16 @@ public:
__swig_getmethods__["error"] = GetError
if _newclass: error = property(GetError, None, doc='''A read only property that returns the lldb.SBError that represents the error from the last time the variable value was calculated.''')
-
+
__swig_getmethods__["summary"] = GetSummary
if _newclass: summary = property(GetSummary, None, doc='''A read only property that returns the summary for this value as a string''')
__swig_getmethods__["description"] = GetObjectDescription
if _newclass: description = property(GetObjectDescription, None, doc='''A read only property that returns the language-specific description of this value as a string''')
-
+
__swig_getmethods__["dynamic"] = __get_dynamic__
if _newclass: dynamic = property(__get_dynamic__, None, doc='''A read only property that returns an lldb.SBValue that is created by finding the dynamic type of this value.''')
-
+
__swig_getmethods__["location"] = GetLocation
if _newclass: location = property(GetLocation, None, doc='''A read only property that returns the location of this value as a string.''')
@@ -591,21 +571,21 @@ public:
s = SBStream()
self.GetExpressionPath (s)
return s.GetData()
-
+
__swig_getmethods__["path"] = get_expr_path
if _newclass: path = property(get_expr_path, None, doc='''A read only property that returns the expression path that one can use to reach this value in an expression.''')
-
+
def synthetic_child_from_expression(self, name, expr, options=None):
if options is None: options = lldb.SBExpressionOptions()
child = self.CreateValueFromExpression(name, expr, options)
child.SetSyntheticChildrenGenerated(True)
return child
-
+
def synthetic_child_from_data(self, name, data, type):
child = self.CreateValueFromData(name, data, type)
child.SetSyntheticChildrenGenerated(True)
return child
-
+
def synthetic_child_from_address(self, name, addr, type):
child = self.CreateValueFromAddress(name, addr, type)
child.SetSyntheticChildrenGenerated(True)
OpenPOWER on IntegriCloud