[lldb-dev] Frame documentation

Enrico Granata egranata at apple.com
Mon Dec 1 10:37:42 PST 2014


> On Nov 30, 2014, at 4:35 AM, Jose H <jose.francisco.hevia at gmail.com> wrote:
> 
> Just being curious(and not loving the fact of using something without
> understanding it, what the last argument of frame.GetVariable does?.
> 
> It says:
> DynamicValueType use_dynamic
> 
> In the c++ documentation it says I could use those values:
> eDynamicCanRunTarget, eNoDynamicValues, eDynamicCanRunTarget,
> eDynamicDontRunTarget
> 
> What dynamic value type means?. It means c++ auto or something like a
> template value?.
> 

Imagine this situation:

class Foo { public: virtual void something() ... };
class Bar: public Foo { … };

Foo *aFoo = new Bar();

The declared type of “aFoo” is Foo*, but its actual type at runtime is Bar*
This “actual type at runtime” notion is what LLDB calls the “dynamic type” (vs. the declared, aka “static” type)

You can tell LLDB whether you want the static or the dynamic type when resolving a variable. And you can control whether LLDB is allowed to run code in the inferior process to perform this resolution
As far as I know, there are no cases in which LLDB actually needs to run code to perform this resolution (it used to be the case historically), except that we cheat, and we will run code even if you say “Don’t run” to fetch a table of classes from the ObjC runtime
We are aware that this is bending the rules a little, of course.

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20141201/062d544c/attachment.html>


More information about the lldb-dev mailing list