aboutsummaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-03-11 00:23:56 +0900
committerKoichi Sasada <ko1@atdot.net>2020-03-11 02:50:44 +0900
commitd9135743c0ae464f39330684b8c6d35917fd6b22 (patch)
tree2be4ce4d2fa8631b54ab56c119429f6ce0dd573d /vm.c
parentbf9abc477261a7a0c21e22634f1ece0ba64793f3 (diff)
downloadruby-d9135743c0ae464f39330684b8c6d35917fd6b22.tar.gz
add debug method RubyVM::mtbl2 (disabled)
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 50e317408b..03dfda3ce0 100644
--- a/vm.c
+++ b/vm.c
@@ -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 */