gdb-miss-debuginfo

使用gdb调试core时候,提示Missing separate debuginfos的解决办法。

错误提示

错误提示信息如下:

1
2
Missing separate debuginfos, use: debuginfo-install glibc-2.17-106.el7_2.8.x86_64 libaio-0.3.109-13.el7.x86_64 
libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 numactl-libs-2.0.9-6.el7_2.x86_64

解决办法

修改yum源debuginfo配置

修改/etc/yum.repos.d/CentOS-Debuginfo.repo, 把enabled修改为1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[root@lehoon yum.repos.d]# vi CentOS-Debuginfo.repo

# 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-7 releases
# are merged into a single repo, split by BaseArch
#
# Note: packages in the debuginfo repo are currently not signed
#

[base-debuginfo]
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
#
~
"CentOS-Debuginfo.repo" 21L, 649C written

安装glibc-debuginfo包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[root@lehoon yum.repos.d]# yum install glibc-debuginfo
已加载插件:fastestmirror
base-debuginfo | 2.5 kB 00:00:00
base-debuginfo/x86_64/primary_db | 1.1 MB 00:00:39
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 glibc-debuginfo.x86_64.0.2.17-106.el7_2.8 将被 安装
--> 正在处理依赖关系 glibc-debuginfo-common = 2.17-106.el7_2.8,它被软件包 glibc-debuginfo-2.17-106.el7_2.8.x86_64 需要
--> 正在检查事务
---> 软件包 glibc-debuginfo-common.x86_64.0.2.17-106.el7_2.8 将被 安装
--> 解决依赖关系完成

依赖关系解决

=================================================================================================================================
Package 架构 版本 源 大小
=================================================================================================================================
正在安装:
glibc-debuginfo x86_64 2.17-106.el7_2.8 base-debuginfo 9.3 M
为依赖而安装:
glibc-debuginfo-common x86_64 2.17-106.el7_2.8 base-debuginfo 9.3 M

事务概要
=================================================================================================================================
安装 1 软件包 (+1 依赖软件包)

总下载量:19 M
安装大小:107 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/base-debuginfo/packages/glibc-debuginfo-2.17-106.el7_2.8.x86_64.rpm: 头V3 RSA/SHA256 Signature,
密钥 ID b6792c39: NOKEY
glibc-debuginfo-2.17-106.el7_2.8.x86_64.rpm 的公钥尚未安装
(1/2): glibc-debuginfo-2.17-106.el7_2.8.x86_64.rpm | 9.3 MB 00:04:17
(2/2): glibc-debuginfo-common-2.17-106.el7_2.8.x86_64.rpm | 9.3 MB 00:16:41
---------------------------------------------------------------------------------------------------------------------------------
总计 19 kB/s | 19 MB 00:16:41
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7 检索密钥
导入 GPG key 0xB6792C39:
用户ID : "CentOS-7 Debug (CentOS-7 Debuginfo RPMS) <security@centos.org>"
指纹 : 759d 690f 6099 2d52 6a35 8cbd d0f2 5a3c b679 2c39
软件包 : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@anaconda)
来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : glibc-debuginfo-common-2.17-106.el7_2.8.x86_64 1/2
正在安装 : glibc-debuginfo-2.17-106.el7_2.8.x86_64 2/2
验证中 : glibc-debuginfo-2.17-106.el7_2.8.x86_64 1/2
验证中 : glibc-debuginfo-common-2.17-106.el7_2.8.x86_64 2/2

已安装:
glibc-debuginfo.x86_64 0:2.17-106.el7_2.8
作为依赖被安装:
glibc-debuginfo-common.x86_64 0:2.17-106.el7_2.8
完毕!

安装nss-softokn-debuginfo包

yum install nss-softokn-debuginfo –nogpgcheck

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[root@lehoon yum.repos.d]# yum install nss-softokn-debuginfo --nogpgcheck
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 nss-softokn-debuginfo.x86_64.0.3.16.2.3-14.2.el7_2 将被 安装
--> 解决依赖关系完成

依赖关系解决

============================================================================================================================
Package 架构 版本 源 大小
============================================================================================================================
正在安装:
nss-softokn-debuginfo x86_64 3.16.2.3-14.2.el7_2 base-debuginfo 1.9 M

事务概要
============================================================================================================================
安装 1 软件包

总下载量:1.9 M
安装大小:8.9 M
Is this ok [y/d/N]: y
Downloading packages:
nss-softokn-debuginfo-3.16.2.3-14.2.el7_2.x86_64.rpm | 1.9 MB 00:03:59
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : nss-softokn-debuginfo-3.16.2.3-14.2.el7_2.x86_64 1/1
验证中 : nss-softokn-debuginfo-3.16.2.3-14.2.el7_2.x86_64 1/1

已安装:
nss-softokn-debuginfo.x86_64 0:3.16.2.3-14.2.el7_2

完毕!

安装yum-utils包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[root@lehoon yum.repos.d]# yum install yum-utils
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 yum-utils.noarch.0.1.1.31-34.el7 将被 安装
--> 正在处理依赖关系 python-kitchen,它被软件包 yum-utils-1.1.31-34.el7.noarch 需要
--> 正在检查事务
---> 软件包 python-kitchen.noarch.0.1.1.1-5.el7 将被 安装
--> 正在处理依赖关系 python-chardet,它被软件包 python-kitchen-1.1.1-5.el7.noarch 需要
--> 正在检查事务
---> 软件包 python-chardet.noarch.0.2.2.1-1.el7_1 将被 安装
--> 解决依赖关系完成

