Re: [Pydev-code] Debugging Java called from python
Brought to you by:
fabioz
From: Andrew M. <mi...@nd...> - 2008-09-12 20:42:34
|
Fabio Zadrozny wrote: > > The Pydev remote debugger does not help me stop at breakpoints in > Java code. It still only stops at breakpoints in Python code. Am > I missing something? > > > Actually, what I said is that you should launch from the java debugger > and later go on and from your code call pydevd.settrace() to attach to > the remote debugger. > > 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? 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... --Andy P.S. Thanks for the great documentation, including the pydev manual_101. |