summaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-11 08:42:13 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-11 08:42:13 +0000
commit7689e6b971542e083e3ef004ebb363e9767bd94e (patch)
treeb4edc75a68ef3733d7eb6107e8dae803dcd2f141 /thread.c
parentd77f313b19ae1c6225bd95b2e3f7a07cc4a47158 (diff)
downloadruby-7689e6b971542e083e3ef004ebb363e9767bd94e.tar.gz
ruby-7689e6b971542e083e3ef004ebb363e9767bd94e.tar.xz
ruby-7689e6b971542e083e3ef004ebb363e9767bd94e.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@13877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/thread.c b/thread.c
index 9476017a3..f059e0dc3 100644
--- a/thread.c
+++ b/thread.c
@@ -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
OSZAR »