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>]
(sdb) b CountAllLines o 0
Set + 0 Breakpoint CountAllLines o 0 stopped:falseThis 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)
- Plus sign that indicates the breakpoint is enabled
- Operator name, port type (
ifor input,ofor output), port index - Current conditions such as
stopped:trueto indicate that the breakpoint is stopped anddropped:falseto indicate that the current tuple is not dropped from the flow.
- Field name, as in
wcs. - Field value, as in
{words=229,chars=2111}. - Field type, as in
tuple<int32 words,int32 chars>.