Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: whitebloodcell on September 08, 2014, 07:49:21 pm

Title: gdb cannot open file error
Post by: whitebloodcell on September 08, 2014, 07:49:21 pm
Depending on which file I place a breakpoint in or in which file it first encounters a segmentation or arithmetic fault, gdb reports that it is unable to open that file. The log is below. It is a matter of urgency (thesis due today) that I figure this out and so far searching online has turned up nothing.

I changed to using the cygwin gdb from mingw included one as the mingw one was suddenly giving me a different error which I also could not resolve.

Code
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: H:\SkyDrive\Development\HotHandByChance\
Adding source dir: H:\SkyDrive\Development\HotHandByChance\
Adding file: H:\SkyDrive\Development\HotHandByChance\bin\Debug\HotHandByChance.exe
Changing directory to: H:/SkyDrive/Development/HotHandByChance/.
Set variable: PATH=.;C:\boost_1_55_0\stage\lib;C:\cygwin64\bin;C:\cygwin64;C:\MinGW\bin;C:\MinGW;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Calibre2;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\Program Files\MATLAB\R2013a\runtime\win64;C:\Program Files\MATLAB\R2013a\bin;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files (x86)\PDFtk\bin;C:\Program Files (x86)\QuickTime\QTSystem;C;C:\Program Files\Java\jdk1.7.0_51\bin;C:\Program Files\Java\jre7\bin;C:\ADT\sdk\platform-tools;C:\MinGW\msys\1.0\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\DTN\IQFeed
Starting debugger: C:\cygwin64\bin\gdb.exe -nx -fullname  -quiet  -args H:/SkyDrive/Development/HotHandByChance/bin/Debug/HotHandByChance.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.8
Child process PID: 13752
Cannot open file: /cygdrive/h/SkyDrive/Development/HotHandByChance/main.cpp
At /cygdrive/h/SkyDrive/Development/HotHandByChance/main.cpp:63
Title: Re: gdb cannot open file error
Post by: stahta01 on September 09, 2014, 05:33:59 am
Quote
Code
Set variable: PATH=.;C:\boost_1_55_0\stage\lib;C:\cygwin64\bin;C:\cygwin64;C:\MinGW\bin;C:\MinGW;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Calibre2;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\Program Files\MATLAB\R2013a\runtime\win64;C:\Program Files\MATLAB\R2013a\bin;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files (x86)\PDFtk\bin;C:\Program Files (x86)\QuickTime\QTSystem;C;C:\Program Files\Java\jdk1.7.0_51\bin;C:\Program Files\Java\jre7\bin;C:\ADT\sdk\platform-tools;C:\MinGW\msys\1.0\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\DTN\IQFeed

I find that having multiple Copies of MinGW GCC in the system path to cause issues with running MinGW GCC.
I also find that having Cygwin or MSys GCC in the system path causes weird errors when running MinGW GCC.
No idea whether having MinGW GCC or MSys GCC in the system path causes issues using Cygwin GCC.

I have no idea if Cygwin gdb works well or at all in the current CB Release or Nightly.

For speed it might be faster getting MinGW GCC gdb working; but, I do NOT use the debugger much in Code::Blocks so not likely going to be able to help you.

Tim S.
Title: Re: gdb cannot open file error
Post by: Jenna on September 09, 2014, 07:11:23 am
My guess is, that it is Code::Blocks that can not handle the cygqin-path to the file and therefore cannot open it.

I suggest using the MinGWgdb, turn on debuggers "Full (debug) log" (in "Settings -> Debugger -> Common") and try to fix the issue you get here.

And as usual:
post some more information on your system: Code::Blocks version, OS/version, Compiler/version and debugger/version.
Title: Re: gdb cannot open file error
Post by: oBFusCATed on September 09, 2014, 07:07:40 pm
I think this is the long standing cygwin issue I have no time to fix...
Title: Re: gdb cannot open file error
Post by: Nightlane on September 20, 2014, 08:29:20 pm
Based on http://stackoverflow.com/questions/18559506/codeblocks-gdb-cannot-open-file-error

Those are the content of 4 files which contains exported register keys. Should work with the first 2 as I have tested.

I imagine it is a problem of using old register keys.


Quote
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"

Quote
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"

Just in the case it is needed.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"