diff options
author | Koichi Sasada <[email protected]> | 2020-03-11 00:23:56 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-03-11 02:50:44 +0900 |
commit | d9135743c0ae464f39330684b8c6d35917fd6b22 (patch) | |
tree | 2be4ce4d2fa8631b54ab56c119429f6ce0dd573d /vm.c | |
parent | bf9abc477261a7a0c21e22634f1ece0ba64793f3 (diff) |
add debug method RubyVM::mtbl2 (disabled)
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -2968,7 +2968,14 @@ f_lambda(VALUE _) static VALUE vm_mtbl(VALUE self, VALUE obj, VALUE sym) { - vm_mtbl_dump(CLASS_OF(obj), SYM2ID(sym)); + vm_mtbl_dump(CLASS_OF(obj), RTEST(sym) ? SYM2ID(sym) : 0); + return Qnil; +} + +static VALUE +vm_mtbl2(VALUE self, VALUE obj, VALUE sym) +{ + vm_mtbl_dump(obj, RTEST(sym) ? SYM2ID(sym) : 0); return Qnil; } @@ -3260,10 +3267,13 @@ Init_VM(void) rb_define_singleton_method(rb_cRubyVM, "SDR", sdr, 0); rb_define_singleton_method(rb_cRubyVM, "NSDR", nsdr, 0); rb_define_singleton_method(rb_cRubyVM, "mtbl", vm_mtbl, 2); + rb_define_singleton_method(rb_cRubyVM, "mtbl", vm_mtbl, 2); + rb_define_singleton_method(rb_cRubyVM, "mtbl2", vm_mtbl2, 2); #else (void)sdr; (void)nsdr; (void)vm_mtbl; + (void)vm_mtbl2; #endif /* VM bootstrap: phase 2 */ |