public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Pedro Alves <pedro@palves.net>, Eli Zaretskii <eliz@gnu.org>,
	Simon Marchi <simon.marchi@efficios.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 1/2] gdb/python: remove Python 2 support
Date: Mon, 21 Mar 2022 12:31:29 -0400	[thread overview]
Message-ID: <cb3d1058-a08e-ee02-af65-2f484a6bf918@simark.ca> (raw)
In-Reply-To: <099c15b0-71e1-2249-82b2-d0456ec240b4@palves.net>

On 2022-03-21 11:33, Pedro Alves wrote:
> On 2022-03-21 15:04, Simon Marchi wrote:
>> On 2022-03-21 10:58, Eli Zaretskii via Gdb-patches wrote:
>>> Here, I think we should say "only against Python 3", or say "Python 2
>>> is not supported as of GDB 13", or something to that effect.  Because
>>> it is otherwise strange to mention Python 3, it sounds "out of the
>>> blue".
>>
>> I'll say "can only be built against Python 3" then.  I'd rather not say
>> "GDB 13", since this text will live for many GDB versions.  Updated
>> locally.
> 
> We document in gdb/README the minimum supported version, so I think you
> could drop the "Python 3" reference completely if you wanted.

Ok, I'll remove that sentence.

> 
> Speaking of which, said gdb/README note should also be updated, as is documents
> that the oldest supported version is 2.6:
> 
> `--with-python[=PYTHON]'
>      Build GDB with Python scripting support.  (Done by default if
>      libpython is present and found at configure time.)  Python makes
>      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 2.6.  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.

Indeed, we should update it.  But we should probably be precise and which
3.x version we support exactly.  The question is what do we support? My
initial patch #3 removed support for below 3.4, so it must be below 3.4.

Using this PPA

https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa

on Ubuntu 18.04, I tried Python 3.1 and above.  Python 3.1 didn't build
because of this:

  CXX    python/py-record-btrace.o
../../gdb/python/py-record-btrace.c: In function 'PyObject* btpy_list_slice(PyObject*, PyObject*)':
../../gdb/python/py-record-btrace.c:504:25: error: cannot convert 'PyObject* {aka _object*}' to 'PySliceObject*' for argument '1' to 'int PySlice_GetIndicesEx(PySliceObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)'
      &step, &slicelength))
                         ^
... which is a "bug" in the Python 3.1 API, fixed in 3.2.  Python 3.2
built fine (although I didn't test further, other than starting GDB).

So I would replace "2.6" with "3.2" in there.  Sounds good?

Simon

  reply	other threads:[~2022-03-21 16:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 15:29 [PATCH 1/3] " Simon Marchi
2022-01-07 15:29 ` [PATCH 2/3] gdb/python: remove Python 2/3 compatibility macros Simon Marchi
2022-01-07 15:29 ` [PATCH 3/3] gdb/python: drop support for Python < 3.4 Simon Marchi
2022-01-07 16:33   ` Eli Zaretskii
2022-01-07 17:14     ` Simon Marchi
2022-01-07 15:33 ` [PATCH 1/3] gdb/python: remove Python 2 support Paul Koning
2022-01-07 15:41   ` Simon Marchi
2022-01-07 17:44 ` Andrew Burgess
2022-01-08  8:18   ` Joel Brobecker
2022-01-10  2:28     ` Simon Marchi
2022-01-10  2:59       ` Joel Brobecker
2022-01-10 16:39         ` Simon Marchi
2022-01-11  3:26           ` Joel Brobecker
2022-01-10 16:26       ` Tom Tromey
2022-03-03 16:31 ` Andrew Burgess
2022-03-03 17:40   ` Simon Marchi
2022-03-21 14:46 ` [PATCH v2 0/2] Remove " Simon Marchi
2022-03-21 14:46   ` [PATCH v2 1/2] gdb/python: remove " Simon Marchi
2022-03-21 14:50     ` Simon Marchi
2022-03-21 14:58     ` Eli Zaretskii
2022-03-21 15:04       ` Simon Marchi
2022-03-21 15:33         ` Pedro Alves
2022-03-21 16:31           ` Simon Marchi [this message]
2022-03-21 16:55             ` Pedro Alves
2022-03-21 17:04               ` Simon Marchi
2022-03-21 14:46   ` [PATCH v2 2/2] gdb/python: remove Python 2/3 compatibility macros Simon Marchi
2022-03-23 11:46   ` [PATCH v2 0/2] Remove Python 2 support Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb3d1058-a08e-ee02-af65-2f484a6bf918@simark.ca \
    --to=simark@simark.ca \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).