gawk: Debugger Execution Control
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, ignore 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, stepping 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 the current stack frame is reached. With an
argument, continue execution until the specified location is
reached, or the current stack frame returns.