User forums > Help
"No source file named " problem while debugging
Ramazan Kartal:
Hi,
I have a problem setting breakpoints in my code. Actually I am able to set breakpoints, but debugger does not stop when it reaches the breakpoint, it simply says "No source file named ../Safka/Safka.cpp.".
Details:
I have the following directory structure.
C:\Z
C:\Z\Saf
C:\Z\Safka
I have the following files
C:\Z\Test.workspace
C:\Z\Saf\Saf.cbp
C:\Z\Saf\Saf.cpp
C:\Z\Saf\Saf.h
C:\Z\Safka\Safka.cbp
C:\Z\Safka\Safka.cpp
C:\Z\Safka\Safka.h
Saf.cbp is a console project. Safka.cbp is a static library project. Saf.cpp contains "main" and simply calls a function in Safka.cpp which prints "doThis" on the screen. I set a preakpoint in this function in Safka.cpp and start the debug (F8). Program runs, I can see the "doThis" on the screen, however debugger does not stop on this breakpoint. On debugger(debug) pane, it says:
Setting breakpoints
Debugger name and version: GNU gdb 6.3
No source file named ../Safka/Safka.cpp.
Breakpoint 1 ("../Safka/Safka.cpp:11) pending.
Build log is as follows:
-------------- Build: debug in Safka ---------------
mingw32-g++.exe -g -ggdb -fno-default-inline -fno-inline -fno-inline-functions -finline-limit=0 -g3 -DDEBUG1 -finput-charset=latin5 -I..\K -I..\T -I..\L -IC:\MinGW\include -c Safka.cpp -o debug\Safka.o
ar.exe -rs debug\libSafka.a debug\Safka.o
ar.exe: creating debug\libSafka.a
-------------- Build: debug in Saf ---------------
mingw32-g++.exe -g -ggdb -fno-default-inline -fno-inline -fno-inline-functions -finline-limit=0 -g3 -DDEBUG1 -finput-charset=latin5 -I..\Safka -I..\T -I..\L -I..\K -IC:\MinGW\include -c Saf.cpp -o debug\Saf.o
mingw32-g++.exe -LC:\MinGW\lib -o debug\Saf.exe debug\Saf.o C:\Z\Safka\debug\libSafka.a
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
I am using "svn build rev 3202" dated Nov 10 2006, 16:32:01.
Is this a bug, or am I doing something wrong?
Thanks,
Ramazan Kartal
pbo42:
I have a similar project structure and the same problem (Windows, mingw, gdb-6.3-2).
I played a bit with setting breakpoints and the current directory manually (via Settings->Compiler and Debugger->Debugger settings->Debugger initialization commands (for debugging this is useless, but shows how it could work)) .
The current directory is set correctly with the directory command.
It seems that gdb does not treat a relative path given with dots (../ and similar) correctly for the breakpoint command. If I set the breakpoint with an absolute path, the "No source file named" warning doesn't occur. (Is this true too for linux/unix version of gdb?)
So, if Code::Blocks would generate the gdb breakpoint command with absolute paths, it would work. But I haven't found any setting or condition which could force CB to do this. Any suggestions?
Peter
pbo42:
--- Quote from: pbo42 on November 21, 2006, 10:38:42 am ---I played a bit with setting breakpoints and the current directory manually (via Settings->Compiler and Debugger->Debugger settings->Debugger initialization commands (for debugging this is useless, but shows how it could work)) .
--- End quote ---
:lol: "Debug->Send user command to debugger" is basically the more useful way do that!!
Entering
break "full_path_to_source_file:lineno"
there works for now, but it's not the most comfortable way...
Peter
Phatency:
Could codeblocks actually add all the source directories to begin with? Wouldn't that eliminate the problem? Or are the recursive paths to blame?
I'm still having the same problem with the latest nightly (3253), gdb 6.3 winXP SP2.
--- Code: ---Adding source dir: C:\CodeBlocks\user\ytlp\gen\
Adding source dir: C:\CodeBlocks\user\ytlp\gen\
Adding source dir: C:\CodeBlocks\user\ytlp\graph\
Adding source dir: C:\CodeBlocks\user\ytlp\graph\
Adding source dir: C:\CodeBlocks\user\ytlp\aitest\
Adding source dir: C:\CodeBlocks\user\ytlp\aitest\
Changing directory to: ./bin/
Adding file: .\bin\Debug.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.3
Breakpoint 2 ("../graph/src/scenemngr.cpp:18) pending.
No source file named ../graph/src/scenemngr.cpp.
--- End code ---
All projects are compiled with debugging symbols enabled.
Ramazan Kartal:
Hi,
After experimenting with gdb, I found out that if:
1. You start the gdb using the command line "gdb -nx -readnow -fullname -quiet -args Program.exe"
2. You set the breakpoints for foreign files using the absolute path of filename with forward slashes
then it works.
So I downloaded all the necessary wxWidgets and codeblocks sources, changed sources accordingly and compiled. Now breakpoints work flawlessly, that is no more "No source file named blabla". I just want to test it a little more and if all goes well I will create a patch for applying to cvs sources.
Ramazan Kartal
Navigation
[0] Message Index
[#] Next page
Go to full version