User forums > Using Code::Blocks
Cygwin and Unix Style Paths
thefurlong:
Hello, I am trying to use Cygwin's version of the gdb debugger. However, whenever I set breakpoints, I get the message Cannot open file
C:\FOO\\cygdrive\c\FOO\main.cpp, where FOO is the name of the directory where my source files are located. When I manually use gdb in the Bash shell, as long as I use the path /cygdrive/c/FOO/, it works correctly. From my glib understanding of how Code Blocks uses gdb, it seems to me that gdb is actually able to locate the executable, but Code Blocks is then unable to convert the Unix style path that it returns into the corresponding DOS path. Is there any workaround for this?
Also, I would respectfully ask you not to suggest that I take a look at the Code Blocks source. I am a professional developer, and have already wasted enough time trying to get Cygwin to work with Code Blocks in the first place. Any other advice is welcome. Thank you.
MortenMacFly:
--- Quote from: thefurlong on March 18, 2010, 05:54:18 pm ---Any other advice is welcome. Thank you.
--- End quote ---
Well... you should at least tell what version of C::B/Cygwin/GDB you are using. You may want to try a nightly in case you are using C::B 08/02. There has been a lot development in this area since the 08/02 days...
thefurlong:
Thank you for your response. Sorry about that. I am using C::B version 8.02, Cygwin version 1.7.1-1, and gdb version 6.8-2.
samho5888:
Execuse me.
Did this issue have a solution?
http://forums.codeblocks.org/index.php/topic,2853.0.html seems to have the similar syndrome.
I use Win7, Cygwin-1.7.7, gdb-6.8, C::B r6688
The same simple project is OK by using MinGW.
But I need to use Cygwin and I can compile but can NOT debug well.
The cursor of current debug line can not located to proper position.
Under "Debugger" window, it shows:
--- Code: ---Warning: /cygdrive/c/Temp/new/C: No such file or directory.
Child process PID: 4572
Cannot open file: C:\Temp\new\\cygdrive\c\Temp\new\main.c
At /cygdrive/c/Temp/new/main.c:13
--- End code ---
Under "Debugger (debug)" window, it shows:
--- Code: ---PATH=.;C:\Cygwin\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Tools\TortoiseSVN\bin;C:\Tools\Cppcheck\;C:\ToolsP\GnuWin32\bin
Command-line: C:\cygwin\bin\gdb.exe -nx -fullname -quiet -args bin/Debug/new.exe
Working dir : C:\Temp\new\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
>>>>>>cb_gdb:
> source C:\Tools\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/Temp/new/
Warning: /cygdrive/c/Temp/new/C: No such file or directory.
Warning: /Temp/new: No such file or directory.
>>>>>>cb_gdb:
> break "C:/Temp/new/main.c:13"
Breakpoint 1 at 0x4011cb: file C:/Temp/new/main.c, line 13.
>>>>>>cb_gdb:
> run
Error: dll starting at 0x77870000 not found.
Error: dll starting at 0x758d0000 not found.
Error: dll starting at 0x77870000 not found.
Error: dll starting at 0x77990000 not found.
gdb: win32_init_thread_list
[New thread 4572.0xce8]
[New thread 4572.0x1bc8]
Breakpoint 1, main () at C:/Temp/new/main.c:13
/cygdrive/c/Temp/new/main.c:13:159:beg:0x4011cb
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
--- End code ---
Could anyone kindly give me some hints?
Thanks.
nightlight:
I am getting the same problem with cygwin gdb. Here is the debugger window dump:
--- Quote ---Debug
Adding source dir: C:\C\exp\cyg\
Adding source dir: C:\C\exp\cyg\
Adding source dir: C:\
Adding file: cyg.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
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
--- End quote ---
It seems the debugger concatenated the /cygdrive/.. path (green color) with the same path in Windows format (red color). I have checked command line to gdb (with process viewer) and that line doesn't have any paths or file items, so the paths and file names are being passed to gdb some other way. Has someone found a workaround for this problem?
Navigation
[0] Message Index
[#] Next page
Go to full version