HPlogo HP WDB-GUI Reference Manual: HP-UX 11i v2 > Chapter 3 Debugging with WDB GUI

Starting and Stopping the Debug Process

» 

Technical documentation

Complete book in PDF

 » Table of Contents

You can use the commands in this section to control the execution of your program in the debugger. The Go and Restart options provide two ways to start the debugging process. For example, you may need to restart the debugging process as you use breakpoints to isolate problems in your program.

Stop Debugging offers a way to stop execution and enable loading of a new executable. If the debugger is attached to an existing process, Stop Debugging detaches the process. The Break Execution option allows you to interrupt the program while it is executing, which is helpful when you have not set breakpoints or cannot run to the cursor interactively. For example, you can use Break Execution to stop execution in an infinite loop.

Starting the debug process (Go)

The Go option starts program execution or continues execution from the location of the program counter.

To start debugging

  1. On the Debug menu, click Go.

  2. Or, click the Go button in the toolbar:

Restarting the debug process (Restart)

The Restart command resets execution to the beginning of the program being debugged. It uses the current program arguments and environment variables settings. The debugger pauses at the program’s entry point, and clears and initializes the Watch, Local Variables, and Call Stack views.

If the debugger is attached to an existing process, Restart detaches the process and starts a new process.

To restart the debug process

  1. On the Debug menu, click Restart.

  2. Or, click the Restart button in the toolbar:

Stopping a debug session

The Stop Debugging command stops executing the current program and enables loading of a new executable. The program is still loaded in the debugger, but no process is running. All views except the Source view are cleared and initialized.

If the debugger is attached to an existing process, Stop Debugging detaches the process. After it is detached, the process continues running independently and WDB no longer has any control of the process.

To stop a debug session

  1. On the Debug menu, click Stop Debugging.

  2. Or, click the Stop Debugging button in the toolbar:

Pausing program execution

The Break Executioncommand pauses execution of the program running in the debugger. Once the program is paused, you can continue debugging as if you had encountered a breakpoint at that location.

To pause program execution

  1. On the Debug menu, click Break Execution.

  2. Or, click the Break Execution button in the toolbar:

Tips:

Changing any debug settings will cause your executable to restart.

© 2004-2005 Hewlett-Packard Development Company, L.P.