Using SoftBench Debugger

Loading or Rerunning an Executable Program

Loading or Rerunning an Executable Program

When you start SoftBench Debugger by selecting a target in the main SoftBench window, then selecting the "Debug" icon, SoftBench Debugger automatically loads the correct executable file.

To load an executable program into SoftBench Debugger when you are already in SoftBench Debugger, choose "File: Load Executable…". (If SoftBench Debugger already has an executable loaded, you must first unload it by choosing "File: Unload Executable".) A dialog box lets you specify the executable to load and the environment in which you want to run the program. See “Specifying the Runtime Environment” on page 165.

To restart an already-loaded executable program using the same runtime environment, choose "File: Rerun". To restart the program and specify a new runtime environment, choose "File: Rerun…".

See “Debugging After a Program Fails (Core Dump)” on page 217 for information on loading and debugging a core file.

Specifying the Runtime Environment

Ordinarily, the program runs using the default runtime environment. You can specify the runtime environment in the main SoftBench window by choosing "Target: Modify Properties…". The "Execution/Debug Properties" tab of the resulting dialog box lets you set program arguments, I/O redirection, and the working directory. The "Runtime Variables" tab lets you set the program's environment variables. In SoftBench Debugger, choose "Options: Default Load/Rerun Settings…". Both the SoftBench main window and SoftBench Debugger store the runtime environment information for your project targets in the same place.

When you load or rerun an executable, SoftBench Debugger starts the program and pauses at the automatically-created breakpoint on the first line of your main() procedure. It's important to realize that your program is already running at this point, so it's too late to specify program arguments, I/O redirection, and environment variables. SoftBench Debugger provides several ways to run your program that let you control settings before SoftBench Debugger starts your program.

Chapter 7

165

Page 165
Image 165
HP UX SoftBench Software manual Loading or Rerunning an Executable Program, Specifying the Runtime Environment