From 553931962a8a6c73ecef770831165070479c8763 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 20 Nov 2012 09:48:24 +0000 Subject: * vm_trace.c: add two methods: (1) TracePoint#return_value which returns return value on the :return and :c_return event. (2) TracePoint#raised_exception which returns raised exception value on the :raise event. Eeach methods raise RuntimeError if it is called at unsupported event. Please review and give us feedback until next preview release (Dec/2012) of Ruby 2.0.0. * insns.def, vm.c, vm_eval.c, vm_insnhelper.c, eval.c, thread.c: ditto. * vm_trace.c, vm_core.h: move definition of rb_trace_arg_t from vm_trace.c to vm_core.h. Caller fills rb_trace_arg_t and pass the pointer of this variable. * test/ruby/test_settracefunc.rb: fix tests to test this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- insns.def | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'insns.def') diff --git a/insns.def b/insns.def index 32d6c9a873..6a5463710e 100644 --- a/insns.def +++ b/insns.def @@ -871,7 +871,8 @@ trace rb_sourceline()); } } - EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */); + EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* id and klass are resolved at callee */, + flag & RUBY_EVENT_RETURN ? TOPN(0) : Qundef); } /**********************************************************/ -- cgit v1.2.3