Listening for an Executing JVM
The debugger can listen for an executing target JVM to connect to the debugger.
There are two ways to connect the target JVM to the debugger:
via shared memory or a network socket.
Shared Memory
Shared memory has the fastest debugging performance if it is supported by your JVM platform.
The debugger and the target must be executing on the same computer.
The required address parameter is the shared memory address that the debugger is listening at.
JDK 1.6
jdk1.6/bin/java -agentlib:jdwp=transport=dt_shmem,suspend=n,address=javadebug test.Test args
JDK 1.5
jdk1.5/bin/java -agentlib:jdwp=transport=dt_shmem,suspend=n,address=javadebug test.Test args
JDK 1.4
j2sdk1.4/bin/java -Xdebug -Xrunjdwp:transport=dt_shmem,suspend=n,address=javadebug test.Test args
JDK 1.3
jdk1.3/bin/java -classic -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_shmem,suspend=n,address=javadebug test.Test args
Socket
A network socket can connect the debugger and the target JVM that can be running on the same
computer or on different computers.
The required address parameter is the host name that the debugger is running on and
the port number that the debugger is listening at.
If the debugger and the target are on the same host, then only the port number (with no colon) is required.
JDK 1.6
jdk1.6/bin/java -agentlib:jdwp=transport=dt_socket,suspend=n,address=dbghost:8000 test.Test args
JDK 1.5
jdk1.5/bin/java -agentlib:jdwp=transport=dt_socket,suspend=n,address=dbghost:8000 test.Test args
JDK 1.4
j2sdk1.4/bin/java -Xdebug -Xrunjdwp:transport=dt_socket,suspend=n,address=dbghost:8000 test.Test args
JDK 1.3
jdk1.3/bin/java -classic -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,suspend=n,address=dbghost:8000 test.Test args
©2001-2010. debugtools.com LLC. All rights reserved.