Last active
August 29, 2015 13:55
-
-
Save chkn/8700315 to your computer and use it in GitHub Desktop.
This file contains 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 monobt(debugger, command, result, dict): | |
target = debugger.GetSelectedTarget() | |
process = target.GetProcess() | |
thread = process.GetSelectedThread() | |
for frame in thread: | |
pc = str(frame.GetPCAddress()) | |
if pc[0] == '0': | |
try: | |
print 'frame #' + str(frame.GetFrameID()) + ': ' + pc + frame.EvaluateExpression('(char*)mono_pmip((void*)' + pc + ')').GetSummary()[1:-1] | |
except: | |
print frame | |
else: | |
print frame | |
return None | |
def __lldb_init_module (debugger, dict): | |
# This initializer is being run from LLDB in the embedded command interpreter | |
# Add any commands contained in this module to LLDB | |
debugger.HandleCommand('command script add -f monobt.monobt monobt') | |
print '"monobt" command installed' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment