59

CentOS 6.2 + GNU gdb (GDB) Red Hat Enterprise Linux (7.2-50.el6)

When I debug a simple c++ code with GDB, I saw the following warning:

Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.9.i686 libgcc-4.4.6-3.el6.i686 libstdc++-4.4.6-3.el6.i686

I have tried the following methods and none of them fix the problems:

  1. Search SO

  2. yum install glibc

  3. debuginfo-install glibc-2.12-1.47.el6_2.9.i686 libgcc-4.4.6-3.el6.i686 libstdc++-4.4.6-3.el6.i686

In fact, when I install those RPM one by one, I just realized that they are installed already.

[root@localhost Excluded]# rpm -ivh glibc-2.12-1.47.el6_2.9.i686.rpm 
Preparing...                ########################################### [100%]
    package glibc-2.12-1.47.el6_2.9.i686 is already installed
[root@localhost Excluded]# ls *.rpm
glibc-2.12-1.47.el6_2.9.i686.rpm  libgcc-4.4.6-3.el6.i686.rpm
[root@localhost Excluded]# rpm -ivh libgcc-4.4.6-3.el6.i686.rpm 
Preparing...                ########################################### [100%]
    package libgcc-4.4.6-3.el6.i686 is already installed
[root@localhost Excluded]# rpm -ivh libstdc++-4.4.6-3.el6.i686.rpm 
warning: libstdc++-4.4.6-3.el6.i686.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
Preparing...                ########################################### [100%]
    package libstdc++-4.4.6-3.el6.i686 is already installed
    file /usr/lib/libstdc++.so.6.0.13 from install of libstdc++-4.4.6-3.el6.i686 conflicts with file from package libstdc++-4.4.6-3.el6.i686

Why GDB cannot find it?

Question: Do I have to worry about this issue? If not, how to turn it off? If yes, how to fix it?

Thank you

4

3 回答 3

107

debuginfo-install是 的命令yum-utils,所以

  1. yum install yum-utils
  2. debuginfo-install glibc
  3. 如果警告仍然存在,请编辑/etc/yum.repos.d/CentOS-Debuginfo.repo,设置enabled=1
于 2013-06-19T14:57:25.417 回答
1

万一其他人遇到同样的问题,

我已经更新了 glibc,并且以某种方式刷新了旧的 ldconfig 在运行应用程序时遇到了这个错误

加载共享库时出错:libjson-c.so.2:无法打开共享对象文件:没有这样的文件或目录

即使在设置之后LD_LIBRARY_PATH它也不起作用:

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

最后,下面的命令来救援。

// Add you library path here.
echo /usr/local/lib >> /etc/ld.so.conf

// And then Run ldconfig to reflect the path
ldconfig
于 2014-05-07T07:30:57.940 回答
0

接受答案的顺序对我不起作用。

我遵循了评论中的一些提示,这是我在全新安装的 CentOS 7.2 中尝试并成功的方法

  1. 从@lkraav 的评论中,我关注了这个 wiki https://wiki.centos.org/AdditionalResources/Repositories/DebugInfo并创建了一个新文件。

可以将以下内容附加到/etc/yum.repos.d/CentOS-Base.repo或创建新文件,例如/etc/yum.repos.d/CentOS-Debug.repo.

  1. 我将这些内容从 wiki 粘贴到新/etc/yum.repos.d/CentOS-Debug.repo文件中,但enabled=0将行编辑为enabled=1

  2. debuginfo-install在 gdb 警告中显示了所有内容并成功安装。

于 2020-11-27T03:34:31.773 回答