|
$ echo "def foo; end" > break_it.rb
|
|
$ lldb ./miniruby test.rb
|
|
(lldb) target create "./miniruby"
|
|
Current executable set to './miniruby' (x86_64).
|
|
(lldb) settings set -- target.run-args "test.rb"
|
|
(lldb) break set -f vm_eval.c -l 559
|
|
Breakpoint 1: where = miniruby`rb_search_method_entry + 369 at vm_eval.c:559, address = 0x0000000100242661
|
|
(lldb) r
|
|
Process 24469 launched: './miniruby' (x86_64)
|
|
== nil
|
|
node: NODE_NIL(implicit)
|
|
iseq_set_local_table: 1, 0
|
|
[compile step 3.1 (iseq_optimize)]
|
|
[compile step 4.1 (iseq_set_sequence)]
|
|
[compile step 4.2 (iseq_set_exception_table)]
|
|
[compile step 4.3 (set_optargs_table)]
|
|
[compile step 5 (iseq_translate_threaded_code)]
|
|
== disasm: #<ISeq:<main>@<main>>========================================
|
|
0000 putnil
|
|
0001 leave
|
|
|
|
[compile step: finish]
|
|
iseq_set_local_table: 2, 1
|
|
[compile step 3.1 (iseq_optimize)]
|
|
[compile step 4.1 (iseq_set_sequence)]
|
|
[compile step 4.2 (iseq_set_exception_table)]
|
|
[compile step 4.3 (set_optargs_table)]
|
|
[compile step 5 (iseq_translate_threaded_code)]
|
|
== disasm: #<ISeq:utime=@<main>>========================================
|
|
local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
|
|
[ 2] _<Arg>
|
|
0000 getlocal_OP__WC__0 2
|
|
0002 putobject_OP_INT2FIX_O_0_C_
|
|
0003 opt_call_c_function rb_vm_opt_struct_aset
|
|
0005 pop
|
|
0006 leave
|
|
|
|
[compile step: finish]
|
|
iseq_set_local_table: 2, 1
|
|
[compile step 3.1 (iseq_optimize)]
|
|
[compile step 4.1 (iseq_set_sequence)]
|
|
[compile step 4.2 (iseq_set_exception_table)]
|
|
[compile step 4.3 (set_optargs_table)]
|
|
[compile step 5 (iseq_translate_threaded_code)]
|
|
== disasm: #<ISeq:stime=@<main>>========================================
|
|
local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
|
|
[ 2] _<Arg>
|
|
0000 getlocal_OP__WC__0 2
|
|
0002 putobject_OP_INT2FIX_O_1_C_
|
|
0003 opt_call_c_function rb_vm_opt_struct_aset
|
|
0005 pop
|
|
0006 leave
|
|
|
|
[compile step: finish]
|
|
iseq_set_local_table: 2, 1
|
|
[compile step 3.1 (iseq_optimize)]
|
|
[compile step 4.1 (iseq_set_sequence)]
|
|
[compile step 4.2 (iseq_set_exception_table)]
|
|
[compile step 4.3 (set_optargs_table)]
|
|
[compile step 5 (iseq_translate_threaded_code)]
|
|
== disasm: #<ISeq:cutime=@<main>>=======================================
|
|
local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
|
|
[ 2] _<Arg>
|
|
0000 getlocal_OP__WC__0 2
|
|
0002 putobject 2
|
|
0004 opt_call_c_function rb_vm_opt_struct_aset
|
|
0006 pop
|
|
0007 leave
|
|
|
|
[compile step: finish]
|
|
iseq_set_local_table: 2, 1
|
|
[compile step 3.1 (iseq_optimize)]
|
|
[compile step 4.1 (iseq_set_sequence)]
|
|
[compile step 4.2 (iseq_set_exception_table)]
|
|
[compile step 4.3 (set_optargs_table)]
|
|
[compile step 5 (iseq_translate_threaded_code)]
|
|
== disasm: #<ISeq:cstime=@<main>>=======================================
|
|
local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
|
|
[ 2] _<Arg>
|
|
0000 getlocal_OP__WC__0 2
|
|
0002 putobject 3
|
|
0004 opt_call_c_function rb_vm_opt_struct_aset
|
|
0006 pop
|
|
0007 leave
|
|
|
|
[compile step: finish]
|
|
iseq_set_local_table: 1, 0
|
|
iseq_set_arguments: 0
|
|
== scoped node
|
|
DBG> : NODE_PRELUDE (2)
|
|
== prelude
|
|
== body
|
|
DBG> : NODE_DEFN (1)
|
|
[new_child_iseq]> ---------------------------------------
|
|
iseq_set_local_table: 1, 0
|
|
iseq_set_arguments:
|
|
- argc: 0
|
|
== scoped node
|
|
node: NODE_NIL(implicit)
|
|
[compile step 3.1 (iseq_optimize)]
|
|
[compile step 4.1 (iseq_set_sequence)]
|
|
[compile step 4.2 (iseq_set_exception_table)]
|
|
[compile step 4.3 (set_optargs_table)]
|
|
[compile step 5 (iseq_translate_threaded_code)]
|
|
== disasm: #<ISeq:foo@test.rb>==========================================
|
|
0000 trace 8 ( 1)
|
|
0002 putnil
|
|
0003 trace 16 ( 2)
|
|
0005 leave
|
|
|
|
[compile step: finish]
|
|
[new_child_iseq]< ---------------------------------------
|
|
Process 24469 stopped
|
|
* thread #1: tid = 0xf9395, 0x0000000100242661 miniruby`rb_search_method_entry(recv=4303796120, mid=2753) + 369 at vm_eval.c:559, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
|
|
frame #0: 0x0000000100242661 miniruby`rb_search_method_entry(recv=4303796120, mid=2753) + 369 at vm_eval.c:559
|
|
556 " (%p flags=0x%"PRIxVALUE")",
|
|
557 rb_id2str(mid), typestr, (void *)recv, flags);
|
|
558 if (typestr)
|
|
-> 559 rb_raise(rb_eNotImpError,
|
|
560 "method `%"PRIsVALUE"' called on unexpected %s object"
|
|
561 " (%p flags=0x%"PRIxVALUE")",
|
|
562 rb_id2str(mid), typestr, (void *)recv, flags);
|
|
(lldb) frame v
|
|
(VALUE) recv = 4303796120
|
|
(ID) mid = 2753
|
|
(VALUE) klass = 0
|
|
(VALUE) flags = 28698
|
|
(int) type = 26
|
|
(const char *) typestr = 0x0000000100282cda "T_IMEMO"
|
|
(lldb) thread backtrace
|
|
* thread #1: tid = 0xf9395, 0x0000000100242661 miniruby`rb_search_method_entry(recv=4303796120, mid=2753) + 369 at vm_eval.c:559, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
|
|
* frame #0: 0x0000000100242661 miniruby`rb_search_method_entry(recv=4303796120, mid=2753) + 369 at vm_eval.c:559
|
|
frame #1: 0x000000010025386c miniruby`rb_call0(recv=4303796120, mid=2753, argc=0, argv=0x0000000000000000, scope=CALL_FCALL, self=4304250480) + 44 at vm_eval.c:343
|
|
frame #2: 0x00000001002431da miniruby`rb_call(recv=4303796120, mid=2753, argc=0, argv=0x0000000000000000, scope=CALL_FCALL) + 74 at vm_eval.c:634
|
|
frame #3: 0x0000000100240051 miniruby`rb_funcallv(recv=4303796120, mid=2753, argc=0, argv=0x0000000000000000) + 49 at vm_eval.c:845
|
|
frame #4: 0x00000001000f4b32 miniruby`rb_inspect(obj=4303796120) + 34 at object.c:477
|
|
frame #5: 0x000000010022956b miniruby`ruby_debug_print_value(level=1, debug_level=2, header=0x00000001002913e0, obj=4303796120) + 43 at debug.c:67
|
|
frame #6: 0x00000001002171b7 miniruby`iseq_compile_each(iseq=0x000000010086b860, ret=0x00007fff5fbfed88, node=0x000000010086bc48, poped=0) + 52295 at compile.c:5250
|
|
frame #7: 0x000000010021a973 miniruby`iseq_compile_each(iseq=0x000000010086b860, ret=0x00007fff5fbfed88, node=0x000000010086bbf8, poped=0) + 66563 at compile.c:5707
|
|
frame #8: 0x0000000100209f21 miniruby`rb_iseq_compile_node(iseq=0x000000010086b860, node=0x000000010086bc20) + 2097 at compile.c:521
|
|
frame #9: 0x000000010022a58f miniruby`rb_iseq_new_with_opt(node=0x000000010086bc20, name=4303796360, path=4303815160, absolute_path=4303796480, first_lineno=1, parent=0x0000000100883730, type=ISEQ_TYPE_MAIN, option=0x00000001002fa808) + 143 at iseq.c:475
|
|
frame #10: 0x000000010022a6cd miniruby`rb_iseq_new_main(node=0x000000010086bc20, path=4303815160, absolute_path=4303796480) + 173 at iseq.c:460
|
|
frame #11: 0x000000010018d358 miniruby`process_options(argc=0, argv=0x00007fff5fbff770, opt=0x00007fff5fbff590) + 4680 at ruby.c:1584
|
|
frame #12: 0x000000010018c0ed miniruby`ruby_process_options(argc=2, argv=0x00007fff5fbff760) + 205 at ruby.c:2066
|
|
frame #13: 0x0000000100065fb4 miniruby`ruby_options(argc=2, argv=0x00007fff5fbff760) + 228 at eval.c:102
|
|
frame #14: 0x00000001000013d9 miniruby`main(argc=2, argv=0x00007fff5fbff760) + 105 at main.c:36
|
|
frame #15: 0x00007fff920165c9 libdyld.dylib`start + 1
|