依赖关系解决

===================================================================================================================
Package 架构 版本 源 大小
===================================================================================================================
正在安装:
yum-utils noarch 1.1.31-34.el7 base 113 k
为依赖而安装:
python-chardet noarch 2.2.1-1.el7_1 base 227 k
python-kitchen noarch 1.1.1-5.el7 base 267 k

事务概要
=====================================================================================================================
安装 1 软件包 (+2 依赖软件包)

总下载量:607 k
安装大小:2.8 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): python-chardet-2.2.1-1.el7_1.noarch.rpm | 227 kB 00:00:13
(2/3): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:13
(3/3): yum-utils-1.1.31-34.el7.noarch.rpm | 113 kB 00:00:06
---------------------------------------------------------------------------------------------------------------------------
总计 30 kB/s | 607 kB 00:00:20
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : python-chardet-2.2.1-1.el7_1.noarch 1/3
正在安装 : ython-kitchen-1.1.1-5.el7.noarch 2/3
正在安装 : yum-utils-1.1.31-34.el7.noarch 3/3
验证中 : python-kitchen-1.1.1-5.el7.noarch 1/3
验证中 : yum-utils-1.1.31-34.el7.noarch 2/3
验证中 : python-chardet-2.2.1-1.el7_1.noarch 3/3

已安装:
yum-utils.noarch 0:1.1.31-34.el7

作为依赖被安装:
python-chardet.noarch 0:2.2.1-1.el7_1 python-kitchen.noarch 0:1.1.1-5.el7

完毕!

安装gdb缺少的包

使用debuginfo-install 命令安装安装libaio-0.3.109-13.el7.x86_64 libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 numactl-libs-2.0.9-6.el7_2.x86_64

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[root@lehoon yum.repos.d]# debuginfo-install libaio-0.3.109-13.el7.x86_64 libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 numactl-libs-2.0.9-6.el7_2.x86_64
已加载插件:auto-update-debuginfo, fastestmirror
Loading mirror speeds from cached hostfile
软件包 libaio-debuginfo-0.3.109-13.el7.x86_64 已安装并且是最新版本
软件包 glibc-debuginfo-2.17-106.el7_2.8.x86_64 已安装并且是最新版本
软件包 yum-plugin-auto-update-debug-info-1.1.31-34.el7.noarch 已安装并且是最新版本
--> 正在检查事务
---> 软件包 gcc-debuginfo.x86_64.0.4.8.5-4.el7 将被 安装
--> 正在处理依赖关系 gcc-base-debuginfo = 4.8.5-4.el7,它被软件包 gcc-debuginfo-4.8.5-4.el7.x86_64 需要
---> 软件包 numactl-debuginfo.x86_64.0.2.0.9-6.el7_2 将被 安装
--> 正在检查事务
---> 软件包 gcc-base-debuginfo.x86_64.0.4.8.5-4.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==============================================================================================================
Package 架构 版本 源 大小
==============================================================================================================
正在安装:
gcc-debuginfo x86_64 4.8.5-4.el7 base-debuginfo 195 M
numactl-debuginfo x86_64 2.0.9-6.el7_2 base-debuginfo 172 k
为依赖而安装:
gcc-base-debuginfo x86_64 4.8.5-4.el7 base-debuginfo 2.8 M

事务概要
==============================================================================================================
安装 2 软件包 (+1 依赖软件包)

总下载量:198 M
安装大小:903 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): gcc-base-debuginfo-4.8.5-4.el7.x86_64.rpm | 2.8 MB 00:01:08
(2/3): numactl-debuginfo-2.0.9-6.el7_2.x86_64.rpm | 172 kB 00:00:03
(3/3): gcc-debuginfo-4.8.5-4.el7.x86_64.rpm | 195 MB 01:42:44
----------------------------------------------------------------------------------------------------------------
总计 33 kB/s | 198 MB 01:42:44
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : gcc-base-debuginfo-4.8.5-4.el7.x86_64 1/3
正在安装 : gcc-debuginfo-4.8.5-4.el7.x86_64 2/3
正在安装 : numactl-debuginfo-2.0.9-6.el7_2.x86_64 3/3
验证中 : gcc-base-debuginfo-4.8.5-4.el7.x86_64 1/3
验证中 : numactl-debuginfo-2.0.9-6.el7_2.x86_64 2/3
验证中 : gcc-debuginfo-4.8.5-4.el7.x86_64 3/3

已安装:
gcc-debuginfo.x86_64 0:4.8.5-4.el7 numactl-debuginfo.x86_64 0:2.0.9-6.el7_2

作为依赖被安装:
gcc-base-debuginfo.x86_64 0:4.8.5-4.el7

完毕!

在使用gdb调试core文件,就不会报缺少debuginfo包了。

文章目录
  1. 1. 错误提示
  2. 2. 解决办法
    1. 2.1. 修改yum源debuginfo配置
    2. 2.2. 安装glibc-debuginfo包
    3. 2.3. 安装nss-softokn-debuginfo包
    4. 2.4. 安装yum-utils包
    5. 2.5. 安装gdb缺少的包