Skip to content

Instantly share code, notes, and snippets.

@chkn
Last active August 29, 2015 13:55
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 chkn/8700315 to your computer and use it in GitHub Desktop.
Save chkn/8700315 to your computer and use it in GitHub Desktop.
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