SBType::GetNumberOfMemberFunctions

It looks like SBType has a new GetNumberOfMemberFunctions that sounds like it does what, but it seems to return 0 for an ObjC class, should it return the right number of methods defined for an objc class (ie interface) or not?

It is currently not implemented for objective-c, so the short-term answer is that 0 is the expected output

There are some quirks with the way ObjC method types are handled in clang that I didn't have time to sort out, so I just didn't fill in the blanks there.

If you need this functionality, feel free to work on a patch of course!

Thanks,

yeah after some deep stepping into this I saw that, but as an earlier thread specified ther'es no debug info at all for selectors on a type itself. Seems my best bet would be exposing a FindGlobalFunctions that takes a regex and look for "?[MyClass .*\]" methods.

You also need to catch the category methods, "\[MyClass(SomeCategory) .*\]".

Jim

Sending include/lldb/API/SBType.h
Sending include/lldb/Symbol/ClangASTType.h
Sending include/lldb/Symbol/Type.h
Sending scripts/Python/interface/SBType.i
Sending source/API/SBType.cpp
Sending source/Symbol/ClangASTType.cpp
Sending source/Symbol/Type.cpp
Sending test/python_api/class_members/Makefile
Sending test/python_api/class_members/TestSBTypeClassMembers.py
Deleting test/python_api/class_members/main.cpp
Adding test/python_api/class_members/main.mm
Transmitting file data …
Committed revision 218132.

You may want to grab this revision and see if it improves things for you!

Cool, thanks!

This is going to be very useful to me.

The only thing I’m wondering, shouldn’t there be a relation between SBFunction and SBMemberFunction?

Sending include/lldb/API/SBType.h
Sending include/lldb/Symbol/ClangASTType.h
Sending include/lldb/Symbol/Type.h
Sending scripts/Python/interface/SBType.i
Sending source/API/SBType.cpp
Sending source/Symbol/ClangASTType.cpp
Sending source/Symbol/Type.cpp
Sending test/python_api/class_members/Makefile
Sending test/python_api/class_members/TestSBTypeClassMembers.py
Deleting test/python_api/class_members/main.cpp
Adding test/python_api/class_members/main.mm
Transmitting file data ..........
Committed revision 218132.

You may want to grab this revision and see if it improves things for you!

Cool, thanks!

This is going to be very useful to me.

The only thing I'm wondering, shouldn't there be a relation between SBFunction and SBMemberFunction?

Dunno if this is what you meant but though formally it might make sense to have SBMemberFunction a subclass of SBFunction, we don't do sub-classing in the SB API's. We're trying to keep these classes as simple as possible so we don't get into any binary compatibility issues.

Jim

Also, the subclassing relation would work well for C++ but not so well for ObjC where member functions are not considered as backed by actual functions (well, yes, in some sense in practice they are - but that’s not how the object model describes things because of objc_msgSend-style dispatch)
But since subclassing in SB* is not an option, that saves us from the intricacies of this model