[英]getting python exeception in gdb when "(gdb) step"
当我执行代码行时,我收到 python 异常。 我想要的是进入或跳过,但是当我输入(gdb) step
并且 bang 抛出异常时,我得到了这个异常。 我用-g
标志编译了代码。 抛出这个异常
Python 异常 <class 'NameError'> 安装错误:gdb._execute_unwinders function 缺失:
Thread 3 "s1.o" hit Breakpoint 2, get_payload_to_send (Python Exception <class 'NameError'> Installation error: gdb._execute_unwinders function is missing: p=0x55555555a2c0, pay=0x7ffff75bfe78) at ServerHi1.c:679 warning: Source file is比可执行文件更新。
第679章 (gdb) 步骤
Python 异常 <class 'NameError'> 安装错误:gdb._execute_unwinders function 缺失:
Python 异常 <class 'NameError'> 安装错误:gdb._execute_unwinders function 缺失:
Python 异常 <class 'NameError'> 安装错误:gdb._execute_unwinders function 缺失:
Python 异常 <class 'NameError'> 安装错误:gdb._execute_unwinders function 缺失:
__inet_addr (Python Exception <class 'NameError'> Installation error: gdb._execute_unwinders function is missing: cp=0x55555555a6d2 "192.168.10.25") at inet_addr.c:210 210 inet_addr.c: No such file or directory.
(gdb)
我想要的是进入/跨过单行。 C 中的编码
gdb 版本:GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
我从源代码安装了gdb 11.1
,我遇到了同样的错误。 我通过手动将 python 文件复制到/usr/share/gdb/python
来修复,即:
cd gdb-11.1
make
make install
cp -r./gdb/python/lib/gdb/ /usr/share/gdb/python
额外:从 Debian 10 上的源代码安装 gcc 11.1 作为gdb111
而不是gdb
的完整步骤(即,不覆盖您的系统 gdb):
apt update &&
apt install texinfo wget \
libgmp-dev python3-dev libncurses5-dev libsource-highlight &&
wget http://ftp.gnu.org/gnu/gdb/gdb-11.1.tar.gz &&
tar xvzf gdb-11.1.tar.gz &&
cd gdb-11.1 &&
./configure --prefix=/usr/local/gdb111 \
--program-suffix=111 --with-python=python3 \
--enable-tui=yes --with-curses --enable-gold=yes \
--enable-ld=yes --enable-libada --enable-libssp \
--enable-lto --enable-vtable-verify --enable-werror \
--enable-source-highlight &&
make &&
make install &&
rsync --recursive ./gdb/python/lib/gdb/ /usr/share/gdb/python/gdb/ &&
perl -pi -e '!$x && s/function black b;/function b;/i && ($x=1)' \
/usr/share/source-highlight/esc.style &&
cp /usr/local/gdb111/bin/gdb111 /bin/
或者,不是手动将文件复制到系统中,而是使用参数冷运行 gdb,例如gdb111 -p $(pidof someprocess) --data-directory /path/to/source/gdb-11.1/gdb/data-directory
.
如果您不是像这样从源安装,则可以使用sudo apt install --reinstall gdb
重新安装/恢复 gdb 安装
参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.