As mentioned several times, the @err pseudo-register will show the last error value, and @err,hr will show the error as a string (if possible).
According to Andy Pennell, a member of the Visual Studio team, starting with VS 7 (Visual Studio .NET 2002), the use of the @ symbol to indicate pseudo-registers is deprecated - they prefer to use $ (as in $err,hr ). Both $ and @ are currently supported.
You can also use the $ err pseudo-register at a conditional breakpoint; therefore, you can break a line of code only if the last error is nonzero. This can be a very convenient trick.
Some other pseudo-registers that you may find convenient (from John Robbins ' outstanding book Debugging Applications for Microsoft.NET and Microsoft Windows ):
$tib - shows the flow information block$clk - shows the number of hours (useful for synchronization functions). To make it easier to use, put the clock $clk and then the extra clock $clk=0 . The second second will clear the pseudo register after displaying the current value, so the next step or step above you will give you time only for this action. Note that this is an approximate time, which includes a fair bit of debugger overhead, but it can still be very useful.
Michael Burr 01 Oct '08 at 22:19 2008-10-01 22:19
source share