public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] Fix Python3.9 related runtime problems
Date: Thu, 28 May 2020 10:42:17 -0700	[thread overview]
Message-ID: <20200528104217.06125a54@f31-4.lan> (raw)
In-Reply-To: <87d06ohzzf.fsf@tromey.com>

On Thu, 28 May 2020 08:54:12 -0600
Tom Tromey <tom@tromey.com> wrote:

> Kevin>    /* Release the GIL while gdb runs.  */
> Kevin> +#if PY_VERSION_HEX < 0x03090000
> Kevin>    PyThreadState_Swap (NULL);
> Kevin>    PyEval_ReleaseLock ();
> Kevin> +#else
> Kevin> +  PyEval_SaveThread ();
> Kevin> +#endif  
>  
> I tend to think we could use PyEval_SaveThread in all cases.

You're right.  I tested the patch below on F28 through F32 and Rawhide
w/ Python 3.9.  No problems encountered.

I've just sent a v2 patch to the list with this change.

diff --git a/gdb/python/python.c b/gdb/python/python.c
index 049d264442..4bdd2201ab 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1790,12 +1790,7 @@ do_start_initialization ()
     return false;
 
   /* Release the GIL while gdb runs.  */
-#if PY_VERSION_HEX < 0x03090000
-  PyThreadState_Swap (NULL);
-  PyEval_ReleaseLock ();
-#else
   PyEval_SaveThread ();
-#endif
 
   make_final_cleanup (finalize_python, NULL);


      reply	other threads:[~2020-05-28 17:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  4:45 Kevin Buettner
2020-05-28 14:54 ` Tom Tromey
2020-05-28 17:42   ` Kevin Buettner [this message]

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=20200528104217.06125a54@f31-4.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).