Oracle® Solaris Studio 12.4: dbxtool Tutorial

Exit Print View

Updated: October 2014
 
 

Step 8: Narrowing Down the Cause

Use balloon evaluation to inspect err_silent again. Now it is -1. The most likely cause is one err_silent-- too many, or one err_silent++ too few, being executed before you got to printField().

You can locate this mismatched pair of err_silents in a small program like this example by careful code inspection. However, a large program might contain numerous pairings of the following:

err_silent++;
err_silent--;

A quicker way to locate the mismatched pair is by using watchpoints.

The cause of the error might not be a mismatched set of err_silent++; and err_silent--; at all, but a rogue pointer overwriting the contents of err_silent. Watchpoints would be more effective in catching such a problem.