Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » No source available when using GDB 7.3 in Photon
No source available when using GDB 7.3 in Photon [message #1798949] Tue, 27 November 2018 15:32 Go to next message
Eclipse UserFriend
I'm using GDB 7.3 in Photon. It's connecting to a GDBServer. When I launch the debugger in Eclipse I get:

No source available for "main() at 0x101250"

I'm compiling with the optimizer turned off and the debug flag set to max:

-O0 -g3

I see the debug symbols in the binary when running objdump:

./powerpc-unknown-eabi-objdump.exe -g | grep debug

GDB 8.1 is able to find the sources. However, I can't use it due to incompatibilities with the GDBServer I'm connecting to :(

I'm not sure why it works in GDB 8.1 but not 7.3
I've set up the Source tab in the Debug configuration exactly the same.

Any help would be nice :)
Thank you.

[Updated on: Tue, 27 November 2018 15:33] by Moderator

Re: No source available when using GDB 7.3 in Photon [message #1798958 is a reply to message #1798949] Tue, 27 November 2018 19:49 Go to previous messageGo to next message
Eclipse UserFriend
In the gdbserver console, try the command "show directories" to see where it is trying to find your code. If the directory of the file with your main function is not there, you may need to add it manually.

More information here: https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html
Re: No source available when using GDB 7.3 in Photon [message #1799017 is a reply to message #1798958] Wed, 28 November 2018 13:16 Go to previous messageGo to next message
Eclipse UserFriend
I get the following when I run "show directories"
$cdir:$cwd
I added the source manually:
cd src
Working directory /path/to/src.

directory .
Source directories searched: /path/to/src:$cdir:$cwd

No source available for "main() at 0x101214"
Re: No source available when using GDB 7.3 in Photon [message #1799098 is a reply to message #1799017] Thu, 29 November 2018 12:17 Go to previous message
Eclipse UserFriend
For those who have this issue in the future.

The problem comes from using a new version of GCC (GCC 8.1) and an older version of GDB (GDB 7.3)

GCC is putting out a new version of debug symbols that the old version GDB does not know how to deal with. I added flags to GCC to produce older dwarf symbols:

-ggdb -gdwarf-3

Here is the documentation for those flags:
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
Previous Topic:Debug Issue
Next Topic:Eclipse GDB settings and usage questions
Goto Forum:
  


Current Time: Sat Aug 02 08:49:29 EDT 2025

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

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

Back to the top