provide equivalent of MRI's rb_exec_end_proc --------------------------------------------
Key: JRUBY-6020 URL: https://jira.codehaus.org/browse/JRUBY-6020 Project: JRuby Issue Type: Bug Reporter: John Firebaugh Assignee: Thomas E Enebo MRI's [rb_exec_end_proc](https://github.com/ruby/ruby/blob/1df42597d15416357a20bd68700ce1a2d245e8bb/eval_jump.c#L96) executes all the at_exit blocks. The ruby-debug-base C extension [calls this method](https://github.com/ruby-debug/ruby-debug/blob/8ff6f477b17ded583d72c773e91b9c4803b9a0ea/ext/ruby_debug.c#L1418-L1420), allowing at_exit blocks to be properly debugged prior to the debugger shutting down. This is essential for debugging tests, as many test frameworks use at_exit to auto-run all registered tests. JRuby's ruby-debug-base currently [calls Ruby.tearDown()](https://github.com/jruby/jruby-debug/blob/master/src/org/jruby/debug/Debugger.java#L105) when stopping the debugger via Debugger.stop. Ruby.tearDown does run at_exit blocks, but also tears down the entire runtime. I'm amazed that this even sort of works considering that Debugger.start/Debugger.stop can be called multiple times during a program run, and there's always more Ruby code executing following Debugger.stop. Tearing down the runtime while things are still in flight definitely has some bad side effects (test failures in the ruby-debug test suite, random debugger hangs due to corruption of internal structures). I'd like to have a Ruby.executeAtExitBlock() so JRuby's ruby-debug-base can mimic the behavior of the C extension. -- This message is automatically generated by JIRA. 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