Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Created February 20, 2012 21:39
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 jfirebaugh/1871632 to your computer and use it in GitHub Desktop.
Save jfirebaugh/1871632 to your computer and use it in GitHub Desktop.
import lldb
def ruby_value(val, dict):
return 'ruby'
def __lldb_init_module(debugger, dict):
print 'ready!'
~ ♢ lldb ruby
Current executable set to 'ruby' (x86_64).
(lldb) version
LLDB-112
(lldb) type summary add -P VALUE
Enter your Python command(s). Type 'DONE' to end.
def function (valobj,dict):
return 'ruby'
DONE
Segmentation fault: 11
~ ♢ lldb ruby
Current executable set to 'ruby' (x86_64).
(lldb) command script import ~/ruby.py
ready!
(lldb) type summary add -F ruby_value VALUE
(lldb) p (VALUE)0
(VALUE) $0 = 0
(lldb) type summary add --python-script "return 'ruby'" VALUE
(lldb) p (VALUE)0
(VALUE) $1 = 0 ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment