Issue1757191

classification
Title: Jython hangs under PyDev debugger
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: paulj_edgewater
Priority: normal Keywords:

Created on 2007-07-19.22:58:58 by paulj_edgewater, last changed 2007-07-19.22:58:58 by paulj_edgewater.

Files
File name Uploaded Description Edit Remove
pydev-jython-patch.txt paulj_edgewater, 2007-07-19.22:58:58 A patch to demonstrate a theory re:Jython debugging
Messages
msg1742 (view) Author: paulj (paulj_edgewater) Date: 2007-07-19.22:58:58
I have seen this problem with various combinations of Jython (2.1, 2.2rc1, 2.2rc2) and PyDev (1.3.5, 1.3.8).

1. Set a breakpoint in some "main" code in a module.
2. Launch the Jython debugger.
3. The console prints "pydev debugger"
4. A "red square" appears to show that the script is running.
5. The breakpoint is not hit.
6. The pause button is greyed-out.
7. The only available option is to terminate the run.

I'm not 100% sure if this is a PyDev problem or a Jython problem but I suspect that the issue has to do with a difference in sys.settrace() behavior between Jython and CPython.

I created a PyDev patch that makes the debugger work (i.e. not hang). They way it is currently coded, I wouldn't recommend it to anyone, but it should provide food for thought.

Details:

The debugger uses sys.settrace() to hook in a dispatch function and then it spawns three threads. Each thread indirectly calls sys.settrace(None) to disable tracing for the given thread. I found that the spawned threads still call the dispatch function. As an experiment, I was able to stop the spawned threads from tracing by giving each thread a fresh PySysytemState. I don't know the effect of this, so I don't recommend this as a workaround.

Thanks,

..PJ

History
Date User Action Args
2007-07-19 22:58:58paulj_edgewatercreate