Bug #8886 » tracepoint_raise.patch
| eval.c | ||
|---|---|---|
|     ID mid = cfp->me->called_id; | ||
|     th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp); | ||
|     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil); | ||
|     setup_exception(th, TAG_RAISE, mesg); | ||
|     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil); | ||
|     rb_thread_raised_clear(th); | ||
|     JUMP_TAG(TAG_RAISE); | ||
| } | ||
| test/ruby/test_settracefunc.rb | ||
|---|---|---|
|                  events.shift) | ||
|     assert_equal(["c-return", 5, :exception, Exception], | ||
|                  events.shift) | ||
|     assert_equal(["c-return", 5, :raise, Kernel], | ||
|                  events.shift) | ||
|     assert_equal(["c-call", 5, :backtrace, Exception], | ||
|                  events.shift) | ||
|     assert_equal(["c-return", 5, :backtrace, Exception], | ||
|                  events.shift) | ||
|     assert_equal(["raise", 5, :test_raise, TestSetTraceFunc], | ||
|                  events.shift) | ||
|     assert_equal(["c-return", 5, :raise, Kernel], | ||
|                  events.shift) | ||
|     assert_equal(["c-call", 6, :===, Module], | ||
|                  events.shift) | ||
|     assert_equal(["c-return", 6, :===, Module], | ||
| ... | ... | |
|      [:c_call,  20, "xyzzy", Exception,   :initialize,      raised_exc,  :outer, :nothing], | ||
|      [:c_return,20, "xyzzy", Exception,   :initialize,      raised_exc,  :outer, raised_exc], | ||
|      [:c_return,20, "xyzzy", Exception,   :exception,       RuntimeError, :outer, raised_exc], | ||
|      [:c_return,20, "xyzzy", Kernel,      :raise,           self,        :outer, nil], | ||
|      [:c_call,  20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, :nothing], | ||
|      [:c_return,20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, nil], | ||
|      [:raise,   20, "xyzzy", TestSetTraceFunc, :trace_by_tracepoint, self, :outer, raised_exc], | ||
|      [:c_return,20, "xyzzy", Kernel,      :raise,           self,        :outer, nil], | ||
|      [:c_call,  20, "xyzzy", Module,      :===,             RuntimeError,:outer, :nothing], | ||
|      [:c_return,20, "xyzzy", Module,      :===,             RuntimeError,:outer, true], | ||
|      [:line,    21, "xyzzy", TestSetTraceFunc, method,      self,        :outer, :nothing], | ||