Using SoftBench Debugger

Interrupting a Running Program

Interrupting a Running Program

When the PC Location is "Running…", your program has control, and you cannot interact with the debugger. You may want to interrupt your program so you can regain control of the debugger.

Instances when you might want to interrupt a running program include:

Your program hangs in some internal loop.

Your program did not arrive at breakpoints as planned.

Your program is waiting in an input statement (such as scanf), and you want to set a breakpoint, or Continue Out after you enter the data.

It appears that something is going very wrong with some internal state.

In these cases and many more, the PC Location shows "Running…" and displays a small "clock" animation. You can interact with the program only under the program's control. SoftBench Debugger queues any commands (except commands that restart, kill, or unload your program) until your program returns control to the debugger. Selecting Interrupt Program discards any queued commands and returns control to SoftBench Debugger.

If you interrupt your program while it executes code that was compiled with the debug options on, you can continue working just as if you had encountered a breakpoint at that location. A PC arrow appears in the Annotation Margin and the source for the code is displayed. At this point the PC Location shows a valid location and you can enter debugger commands.

Interrupting in System or Non-debuggable Routines

If you interrupt the program while it executes some system-supplied routine (kernel code), or any other routine that was compiled without debug options on, the PC Location may consist of a "virtual" address.

SoftBench Debugger clears the Editable Source Area to indicate that no source is available. You cannot examine local variables or step through statements. You can only step by assembly instructions, and examine other procedures on the call stack.

You can run the nondebuggable routine until it reaches the point where

172

Chapter 7

Page 172
Image 172
HP UX SoftBench Software manual Interrupting a Running Program, Interrupting in System or Non-debuggable Routines, 172