我跟着STL Support Tools並發現它不能在我的系統上工作。 我使用gnome Ubuntu 14.04。我試過這個:gdb漂亮打印機stl扔「TypeError」
(gdb) p vct
Python Exception <class 'TypeError'> iter() returned non-iterator of type '_iterator':
$1 = std::vector of length 20, capacity 32
它拋出一個「TypeError」,只打印長度和容量。 我的G ++和gdb的版本:
g++ --version
g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2
gdb --version
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
我.gdbinit:
python
import sys
sys.path.insert(0,'/home/james/bin/gdb_printers/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
請幫助我,非常感謝你。
感謝您的回覆。您的解決方案在Ubuntu 14.10上不起作用,它使用python 3作爲gdb。我現在已經解決了這個問題,搜索後,我發現https://github.com/Manicqin/gdb_printers__python,它可以很好地解決我的問題。 – Mackerel