|Can a Java program contain its own debugger? [message #1475862]
|Sun, 16 November 2014 16:36
| Gary Ford
Registered: August 2014
We have a desktop application written in Java using Swing. Users can add functionality, while the program is running, via a procedural scripting language. We translate the script into Java, compile it, load the new class, and make its methods available to the currently executing program.
Now we would like to add a debugger for user scripts, using the JDI and JVMTI interfaces. We probably can use either sockets or shared memory for communication between the debugger front end and back end.
This will be our first time attempting to use JDI and JVMTI. We have two questions before we jump in:
1. Is there anything in the Java Platform Debugger Architecture (JPDA) that is fundamentally incompatible with the idea of a program containing its own debugger, with both running in the same JVM (in different threads or processes)?
2. We understand that JVMTI requires that the JVM be launched with a debugging option (something like the -agentlib:jdwp option?), and that the debugger (if and when it is needed) then attaches itself. If the debugger is never needed, is there a performance hit because the JVM was launched that way?
Powered by FUDForum
. Page generated in 0.01970 seconds