Remote Debugging

See Also

Remote debugging is the process of debugging a program that is running on a different computer. This technique is useful when you are developing a program that runs on a server or in a different environment than the computer on which you are developing the program. This method can be used even for programs running on the same machine as the debugger, which is useful if that program has a complex startup procedure.

Attaching to a remote debuggee is performed by way of the attach dialog. This dialog prompts you for a few pieces of information, some of which will have default values if the fields are left blank.

You can open the dialog box by choosing Session > Attach.

To start remote debugging:

Attaching

  1. On the computer where program is located, start the program in debugging mode. See your VM documentation for instructions on starting a program in debugging mode. For the Sun Microsystems Java Virtual Machine, the options can be found at:
    http://java.sun.com/products/jpda/doc/conninv.html
  2. In the Attach dialog, select the connector type and enter any required information, then click Attach. See your VM documentation for information about the connectors it provides.

Listening

Listening for a connection from a debuggee differs in that the debugger starts listening for a connection from the debuggee, which must occur before the debuggee has been launched.

  1. In the Attach dialog, select the connector type and enter any required information, then click Attach. See your VM documentation for information about the connectors it provides.
  2. On the computer where program is located, start the program in debugging mode. See your VM documentation for instructions on starting a program in debugging mode. For the Sun Microsystems Java Virtual Machine, the options can be found at:
    http://java.sun.com/products/jpda/doc/conninv.html

Note that if the debuggee is not launched within the timeout period defined in the Options dialog, the debugger will cease listening for a connection. A progress bar is displayed to indicate that the debugger is waiting. The listen operation can be cancelled by clicking on the progress bar and clicking the close button.

Options

Resume immediately
If checked, the debugger will instruct the debuggee to resume execution as soon as a connection is established.
Ignore debuggee classpath
If checked, the debugger will use the value for "Classes" in the session settings, rather than the classpath defined by the JVM running the debuggee application.

What to do next

After attaching to the debuggee, you are ready to begin debugging by setting breakpoints and stepping through your code.

Note that the classpath session setting will temporarily take on the value of the classpath setting in the debuggee. To learn more about the classpath and how it is used, see the Classpath and Sourcepath topic.

See Also


Legal Notices