Re: [Pydev-code] Debugging Java called from python
Brought to you by:
fabioz
From: Fabio Z. <fa...@gm...> - 2008-09-15 01:13:27
|
> I think that doing it the other way around and passing additional arguments to the java and attaching the java debugger as a remote debugger should work too... But one of those should be the remote debugger... > > Yes, I agree that would probably work. It is a lot more awkward than just pressing the debug button, but it would probably work. > > But since PyDev is launching the Java process to run Jython, why not just activate the standard jdwp debugging agent? That's possible, but needs digging into JDT internals to make it work > > My first stab at this was to make org.python.pydev.debug.ui.launching.AbstractLaunchConfigurationDelegate extend org.eclipse.jdt.launching.JavaLaunchDelegate. This successfully added the -agentlib:jdwp argument to the JVM command line, but it is not sufficient to get Eclipse to automatically connect to the launched process. The console says: > > FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) > ERROR: transport error 202: connect failed: Connection refused > ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) > JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690] > > This apparently comes from the launched process (not Eclipse), because I get the same error message when I launch using the -agentlib:jdwp argument from the command line outside of Eclipse. > > I wish I knew more about how to initialize Eclipse's JDT package properly... I think it goes a bit deeper than just passing those flags...(but I haven't looked it myself). Still, if you're up to the task and manage to get it working, please submit a patch with it (or you can enter a feature request, but I'm not sure when I'll be able to tackle that). Cheers, Fabio |