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] |