[lldb-dev] Dynamic types

Greg Clayton gclayton at apple.com
Fri Oct 7 10:28:57 PDT 2011


Thre is currently no way to control this selectively through the SB API, but there is a global switch that is controlled by a target setting which will allow you to always get dynamic values:


settings set target.prefer-dynamic-value no-dynamic-values

settings set target.prefer-dynamic-value run-target

settings set target.prefer-dynamic-value no-run-target

The "no-dynamic-values" will always hand out types as they are in your program. The "run-target" setting tells LLDB that it is ok to run the target when doing dynamic type resolution. This means one mor more threads might get run when trying to determine the dynamic type of a variable.  The "no-run-target" tells LLDB to do what it can to determine dynamic types statically without ever running the process we are debugging. The default is "no-dynamic-values", so try excuting one of the above commands before debugging through the command interpreter API and verify you then do get dynamic types.

Greg Clayton

On Oct 7, 2011, at 9:36 AM, Andrey Zaytsev wrote:

> Hello everyone!
> I have an issue with getting dynamic type of variable object. I've got an SBValue from SBFrame::EvaluateExpression. It has some type. But it's id for objc object. 
> "expr <my_expression>"
> shows me both types. static and dynamic. How can I get dynamic type programmatically?
> Thanks a lot.
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list