I have a fresh install CentOS Linux release 7.2.1511 (Core)
, and gdb
verison is GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-119.el7
.
I saw the Missing separate debuginfos warning
Missing separate debuginfos, use: debuginfo-install glibc-2.17-307.el7.1.x86_64 libgcc-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.x86_64
and I learnt that:
Missing
glibc-2.17-157.el7_3.1.x86_64
will only prevent you from stepping throughGLIBC
itself.
from this answer Missing separate debuginfos, use: debuginfo-install glibc-2.17-157.el7_3.1.x86_64.
Now I've succeeded installing all those debug infos pacakges. But I can't see a difference. What are the additionals things that I can do now with those extra packages installed?
Take this C++ program as an example:
#include <iostream>
#include <vector>
#include <map>
using namespace std;
int main(){
vector<int> a = {1,2,3};
vector<int> b = {4,5,6};
map<int, vector<int>> m = {{1, a}, {2, b}};
cout << m[1][0] << endl;
cout << m[2][0] << endl;
}
compile with g++ -Wall -g test.cpp -std=c++11
.
I can step through libstdc++
both before and after installing those debug info packages. So what's the difference?
What I understand step through is that for example when I press s
at this line cout << m[1][0] << endl;
, gdb
shows that I am in stl_map.h:481
:
std::map<int, std::vector<int, std::allocator<int> >, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int> > > > >::operator[](int&&) (this=0x7fffffffe3f0,
__k=<unknown type in /root/a.out, CU 0x0, DIE 0x7b70>) at /usr/include/c++/4.8.2/bits/stl_map.h:481
481 iterator __i = lower_bound(__k);
related question: Missing separate debuginfos
Solution Update:
I figured out the details after reading this How to use debug version of libc. I also read about how separate debug info files work and tried manually redirecting gdb
to find source files with set substitute-path
by this answer.
And eventually I learn how the things work together:
By default those shared libraries don't have debug info embedded in the
.so
And the debug infos are stored in another directory where
gdb
would try to load from.Beyond that, I still need the source text files to
list
around.