Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » IDE crashes on step into looks for file(below)(making debugger fully functional)
IDE crashes on step into looks for file(below) [message #1716903] Tue, 08 December 2015 23:35 Go to next message
John Gray is currently offline John GrayFriend
Messages: 13
Registered: June 2015
Junior Member
When I step into code during IDE debugging session using step into in the wrong place yeilds a can't find program file: I've attatched a jpeg to illustrate.
I want to continue to develop on the IDE which is great, but I need a fully functional one. See photo



Thx in advance

JG

well it wont let me choose file:

request after stepping into code:

Can't find a source file at "/home/gfortran/gcc-home/workshop/gcc/objdir/x86_64-w64-mingw32/libstdc++-v3/include/bits/ostream.tcc"

Locate the file or edit the source lookup path to include its location.
Button to press for file search


Can somebody help!
Re: IDE crashes on step into looks for file(below) [message #1716911 is a reply to message #1716903] Wed, 09 December 2015 01:45 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
This has nothing to do with Eclipse.

It's because libraries usually don't come with source code by default. Best thing to do is step over library calls. I usually get an offer to view the assembly when I inadvertently step into one though. Edit: If you accidentally step into one just press the debugger Step Return button to continue stepping through your code.

If you have the source you will have to specify to gdb where to look for it.
Some parts of the std library are available but some of it refers to precompiled modules which don't normally come with the source.

GDB documentation on source files: https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html
You can specify places to look for source in the Debug Configuration dialog using the Source tab.
http://help.eclipse.org/mars/topic/org.eclipse.cdt.debug.application.doc/tasks/cdt_t_run_dbg.htm
More on specifying source locations:
http://help.eclipse.org/mars/topic/org.eclipse.cdt.debug.application.doc/tasks/cdt_t_run_source.htm

You'd be surprised what can be found using Google. Search for "gdb can't find a source file at".
Your attached jpeg must be very small. I can't see it.

[Updated on: Wed, 09 December 2015 01:50]

Report message to a moderator

Re: IDE crashes on step into looks for file(below) [message #1716916 is a reply to message #1716911] Wed, 09 December 2015 02:38 Go to previous messageGo to next message
John Gray is currently offline John GrayFriend
Messages: 13
Registered: June 2015
Junior Member
Thx for the reply. The message board would not allow me to choose the file, and I couldn't display an image I couldn't upload. I'll try again.

When I first installed Eclipse IDE there were some options about fortran files be installed that I declined. Is it possible that these events are related?
Do you think eclipse worth a reinstall including that option? I did google that error but got nowhere a while ago.

Yes, it won't let me choose a file, frustrating.

[Updated on: Wed, 09 December 2015 02:42]

Report message to a moderator

Re: IDE crashes on step into looks for file(below) [message #1717019 is a reply to message #1716916] Wed, 09 December 2015 15:43 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You can't upload a file with a Quick Reply. You need to preview the post first There should be an Upload File button just below the post edit box when previewing. But it isn't necessary here. You've posted enough to narrow down the problem.

Quote:
there were some options about fortran files be installed ... Do you think eclipse worth a reinstall including that option? I did google that error but got nowhere a while ago..


Maybe, but the files you want are C++ files -- not FORTRAN. In this particular case it's ostream.tcc.

The problem is the source for the library wasn't installed or is not at the location gdb is trying to use. You should either try to download it from somewhere or find out where it was placed in your system.

If there is an option to download library sources (C/C++ in particular) from your installation file you could try that. But that seems excessive. A Google search for "ostream.tcc" turned up this:

https://gcc.gnu.org/onlinedocs/gcc-4.6.3/libstdc++/api/a00968_source.html

Though you will need to check the version. You want the one that matches the one you are using. You could also download all of the standard library source from GNU if you can find the version you are using. Go find the complete name of the library. It will likely have the version number attached. Something like libdir/libstdc++-version.so or libdir/libstdc++version.a. libdir is usually something like /usr/lib or /usr/local/lib but it is distro dependent. You'll have to figure it out on your own. The find command might help.

Also, the library has to have been built with debug information but gdb seems to have found some information so maybe it has been.


Re: IDE crashes on step into looks for file(below) [message #1717386 is a reply to message #1717019] Sat, 12 December 2015 15:13 Go to previous messageGo to next message
John Gray is currently offline John GrayFriend
Messages: 13
Registered: June 2015
Junior Member
Ok, I see the source file. How do I download this? If I cut and paste it carries the line numbers with it, and I don't see an option for "download". Sorry for being so newb-ish. Thanx for your time.

[Updated on: Sat, 12 December 2015 15:17]

Report message to a moderator

Re: IDE crashes on step into looks for file(below) [message #1717390 is a reply to message #1717386] Sat, 12 December 2015 17:03 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Well, it's the listing from the documentation.

Read the Downloading section in https://gcc.gnu.org/libstdc++/ and follow the link for one of the mirror sites.

You need to use the source for the version of the library you have linked. Anything else may appear to jump randomly. In fact, if you really are going to step into this, it's likely best you compile and link your own version. It's possible that the majority of the symbols have been stripped from a distro lib and even if it had been compiled with debug info it's also possible optimization was used. Makes for tough debugging. Compile with -g -O0 then you'll be certain of what you have.
Re: IDE crashes on step into looks for file(below) [message #1717396 is a reply to message #1717390] Sat, 12 December 2015 21:20 Go to previous message
John Gray is currently offline John GrayFriend
Messages: 13
Registered: June 2015
Junior Member
Thank you!
Previous Topic:Cant find source file
Next Topic:Could Not Be Resolved and Invalid Template issues
Goto Forum:
  


Current Time: Fri Apr 26 16:06:08 GMT 2024

Powered by FUDForum. Page generated in 0.04612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top