Suspending execution with breakpoints

You set a breakpoint with the Streams Debugger to suspend execution of your application.

A breakpoint is set with the following command:

b <operator-name> (i|o) (<port-index> | *) [d] [p <predicate>]
For example:
(sdb) b CountAllLines o 0
    Set + 0 Breakpoint CountAllLines o 0 stopped:false

This command establishes a breakpoint on the output port (o) identified with port index zero (0) for operator CountAllLines. The output from the command indicates that the breakpoint is set. The plus sign indicates that the breakpoint is enabled, the number zero (0) following the plus sign is the breakpoint identifier. The output also indicates that application is not currently stopped at the breakpoint.

You can use the optional d parameter to define a breakpoint that is initially disabled. While a breakpoint is disabled, it does not suspend execution when tuples arrive at its associated port.

You can use the optional p parameter to provide an SPL expression that is used as a predicate to conditionally suspend execution of the breakpoint.

When a breakpoint suspends thread execution due to the arrival of a tuple or punctuation at a port, the breakpoint and tuple or punctuation information is written to the console as shown here.

(sdb)
   + 0 Breakpoint CountAllLines o 0 dropped:false
   stopped:true
   lines, 47, int32
   wcs, {words=229,chars=2111}, tuple<int32 words,int32 chars>
(sdb)

The first line of output identifies the currently stopped breakpoint and includes the following parts.
  • Plus sign that indicates the breakpoint is enabled
  • Operator name, port type (i for input, o for output), port index
  • Current conditions such as stopped:true to indicate that the breakpoint is stopped and dropped:false to indicate that the current tuple is not dropped from the flow.
The remaining lines show the contents of the tuple for the currently stopped breakpoint. There is one line for each top-level tuple attribute value that shows:
  • Field name, as in wcs.
  • Field value, as in {words=229,chars=2111}.
  • Field type, as in tuple<int32 words,int32 chars>.