From patchwork Fri Jun 2 16:33:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 70551 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 521CF3856DD4 for ; Fri, 2 Jun 2023 16:33:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 521CF3856DD4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685723618; bh=1IGsqNc8cH9CEEXSHFy8KntVkpfvoEYimc/k2lzYaDE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=n6p87ZbZOpTuu8wY/fkr3/E91lC9R1X2sNUwhyojQSODOuHU4xV0KWUKORHTs0Kif VINhQUJOljw5O7+VHWcjdN/ak8106gZQQp8WzG9PJX2Ekc4LplUnc3FHV2FPOW9aF8 e48OxdsoVBNu8fzyl6Dxu1WJhbsPwrWSXmPOy7DE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id 7B0A9385771B for ; Fri, 2 Jun 2023 16:33:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B0A9385771B Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-77499bf8e8bso54005739f.0 for ; Fri, 02 Jun 2023 09:33:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685723593; x=1688315593; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1IGsqNc8cH9CEEXSHFy8KntVkpfvoEYimc/k2lzYaDE=; b=dL9O0nnoyEVLKhEtj4PEsG/LSUfMqtiDgzQJDCFuTyyqLCd7YGS7+PnldeMeBxw1r3 zGfWUFHqiN6/80HChfN49wbJ/Ebj4Cy2X80db9g6bQz9DELX75HGtR7EPp2VG7pC37WX zgvxpgzWe9N8Sz36KoDR3RSac9jxXLVv2IBqiCMl8n0yWYA926K0wyQAX52eCn303XVJ aViRn0tNiQSavc2hCww1BVOnRirr5cYGls/3LH+YVcWTz2Npmj4CqXzZkTsbxr8HK3gP 2VBW3IEBZNjmc7QHy0OX9o8YZSzwpa2Ay79x3Xa+DXg5x02F1/mxdyloHRATcwfTbTQ4 UNEA== X-Gm-Message-State: AC+VfDzHNUuUgn/vExceHlIs7S3SKBdfct4MduWODl4qZ7SdurjxnGu1 kdR7hH22K+SirOYOZi23aCU7Z07I5TiTwnK6LFkgUg== X-Google-Smtp-Source: ACHHUZ67NGXx/1ZtabX/rUoCblUqYTZNX/xxFjHvWd7t69SPw0qR6z7fDF7zthSJbq7yOyD+OUmO2A== X-Received: by 2002:a5d:9f18:0:b0:776:f6d7:f5b6 with SMTP id q24-20020a5d9f18000000b00776f6d7f5b6mr2305247iot.9.1685723593696; Fri, 02 Jun 2023 09:33:13 -0700 (PDT) Received: from localhost.localdomain (71-211-130-244.hlrn.qwest.net. [71.211.130.244]) by smtp.gmail.com with ESMTPSA id h15-20020a02c4cf000000b0040bbcee6b57sm366172jaj.133.2023.06.02.09.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 09:33:13 -0700 (PDT) To: gdb-patches@sourceware.org Cc: legouguec@adacore.com, Tom Tromey Subject: [RFC] Bump minimum Python version to 3.4 Date: Fri, 2 Jun 2023 10:33:03 -0600 Message-Id: <20230602163303.3945535-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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. Reviewed-By: Eli Zaretskii --- 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.