News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

"No source file named " problem while debugging

Started by Ramazan Kartal, November 15, 2006, 04:26:46 PM

Previous topic - Next topic

Eremit

Hi all,

I got the same problem.
I use v8.02 on Ubuntu 9.10.

Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.0-ubuntu
No source file named /home/<removed>/src/test/test.cpp.
Temporary breakpoint 1 ("/home/<removed>/src/test/test.cpp:5) pending.
Program exited normally.
Debugger finished with status 0


It's a custom makefile project, created from cmake files.
I checked it and the file exists.

Any ideas?

fiesch

absolutely the same here, custom makefile, file exists
c::B 8.02 (Apr 19/09)
running on ubuntu

note: "File exists" refers to the file the breakpoint is in and which gdb states it can't find, it's given in the output as a absolute path

Eremit

So I guess it is likely that this is a bug in codeblocks and not in the cmake project file generator.

Correct? - If yes I will file a bug.

fiesch

As mine is a self-managed makefile i would guess so, yes.
That is if i understood you correctly.

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

fiesch

a quite short answer ;)

all i can safely identify is a error message from gdb about an non-existing file which exists in exactly that spot.
I already 777'ed the whole file structure to eliminate a error source to no avail.

I can, however, not say if this is a gdb problem or a C::B Problem, as i haven't had the time yet to probe around on the issue.
I do see the same pattern as "Eremit", though so i thought I'd second.

Eremit


koso

Some older version of gdb had problem with paths which included spaces or special characters ... If this is your case, try to move project to some "safe" path.

Eremit

Path should be ok, no special characters or something like that.

fiesch

Just for completeness sake as i was stumbling across this thread again:

In my case the custom make file was simply missing the -g flag to generate debug symbols which generates the "no sourcefile named" message which is pretty misleading

christobal

Quote from: fiesch on October 28, 2009, 02:48:36 PM

all i can safely identify is a error message from gdb about an non-existing file which exists in exactly that spot.
I already 777'ed the whole file structure to eliminate a error source to no avail.


I got the same behaviour when I cross - debug a PowerPC/Linux target remotely from my i686/Windows host (with C::B svn 6843). Looks like GDB doesn't like the generated "break" commands (e.g break "C:/myproject/sourcefiles/source.c:30") if the source file is not in the same directory as the project file.

I've played around a bit and the only solution I could come up was changing the command invokation to use relative filepaths (based on project.cbp), so they would look like: break "../sourcefiles/source.c:30".
This seems to be working fine in my HelloWorld - Application. I'll test it with a more complex project any time soon...

Does anyone think this could cause side effects or complications?