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

**URL:** <https://www.ruby-forum.com/t/trace-bl-na-g-n-a-c-i-bid-b-i-9-n0zeo-7-b/170899>\
**Category:** Development\
**Created:** [June 24, 2009, 2:46am UTC](https://www.ruby-forum.com/t/trace-bl-na-g-n-a-c-i-bid-b-i-9-n0zeo-7-b/170899 "2009-06-24T02:46:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wanabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/51bf81/32.png) [@wanabe](https://www.ruby-forum.com/u/wanabe)\
**Post date:** [June 24, 2009, 2:46am UTC](https://www.ruby-forum.com/t/trace-bl-na-g-n-a-c-i-bid-b-i-9-n0zeo-7-b/170899/1 "2009-06-24T02:46:22Z")

</div>

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);
