ScriptedSyntheticChildren#
- class lldb.plugins.scripted_synthetic_children.ScriptedSyntheticChildren(valobj: SBValue)#
The base class for a scripted synthetic children provider.
A synthetic children provider allows you to customize how a value is expanded into children when displayed (e.g.
frame variable,bt). Register it withtype synthetic add -l <ClassName> ....Most of the base class methods are
@abstractmethodthat need to be overwritten by the inheriting class.Methods Summary
get_child_at_index(index)Get the child at the given index.
get_child_index(name)Get the index of the child with the given name.
Override the type name shown for this synthetic value.
Make this a value-providing synthetic children provider: the value returned here becomes the value for this
SBValue, in place of the value backing it.Whether this value might have children, without necessarily computing them.
The number of children this value has.
update()Called when the value backing this provider may have changed (e.g. after a
continue), giving the provider a chance to refresh any cached state.Methods Documentation
- abstract get_child_at_index(index: int) SBValue | None#
Get the child at the given index.
- Parameters:
index (int) β The index of the child to return.
- Returns:
The value for the child at this index, or
Noneif there is no child at this index.- Return type:
- get_child_index(name: str) int | None#
Get the index of the child with the given name.
- Parameters:
name (str) β The name of the child to look up.
- Returns:
The index of the child with this name, or
None/a negative value if no such child exists. Defaults to a linear search overget_child_at_index/num_children.- Return type:
int
- get_type_name() str | None#
Override the type name shown for this synthetic value.
- Returns:
The type name to display, or
None/empty to keep the default. Defaults toNone.- Return type:
str
- get_value() SBValue | None#
Make this a value-providing synthetic children provider: the value returned here becomes the value for this
SBValue, in place of the value backing it. None of the other methods on this class (num_children,get_child_at_index,get_child_index) are consulted, and the children of the original value are not shown.- Returns:
The value to use instead of this valueβs own, or
Noneto leave this value unaffected. Defaults toNone.- Return type:
- has_children() bool#
Whether this value might have children, without necessarily computing them. Used as a cheap check to decide whether to show an expansion arrow in graphical frontends, for example.
- Returns:
Trueif this value might have children,Falseotherwise. Defaults toTrue.- Return type:
bool
- abstract num_children() int#
The number of children this value has.
This can optionally take a second
max_countparameter (i.e.def num_children(self, max_count)) if computing the exact count is expensive; in that case returnmax_countonce at least that many children are known to exist.- Returns:
The number of children.
- Return type:
int
- update() bool#
Called when the value backing this provider may have changed (e.g. after a
continue), giving the provider a chance to refresh any cached state.- Returns:
Trueif the previously computed children can be reused,Falseif they should be recomputed. Defaults toFalse.- Return type:
bool