From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id XP5wDl85GmenDRkAWB0awg (envelope-from ) for ; Thu, 24 Oct 2024 08:11:11 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=JAacW6UV; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=xOICaQQU; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pcBuVoGi; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=9coUIVJb; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 15E1D1E39B; Thu, 24 Oct 2024 08:11:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A834D1E37A for ; Thu, 24 Oct 2024 08:11:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C4913858CD1 for ; Thu, 24 Oct 2024 12:11:09 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 219EF3858D21 for ; Thu, 24 Oct 2024 12:10:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 219EF3858D21 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 219EF3858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729771850; cv=none; b=titm/+zIzzN4ta6Y+LRT7O4E1Hera9n4i1cSFm9lhHI+ujmSyyZm2mwyzb4EUcjR3QdOpKrX03NDwMH115XSd8YQcbp4X39rYxlxxZq61js3aQCNXbNWNOw8vD7vCnR1Xrhl0f9c8+51i70bj+aiESxQVaRtGdSDsnxmvlxxHRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729771850; c=relaxed/simple; bh=2bZ/UFUvIKB32SQBmzZ33XrFAaloUmYy3zF1Nh0DZ5c=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=WuP5j4RDPmYn9JA4lEeam1XTslbdRXB1RZ/M9qv1JDyeARH4K0RyjSJI2TNRkWJeIJPuA9j2u5xsff6EmFW+nVasjZiwqjAtdraaTvKlPn3FpCWRxBsraic0aro7goFcmo99IU7/qJyl7iWJiNYrDa/dWpmXk4XPV9l9SwdP0TE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F19521FB8D; Thu, 24 Oct 2024 12:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1729771839; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=szFZ0v/ef9g0yP6fBDxdvuhWiXzstRYGsehqyXibMkk=; b=JAacW6UVkarSiaIaBugLGp8LYbInsBbTxuNnVikoEiazoKMN0+/OrK5rt1vozO9f8SyvNw DWZ0LojIRkG4WCczX9utHj/HcsdycCGWJ7NSmsRuGWLGnzTyDRmAmbeFcQNR+cj3asGpOC T8msLY7pdFIjUFbl0Wjm9HvpFeHWdYg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1729771839; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=szFZ0v/ef9g0yP6fBDxdvuhWiXzstRYGsehqyXibMkk=; b=xOICaQQUfOKuCrvvJu/WgrMfn9LS1cDBUwPbj9HFtuvjnjGCMqLpAxcDwmkHuMEY0CMFgT EGhxXBKDLncbhcAQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1729771838; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=szFZ0v/ef9g0yP6fBDxdvuhWiXzstRYGsehqyXibMkk=; b=pcBuVoGinHIN7DBfuEl9/KU4P3V6nsnksZcXD8lENza7MI3NTM/KZfjHn8xcbb9O1keAb5 YNvlxd/6U6+ryzveMiV4vVtF6woVLbcGgeDJrAHYWiRpHjlkyg+s3W06IeCoY7gjepC/6S 0JaGItIxS22HRkA1XuOcmrxzwI4e5/c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1729771838; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=szFZ0v/ef9g0yP6fBDxdvuhWiXzstRYGsehqyXibMkk=; b=9coUIVJbJ+Qxmly7pI1IqToU32Ee095KpEkxGc4ieao2ZrGKeBtFuY73nwMQhep90K50ze y3zvT+7AWOZvkGCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D2875136F5; Thu, 24 Oct 2024 12:10:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xjrTMT45GmfKfwAAD6G6ig (envelope-from ); Thu, 24 Oct 2024 12:10:38 +0000 Message-ID: <4ab8631d-751d-43e6-ae33-8551f61c0b7c@suse.de> Date: Thu, 24 Oct 2024 14:11:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Require Python 3.4 To: Tom Tromey , gdb-patches@sourceware.org References: <20241016160000.219628-1-tromey@adacore.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <20241016160000.219628-1-tromey@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, suse.de:email, suse.de:mid] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 10/16/24 18:00, Tom Tromey wrote: > I believe we previously agreed that the minimum supported Python > version should be 3.4. This patch makes this change, harmonizing the > documentation (which was inconsistent about the minimum version) and > the code. Perhaps a good idea to reference PR31870 " [gdb/python, meta] Minimum supported python version" ( https://sourceware.org/bugzilla/show_bug.cgi?id=31870 ). Acked-By: Tom de Vries Thanks, - Tom > --- > gdb/NEWS | 2 ++ > gdb/README | 2 +- > gdb/configure | 4 ++-- > gdb/configure.ac | 4 ++-- > gdb/doc/gdb.texinfo | 2 +- > gdb/python/py-gdb-readline.c | 4 ---- > gdb/python/python-internal.h | 13 ++----------- > 7 files changed, 10 insertions(+), 21 deletions(-) > > diff --git a/gdb/NEWS b/gdb/NEWS > index 42668cbc057..544e805915e 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -51,6 +51,8 @@ > > * Python API > > + ** GDB no longer supports Python versions less than 3.4. > + > ** Added gdb.record.clear. Clears the trace data of the current recording. > This forces re-decoding of the trace for successive commands. > > diff --git a/gdb/README b/gdb/README > index d85c37d5d17..e3bfda45da1 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/configure b/gdb/configure > index ec9bbd3a842..e3e9d1c8ec7 100755 > --- a/gdb/configure > +++ b/gdb/configure > @@ -28157,8 +28157,8 @@ int > main () > { > > - #if PY_MAJOR_VERSION != 3 > - # error "We only support Python 3" > + #if PY_VERSION_HEX < 0x03040000 > + # error "Minimum supported Python version is 3.4" > #endif > Py_Initialize (); > > diff --git a/gdb/configure.ac b/gdb/configure.ac > index 21f5dc8dd30..250b014e56c 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -734,8 +734,8 @@ AC_DEFUN([AC_TRY_LIBPYTHON], > found_usable_python=no > AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "Python.h"]], > [[ > - #if PY_MAJOR_VERSION != 3 > - # error "We only support Python 3" > + #if PY_VERSION_HEX < 0x03040000 > + # error "Minimum supported Python version is 3.4" > #endif > Py_Initialize (); > ]])], > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index 554608da9fd..e12104867c4 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -41182,7 +41182,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 dd0ee45fe2e..d8782a9ff33 100644 > --- a/gdb/python/py-gdb-readline.c > +++ b/gdb/python/py-gdb-readline.c > @@ -29,11 +29,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 d723c4d577b..d3337de9043 100644 > --- a/gdb/python/python-internal.h > +++ b/gdb/python/python-internal.h > @@ -87,6 +87,8 @@ > #include > #include "py-ref.h" > > +static_assert (PY_VERSION_HEX >= 0x03040000); > + > #define Py_TPFLAGS_CHECKTYPES 0 > > /* If Python.h does not define WITH_THREAD, then the various > @@ -134,17 +136,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 > - > /* A template variable holding the format character (as for > Py_BuildValue) for a given type. */ > template