Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Debugging custom scripts interpreted in Java

Jae Gangemi wrote:
i believe what johan is saying is that you need to fire off two debugging processes, one for the dltk script, and one for the java code you wish to intercept.
Couldn't the launched process simultaneously interact with Eclipse's "native" Java -agentlib:jdwp protocol AND the dbgp protocol?

I can stop at Java breakpoints when I run my python script from Eclipse directly with Jython (i.e., without the pydevd.py wrapper). In this scenario, my Eclipse launcher produces a command line like this:

C:\Program Files\Java\jdk1.6.0_02\bin\javaw.exe
   -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:4088
   -Dfile.encoding=Cp1252
-classpath C:\jython2.2.1\jython.jar org.python.util.jython src\example.py

However, when I run my python script from Eclipse using PyDev, there is no -agentlib:jdwp in the command line:

C:\Program Files\Java\jdk1.6.0_02\bin\javaw.exe
-classpath "C:\jython2.2.1\jython.jar;...;C:\Program Files\Java\jdk1.6.0_02\jre\lib\ext\tools.jar"
   -Dpython.security.respectJavaAccessibility=false
   org.python.util.jython
   pydevd.py
   --vm_type jython --client localhost --port 3088 --file src\example.py

The -agentlib:jdwp is the link between the launched process and the Eclipse debugger, and should be activated on all launched Java processes. The agent is built-in to every JVM, and Eclipse just activates it in the launched process, then connects to it.

Seems that any Java process implementing the dbgp protocol could be launched with the -agentlib:jdwp switch, and all debugging would be integrated. No?

--Andy



Back to the top