Project

General

Profile

Bug #1588

ブロックの中断でset_trace_funcのreturnイベントが呼び出されない

Added by kumaryu (Ryuichi Sakamoto) over 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.2dev (2009-06-08 trunk 23650) [i386-darwin9.7.0]
Backport:
[ruby-dev:38582]

Description

=begin
set_trace_funcでフックを設定した時に、ブロック中のbreakや例外で脱出をすると
'return'や'c-return'イベントが発生せずフックが呼び出されません。

$ cat tracefunc.rb
set_trace_func(proc {|event, file, line, id, binding, klass|
puts "'#{id}' event: #{event}" unless /line/ =~ event
})

1.times do
break
end

$ ./ruby1.9 -v tracefunc.rb
ruby 1.9.2dev (2009-06-08 trunk 23650) [i386-darwin9.7.0]
'set_trace_func' event: c-return
'times' event: c-call

1.8ではc-returnが呼ばれます。

$ ruby -v tracefunc.rb
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]
'times' event: c-call
'times' event: c-return

この影響でプロファイラでの計測が正常に出来ません。
=end

#1

Updated by yugui (Yuki Sonoda) over 11 years ago

  • Category set to YARV
  • Assignee set to ko1 (Koichi Sasada)
  • Target version changed from 2.0.0 to 1.9.2

=begin

=end

#2

Updated by wanabe (_ wanabe) about 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24574.
=end

Also available in: Atom PDF