0

I'm developing a C++ app on Ubuntu 14.04 LTS Desktop using Eclipse CDT. I'm having problems using the getopt_long() function. When I step through my code, Eclipse isn't able to find the source code for this file.

How do I get find the right version of the source files for the debugging information that's on my system and get Eclipse to use those files as I step through debugging?

I'm assuming that the answer to this question will also answer the same question for other libraries' source code.

The Demigeek
  • 763
  • 3
  • 13
  • 27
  • You don't need the source code if you have a version of the library that's been compiled with debug symbols -- assuming you simply want to step through the code with a debugger and examine the stack etc. Find a debug version of the library and link against that. – RJinman Oct 31 '14 at 03:09
  • Stepping through library functions in a debugger generally isn't what you want to do anyway. It's your own code that you'll usually want to debug. – Crowman Oct 31 '14 at 03:13
  • Yes, I'm quite sure that my code is where the fault lies, but stepping through the library can help me understand what's wrong with my code. – The Demigeek Oct 31 '14 at 03:30
  • I think in Ububtu you need the packages with suffix `-dbg` – Galik Oct 31 '14 at 03:49
  • possible duplicate of [How to use debug version of libc](http://stackoverflow.com/questions/10000335/how-to-use-debug-version-of-libc) – ArtemGr Oct 31 '14 at 07:37
  • "apt-get source libc6"? (cf. http://ubuntuforums.org/showthread.php?t=1374829) – ArtemGr Oct 31 '14 at 07:40

0 Answers0