loading gdb source for a shared library
i'm using gdb 7.2 on ubuntu 10.10
while stepping with step
i get to a point that looks (literally) like this:
0x00130a2c in boost::contexts::context::impl_t::impl_t(void (*)(void*), void*, unsigned int, boost::contexts::context::impl_t*, std::auto_ptr<boost::contexts::context::allocator_base>) () from /home/lurscher/third_party/boost_1_45_0/stage/lib/libboost_context.so.1.45.0
开发者_如何学PythonSo i want now to associate the appropiate source files; which likely should be on /home/lurscher/third_party/boost_1_45_0/boost/context
and /home/lurscher/third_party/boost_1_45_0/libs/context
.
But the truth is i'm not sure how to achieve this, its been years since i had to debug in terminal mode
You can compile the third-party library with debugging symbols, and those debugging symbols will chain [i.e. if your app is compiled with debugging symbols, you can step through and see the source lines even within the library]
boost jam takes a debug argument which will instruct it to build a debug version.
in gcc, debug symbols is -g
If your library is compiled in the debug mode, but GDB just doesn't find the sources, you should use the dir
command to add the source directory to the search list.
精彩评论