From: Rocky Bernstein Date: 2008-03-11T18:30:28+09:00 Subject: Ruby 1.8.6 trace return line numbers wrong ------=_Part_1640_16289193.1205227835085 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Consider this program: def first x = 0 1 end first Running a trace on this: $ ruby -rtracer /tmp/bug.rb #0:/tmp/bug.rb:1::-: def first #0:/tmp/bug.rb:1:Module:>: def first #0:/tmp/bug.rb:1:Module:<: def first #0:/tmp/bug.rb:5::-: first #0:/tmp/bug.rb:1:Object:>: def first #0:/tmp/bug.rb:2:Object:-: x = 0 #0:/tmp/bug.rb:3:Object:-: 1 #0:/tmp/bug.rb:2:Object:<: x = 0 Notice that we give a *line* trace for line 3 but the *return *line number which follows that goes back to line 2. Ruby version: ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux] Also filed as: http://rubyforge.org/tracker/index.php?func=detail&aid=18749&group_id=426&atid=22040 ------=_Part_1640_16289193.1205227835085 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Consider this program:

  def first
    x = 0
    1
  end
  first

Running a trace on this:


$ ruby -rtracer /tmp/bug.rb
#0:/tmp/bug.rb:1::-: def first
#0:/tmp/bug.rb:1:Module:>: def first
#0:/tmp/bug.rb:1:Module:<: def first
#0:/tmp/bug.rb:5::-: first
#0:/tmp/bug.rb:1:Object:>: def first
#0:/tmp/bug.rb:2:Object:-:   x = 0
#0:/tmp/bug.rb:3:Object:-:   1
#0:/tmp/bug.rb:2:Object:<:   x = 0


Notice that we give a line trace for line 3 but the return line number which follows that goes back to line 2.

Ruby version: ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]
Also filed as:
http://rubyforge.org/tracker/index.php?func=detail&aid=18749&group_id=426&atid=22040
------=_Part_1640_16289193.1205227835085--