天天看點

安裝帶有調試資訊的C庫

場景說明:RedHat6.4

    在gdb調試boost庫的時候,出現如下的錯誤:

Program received signal SIGSEGV,Segmentation fault.

0x0011c613 in boost::thread::start_thread()()

  from /usr/local/lib/libboost_thread.so.1.49.0

Missing separate debuginfos, use:debuginfo-install glibc-2.12-1.80.el6.i686 libgcc-4.4.6-4.el6.i686 libstdc++-4.4.6-4.el6.i686

原因:

一言以蔽之,該指令和yum一樣安裝一些庫檔案,但是安裝的庫檔案是攜帶gdb的調試。如下是debuginfo提供的源,如果debuginfo-install下載下傳緩慢,可以直接使用迅雷下載下傳:

<a href="http://debuginfo.centos.org/6/i386/" target="_blank">http://debuginfo.centos.org/6/i386/</a>

解決方案:

1)配置debuginfo的yum源,CentOS可能自帶:

# CentOS-Debug.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

# All debug packages from all the various CentOS-5 releases

# are merged into a single repo, split by BaseArch

# Note: packages in the debuginfo repo are currently not signed

[debug]

name=CentOS-6 - Debuginfo

baseurl=http://debuginfo.centos.org/6/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6

enabled=1

儲存檔案到/etc/yum.repos.d/目錄下,名字:CentOS-Debug.repo   

2)測試是否已經安裝了debuginfo-install

debuginfo-install glibc

如果出現下面的問題,表明沒有安裝:

-bash: debuginfo-install: command not found

3)安裝yum-utils,使用指令:

yum install yum-utils

可能安裝的軟體包比較多,可以單獨安裝:

# yum install nss-softokn-debuginfo --nogpgcheck

--nogpgcheck參數選項:忽略簽名的檢查

4)使用debuginfo-install指令,下載下傳上面缺乏的調試庫

參考網址:

<a href="http://www.qixing318.com/article/gdb-to-debug-the-error-missing-separate-debuginfos-use-debuginfo-to-install.html" target="_blank">http://www.qixing318.com/article/gdb-to-debug-the-error-missing-separate-debuginfos-use-debuginfo-to-install.html</a>

<a href="http://blog.csdn.net/testcs_dn/article/details/19565411" target="_blank">http://blog.csdn.net/testcs_dn/article/details/19565411</a>

     本文轉自fengyuzaitu 51CTO部落格,原文連結:http://blog.51cto.com/fengyuzaitu/1403687,如需轉載請自行聯系原作者

繼續閱讀