チケット #164 が報告されました。 (by Dave Thomas)

----------------------------------------
Bug #164: set_trace_func no longer reports 'line', 'call' and 'return' events
http://redmine.ruby-lang.org/issues/show/164

起票者: Dave Thomas
ステータス: Open
優先度: Normal
担当者: 
カテゴリ: 
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


----------------------------------------
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account