[英]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.