[lldb-dev] SBValue defined vs runtime type

jingham at apple.com jingham at apple.com
Tue Feb 10 13:41:11 PST 2015


As long as the variable we're printing remains in scope, you should be able to change your mind about what you want to fetch and we'll refresh the object.  You can see this for instance in the Script interpreter:

>>> print var.GetType()
Dynamic:
FooChild *
Static:
Foo *
>>> print var.SetPreferDynamicValue(lldb.eNoDynamicValues)
None
>>> print var.GetType()
Foo *
>>> print var.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)
None
>>> print var.GetType()
Dynamic:
FooChild *
Static:
Foo *

Once the value is no longer alive in the target (e.g. it was a local and you stepped out of that local's frame) then we won't be able to fetch any more information about it and you're stuck with what you asked for.  

Jim


> On Feb 10, 2015, at 1:24 PM, Carlo Kok <ck at remobjects.com> wrote:
> 
> 
> 
> jingham at apple.com schreef op 2/10/2015 om 10:18 PM:
>> You can call:
>> 
>> my_value.SetPreferDynamicValue(eNoDynamicValues)
>> 
>> before fetching the type or value from an SBValue.
>> 
> 
> Won't that make me unable to get the dynamic type afterwrds? The type seems to be cached
> 
> 
> -- 
> Carlo Kok
> RemObjects Software





More information about the lldb-dev mailing list