Reputation: 1416
Is there a way to determine the argument types of Objective-C methods traced by Instruments? I created a custom DTrace Instrument that just lists all Objective-C calls in a class. I am trying to swizzle one of the methods, but only the method name is listed.
Is there a way to determine the argument types? Or as an alternative, a way to swizzle the methods without knowing the argument types?
Upvotes: 0
Views: 269
Reputation: 11594
If you use classdump, then you can see C data types in the method definitions. This should be sufficient for swizzling. Once you have the routines swizzled, you can print a description of objective-C types using NSLog.
http://www.codethecode.com/projects/class-dump/
Upvotes: 2
Reputation: 2030
Use the debugger and set a breakpoint on the method you're interested in. If the arguments are object types, you can use print-object
to find out what class they are. On x86, arguments are generally passed on the stack. On PPC, you'll find the arguments in register r3-r11.
Upvotes: 0