gdb supports native debugging of MS Windows programs, including DLLs with and without symbolic debugging information.
MS-Windows programs that call
SetConsoleMode to switch off the
special meaning of the ‘Ctrl-C’ keystroke cannot be interrupted
by typing C-c. For this reason, gdb on MS-Windows
supports C-<BREAK> as an alternative interrupt key
sequence, which can be used to interrupt the debuggee even if it
There are various additional Cygwin-specific commands, described in this section. Working with DLLs that have no debugging symbols is described in Non-debug DLL Symbols.
info w32 selector
GetThreadSelectorEntryfunction. It takes an optional argument that is evaluated to a long value to give the information about this given selector. Without argument, this command displays information about the six segment registers.
info w32 thread-information-block
$fsselector for 32-bit programs and
$gsfor 64-bit programs).
To use it, create or edit the following keys in
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug and/or
(for x86_64 versions):
Debugger(REG_SZ) — a command to launch the debugger. Suggested command is: fully-qualified-path-to-gdb.exe
-ex "attach %ld" -ex "signal-event %ld" -ex "continue".
%ld will be replaced by the process ID of the
crashing process, the second
%ld will be replaced by the ID of
the event that blocks the crashing process, waiting for gdb
Auto(REG_SZ) — either
1will make the system run debugger specified by the Debugger key automatically,
0will cause a dialog box with “OK” and “Cancel” buttons to appear, which allows the user to either terminate the crashing process (OK) or debug it (Cancel).
on, gdb will break on exceptions that happen inside the Cygwin DLL. If mode is
off, gdb will delay recognition of exceptions, and may ignore some exceptions which seem to be caused by internal Cygwin DLL “bookkeeping”. This option is meant primarily for debugging the Cygwin DLL itself; the default value is
offto avoid annoying gdb users with false
onthe debuggee will be started in a new console on next start. If mode is
off, the debuggee will be started in the same console as the debugger.