Author Topic: Uniwin and Codeblocks not finding source file.  (Read 6299 times)

Offline rrobinson

  • Single posting newcomer
  • *
  • Posts: 2
Uniwin and Codeblocks not finding source file.
« on: February 08, 2010, 07:48:00 am »
After reading everything I could find in the forums, the Wiki I have this working.
I am using the patched version of gdb found in one forum post.

The only issue is when I debug I get this error in the debugger log:
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c

and even though the breakpoints and watches work the correct file isn't switched to and the current line is
not highlighted. I can live without these things but it would be nice to have it all working.

What did I miss?

full debug log:
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: Z:\Itpdx\StoreCommand\sc_import\
Adding source dir: Z:\Itpdx\StoreCommand\sc_import\
Adding source dir: Z:\Itpdx\StoreCommand\sc_import\
Adding file: bin\Debug\ximpi.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 Fedora (6.8-37.el5)
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/main.c:45
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/main.c:46
Continuing...
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:91
Cannot open file: Z:\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:92
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:96
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:97
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/main.c:76
Continuing...
Program exited normally.
Debugger finished with status 0

Thanks
« Last Edit: February 08, 2010, 07:53:05 am by rrobinson »

Offline rrobinson

  • Single posting newcomer
  • *
  • Posts: 2
Re: Uniwin and Codeblocks not finding source file.
« Reply #1 on: February 09, 2010, 04:01:45 am »
After further research I think it has to do with the compiler flag force forward slashes.
I have created a new compiler as described in the wiki and I have the flag checked.
I verified the default.conf xml file has the flag set.

I also downloaded the nightly build and tried it there, same result.

Code
<gnu_gcc_uniwin>
<NAME>
<str>
<![CDATA[GNU GCC (Uniwin)]]>
</str>
</NAME>
<PARENT>
<str>
<![CDATA[gcc]]>
</str>
</PARENT>
<MASTER_PATH>
<str>
<![CDATA[W:\Uniwin]]>
</str>
</MASTER_PATH>
<C_COMPILER>
<str>
<![CDATA[gcc.exe]]>
</str>
</C_COMPILER>
<CPP_COMPILER>
<str>
<![CDATA[g++.exe]]>
</str>
</CPP_COMPILER>
<LINKER>
<str>
<![CDATA[g++.exe]]>
</str>
</LINKER>
<MAKE>
<str>
<![CDATA[make.exe]]>
</str>
</MAKE>
<switches>
<FORCEFWDSLASHES bool="1" />
</switches>
</gnu_gcc_uniwin>

tarredondo

  • Guest
gdb and Codeblocks (XP, Cygwin) not finding source file.
« Reply #2 on: March 20, 2010, 04:24:25 am »

...commented out...

The only issue is when I debug I get this error in the debugger log:
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c

and even though the breakpoints and watches work the correct file isn't switched to and the current line is
not highlighted. I can live without these things but it would be nice to have it all working.

What did I miss?

full debug log:
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: Z:\Itpdx\StoreCommand\sc_import\
Adding source dir: Z:\Itpdx\StoreCommand\sc_import\
Adding source dir: Z:\Itpdx\StoreCommand\sc_import\
Adding file: bin\Debug\ximpi.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 Fedora (6.8-37.el5)
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/main.c:45
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/main.c:46
Continuing...
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:91
Cannot open file: Z:\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:92
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:96
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\logger.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/logger.c:97
Cannot open file: Z:\Itpdx\StoreCommand\sc_import\->->\cygdrive\Z\Itpdx\StoreCommand\sc_import\main.c
At ->->/cygdrive/Z/Itpdx/StoreCommand/sc_import/main.c:76
Continuing...
Program exited normally.
Debugger finished with status 0

Thanks

***********************************
I see a similar thing in a win XP, C::B 8.02, wx2.8.7 (windows, unicode), using cygwin g++/gdb. To get to compile I set in the toolchain configuration g++-3.exe as the compiler/linker because it could not use the 1KB g++.exe file that was installed by cygwin. All the rest is the same as the GNU GCC Configuration. Also this configuration works OK in Win Vista.

I am building the hello world C++ console app, builds fine but when debugging gdb can't open the source files.  I read another post about in the advanced configurations for gdb to use full path and it is turned on (I also tried with it off same error).

I get the following errors (sorry for the project name...  :-) Any help appreciated!

Thx, Tomas

CONSOLE LOGS FOLLOW:

-------------- Build: Debug in terd ---------------
[ 50.0%] g++-3.exe -Wall -fexceptions  -g  -Wall -g    -c C:\cygwin\home\Tomas\terd\main.cpp -o obj\Debug\main.o
[100.0%] g++-3.exe  -o bin\Debug\terd.exe obj\Debug\main.o   
Output size is 599.43 KB
Process terminated with status 0 (0 minutes, 8 seconds)
0 errors, 0 warnings

---------------Debugger -------------------------
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\cygwin\home\Tomas\terd\
Adding source dir: C:\cygwin\home\Tomas\terd\
Adding file: bin\Debug\terd.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)
Child process PID: 2916
Cannot open file: C:\cygwin\home\Tomas\terd\->->\cygdrive\c\cygwin\home\Tomas\terd\main.cpp
At ->->/cygdrive/c/cygwin/home/Tomas/terd/main.cpp:7

------------Debugger (debug) log-----------------------------------
> run
gdb: win32_init_thread_list
[New thread 2916.0xaa4]
[New thread 2916.0xde8]
Breakpoint 1, main () at C:\cygwin\home\Tomas\terd\main.cpp:7
->->/cygdrive/c/cygwin/home/Tomas/terd/main.cpp:7:62:beg:0x40116a
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:

Alex32768

  • Guest
Re: Uniwin and Codeblocks not finding source file.
« Reply #3 on: August 06, 2010, 12:40:09 pm »
I've got the  the same symptoms during the debugging stage for cygwin gcc/gdb (1.7.5) (current line is
not highlighted and the message Cannot open file: ........ for each step). After looking for something about the debug process with the cygwin plugin in the source code of C::B, I found that my Win XP registry is very poor regarding the cygwin settings. Using previous versrion of cygwin  and properly working debugging in C::B, I  got the difference in the registry.

This is the export from the registry regarding the cygwin settings for properly working C::B & Cygwin

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin]

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"
"cygdrive flags"=dword:00000022

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/]
"native"="C:\\cygwin\\"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin]
"native"="C:\\cygwin\\/bin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib]
"native"="C:\\cygwin\\/lib"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options]


Some lines from Cygwin documentation ( http://cygwin.com/cygwin-ug-net/ov-new1.7.html#ov-new1.7.5 ):

“File Access related changes
Mount points are no longer stored in the registry. Use /etc/fstab and /etc/fstab.d/$USER instead. Mount points created with mount(1) are only local to the current session and disappear when the last Cygwin process in the session exits.”

“Cygwin creates the mount points for /, /usr/bin, and /usr/lib automatically from it's own position on the disk. They don't have to be specified in /etc/fstab.“

So, we need to add the registry entries manually for normal working debug process in C::B & and Cygwin 1.7.5. I've tested this solution for C::B 8.02 and 10.05 both work fine
« Last Edit: August 08, 2010, 06:43:03 am by Alex32768 »