EventHook not firing for return events coming from inside a block
-----------------------------------------------------------------

                 Key: JRUBY-5859
                 URL: http://jira.codehaus.org/browse/JRUBY-5859
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.6.2
         Environment: jruby 1.6.2 on windows
            Reporter: rich liebling
         Attachments: JavaEventHook.java, jeh.jar, test.rb

While working on a fork of jruby-prof (to fix bugs and support threading, eg 
profiling selected threads only) I noticed that call and return events are not 
always balanced.  The test case I provide here worked under jruby 1.5.6, but I 
think jruby 1.5.6 still had the same issue under other conditions (for which I 
am not providing a test case as I have not narrowed it down further).  

I'm attaching the source files, but wanted to show what i mean:

def foo
  [1,2,3].each do |i|
    return i
  end
end

Now, if i invoke foo, with an event hook active, i get these events:
c:\Users\rich\workspace\eventhooktest>jruby --debug  test.rb
EVENT: line methodName: null
EVENT: call methodName: foo
EVENT: line methodName: foo
EVENT: c-call methodName: each
EVENT: line methodName: foo
EVENT: return methodName: foo

Note that there is no return event for the method 'each'.

BTW - I also tried, unsuccessfully, to use jruby to implement a concrete 
EventHook class so my testcase could be all ruby.  But, i could not make it 
work, possibly/probably due to my error.


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