簡體   English   中英

當“(gdb)步驟”時,在 gdb 中出現 python 異常

[英]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來修復,即:

  1. cd gdb-11.1
  2. make
  3. make install
  4. 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 安裝

參考:

  1. https://superuser.com/questions/102449/how-to-reinstall-a-package-using-apt-get
  2. https://askubuntu.com/questions/32507/how-do-i-get-a-list-of-installed-files-from-a-package
  3. https://bugzilla.redhat.com/show_bug.cgi?id=1688372 - 新 gdb 終端 colors 終端無法讀取 GNO

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM