Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: nightlight on December 02, 2010, 12:25:02 am
-
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:
/cygdrive
Restart C::B and the debugger will now work.
-
1. "Cygnus solutions" key has been moved from cygwin 1.7? I only find HKLM\Cygwin after cygwin setup.
-
The solution given above was not enough, you need to create the "cygdrive prefix" value in these two keys:
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2
which, by the way, do not exist (@gamert, you must create both Cygnus Solutions keys...).
I found that here:
http://stackoverflow.com/questions/20477387/cygwin-with-codeblocks-debugger-error
It's three years old, shouldn't those keys be created by default or be configurable somewhere easy to find?
Hopefully I'll remember this after the next install :-/