在使用 gdb 时遇到
Missing separate debuginfos, use: debuginfo-install glibc-2.17-157.el7_3.5.x86_64
先修改"/etc/yum.repos.d/CentOS-Debuginfo.repo"文件的 enable=1;如果该文件不存在,则手工创建并加入以下内容:
[debug] name=CentOS-7 - Debuginfo baseurl=http://debuginfo.centos.org/7/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7 enabled=1
然后执行
sudo yum install -y glibc sudo debuginfo-install glibc
如果在这之后,gdb 使用中无法 run,提示信息
error while loading shared libraries: libcunit.so.1: cannot open shared object file: No such file or directory [Inferior 1 (process 23252) exited with code 0177]
解决方法
sudo find / -name "libcunit.so.1"
找到对应的路径后将 libcunit.so.1 复制到 /lib64 目录下
cp/lib64
之后就可以正常 run 了。


![[gdb] error while loading shared libraries: libcunit.so.1: cannot open shared object file [gdb] error while loading shared libraries: libcunit.so.1: cannot open shared object file](http://www.mshxw.com/aiimages/31/334954.png)
