最近在一個Ubuntu的機器上,調試程序,每步調試都輸出幾條Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:,看着很不習慣,於是找了個方法解決了下這個問題。
出現這個問題的原因一般是GDB沒有裝好的緣故。解決步驟如下:
1)移除gdb:sudo apt-get purge gdb
2) 源碼方式安裝gdb (說明:如果編譯過程有出現PyUnicodeUCS2_Decode未定義的引用問題,導致編譯無法通過時,執行./configure時,請添加--enable-unicode=ucs4 選項設置,如下所示)
./configure --enable-unicode=ucs4 && make -j4 && sudo make install
3)在sudo make install 時,若提示缺少makeinfo,導致無法install時,請根據提示信息,執行:sudo apt-get install textinfo
通過以上幾個步驟,一般都可以解決該問題。