diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-11 08:42:13 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-11 08:42:13 +0000 |
commit | 577eaa60a705efd018a94ec5e752fb77626dba72 (patch) | |
tree | b4edc75a68ef3733d7eb6107e8dae803dcd2f141 /thread.c | |
parent | c5335ee110cfab1179018f6b0dbd504742017a4e (diff) | |
download | ruby-577eaa60a705efd018a94ec5e752fb77626dba72.tar.gz |
* insnhelper.ci (vm_call_method): pass mn->nd_clss to
vm_call_cfunc() instead of klass.
* vm.c (rb_thread_method_id_and_klass): traverse parent_iseq.
* thread.c (call_trace_proc): use rb_thread_method_id_and_klass().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -2890,22 +2890,32 @@ call_trace_proc(VALUE args) VALUE eventname = rb_str_new2(get_event_name(p->event)); VALUE filename = rb_str_new2(rb_sourcefile()); int line = rb_sourceline(); - VALUE mid; + ID id = 0; + VALUE klass = 0; - if (p->id == ID_ALLOCATOR) { - mid = ID2SYM(rb_intern("allocate")); - } - else if (p->id) { - mid = ID2SYM(p->id); + if (p->event == RUBY_EVENT_C_CALL || + p->event == RUBY_EVENT_C_RETURN) { + id = p->id; + klass = p->klass; } else { - mid = Qnil; + rb_thread_method_id_and_klass(GET_THREAD(), &id, &klass); + } + if (id == ID_ALLOCATOR) + return; + if (klass) { + if (TYPE(klass) == T_ICLASS) { + klass = RBASIC(klass)->klass; + } + else if (FL_TEST(klass, FL_SINGLETON)) { + klass = rb_iv_get(klass, "__attached__"); + } } return rb_proc_call(p->proc, rb_ary_new3(6, eventname, filename, INT2FIX(line), - mid, + id ? ID2SYM(id) : Qnil, p->self ? rb_binding_new() : Qnil, - p->klass ? p->klass : Qnil)); + klass ? klass : Qnil)); } static void |