summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/how-to-debug-cygwin.txt
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/how-to-debug-cygwin.txt')
-rw-r--r--winsup/cygwin/how-to-debug-cygwin.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/winsup/cygwin/how-to-debug-cygwin.txt b/winsup/cygwin/how-to-debug-cygwin.txt
index 52e85c30e..100e9ac34 100644
--- a/winsup/cygwin/how-to-debug-cygwin.txt
+++ b/winsup/cygwin/how-to-debug-cygwin.txt
@@ -71,6 +71,19 @@ c:\some\path\bad_program.exe some parameters
After that you can normally step through the code in cygwin1.dll and
bad_program.exe
+ You can also set a CYGWIN_DEBUG variable to force the debugger to pop up
+ only when a certain program is run:
+
+set CYGWIN_DEBUG=cat.exe=gdb.exe
+
+ This will force gdb.exe to start when the program name contains the string
+ "cat.exe". The '=gdb.exe' isn't really needed, since it is the default.
+ It is just there to show how you can specify a program to run when the
+ program starts.
+
+ Note that it bears repeating that both of the above options are *only*
+ available when configuring cygwin with --enable-debugging.
+
6. Heap corruption.
If your program crashes at malloc() or free() or when it references some
malloc()'ed memory, it looks like heap corruption. You can configure and