Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT GDB No source file named ... error
CDT GDB No source file named ... error [message #236177] Mon, 20 July 2009 15:03 Go to next message
T Kruse is currently offline T Kruse
Messages: 73
Registered: July 2009
Member
Hi,

I am using CDT on Eclipse 3.4.2 to develop on a large C project, which has
its own custom makefiles.
I am facing problems with debugging, which I could not resolve after
spending hours on google looking for solutions.

I had everything run perfect on Debian 32 for a while. I then copied the
workspace to a different PC, running Debian 64 bit, with different home
directory.
I made a make clean and make, and I am able to run the application without
problems. However, when i try to set breakpoints, it does not work. While
the application runs with the c files I set the break points in, if I add
another breakpoint, I get in the gdb console:

(gdb)
300*stopped,reason="signal-received",signal-name="SIGINT",signal-meaning= "Interrupt",thread-id="0",frame={addr="0x00007f13ba656c93 ",func="??",args=[],from="/lib/libc.so.6"}
No source file named gnuplot.c.
(gdb)
301-break-insert gnuplot.c:103
&"No source file named gnuplot.c.\n"
301^error,msg="No source file named gnuplot.c."

The same happens for absolute paths. The debugger can stop on startup at
main, and the debugger works fine with a HelloWorld c app in the same
workspace.

Would this be due to that SIGINT, and does anyone here understand what
causes this and how I may fix it?
Re: CDT GDB No source file named ... error [message #236185 is a reply to message #236177] Tue, 21 July 2009 09:03 Go to previous messageGo to next message
T Kruse is currently offline T Kruse
Messages: 73
Registered: July 2009
Member
Hi, I figure the SIGINT is not the problem, since on the 32Bit machine
where debugging works, I get a similar gdb log message. So why can't gdb
set the breakpoint?
Re: CDT GDB No source file named ... error [message #236192 is a reply to message #236177] Tue, 21 July 2009 09:41 Go to previous messageGo to next message
Eclipse User
Originally posted by: subs._nospam_consertum.com

My guess is that you have the Source lookup path wrong for the debug
configuration. Look in the Source tab of the debug configuration.

btw: it is recommended that when moving projects between machines, you
should Export and then Import, rather than copying.

T Kruse wrote:
> Hi,
>
> I am using CDT on Eclipse 3.4.2 to develop on a large C project, which
> has its own custom makefiles.
> I am facing problems with debugging, which I could not resolve after
> spending hours on google looking for solutions.
>
> I had everything run perfect on Debian 32 for a while. I then copied the
> workspace to a different PC, running Debian 64 bit, with different home
> directory.
> I made a make clean and make, and I am able to run the application
> without problems. However, when i try to set breakpoints, it does not
> work. While the application runs with the c files I set the break points
> in, if I add another breakpoint, I get in the gdb console:
>
> (gdb)
> 300*stopped,reason="signal-received",signal-name="SIGINT",signal-meaning= "Interrupt",thread-id="0",frame={addr="0x00007f13ba656c93 ",func="??",args=[],from="/lib/libc.so.6"}
>
> No source file named gnuplot.c.
> (gdb) 301-break-insert gnuplot.c:103
> &"No source file named gnuplot.c.\n"
> 301^error,msg="No source file named gnuplot.c."
>
> The same happens for absolute paths. The debugger can stop on startup at
> main, and the debugger works fine with a HelloWorld c app in the same
> workspace.
>
> Would this be due to that SIGINT, and does anyone here understand what
> causes this and how I may fix it?
>


--
Derek
Re: CDT GDB No source file named ... error [message #236201 is a reply to message #236192] Tue, 21 July 2009 10:49 Go to previous messageGo to next message
T Kruse is currently offline T Kruse
Messages: 73
Registered: July 2009
Member
The Source tab of the default configuration has a root item "Default",
which has elements "Absolute file path" which has no children, and the
project, with all its folders. It looks fine to me, and I aldo tried
removing all Debug configurations and have a new one created for me. I do
not use any subprojects.

I tried adding only the project or only the absolute filesystem location
as source in the Debug Configuration. The same error happens.

For fun, I added the project tree same path several times, as workspace,
workspace project, filesystem folder, workspace folder. No change.
I removed all the source path, then the breakpoints did not even trigger
any gdb action.

I tried creating a new project of the same name, copied the project files
(except .project and .cproject) into it, and still nothing.

There ought to be a logical explanation to this, aren't there gdb commands
that I could use somehow to check where it looks for files or something?
Re: CDT GDB No source file named ... error [message #236223 is a reply to message #236201] Tue, 21 July 2009 17:55 Go to previous messageGo to next message
FStanley is currently offline FStanley
Messages: 14
Registered: July 2009
Junior Member
Is the gnuplot.c file in the base path of the project workspace? Or do you
add folder depth? I doubt the error is coming from an Eclipse/CDT problem,
that is an error from gdb. If you have folders, I'd try moving it all to
the base project folder.

I have seen errors like this on windows machines when the directory
containing the source has spaces in it. Assuming that's not your issue

Are the two different machines running two different revisions of gcc? In
that case, different gdb applications. That could explain the reason why
it works on one, and not the other.

----
Forrest Stanley
Project Engineer
NetBurner, Inc
NBEclipse - Build a network enabled embedded device in one day with an
Eclipse interface!
Re: CDT GDB No source file named ... error [message #236242 is a reply to message #236223] Wed, 22 July 2009 05:53 Go to previous messageGo to next message
T Kruse is currently offline T Kruse
Messages: 73
Registered: July 2009
Member
Hi,

the breakpoints do now work on the new machine after I added -g to the
CFLAGS in the makefile. I don't quite get why it is necessary to do so on
one machine but not on the other, but I can cope with it remaining a
mystery for now. Different gdb maybe.
Re: CDT GDB No source file named ... error [message #491494 is a reply to message #236242] Wed, 14 October 2009 15:19 Go to previous messageGo to next message
Ariel  is currently offline Ariel
Messages: 1
Registered: October 2009
Junior Member
CDT Version: 3.4.2
I have the same problem.
On the same PC (running Ubuntu 8.10) i have an instance of Eclipse with working breakpoints.
I also have an instance of Eclipse with the problem described above

In fact, i have changed something, and ever since i changed whatever it was, my new installations of eclipse or my C++ project will not debug....?
Re: CDT GDB No source file named ... error [message #876310 is a reply to message #491494] Thu, 24 May 2012 06:56 Go to previous messageGo to next message
Anne Eisgruber is currently offline Anne Eisgruber
Messages: 2
Registered: May 2012
Junior Member
Where do I have to add the -g in eclipse? can you please describe that more specificly?
Re: CDT GDB No source file named ... error [message #954714 is a reply to message #876310] Tue, 23 October 2012 03:36 Go to previous message
Tamas Kleiber is currently offline Tamas Kleiber
Messages: 20
Registered: December 2010
Junior Member
I had the same issue and adding -g explicitly to CFLAGS in my makefile solved the issue for GCC.

Quote:

'-g' is a GCC command line switch which enables GCC to produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or DWARF 2).

GDB can work with this debugging information. On most systems that use stabs format, '-g' enables use of extra debugging information that only GDB can use; this extra information makes debugging work better in GDB but will probably make other debuggers crash or refuse to read the program.


If you have a C or C++ project in eclipse, instead of a makefile project, go to Project properties -> C/C++ Build -> Settings -> Tool Settings -> GCC Compiler -> Debugging -> "Other debugging flags" and add -g there.
Previous Topic:to create a pluggin which will add a new tool chain in eclipse
Next Topic:Eclipse C++ only has Java Projects ?
Goto Forum:
  


Current Time: Fri Jul 25 14:20:11 EDT 2014

Powered by FUDForum. Page generated in 0.07974 seconds