dflush
Unwinds stack from suspended computations
Format
Removes the top-most suspended expression evaluation
dflush
Removes the computation indicated by a suspended evaluation ID and all those that precede it
dflush susp-eval-id
Removes all suspended computations
dflush -all
Arguments
susp-eval-id
The ID returned or thrown by the
dprint command or which is printed by the
dwhere command.
-all
Flushes all suspended evaluations in the current focus.
Description
The
dflush command unwinds the stack to eliminate frames generated by suspended computations. Typically, these frames can occur when using the
dprint -nowait command. Other possibilities are if an error occurred in a function call in an eval point, in an expression in a
Tools > Evaluate window, or if you use a
$stop function.
Use this command as follows:
• If you don’t use an argument, the CLI unwinds the top-most suspended evaluation in all threads in the current focus.
• If you use a susp-eval-id, the CLI unwinds each stack of all threads in the current focus, flushing all pending computations up to and including the frame associated with the ID.
• If you use the -all option, the CLI flushes all suspended evaluations in all threads in the current focus.
If no evaluations are suspended, the CLI ignores this command. If you do not indicate a focus, the default focus is the thread of interest.
Examples
The following example uses the dprint command to place five suspended routines on the stack. It then uses the dflush command to remove them. This example uses the dflush command in three different ways.
#
# Create 5 suspended functions
#
d1.<> dprint -nowait nothing2(7)
7
Thread 1.1 hit breakpoint 4 at line 310 in "nothing2(int)"
d1.<> dprint -nowait nothing2(8)
8
Thread 1.1 hit breakpoint 4 at line 310 in "nothing2(int)"
d1.<> dprint -nowait nothing2(9)
9
Thread 1.1 hit breakpoint 4 at line 310 in "nothing2(int)"
d1.<> dprint -nowait nothing2(10)
10
Thread 1.1 hit breakpoint 4 at line 310 in "nothing2(int)"
d1.<> dprint -nowait nothing2(11)
11
Thread 1.1 hit breakpoint 4 at line 310 in "nothing2(int)"
...
#
# The top of the call stack looks like:
#
d1.<> dwhere
0 nothing2 PC=0x00012520, FP=0xffbef130 [fork.cxx#310]
1 ***** Eval Function Call (11) ****************
2 nothing2 PC=0x00012520, FP=0xffbef220 [fork.cxx#310]
3 ***** Eval Function Call (10) ****************
4 nothing2 PC=0x00012520, FP=0xffbef310 [fork.cxx#310]
5 ***** Eval Function Call (9) ***************
6 nothing2 PC=0x00012520, FP=0xffbef400 [fork.cxx#310]
7 ***** Eval Function Call (8) ****************
8 nothing2 PC=0x00012520, FP=0xffbef4f0 [fork.cxx#310]
9 ***** Eval Function Call (7) ****************
10 forker PC=0x00013fd8, FP=0xffbef648 [fork.cxx#1120]
11 fork_wrap PC=0x00014780, FP=0xffbef6c8 [fork.cxx#1278]
...
#
# Use the dflush command to remove the last item pushed
# onto the stack. Notice the frame associated with "11"
# is no longer there.
#
d1.<> dflush
d1.<> dwhere
0 nothing2 PC=0x00012520, FP=0xffbef220 [fork.cxx#310]
1 ***** Eval Function Call (10) ****************
2 nothing2 PC=0x00012520, FP=0xffbef310 [fork.cxx#310]
3 ***** Eval Function Call (9) ****************
4 nothing2 PC=0x00012520, FP=0xffbef400 [fork.cxx#310]
5 ***** Eval Function Call (8) ****************
6 nothing2 PC=0x00012520, FP=0xffbef4f0 [fork.cxx#310]
7 ***** Eval Function Call (7) ****************
8 forker PC=0x00013fd8, FP=0xffbef648 [fork.cxx#1120]
9 fork_wrap PC=0x00014780, FP=0xffbef6c8 [fork.cxx#1278]
#
# Use the dflush command with a suspened ID argument to remove
# all frames up to and including the one associated with
# suspended ID 9. This means that IDs 7 and 8 remain.
#
d1.<> dflush 9
# Top of call stack after dflush 9
d1.<> dwhere
0 nothing2 PC=0x00012520, FP=0xffbef400 [fork.cxx#310]
1 ***** Eval Function Call (8) ****************
2 nothing2 PC=0x00012520, FP=0xffbef4f0 [fork.cxx#310]
3 ***** Eval Function Call (7) ****************
4 forker PC=0x00013fd8, FP=0xffbef648 [fork.cxx#1120]
5 fork_wrap PC=0x00014780, FP=0xffbef6c8 [fork.cxx#1278]
#
# Use dflush -all to remove all frames. Only the frames
# associated with the program remain.
#
d1.<> dflush -all
# Top of call stack after dflush -all
d1.<> dwhere
0 forker PC=0x00013fd8, FP=0xffbef648 [fork.cxx#1120]
1 fork_wrap PC=0x00014780, FP=0xffbef6c8 [fork.cxx#1278]