DerekSelander/LLDB

methods command

rustymagnet3000 opened this issue · 2 comments

I just updated to the latest scripts (from first week of May 2019).

When connected to a real or simulator iOS device, if I run...

(lldb) methods UIView
error: expression value didn't result in a scalar value for the expression 'UIView'

If I find a pointer to the Class, it works..

(lldb) search UIView
<UIImageView: 0x7fd81bd08450; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x60000290f020>>

(lldb) methods 0x7fd81bd08450
...happily lists class and instance methods here....
(lldb) help methods
     Dumps all methods implemented by the NSObject subclass (iOS, NSObject
     subclass only)  Expects 'raw' input (see 'help raw-input'.)

Syntax: methods UIView

I just tried again. This seems related to when the iOS Swift app was shipped in debug mode or release mode. (Swift v4.0, 4.2). methods UIView worked in debug mode but in release mode it needs the pointer to the UIView you wanted to inspect.

The issue was me being cute trying to write a Swift/ObjC catch-all that would work with instances (though not with classes). I've reverted that back to the original ObjC-only and will think of a better way to dump the classes from both a Swift/Obj context for instances or classes

The methods UIView example will now work