[前][次][番号順一覧][スレッド一覧]

ruby-changes:60356

From: Koichi <ko1@a...>
Date: Wed, 11 Mar 2020 02:55:38 +0900 (JST)
Subject: [ruby-changes:60356] d9135743c0 (master): add debug method RubyVM::mtbl2 (disabled)

https://git.ruby-lang.org/ruby.git/commit/?id=d9135743c0

From d9135743c0ae464f39330684b8c6d35917fd6b22 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Wed, 11 Mar 2020 00:23:56 +0900
Subject: add debug method RubyVM::mtbl2 (disabled)


diff --git a/vm.c b/vm.c
index 50e3174..03dfda3 100644
--- a/vm.c
+++ b/vm.c
@@ -2968,7 +2968,14 @@ f_lambda(VALUE _) https://github.com/ruby/ruby/blob/trunk/vm.c#L2968
 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) https://github.com/ruby/ruby/blob/trunk/vm.c#L3267
     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 */
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]