Author Topic: "No source file named " problem while debugging  (Read 66503 times)

Offline Eremit

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #15 on: October 27, 2009, 12:16:45 pm »
Hi all,

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

Code
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?

Offline fiesch

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #16 on: October 28, 2009, 02:15:01 pm »
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

Offline Eremit

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #17 on: October 28, 2009, 02:26:11 pm »
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.

Offline fiesch

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #18 on: October 28, 2009, 02:33:54 pm »
As mine is a self-managed makefile i would guess so, yes.
That is if i understood you correctly.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: "No source file named " problem while debugging
« Reply #19 on: October 28, 2009, 02:39:33 pm »
Correct? - If yes I will file a bug.
No.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline fiesch

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #20 on: October 28, 2009, 02:48:36 pm »
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.

Offline Eremit

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #21 on: October 28, 2009, 02:53:18 pm »
Correct? - If yes I will file a bug.
No.

Ok, then what now?

@fiesch: You understood me correctly :)

Offline koso

  • Multiple posting newcomer
  • *
  • Posts: 58
Re: "No source file named " problem while debugging
« Reply #22 on: October 28, 2009, 03:30:08 pm »
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.

Offline Eremit

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #23 on: October 28, 2009, 03:35:32 pm »
Path should be ok, no special characters or something like that.

Offline fiesch

  • Single posting newcomer
  • *
  • Posts: 4
Re: "No source file named " problem while debugging
« Reply #24 on: March 21, 2010, 12:11:24 pm »
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

Offline christobal

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: "No source file named " problem while debugging
« Reply #25 on: November 12, 2010, 12:29:32 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?