Debugger

The JDT includes a debugger that enables you to detect and diagnose errors in your programs running either locally or remotely.

The debugger allows you to control the execution of your program by setting breakpoints, suspending launches, stepping through your code, and examining the contents of variables.

The debugger has a client/server design so you can debug programs running remotely on other systems in the network as well as programs running locally on your workstation. The debugger server runs on the same system as the program you want to debug, which can be on your workstation (local debugging) or a system that is accessible through a network (remote debugging).

Breakpoints

Breakpoints are temporary markers you place in your program to tell the debugger to stop your program at a given point. When the workbench is running a program and encounters a breakpoint, it suspends execution. The corresponding thread is suspended (i.e., temporarily stops running) so that you can see the stack for the thread.

Execution suspends at the breakpoint before the statement is executed. You can check the contents of variables and the stack. You can then step over statements, step into other methods or classes, continue running until the next breakpoint is reached, or continue running until you reach the end of the program.

You can disable a breakpoint so that it does not suspend execution and then, later, enable it again.

Remote Debugging

Remote debugging allows you to run an application on one system and debug the application on another system. The local system runs the debugger, and the remote system runs both the debugging engine and your program.

Connection

The main requirement for remote debugging is access to remote machines where the files you are debugging must reside. When debugging a program remotely, a debug engine daemon begins listening for a connection. Once a connection is made, you can begin to debug your program.

Why Use Remote Debugging?

Remote debugging can prove useful in any number of situations, such as: