gawk: Breakpoint Control
1
1 14.3.1 Control of Breakpoints
1 -----------------------------
1
1 As we saw earlier, the first thing you probably want to do in a
1 debugging session is to get your breakpoints set up, because your
1 program will otherwise just run as if it was not under the debugger.
1 The commands for controlling breakpoints are:
1
1 'break' [[FILENAME':']N | FUNCTION] ['"EXPRESSION"']
1 'b' [[FILENAME':']N | FUNCTION] ['"EXPRESSION"']
1 Without any argument, set a breakpoint at the next instruction to
1 be executed in the selected stack frame. Arguments can be one of
1 the following:
1
1 N
1 Set a breakpoint at line number N in the current source file.
1
1 FILENAME':'N
1 Set a breakpoint at line number N in source file FILENAME.
1
1 FUNCTION
1 Set a breakpoint at entry to (the first instruction of)
1 function FUNCTION.
1
1 Each breakpoint is assigned a number that can be used to delete it
1 from the breakpoint list using the 'delete' command.
1
1 With a breakpoint, you may also supply a condition. This is an
1 'awk' expression (enclosed in double quotes) that the debugger
1 evaluates whenever the breakpoint is reached. If the condition is
1 true, then the debugger stops execution and prompts for a command.
1 Otherwise, it continues executing the program.
1
1 'clear' [[FILENAME':']N | FUNCTION]
1 Without any argument, delete any breakpoint at the next instruction
1 to be executed in the selected stack frame. If the program stops
1 at a breakpoint, this deletes that breakpoint so that the program
1 does not stop at that location again. Arguments can be one of the
1 following:
1
1 N
1 Delete breakpoint(s) set at line number N in the current
1 source file.
1
1 FILENAME':'N
1 Delete breakpoint(s) set at line number N in source file
1 FILENAME.
1
1 FUNCTION
1 Delete breakpoint(s) set at entry to function FUNCTION.
1
1 'condition' N '"EXPRESSION"'
1 Add a condition to existing breakpoint or watchpoint N. The
1 condition is an 'awk' expression _enclosed in double quotes_ that
1 the debugger evaluates whenever the breakpoint or watchpoint is
1 reached. If the condition is true, then the debugger stops
1 execution and prompts for a command. Otherwise, the debugger
1 continues executing the program. If the condition expression is
1 not specified, any existing condition is removed (i.e., the
1 breakpoint or watchpoint is made unconditional).
1
1 'delete' [N1 N2 ...] [N-M]
1 'd' [N1 N2 ...] [N-M]
1 Delete specified breakpoints or a range of breakpoints. Delete all
1 defined breakpoints if no argument is supplied.
1
1 'disable' [N1 N2 ... | N-M]
1 Disable specified breakpoints or a range of breakpoints. Without
1 any argument, disable all breakpoints.
1
1 'enable' ['del' | 'once'] [N1 N2 ...] [N-M]
1 'e' ['del' | 'once'] [N1 N2 ...] [N-M]
1 Enable specified breakpoints or a range of breakpoints. Without
1 any argument, enable all breakpoints. Optionally, you can specify
1 how to enable the breakpoints:
1
1 'del'
1 Enable the breakpoints temporarily, then delete each one when
1 the program stops at it.
1
1 'once'
1 Enable the breakpoints temporarily, then disable each one when
1 the program stops at it.
1
1 'ignore' N COUNT
1 Ignore breakpoint number N the next COUNT times it is hit.
1
1 'tbreak' [[FILENAME':']N | FUNCTION]
1 't' [[FILENAME':']N | FUNCTION]
1 Set a temporary breakpoint (enabled for only one stop). The
1 arguments are the same as for 'break'.
1