Table of Contents
Exceptions debugging
WinGDB utilizes GDB catchpoints for exceptions debugging. At the moment WinGDB does support
C/C++ exceptions only.
Using the Exceptions dialog
Current WinGDB versions use standard Visual Studio Exceptions dialog (available
from Debug menu) to configure exception handling by the debugger. This is available
for all Visual Studio versions above 2005. For Visual Studio 2005, see the legacy configuration
chapter below.
The Exceptions dialog can be used to configure exception handling for various languages
and platforms. WinGDB adds its own entries to the available ones. The dialog looks like this:
To access WinGDB options, scroll down the list and find catetories starting with WinGDB:
-
WinGDB common exceptions and events: various generic exceptions and events
which are detectable by GDB. Here you can specify a generic catch/throw/rethrow handler
working for any exception type. Also calls to exec and fork can be
intercepted. Some of these options require recent version of GDB. Catch and throw
should work with almost any GDB, Exec and Fork require at least 6.8, Syscalls 7.0,
where Rethrow is supported by GDB 7.7 or newer. Note that in any case you need to
check the button in the Thrown column, regardless of the fact that this
can be a Catch, Rethrow or other handler. This is because the dialog in Visual Studio
does not allow to add custom columns. Just think of the button as of generic
enabling button. Also don't mind the numbers before event names, those are
exception codes which are used internally.
-
WinGDB filtered thrown exceptions: here you can specify your own exception classes
to be handled when thrown. Click Add button to add a new name, then select appropriate
category and enter C++ class name. The name can be qualified with namespace names.
Do not forget to check the Thrown button, as by default the handler is disabled.
This option (and all ones listed below) requires GDB 7.7 or newer.
-
WinGDB filtered caught exceptions: similar as above, but for caught exceptions.
Do not forget to check the Thrown button (which means 'enable' here), as by default
the handler is disabled.
-
WinGDB filtered rethrown exceptions: similar as above, but for rethrown exceptions.
Do not forget to check the Thrown button (which means 'enable' here), as by default
the handler is disabled.
-
WinGDB filtered raised syscalls: similar as above, but for Linux system calls
rather than exceptions. Enter a syscall name instead of C++ exception name.
Do not forget to check the Thrown button (which means 'enable' here), as by default
the handler is disabled.
In case of custom exceptions and syscalls, you can also delete items from the list
using the Delete button.
Caution: if you use the Project mode, your custom exception configuration
will be saved by Visual Studio to the suo file, so that you do not need
to specify it again during next session. However, in Quick mode there is no
suo file and the exception state will not be saved.
Legacy configuration
For Visual Studio 2005 (for which Exceptions dialog extensibility is not supported),
you can still use the old method, involving the Exceptions menu. This menu
is available only under VS 2005. Use the Exceptions dialog when working with
Visual Studio 2008 and above.
To configure exceptions debugging this way, use options in submenu Exceptions which
is available in main WinGDB menu.
- To break execution when an exception is caught enable Break when caught
- To break execution when an exception is thrown enable Break when thrown
If debugger doesn't support catchpoints or debugged program hasn't been built with exceptions support, then
options regarding exceptions will be disabled.
Table of Contents
Copyright (C) 2008-2019 SOFT-ERG. All rights reserved.