Oracle® Solaris Studio 12.4: dbxtool Tutorial

Exit Print View

Updated: October 2014

Step 11: Verifying the Diagnosis by Popping the Stack

One way to double-check that you indeed went through the else block of the function would be to set a breakpoint on checkThings() and run the program. But checkThings() might be called many times. You can use breakpoint counts or bounded breakpoints to get to the right invocation of checkThings(), but a quicker way to replay what was recently executed is to pop the stack.

  1. Choose Debug → Stack → Pop Topmost Call.

    Notice the Pop Topmost Call does not undo everything. In particular, the value of err_silent is already wrong because you are switching from data debugging to control flow debugging.

    The process state reverts to the beginning of the line containing the call to checkThings().

  2. Click Step Into image:Step Into button . and observe as checkThings() is called again.

    As you step through checkThings(), you can verify that the process executes the if block where err_silent is not incremented and then is decremented to -1.

image:Editor window showing program stopped in if section of                                     checkThings( )

Although you appear to have found the programming error, you might want to triple check it.