Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh jfirebaugh/ruby.py
Created Feb 20, 2012

Embed
What would you like to do?
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
You can’t perform that action at this time.