|
|
The r command is used to begin program execution. It restarts the program as if it were invoked from the shell.
*r argsThe above command runs the program with the given arguments as if they had been typed on the shell command line. If no arguments are specified, then the arguments from the last execution of the program within sdb are used. To run a program with no arguments, use the R command.
After the program is started, execution continues until a breakpoint is encountered, a signal such as INTERRUPT or QUIT occurs, or the program terminates. In all cases, after an appropriate message is printed, control returns to the user.
The c command may be used to continue execution of a stopped program. A line number may be specified, for example:
*proc:12cThis places a temporary breakpoint at the named line. The breakpoint is deleted when the c command finishes. There is also a C command that continues but passes the signal that stopped the program back to the program.
*17 gWill continue at line 17 of the current function. One use for this command is to avoid executing a section of code that is known to be bad. The user should not attempt to continue execution in a function different from that of the breakpoint.
The s command is used to run the program for a single statement. It is useful for slowly executing the program to examine its behavior in detail. An important alternative is the S command. This command is like the s command but does not stop within called functions. It is often used when you are confident that the called function works correctly but are interested in testing the calling routine.
The i command is used to run the program, one machine-level instruction at a time, while ignoring the signal that stopped the program. Its uses are similar to the s command. There is also an I command that causes the program to execute one machine-level instruction at a time, but also passes the signal that stopped the program back to the program.