I am trying to develop a C++ application for the RTEMS RTOS but I am having trouble getting debugging to work. They have a basic LED blinky example written in C that I am able to debug. However, converting this to C++ causes gdb to not be able to find the source file.
If I connect gdb
to the C app and run info sources
, I can see my init.c
file right at the top followed by all the RTEMS sources. Repeating this for the C++ app, there is no mention of init.cpp
. Using objdump
on the exe/ELF files, I can see in debug_info
and debug_str
the path to init.c
. But in the C++ app, there is no mention of the path to init.cpp
.
The C app and the C++ app are nested under the same top level directory and use the same wscript
file to configure the compiler. Both apps are being compiled with -Og
and -g
. What would prevent the source path from being written to the debug section of the ELF file?