本人使用rhel 6 GDB 調試代碼時,出現以下錯誤:
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.166.el6.x86_64 keyutils-libs-1.4-5.el6.x86_64 krb5-libs-1.10.3-42.el6.x86_64 libcom_err-1.41.12-22.el6.x86_64 libgcc-4.4.7-16.el6.x86_64 libselinux-2.0.94-5.8.el6.x86_64 libstdc++-4.4.7-16.el6.x86_64 openssl-1.0.1e-42.el6.x86_64 zlib-1.2.3-29.el6.x86_64
在網上搜了大量的資料,,對centos 的類似問題解決方法比較多,我參考百度經驗采取以下方法:
- 先查看本機的內核版本號:uname -r 本機為:2.6.32-573.el6.x86_64
- 安裝debuginfo 去http://debuginfo.centos.org尋找和你內核完全匹配: 本機內核是2.6.32-573的 在網址 http://debuginfo.centos.org/6/x86_64/ 下
-
選kernel-debuginfo-2.6.32-573.el6.x86_64.rpm kernel-debuginfo-common-2.6.32-573.el6.x86_64.rpm
方法:只裝這倆個包,,可以下載下來放共享目錄,也可以在配置好ftp后設置yum的獲取地址為:baseurl=http://debuginfo.centos.org/6/$basearch/
kernel-debuginfo-common-xxxxx
kernel-debuginfo-xxxx
-
rpm -ivh kernel-debuginfo-common-xxxxx
rpm -ivh kernel-debuginfo-xxxx
也可以用這個命令安裝 rpm -ivh kernel-debuginfo*.rpm
-
For this to work, you need to have the debuginfo repository defined. For CentOS 5, put the following in /etc/yum.repos.d/CentOS-Base-debuginfo.repo:
[base-debuginfo] name=CentOS-$releasever - DebugInfo
baseurl=http://debuginfo.centos.org/$releasever/$basearch/ 此處的根據需要,$releasever 要改為自己所需的版本號,比如我的就是 6
gpgcheck=0
enabled=0
protect=1
priority=1
注意要確保外網連通,,,,可以使用centos 的rpm包
yum --nogpgcheck --enablerepo=debug install glibc-debuginfo 配好倉庫以后可以裝debuginfo (!!!詳細情況可以見下文,redhat的未注冊解決辦法)
如果直接執行debuginfo-install命令的話會出現nss-softokn-debuginfoXXXXXXX not signed ,就是沒有簽名,不能安裝,所以采用--nogpgcheck選項 忽略簽名的檢查
-
debuginfo-install glibc + 版本號
如果沒有debuginfo-install命令的話:
yum install yum-utils