Trace $BL?Na$G$N%a%=%C%I(BID/$B%/%i%9$N0zEO$7(B

e$B%o%J%Y$H?=$7$^$9!#e(B

trace e$BL?Na$G%$%Y%s%H%U%C%/$,8F$S=P$5$l$k$H$-$Ke(B
e$B%a%=%C%Ie(B ID e$B$H%/%i%9$rEO$9$h$&$K$7$F$$$?$@$1$k$He(B
e$B3HD%%i%$%V%i%jEy$G$b$=$l$i$,<hF@$G$-$F$"$j$,$?$$$G$9!#e(B
rb_thread_method_id_and_classe$B$N<BAu$r$=$N$^$^MQ$$$?%Q%C%A$rE:IU$7$^$9!#e(B

Index: insns.def

— insns.def (revision 23834)
+++ insns.def (working copy)
@@ -852,8 +852,11 @@
()
{
rb_event_flag_t flag = nf;

  • ID id = 0;
  • VALUE klass = 0;
  • EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */);
  • rb_vm_method_id_and_class(GET_CFP(), &id, &klass);
  • EXEC_EVENT_HOOK(th, flag, GET_SELF(), id, klass);
    }

/**********************************************************/
Index: vm.c

— vm.c (revision 23834)
+++ vm.c (working copy)
@@ -1317,10 +1317,9 @@
}

int
-rb_thread_method_id_and_class(rb_thread_t *th,

  •                         ID *idp, VALUE *klassp)
    

+rb_vm_method_id_and_class(rb_control_frame_t *cfp,

  •                     ID *idp, VALUE *klassp)
    

{

  • rb_control_frame_t *cfp = th->cfp;
    rb_iseq_t *iseq = cfp->iseq;
    if (!iseq) {
    if (idp) *idp = cfp->method_id;
    @@ -1347,6 +1346,13 @@
    }

int
+rb_thread_method_id_and_class(rb_thread_t *th,

  •                         ID *idp, VALUE *klassp)
    

+{

  • return rb_vm_method_id_and_class(th->cfp, idp, klassp);
    +}

+int
rb_frame_method_id_and_class(ID *idp, VALUE *klassp)
{
return rb_thread_method_id_and_class(GET_THREAD(), idp, klassp);