Exceptions and the Debugger

The Microsoft Visual Studio debugger has fantastic support for debugging exceptions. When a process’ thread raises an exception, the operating system immediately notifies a debugger (if a debugger is attached). This notification is called a first-chance notification. Normally, the debugger responds to a first-chance notification by telling the thread to search for exception filters. If all the exception filters return EXCEPTION_CONTINUE_SEARCH, the operating system notifies the debugger again with a last-chance notification. These two notifications exist to give the software developer more control over debugging an exception.

On a per-solution basis, you use the debugger’s Exceptions dialog box (shown next) to tell the ...

Get Windows® via C/C++, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.