Linux gdb调试的时候没有对应的c调试信息库怎么办?

gdb 调试报错:Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.6.x86_64

在centos7上面gdb调试程序时候,报错信息是:
Missing separate debuginfos, use: debuginfo-install glibc-2.17-157.el7_3.5.x86_64

解决方案:
1 先修改"/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

2 执行 sudo yum install -y glibc
3 执行 debuginfo-install glibc


[root@master Code]# gdb ./a.out 
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/Code/a.out...done.
(gdb) set args 9191
(gdb) r
Starting program: /root/Code/./a.out 9191
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff6fd2700 (LWP 13317)]
[Thread 0x7ffff6fd2700 (LWP 13317) exited]
[New Thread 0x7ffff6fd2700 (LWP 13318)]
[New Thread 0x7ffff67d1700 (LWP 13319)]Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6fd2700 (LWP 13318)]
0x00007ffff706ced7 in __strcpy_sse2_unaligned () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.5.x86_64 libgcc-4.8.5-39.el7.x86_64 libstdc++-4.8.5-39.el7.x86_64

这里就说明了没有对应的调试信息库

安装实录
[root@master Code]# cat /etc/yum.repos.d/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=0
#
[root@master Code]# vi /etc/yum.repos.d/CentOS-Debuginfo.repo 
[root@master Code]# cat /etc/yum.repos.d/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
#
[root@master Code]# yum install -y glibc
Loaded plugins: fastestmirror
base                                                    | 3.6 kB     00:00     
base-debuginfo                                          | 2.5 kB     00:00     
clickhouse-stable/signature                             |  821 B     00:00     
clickhouse-stable/signature                             | 1.4 kB     00:00 !!! 
docker-ce-stable                                        | 3.5 kB     00:00     
emqx-stable                                             | 2.9 kB     00:00     
epel/x86_64/metalink                                    | 9.9 kB     00:00     
epel                                                    | 4.7 kB     00:00     
extras                                                  | 2.9 kB     00:00     
kubernetes                                              | 1.4 kB     00:00     
updates                                                 | 2.9 kB     00:00     
(1/7): epel/x86_64/updateinfo                             | 1.1 MB   00:00     
(2/7): epel/x86_64/primary_db                             | 7.0 MB   00:00     
(3/7): docker-ce-stable/x86_64/primary_db                 |  80 kB   00:00     
(4/7): kubernetes/primary                                 | 111 kB   00:00     
(5/7): updates/7/x86_64/primary_db                        |  16 MB   00:00     
(6/7): clickhouse-stable/primary                          |  17 kB   00:01     
(7/7): base-debuginfo/x86_64/primary_db                   | 2.7 MB   00:03     
Determining fastest mirrors* base: mirrors.bupt.edu.cn* epel: mirrors.bfsu.edu.cn* extras: mirrors.bfsu.edu.cn* updates: mirrors.tuna.tsinghua.edu.cn
clickhouse-stable                                                      131/131
kubernetes                                                             823/823
Resolving Dependencies
--> Running transaction check
---> Package glibc.x86_64 0:2.17-260.el7_6.5 will be updated
--> Processing Dependency: glibc = 2.17-260.el7_6.5 for package: glibc-headers-2.17-260.el7_6.5.x86_64
--> Processing Dependency: glibc = 2.17-260.el7_6.5 for package: glibc-devel-2.17-260.el7_6.5.x86_64
--> Processing Dependency: glibc = 2.17-260.el7_6.5 for package: glibc-common-2.17-260.el7_6.5.x86_64
---> Package glibc.x86_64 0:2.17-326.el7_9 will be an update
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-260.el7_6.5 will be updated
---> Package glibc-common.x86_64 0:2.17-326.el7_9 will be an update
---> Package glibc-devel.x86_64 0:2.17-260.el7_6.5 will be updated
---> Package glibc-devel.x86_64 0:2.17-326.el7_9 will be an update
---> Package glibc-headers.x86_64 0:2.17-260.el7_6.5 will be updated
---> Package glibc-headers.x86_64 0:2.17-326.el7_9 will be an update
--> Finished Dependency ResolutionDependencies Resolved===============================================================================Package              Arch          Version               Repository      Size
===============================================================================
Updating:glibc                x86_64        2.17-326.el7_9        updates        3.6 M
Updating for dependencies:glibc-common         x86_64        2.17-326.el7_9        updates         12 Mglibc-devel          x86_64        2.17-326.el7_9        updates        1.1 Mglibc-headers        x86_64        2.17-326.el7_9        updates        691 kTransaction Summary
===============================================================================
Upgrade  1 Package (+3 Dependent packages)Total download size: 17 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/4): glibc-2.17-326.el7_9.x86_64.rpm                    | 3.6 MB   00:00     
(2/4): glibc-devel-2.17-326.el7_9.x86_64.rpm              | 1.1 MB   00:00     
(3/4): glibc-common-2.17-326.el7_9.x86_64.rpm             |  12 MB   00:00     
(4/4): glibc-headers-2.17-326.el7_9.x86_64.rpm            | 691 kB   00:00     
-------------------------------------------------------------------------------
Total                                              22 MB/s |  17 MB  00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionUpdating   : glibc-2.17-326.el7_9.x86_64                                 1/8 
warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnewUpdating   : glibc-common-2.17-326.el7_9.x86_64                          2/8 Updating   : glibc-headers-2.17-326.el7_9.x86_64                         3/8 Updating   : glibc-devel-2.17-326.el7_9.x86_64                           4/8 Cleanup    : glibc-devel-2.17-260.el7_6.5.x86_64                         5/8 Cleanup    : glibc-headers-2.17-260.el7_6.5.x86_64                       6/8 Cleanup    : glibc-2.17-260.el7_6.5.x86_64                               7/8 Cleanup    : glibc-common-2.17-260.el7_6.5.x86_64                        8/8 Verifying  : glibc-common-2.17-326.el7_9.x86_64                          1/8 Verifying  : glibc-2.17-326.el7_9.x86_64                                 2/8 Verifying  : glibc-devel-2.17-326.el7_9.x86_64                           3/8 Verifying  : glibc-headers-2.17-326.el7_9.x86_64                         4/8 Verifying  : glibc-devel-2.17-260.el7_6.5.x86_64                         5/8 Verifying  : glibc-headers-2.17-260.el7_6.5.x86_64                       6/8 Verifying  : glibc-common-2.17-260.el7_6.5.x86_64                        7/8 Verifying  : glibc-2.17-260.el7_6.5.x86_64                               8/8 Updated:glibc.x86_64 0:2.17-326.el7_9                                                Dependency Updated:glibc-common.x86_64 0:2.17-326.el7_9    glibc-devel.x86_64 0:2.17-326.el7_9  glibc-headers.x86_64 0:2.17-326.el7_9  Complete!
[root@master Code]# debuginfo-install glibc
Loaded plugins: fastestmirror
enabling epel-debuginfo
enabling docker-ce-stable-debuginfo
docker-ce-stable-debuginfo                              | 3.5 kB     00:00     
epel-debuginfo/x86_64/metalink                          | 9.6 kB     00:00     
epel-debuginfo                                          | 3.0 kB     00:00     
(1/3): epel-debuginfo/x86_64/primary_db                   | 902 kB   00:00     
(2/3): docker-ce-stable-debuginfo/x86_64/primary_db       | 6.4 kB   00:00     
(3/3): docker-ce-stable-debuginfo/x86_64/updateinfo       |   55 B   00:00     
Loading mirror speeds from cached hostfile* base: mirrors.bupt.edu.cn* epel: mirrors.bfsu.edu.cn* epel-debuginfo: mirrors.bfsu.edu.cn* extras: mirrors.bfsu.edu.cn* updates: mirrors.tuna.tsinghua.edu.cn
--> Running transaction check
---> Package glibc-debuginfo.x86_64 0:2.17-326.el7_9 will be installed
--> Processing Dependency: glibc-debuginfo-common = 2.17-326.el7_9 for package: glibc-debuginfo-2.17-326.el7_9.x86_64
---> Package nss-softokn-debuginfo.x86_64 0:3.28.3-6.el7 will be installed
---> Package yum-plugin-auto-update-debug-info.noarch 0:1.1.31-54.el7_8 will be installed
--> Running transaction check
---> Package glibc-debuginfo-common.x86_64 0:2.17-326.el7_9 will be installed
--> Finished Dependency ResolutionDependencies Resolved===============================================================================Package                           Arch   Version         Repository      Size
===============================================================================
Installing:glibc-debuginfo                   x86_64 2.17-326.el7_9  base-debuginfo 9.5 Mnss-softokn-debuginfo             x86_64 3.28.3-6.el7    base-debuginfo 1.9 Myum-plugin-auto-update-debug-info noarch 1.1.31-54.el7_8 base            29 k
Installing for dependencies:glibc-debuginfo-common            x86_64 2.17-326.el7_9  base-debuginfo 9.7 MTransaction Summary
===============================================================================
Install  3 Packages (+1 Dependent package)Total download size: 21 M
Installed size: 119 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/base-debuginfo/packages/glibc-debuginfo-2.17-326.el7_9.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID b6792c39: NOKEY
Public key for glibc-debuginfo-2.17-326.el7_9.x86_64.rpm is not installed
(1/4): glibc-debuginfo-2.17-326.el7_9.x86_64.rpm          | 9.5 MB   00:06     
(2/4): yum-plugin-auto-update-debug-info-1.1.31-54.el7_8. |  29 kB   00:00     
(3/4): nss-softokn-debuginfo-3.28.3-6.el7.x86_64.rpm      | 1.9 MB   00:00     
(4/4): glibc-debuginfo-common-2.17-326.el7_9.x86_64.rpm   | 9.7 MB   01:46     
-------------------------------------------------------------------------------
Total                                             203 kB/s |  21 MB  01:46     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7
Importing GPG key 0xB6792C39:Userid     : "CentOS-7 Debug (CentOS-7 Debuginfo RPMS) <security@centos.org>"Fingerprint: 759d 690f 6099 2d52 6a35 8cbd d0f2 5a3c b679 2c39Package    : centos-release-7-4.1708.el7.centos.x86_64 (@anaconda)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7
Is this ok [y/N]: yKey imported successfully
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : glibc-debuginfo-common-2.17-326.el7_9.x86_64                1/4 Installing : glibc-debuginfo-2.17-326.el7_9.x86_64                       2/4 Installing : yum-plugin-auto-update-debug-info-1.1.31-54.el7_8.noarch    3/4 Installing : nss-softokn-debuginfo-3.28.3-6.el7.x86_64                   4/4 Verifying  : nss-softokn-debuginfo-3.28.3-6.el7.x86_64                   1/4 Verifying  : yum-plugin-auto-update-debug-info-1.1.31-54.el7_8.noarch    2/4 Verifying  : glibc-debuginfo-common-2.17-326.el7_9.x86_64                3/4 Verifying  : glibc-debuginfo-2.17-326.el7_9.x86_64                       4/4 Installed:glibc-debuginfo.x86_64 0:2.17-326.el7_9                                      nss-softokn-debuginfo.x86_64 0:3.28.3-6.el7                                  yum-plugin-auto-update-debug-info.noarch 0:1.1.31-54.el7_8                   Dependency Installed:glibc-debuginfo-common.x86_64 0:2.17-326.el7_9                               Complete!
[root@master Code]# 
[root@master Code]# 

