[RFC] Bump minimum Python version to 3.4
Tom Tromey
tromey@adacore.com
Fri Jun 2 16:33:03 GMT 2023
While looking into the f-string issue, I noticed that the README
documents 3.2 as the minimum Python version, while gdb.texinfo says
3.0.2. Asking on irc, I found out that SuSE's "LTS" ships 3.4, and
RHEL 7 ships 3.6. Based on this I think it's reasonable to bump the
minimum required version to 3.4.
---
gdb/NEWS | 2 ++
gdb/README | 2 +-
gdb/doc/gdb.texinfo | 2 +-
gdb/python/py-gdb-readline.c | 4 ----
gdb/python/python-internal.h | 11 -----------
5 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/gdb/NEWS b/gdb/NEWS
index 649a3a9824a..4a8f51c06c3 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,8 @@
*** Changes since GDB 13
+* The minimum supported version of Python is now 3.4.
+
* The AArch64 'org.gnu.gdb.aarch64.pauth' Pointer Authentication feature string
has been deprecated in favor of the 'org.gnu.gdb.aarch64.pauth_v2' feature
string.
diff --git a/gdb/README b/gdb/README
index 9699f4890c6..527aa5ff27c 100644
--- a/gdb/README
+++ b/gdb/README
@@ -516,7 +516,7 @@ more obscure GDB `configure' options are not listed here.
GDB scripting much more powerful than the restricted CLI
scripting language. If your host does not have Python installed,
you can find it on `http://www.python.org/download/'. The oldest
- version of Python supported by GDB is 3.2. The optional argument
+ version of Python supported by GDB is 3.4. The optional argument
PYTHON is used to find the Python headers and libraries. It can
be either the name of a Python executable, or the name of the
directory in which Python is installed.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index fc55c4e7b43..09adce80e85 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -40421,7 +40421,7 @@ libpython is present and found at configure time.) Python makes
@value{GDBN} scripting much more powerful than the restricted CLI
scripting language. If your host does not have Python installed, you
can find it on @url{http://www.python.org/download/}. The oldest version
-of Python supported by GDB is 3.0.1. The optional argument @var{python}
+of Python supported by GDB is 3.4. The optional argument @var{python}
is used to find the Python headers and libraries. It can be either
the name of a Python executable, or the name of the directory in which
Python is installed.
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
index 124cec8055d..698f6cad038 100644
--- a/gdb/python/py-gdb-readline.c
+++ b/gdb/python/py-gdb-readline.c
@@ -30,11 +30,7 @@
static char *
gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
-#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 4
const char *prompt)
-#else
- char *prompt)
-#endif
{
int n;
const char *p = NULL;
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 93217375cc5..83fb9b79453 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -123,17 +123,6 @@ typedef unsigned long gdb_py_ulongest;
#endif /* HAVE_LONG_LONG */
-#if PY_VERSION_HEX < 0x03020000
-typedef long Py_hash_t;
-#endif
-
-/* PyMem_RawMalloc appeared in Python 3.4. For earlier versions, we can just
- fall back to PyMem_Malloc. */
-
-#if PY_VERSION_HEX < 0x03040000
-#define PyMem_RawMalloc PyMem_Malloc
-#endif
-
/* PyObject_CallMethod's 'method' and 'format' parameters were missing
the 'const' qualifier before Python 3.4. Hence, we wrap the
function in our own version to avoid errors with string literals.
--
2.40.0
More information about the Gdb-patches
mailing list