Next: , Previous: Breakpoint Control, Up: List of Debugger Commands


14.3.2 Control of Execution

Now that your breakpoints are ready, you can start running the program and observing its behavior. There are more commands for controlling execution of the program than we saw in our earlier example:

commands [n]
silent
...
end
Set a list of commands to be executed upon stopping at a breakpoint or watchpoint. n is the breakpoint or watchpoint number. Without a number, the last one set is used. The actual commands follow, starting on the next line, and terminated by the end command. If the command silent is in the list, the usual messages about stopping at a breakpoint and the source line are not printed. Any command in the list that resumes execution (e.g., continue) terminates the list (an implicit end), and subsequent commands are ignored. For example:
          gawk> commands
          > silent
          > printf "A silent breakpoint; i = %d\n", i
          > info locals
          > set i = 10
          > continue
          > end
          gawk>


continue [count]
c [count]
Resume program execution. If continued from a breakpoint and count is specified, ignores the breakpoint at that location the next count times before stopping.


finish
Execute until the selected stack frame returns. Print the returned value.


next [count]
n [count]
Continue execution to the next source line, stepping over function calls. The argument count controls how many times to repeat the action, as in step.


nexti [count]
ni [count]
Execute one (or count) instruction(s), stepping over function calls.


return [value]
Cancel execution of a function call. If value (either a string or a number) is specified, it is used as the function's return value. If used in a frame other than the innermost one (the currently executing function, i.e., frame number 0), discard all inner frames in addition to the selected one, and the caller of that frame becomes the innermost frame.


run
r
Start/restart execution of the program. When restarting, the debugger retains the current breakpoints, watchpoints, command history, automatic display variables, and debugger options.


step [count]
s [count]
Continue execution until control reaches a different source line in the current stack frame. step steps inside any function called within the line. If the argument count is supplied, steps that many times before stopping, unless it encounters a breakpoint or watchpoint.


stepi [count]
si [count]
Execute one (or count) instruction(s), stepping inside function calls. (For illustration of what is meant by an “instruction” in gawk, see the output shown under dump in Miscellaneous Debugger Commands.)


until [[filename:]n | function]
u [[filename:]n | function]
Without any argument, continue execution until a line past the current line in current stack frame is reached. With an argument, continue execution until the specified location is reached, or the current stack frame returns.