Running a Program Under Debugger Control

You can tell the debugger to create a process or to attach to an existing process.

After you specify the program (either on the shell command line or by using the load (dbx) or file (gdb) command), but before you have requested the debugger to create the process, you can still do things that seem to require a running process; for example, you can create breakpoints and examine sources. Any breakpoints that you create will be inserted into the process as soon as possible after it executes your program.

To have the debugger create a process (rather than attach to an existing process), you request it to run, specifying, if necessary, any arguments and input and output redirection as follows:

% idb a.out

Intel(R) Debugger for ..., Version ..., Build ...

...Preparing the Compiler and Linker Environment>

(idb) run

 

or

(idb) run arguments

 

or

(idb) run arguments > output-file

 

or

(idb) run arguments < input-file > output-file

 

The result of using any of the preceding command variations is similar to having attached to a running process.

DBX Mode

The rerun command repeats the previous run command with the same arguments and file redirection.

GDB Mode

The run command without arguments repeats the previous run (with the same arguments, input and output redirections).

r is a shortcut for the run command.