Created
November 5, 2014 03:17
-
-
Save marieandromeda/96f371f1f635f9e3d23f to your computer and use it in GitHub Desktop.
manipulate NSStrings via python and LLDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lldb | |
def rhptest(debugger, command, result, internal_dict): | |
frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() | |
value = frame.EvaluateExpression(command) | |
string_value = value.GetObjectDescription() | |
print >>result, string_value.upper() | |
def __lldb_init_module(debugger, internal_dict): | |
debugger.HandleCommand('command script add -f rhptest.rhptest rhptest') | |
print 'The "rhptest" python command has been installed and is ready for use.' | |
# Load via: command script import path/to/rhptest.py | |
# (lldb)rhptest @"hello" | |
# HELLO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment