[lldb-dev] Getting the instance/static methods on an objc class

jingham at apple.com jingham at apple.com
Thu Jul 17 10:45:23 PDT 2014


> On Jul 17, 2014, at 12:03 AM, Carlo Kok <ck at remobjects.com> wrote:
> 
> On Thu, 17 Jul 2014 00:45:09 +0200, <jingham at apple.com> wrote:
> 
>> llvm doesn't include method definitions in the type DIEs for an ObjC class, just the properties and ivars(neither did gcc.)  The method table for ObjC is dynamic so I'm not sure it would make sense to do this.
>> 
>> lldb currently looks up method invocations one by one when it needs them (mostly in the expression parser) from the subroutine DIEs at the definition sites of the methods if we have debug information for them, or from the ObjC runtime as a fallback. Since there's no reason to do so and it would be fairly expensive, lldb doesn't try to gather all the methods into its type representation for the class by hand.
> 
> I need that info for my own language frontend, would there be any interest in a patch that lets me find this information (and maybe the static vars/consts on a class once i figure out how to encode them) from the SBType side?
> 

This could be expensive and you don't need this information for most common task of presenting the values of a variable of this type.  So this would have to be done only lazily, like only in result to a specific request for the methods of that type.   

C++ debug info already encodes the methods in the class definitions in DWARF, so you would presumably make it look like that.  It would also have to stay out of the way of the current method signature lookup between us & clang.  You'd have to do something sensible with categories that provide overriding definitions as well.  But other than that this seems like it would be useful in some circumstances.

Jim




More information about the lldb-dev mailing list