Gdb 7.10 Python 扩展版本

Gdb 7.10 Python Version for Extensions

我想移植一些 Python 2.x 代码以在当前版本的 GDB (7.10) 中作为 GDB 扩展工作 该代码是否应该移植到 Python 3.x ,而不用担心向后兼容 2.x?或者这是基于任何 Python 版本系统?理想情况下,我希望脚本可以在安装了 GDB 7.10 的任何 Linux 系统上运行。

阅读 GDB 的文档,没有提到 Python 版本 http://sourceware.org/gdb/onlinedocs/gdb/Python.html#Python

Reading the documentation from GDB there is no reference to Python version

那是因为 GDB 7.10 可以针对 Python 的任何一个版本构建。

Ideally I want the scripts to work on any Linux system with GDB 7.10 installed.

这意味着您必须编写代码,使其适用于 Python 2.x 或 3.x.