DerekSelander / LLDB

A collection of LLDB aliases/regexes and Python scripts to aid in your debugging sessions
GNU General Public License v2.0
1.77k stars 198 forks source link

methods command #15

Closed rustymagnet3000 closed 5 years ago

rustymagnet3000 commented 5 years ago

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
rustymagnet3000 commented 5 years ago

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.

DerekSelander commented 5 years ago

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