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 sourcesonly lists header files from that library and no
.cppfiles.I am able to set breakpoint to some function that was implemented in a
.cppfile. For examplegdbunderstands 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
stepicommand.) On the other hand, the debuger is able to see the code of functions implemented in header files.The
backtracecommand reports that there is "No symbol table available" for therunQhullfunction 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:
- The library in question is Qhull's
libqhullcpp.awith sources atgit://gitorious.org/qhull/qhull.git - System: Ubuntu 12.04.2 LTS with GNU/Linux 3.2.0-40-generic #64-Ubuntu SMP x86_64
- gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
- GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04