Sun Studio 12 Update 1: Debugging a Program With dbx

Setting a when Breakpoint at a Line

A when breakpoint command accepts other dbx commands such as list, letting you write your own version of trace.

(dbx) when at 123 {list $lineno;}

The when command operates with an implied cont command. In the example above, after listing the source code at the current line, the program continues executing. If you included a stop command after the list command, the program would not continue executing.

For the complete syntax of the when command, see when Command. For detailed information on event modifiers, see Event Specification Modifiers.