Through various resources I found that you can create custom descriptions and even custom object summaries in LLDB. I'm also aware that I can do "Add Expression" in order to display the value of a property for a Apple framework class that the debugger hides from us.
What I want is to display the framework class object as if the source code were available for it.
A picture says more than words ... what I have so far:
As you can see I have a SKLabelNode
named _label
in scope. I managed to add a custom summary string ("these are words") next to SKNode
via Python scripting following the tutorials here and here.
I can also see the _label.fontName
and _label.text
but that's only because I right-clicked and did "Add Expression" manually for each property.
My questions:
Is it possible (and if so how) to add an object's properties to its tree view via Python LLDB scripts? What I want is the
_label
object to expand and then always display itsfontName
,text
and other properties like I have done by manually adding the expressions. Or in other words: it ought to behave as if full source code were available for that class.Alternatively: Is there a way to run "Add Expression" from the script so that I can create an alias that will quickly add multiple expressions? Perhaps one where I can add the object in question as a reference, for example
command addCustomExpressionsWithObject _label
.
I accept alternative solutions as well. For example if I could write proxy classes for each SK*Node class and somehow get LLDB to display the contents of a node's corresponding proxy class, that would also work. Whatever gets the job done, and preferably in a way that's automated (once implemented).
In general, how hard can it be to have the LLDB debugger display the (documented!) properties of a class from an Apple framework?
In particular for Sprite Kit we get no info on any SK*Node object whatsoever and I can't believe this hasn't bugged other developers using other Apple frameworks as hard as it bugs me. I hope there's a way to "fix" this but the little info I can find makes me think it's either not possible or I'm insane for wanting to see more details about Apple class objects.
PS: Yes, I've also looked into and customized Xcode 5.1's QuickLook functionality. I created a SpriteKit+QuickLook repository with QuickLook/debugDescriptions for some Sprite Kit classes but it's still not satisfactory as it serves only as a full class dump (better than nothing though).