Wrong line numbers for 'return' events
--------------------------------------

                 Key: JRUBY-2743
                 URL: http://jira.codehaus.org/browse/JRUBY-2743
             Project: JRuby
          Issue Type: Bug
          Components: Interpreter
    Affects Versions: JRuby 1.1.3
         Environment: jruby 1.1.3-dev (ruby 1.8.6 patchlevel 114) (2008-07-03 
rev 7091) [i386-java]
            Reporter: Martin Krauskopf


JRUBY-2723 was fixed but there is still another, related problem (might be 
introduced by JRUBY-2723) that the lines for 'return' events are wrong. It is 
the first line of the function instead of last line.

{code}
$ cat test.rb 
# first line
# second line
def call_me
  sleep 0.01
end

Kernel.set_trace_func(lambda do |event, file, line, id, binding, clazz|
  printf "%8s | %#{$0.length}s:%-4d | %12s | %8s\n", event, 
File.basename(file), line, id, clazz
end)

call_me
{code}

{code}
$ jruby --debug test.rb 
    line | test.rb:11   |              |    false
    call | test.rb:3    |      call_me |   Object
    line | test.rb:4    |      call_me |   Object
  return | test.rb:3    |      call_me |   Object
{code}

Last line should have number 5, might be 4, depends on style. MRI returns 4 in 
1.8.7-p22.

I've added regression tests into jruby-debug-base test suite.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to