tracepoint_raise.patch

David Rodríguez, 09/10/2013 08:03 PM

Download (2.44 KB)

View differences:

eval.c
661 661
    ID mid = cfp->me->called_id;
662 662

  
663 663
    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
664
    EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil);
664 665

  
665 666
    setup_exception(th, TAG_RAISE, mesg);
666 667

  
667
    EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil);
668 668
    rb_thread_raised_clear(th);
669 669
    JUMP_TAG(TAG_RAISE);
670 670
}
test/ruby/test_settracefunc.rb
247 247
                 events.shift)
248 248
    assert_equal(["c-return", 5, :exception, Exception],
249 249
                 events.shift)
250
    assert_equal(["c-return", 5, :raise, Kernel],
251
                 events.shift)
250 252
    assert_equal(["c-call", 5, :backtrace, Exception],
251 253
                 events.shift)
252 254
    assert_equal(["c-return", 5, :backtrace, Exception],
253 255
                 events.shift)
254 256
    assert_equal(["raise", 5, :test_raise, TestSetTraceFunc],
255 257
                 events.shift)
256
    assert_equal(["c-return", 5, :raise, Kernel],
257
                 events.shift)
258 258
    assert_equal(["c-call", 6, :===, Module],
259 259
                 events.shift)
260 260
    assert_equal(["c-return", 6, :===, Module],
......
509 509
     [:c_call,  20, "xyzzy", Exception,   :initialize,      raised_exc,  :outer, :nothing],
510 510
     [:c_return,20, "xyzzy", Exception,   :initialize,      raised_exc,  :outer, raised_exc],
511 511
     [:c_return,20, "xyzzy", Exception,   :exception,       RuntimeError, :outer, raised_exc],
512
     [:c_return,20, "xyzzy", Kernel,      :raise,           self,        :outer, nil],
512 513
     [:c_call,  20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, :nothing],
513 514
     [:c_return,20, "xyzzy", Exception,   :backtrace,       raised_exc,  :outer, nil],
514 515
     [:raise,   20, "xyzzy", TestSetTraceFunc, :trace_by_tracepoint, self, :outer, raised_exc],
515
     [:c_return,20, "xyzzy", Kernel,      :raise,           self,        :outer, nil],
516 516
     [:c_call,  20, "xyzzy", Module,      :===,             RuntimeError,:outer, :nothing],
517 517
     [:c_return,20, "xyzzy", Module,      :===,             RuntimeError,:outer, true],
518 518
     [:line,    21, "xyzzy", TestSetTraceFunc, method,      self,        :outer, :nothing],