ruby-debug/ruby-debug — Issue #7: Cannot debug multiple threads if any block in debug code
Author: headius
Created: 2011-10-13 16:08:25+00:00
State: open

The following JRuby bug seems to be a ruby-debug bug: http://jira.codehaus.org/browse/JRUBY-6083

The problem here is that two threads are active, one of them enters debug code and sleeps (presumably waiting for IDE or user feedback) and then all other threads freeze waiting for that debug code to proceed.

The problem is that DebugEventHook always synchronizes against itself when entering debug code. This works ok for non-blocking debugging, but in any case where someone is attempting to step through code or inspect state, all other threads grind to a halt. I do not think this is correct behavior.

I'm not sure of the appropriate fix at this time, since I'm not intimately familiar with ruby-debug's codebase. But it seems like if DebugEventHook were modified to contain per-thread data rather than shared data, it shouldn't need to synchronize.

Anyone out there want to help me fix and resolve this?