Skip to content

Instantly share code, notes, and snippets.

@eam
Created July 20, 2015 16:12
Show Gist options
  • Save eam/b1b695165fc360ce2eda to your computer and use it in GitHub Desktop.
Save eam/b1b695165fc360ce2eda to your computer and use it in GitHub Desktop.
~ lldb /usr/bin/ruby
Current executable set to '/usr/bin/ruby' (x86_64).
(lldb) break rb_exit
invalid command 'breakpoint rb_exit'
(lldb) break set --name rb_exit
Breakpoint 1: where = libruby.2.0.0.dylib`rb_exit, address = 0x000000000008bc6b
(lldb) run -eexit
Process 87866 launched: '/usr/bin/ruby' (x86_64)
Process 87866 stopped
* thread #1: tid = 0x2e4348, 0x0000000100090c6b libruby.2.0.0.dylib`rb_exit, queue = 'com.apple.main-thread, stop reason = breakpoint 1.1
frame #0: 0x0000000100090c6b libruby.2.0.0.dylib`rb_exit
libruby.2.0.0.dylib`rb_exit:
-> 0x100090c6b: pushq %rbp
0x100090c6c: movq %rsp, %rbp
0x100090c6f: pushq %rbx
0x100090c70: subq $24, %rsp
(lldb) p rb_eval_string("puts caller.inspect")
error: 'rb_eval_string' has unknown return type; cast the call to its declared return type
error: 1 errors parsing expression
(lldb) p (void) rb_eval_string("puts caller.inspect")
["-e:1:in `exit'", "-e:1:in `<main>'"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment