关键词

如何为 gdb 安装 python 调试信息?

【问题标题】:How to install python debug-info for gdb?如何为 gdb 安装 python 调试信息?
【发布时间】:2023-04-06 12:32:02
【问题描述】:

我想使用gdb 来调试python 脚本。启动gdb后,输出:

[root@localhost scripts]# gdb python
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.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 /usr/bin/python2.7...Reading symbols from /usr/bin/python2.7...(no debugging symbols found)..
.done.
(no debugging symbols found)...done.
Missing separate debuginfos, use: debuginfo-install python-2.7.5-16.el7.x86_64

根据它的提示,我执行debuginfo-install python-2.7.5-16.el7.x86_64命令,输出为:

[root@localhost scripts]# debuginfo-install python-2.7.5-16.el7.x86_64
Loaded plugins: product-id
centos-extra                                                                               | 3.4 kB  00:00:00
rhel                                                                                       | 4.1 kB  00:00:00
centos-extra/primary_db                                                                    | 563 kB  00:00:00
Could not find debuginfo for main pkg: python-2.7.5-16.el7.x86_64
Could not find debuginfo pkg for dependency package glibc-2.17-55.el7.x86_64
Could not find debuginfo pkg for dependency package python-libs-2.7.5-16.el7.x86_64
No debuginfo packages available to install

P.S.:yum数据源有2个:RHEL 7.0 iso和CentOS链接:

[rhel]
name=rhel 7.0
baseurl=file:///mnt/iso
enabled=1
gpgcheck=0


[centos-extra]
name=centos extra
baseurl=http://cbs.centos.org/repos/virt7-testing/x86_64/os/
enabled=1
gpgcheck=0

如何安装 python 调试信息?

【问题讨论】:

    标签:
    python
    linux
    debugging
    gdb
    rhel

    本文链接:http://task.lmcjl.com/news/12912.html

    展开阅读全文