Reputation: 625
I am using gdb
to debug a program compiled against a static library. Both the library and the program were compiled with debug symbols. For this library, gdb
does only see the source code implemented in .h
files and not the source code implemented in .cpp
files. I wonder why?
For example
(gdb) info sources
only lists header files from that library and no .cpp
files.
I am able to set breakpoint to some function that was implemented in a .cpp
file. For example gdb
understands this command:
(gdb) break orgQhull::Qhull::runQhull,
it is, however, not possible to debug the code inside the body of that function. (It is only possible to step through individual instructions on the assembler level using the stepi
command.) On the other hand, the debuger is able to see the code of functions implemented in header files.
The backtrace
command reports that there is "No symbol table available" for the runQhull
function mentioned earlier:
(gdb) backtrace full
#0 0x00000000004d361a in orgQhull::Qhull::runQhull(orgQhull::RboxPoints const&, char const*) ()
No symbol table info available.
#1 0x000000000049573a in ConvexHull::ConvexHull (this=0x7fffffffcb70, tree=..., begin=..., end=...)
at /home/filip/fel/dp/sandbox/src/populating_octomap/include/ConvexHull.h:40
What could be the reason for this? Any suggestions are welcome!
Some details:
libqhullcpp.a
with sources at git://gitorious.org/qhull/qhull.git
Upvotes: 3
Views: 3671
Reputation: 213446
What could be the reason for this?
Either
-g
flag, orCheck your library build log. You believe you built it with -g
, but you are very likely mistaken.
Upvotes: 1