The Attach to VM dialog box enables you to connect the debugger to
an application running on another virtual machine. You open this
dialog box by choosing Debug Attach from the main window.
You have two types of debuggers to choose from:
If you choose the JDK 1.1 debugger implementation, you will be required
to enter a host name and password. You can obtain the password
when launching the process by typing -Xdebug
in the Java virtual machine's parameter list (after -classic
when running on HotSpot virtual machine).
If you choose the JPDA, you will be asked for a connector type and its
parameters, which depend on your Java VM implementation. The
Java VM supports two types of connectors: Shared Memory Attach (dt_shmem
) and Socket Attach (dt_socket
).
The Shared Memory Attach connector is available only on the Windows platform. If you choose this connector, you must supply a name for the shared memory that is used to communicate with the debugged process.
If you choose the Socket Attach connector, you must supply the host name of the computer that the Java application runs on and the number of the port on which the debugged JVM is listening. The default host name
is the name of the computer that the IDE runs on. You
can obtain the port number by forcing the JVM to use
a port (address=1111) or by reading the port number from the java.exe
output.
When you click OK, the IDE connects to the running virtual machine. You will see threads as if you were debugging locally. If you have source code for the debugged application and you set a breakpoint in the code, the Source Editor will open with the breakpoint line highlighted.
See also | |
---|---|
Attaching the Debugger to a Running Process |