Skip to content

Instantly share code, notes, and snippets.

@haShalosh
Last active March 10, 2022 12:19
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save haShalosh/3af8ec00b26cae794ce2 to your computer and use it in GitHub Desktop.
Save haShalosh/3af8ec00b26cae794ce2 to your computer and use it in GitHub Desktop.
# ~/.lldbinit-Xcode
# Apple private methods
command regex ivars 's/(.+)/po [%1 _ivarDescription]/'
command regex methods 's/(.+)/po [%1 _methodDescription]/'
command regex shortmethods 's/(.+)/po [%1 _shortMethodDescription]/'
command regex nextviewcontroller 's/(.+)/po [%1 _nextViewControllerInResponderChain]/'
command alias nextvc nextviewcontroller
# Convenience
command regex keywindowrecursivedescription 's/.*/po [[UIWindow keyWindow] recursiveDescription]/'
# Nib names
command regex tableviewcellnibname 's/(.+)/po [[[[[%1 nextResponder] nextResponder] valueForKey:@"_nibMap"] valueForKey:(id)[%1 reuseIdentifier]] valueForKeyPath:@"storage.bundleResourceName"]/'
command regex collectionviewcellnibname 's/(.+)/po [[[[%1 nextResponder] valueForKey:@"_cellNibDict"] valueForKey:(id)[%1 reuseIdentifier]] valueForKeyPath:@"storage.bundleResourceName"]/'
command regex viewcontrollernibname 's/(.+)/po [%1 nibName]/'
command regex viewcontrollerstoryboardname 's/(.+)/po [[%1 storyboard] name]/'
command regex nibname 's/(.+)/po [%1 valueForKeyPath:@"storage.bundleResourceName"]/'
# Spark Inspector
command alias startsparkinspector expr (void*)dlopen("/Applications/Spark Inspector.app/Contents/Resources/Frameworks/SparkInspector.dylib", 2)
# DALDebugging https://github.com/haShalosh/DALDebugging
command regex propertynames 's/(.+)/po [%1 DALPropertyNames]/'
command regex ivarnames 's/(.+)/po [%1 DALIvarNames]/'
# LLDB Quicklook script https://github.com/ryanolsonk/LLDB-QuickLook
command script import ~/bin/lldb_quick_look.py
command alias ql quicklook
command regex qll 's/(.*)/quicklook -l -- %1/'
# testing
command regex variablelinedefinition 's/(.+)/fr v -c -- %1/'
command alias vld variablelinedefinition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment