Yes that is possible with JDebug. You choose which process you want to
start first, the debugger or the application.
If you start the debugger first you put it into "Listen" mode. Then you
start the application and the JVM command line arguments tell it to attach
to a debugger.
If you start the application first you tell the JVM to listen for a
debugger. You then start the debugger and attach to the application.
Which you choose will depend on the environment. For instance, if you want
to debug an applet using the Java Plug-In you need to use the 2nd method.
This allows you to start the browser and load the page with the applet.
When the JVM starts up it will attach to the debugger before starting the
applet.
To start an application so that you can attach the debugger via shared
memory, use the JVM command line options of:
-Djava.compiler=NONE
-Xdebug
-Xnoagent
-Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=javadebug
To start an application that will attach to a listening debugger via shared
memory use:
-Djava.compiler=NONE
-Xdebug
-Xnoagent
-Xrunjdwp:transport=dt_shmem,address=javadebug,server=n,suspend=y
It is possible to use sockets to attach a JVM to a debugger but I have not
tried that.
Erik Husby
Domain Pharma Corp
Suite 110 Vox: 781-778-3834
10 Maguire Rd Fax: 781-778-3800
Lexington, MA 02421 Email: [EMAIL PROTECTED]