我正在使用 GDB 调试 Kubuntu 12.04 上我的 python 应用程序中的分段错误。据说 GDB 版本 7 具有用于提取有关 python 堆栈的信息的内置宏 (http://docs.python.org/devguide/gdb.html),但我无法让它工作。我已经安装了 python-dbg。
当我在 GDB 中请求 python 堆栈跟踪时,结果如下所示:
(gdb) py-bt
#5 (unable to read python frame information)
#16 (unable to read python frame information)
#26 (unable to read python frame information)
...
Run Code Online (Sandbox Code Playgroud)
我的 GDB 版本是 7.4-2012.04-0ubuntu2,Python 是 2.7.3-0ubuntu3。