分享一个有趣的 学习链接:https://xxetb.xet.tech/s/HY8za

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/149957.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Redis学习笔记14:基于spring data redis及lua脚本ZSET有序集合实现环形结构案例及lua脚本如何发送到redis服务器

案例实现目标&#xff0c;一、实现一个环形结构&#xff0c;环形结构上节点有一个阀值threshold,超过阀值则移除分数score最低的成员&#xff0c;不足则将当前成员添加进环中&#xff0c;且确保成员不可重复&#xff1b;二、每次访问环中的数据都需要刷新key的过期时间&#xf…

亚马逊云科技AI创新应用下的托管在AWS上的数据可视化工具—— Amazon QuickSight

目录 Amazon QuickSight简介 Amazon QuickSight的独特之处 Amazon QuickSight注册 Amazon QuickSight使用 Redshift和Amazon QuickSightt平台构建数据可视化应用程序 构建数据仓库 数据可视化 Amazon QuickSight简介 亚马逊QuickSight是一项可用于交付的云级商业智能 (BI…

基于circle group的Reed-Solomon codes

1. 引言 Polygon团队Ulrich Habock等人2023年论文 Reed-Solomon codes over the circle group。 前序博客有&#xff1a; Plonky3 Mersenne素数域的Reed-Solomon codes设计 STARKs支持任意size的域&#xff0c;而不要求是椭圆曲线。STARKs中在选择域size时&#xff0c;越小…

Unity中 Start和Awake的区别

Awake和Start在Unity中都是MonoBehaviour脚本中的生命周期函数 Awake函数在游戏对象首次被加载时调用&#xff0c;在游戏对象初始化之前调用。 start函数在游戏对象初始化完成后调用&#xff0c;在update第一次执行前调用。 这两个函数在其生命周期内都只会调用一次&#xf…

替换sql,某个字段特定容

要替换wp_posts表中的wp_posts.post_content字段中的特定文本&#xff0c;可以使用MySQL的UPDATE语句和字符串替换函数来实现。 sql&#xff1a;语句 UPDATE 表名 SET 字段名 REPLACE(字段名, 原本内容, 替换内容);请注意&#xff0c;执行这样的操作可能会对数据库产生较大的…

verilog语言中条件编译ifdef的使用和例子

1条件编译ifdef 如果ifdef后面的参数被编译过&#xff0c;则编译ifdef语句后的内容&#xff0c;忽略else后面的内容&#xff0c;如果ifdef后面的参数没有被编译过&#xff0c;则编译else语句后面的内容&#xff0c;条件编译的范围以ifdef开始&#xff0c;以endif结束&#xff…

Android studio访问选程https接口(.crt handshake)

如果服务器是https的&#xff0c;访问受限怎么办&#xff1f;有两种方法&#xff0c;一种是接受一切证书个人官方正式非正式&#xff0c;当然这样就牺牲了安全性&#xff0c;网上方法很多&#xff0c;我现在教大家如何去验证crt文件 首先服务器是https的&#xff0c;必然有几个…

js数组操作——对象数组根据某个相同的字段分组

js数组操作——对象数组根据某个相同的字段分组 可以使用JavaScript的map()方法和reduce()方法来实现将数组中包含的数组对象的某个字段整合为数组的操作。具体实现方法如下&#xff1a; 假设有以下数组对象arr&#xff1a;let arr [{name: Tom, age: 18, hobbies: [reading,…

SpringBoot的启动流程

一、SpringBoot是什么&#xff1f; springboot是依赖于spring的&#xff0c;比起spring&#xff0c;除了拥有spring的全部功能以外&#xff0c;springboot无需繁琐的xml配置&#xff0c;这取决于它自身强大的自动装配功能&#xff1b;并且自身已嵌入Tomcat、Jetty等web容器&am…

redis+python 建立免费http-ip代理池;验证+留接口

前言: 效果图: 对于网络上的一些免费代理ip,http的有效性还是不错的;但是,https的可谓是凤毛菱角; 正巧,有一个web可以用http访问,于是我就想到不如直接拿着免费的HTTP代理去做这个! 思路: 1.单页获取ipporttime (获取time主要是为了后面使用的时候,依照时效可以做文章) 2.整…

windows环境搭建Zblog博客并发布上线公网可访问

文章目录 1. 前言2. Z-blog网站搭建2.1 XAMPP环境设置2.2 Z-blog安装2.3 Z-blog网页测试2.4 Cpolar安装和注册 3. 本地网页发布3.1. Cpolar云端设置3.2 Cpolar本地设置 4. 公网访问测试5. 结语 1. 前言 想要成为一个合格的技术宅或程序员&#xff0c;自己搭建网站制作网页是绕…

总结 CNN 模型:将焦点转移到基于注意力的架构

一、说明 在计算机视觉时代&#xff0c;卷积神经网络&#xff08;CNN&#xff09;几十年来一直是主导范式。直到 2021 年 Vision Transformers (ViTs) 出现&#xff0c;这个领域才开始发生变化。现在&#xff0c;是时候采用受 Transformer 架构启发的基于注意力的模型了&#x…

Springboot+vue的机动车号牌管理系统(有报告)。Javaee项目,springboot vue前后端分离项目

演示视频: Springbootvue的机动车号牌管理系统&#xff08;有报告&#xff09;。Javaee项目&#xff0c;springboot vue前后端分离项目 项目介绍&#xff1a; 本文设计了一个基于Springbootvue的前后端分离的机动车号牌管理系统&#xff0c;采用M&#xff08;model&#xff09…

项目九、无线组网

目录 1 配置AC使AP放出Wifi1.1 确保AP和AC三层互通且AP知道AC的IP1.1.1 配置管理SVI的IP1.1.2 该SVI配置DHCP下发IP给AP 1.2 AC为AP下发配置1.2.1 AC用哪个接口回复AP1.2.2 AC验证AP身份&#xff08;可以不认证&#xff09;1.2.3 配置ssid 文件确定Wifi名称1.2.4 配置security …

Mac开发指南

文章目录 1 前期准备1.1 brew1.2 tmux 1 前期准备 1.1 brew 用于下载软件 ubuntu用apt-get mac用brew /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"1.2 tmux

华纳云:租用的服务器连接超时怎么办?

服务器连接超时可能由多种原因引起&#xff0c;解决问题的方法取决于具体的情况。以下是一些常见的原因和相应的解决方法&#xff1a; 网络问题&#xff1a; 检查本地网络&#xff1a; 确保本地网络连接正常&#xff0c;尝试访问其他网站或服务&#xff0c;检查是否存在网络问题…

pnpm的安装及其使用

1、pnpm是什么 pnpm &#xff08;performant npm&#xff0c;意思是高性能的 npm&#xff09;是 Node.js 的替代包管理器。它是 npm 的直接替代品&#xff0c;速度更快、效率更高。为什么效率更高&#xff1f;当你安装一个包时&#xff0c;pnpm 将它保存在你机器上的一个全局存…

Java后台防止请求重复提交,拦截器+注解实现防止表单重复提交

一、前言 由于网络原因&#xff0c;用户操作有误&#xff08;连续点击两次以上提交按钮&#xff09;&#xff0c;或者页面卡顿等原因&#xff0c;可能会出现请求重复提交&#xff0c;造成数据库保存多条重复数据。后端实现拦截器防重。 那么如何防止请求重复提交呢&#xff1f…

Apache Pulsar 技术系列 - 基于 Pulsar 的海量 DB 数据采集和分拣

导语 Apache Pulsar 是一个多租户、高性能的服务间消息传输解决方案&#xff0c;支持多租户、低延时、读写分离、跨地域复制、快速扩容、灵活容错等特性。本文是 Pulsar 技术系列中的一篇&#xff0c;主要介绍 Pulsar 在海量DB Binlog 增量数据采集、分拣场景下的应用。 前言…

程序员开发者神器:10个.Net开源项目

今天一起盘点下&#xff0c;8月份推荐的10个.Net开源项目&#xff08;点击标题查看详情&#xff09;。 1、基于C#开发的适合Windows开源文件管理器 该项目是一个基于C#开发、开源的文件管理器&#xff0c;适用于Windows&#xff0c;界面UI美观、方便轻松浏览文件。此外&#…