[lldb-dev] static fields and consts on a class

Carlo Kok ck at remobjects.com
Fri Jul 25 00:27:52 PDT 2014


On Sat, 19 Jul 2014 00:42:21 +0200, <jingham at apple.com> wrote:

> You have to be careful about including static variables in the type of a  
> class, since it is not uncommon to have a class which has a static  
> variable that is an instance of itself, so you can get into display  
> cycles.  gdb showed statics as part of the object display, and had some  
> "set" variable you would set to avoid cycles (usually after you had hung  
> once because of it...)  We didn't want to play that game, plus I think  
> it's kind of ugly to have the statics show up in object displays, so at  
> present we just leave the statics out of the type representations.  But  
> we could add them as a side-car to the type, but leave them separate  
> from the ivars.  I assume you can get them from the clang's type for the  
> class...
>

I can get the type yes. I wouldn't show them as part of an instance of a  
variable but my users expect to be able to type MyClass.StaticField (which  
corresponds to a global variable called __namespace_myclass_staticfield)  
and see it when hovering over Myclass.

-- 
Carlo Kok
RemObjects Software



More information about the lldb-dev mailing list