The combo of recent Cygwin versions (1.7+) with C::B has broken gdb plugin support due to changes in Cygwin registry entries. As results the GDB cannot find the source file and one can't use GUI debugging. An example of error message one gets is below:
Debugger name and version: GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Warning: /cygdrive/c/C/exp/cyg/C: No such file or directory.
Warning: /cygdrive/c/C/exp/cyg/C: No such file or directory.
Child process PID: 2560
Cannot open file: C:\C\exp\cyg\\cygdrive\c\C\exp\cyg\main.c
At /cygdrive/c/C/exp/cyg/main.c:60
Checking the debugger plugin source, I noticed a method
GDB_driver::DetectCygwinMount where they check for the presence of Cygwin and obtain the virtual cygdrive prefix from registry. Since cygwin has changed in the latest rev 1.7 its handling of registry (it took everything out), the debugger plugin failed to detect the cygwin and then misbehaved as described above. Looking through older cygwin docs, I found the piece that debugger plugin is missing, put it in the registry by hand and gdb started working correctly.
Here is the fix:
1. Run regedit and locate in registry the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
2. Right click in the right pannel (it's empty since cygwin 1.7) and select New,
then submenu "String value". It will ask you for the
string name - enter:
cygdrive prefix then right click the name to set the
string value as:
/cygdriveRestart C::B and the debugger will now work.