e$B%A%1%C%He(B #164 e$B$,Js9p$5$l$^$7$?!#e(B (by Dave T.)
Bug #164: set_trace_func no longer reports ‘line’, ‘call’ and ‘return’
events
http://redmine.ruby-lang.org/issues/show/164
e$B5/I<<Te(B: Dave T.
e$B%9%F!<%?%9e(B: Open
e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B:
e$B%+%F%4%je(B:
Target version:
Given the following code:
class Test
def test
a = 1
b = 2
end
end
set_trace_func proc {|event, file, line, id, binding, classname|
printf “%8s %s:%-2d %10s %8s\n”, event, file, line, id, classname
}
t = Test.new
t.test
Run under 1.9:
dave[RUBY3/Book 22:09:47*] ruby -v t.rb
ruby 1.9.0 (2008-06-16 revision 15427) [i686-darwin9.3.0]
c-return t.rb:10 set_trace_func Kernel
c-call t.rb:11 new Class
c-call t.rb:11 initialize BasicObject
c-return t.rb:11 initialize BasicObject
c-return t.rb:11 new Class
But, under 1.8:
dave[RUBY3/Book 22:11:17*] /usr/bin/ruby -v t.rb
ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]
line t.rb:11 false
c-call t.rb:11 new Class
c-call t.rb:11 initialize Object
c-return t.rb:11 initialize Object
c-return t.rb:11 new Class
line t.rb:12 false
call t.rb:2 test Test
line t.rb:3 test Test
line t.rb:4 test Test
return t.rb:3 test Test
If this is deliberate, I’ll update the documentation in the book.
Dave