Skip to content

Instantly share code, notes, and snippets.

@aufflick
Forked from chrismiles/reveal.py
Last active January 1, 2016 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aufflick/8090606 to your computer and use it in GitHub Desktop.
Save aufflick/8090606 to your computer and use it in GitHub Desktop.
""" File: reveal.py
Add to ~/.lldbinit:
command script import ~/.lldb-scripts/reveal.py
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode?
A: In Xcode:
Add a Symbolic Breakpoint
Symbol: "UIApplicationMain"
Action: Debugger Command with value "reveal"
Tick "Automatically continue after evaluating"
"""
__author__ = 'Chris Miles'
__copyright__ = 'Copyright (c) Chris Miles 2013'
__license__ = 'MIT'
from subprocess import call
import lldb
def auto_load_reveal(debugger, command, result, dict):
lldb.debugger.HandleCommand('call (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2)')
lldb.debugger.HandleCommand('call (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil]')
call(["open", "-a", "/Applications/Reveal.app"])
# lldb.debugger.HandleCommand('continue')
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f reveal.auto_load_reveal reveal')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment