[Python-checkins] bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)

Miss Islington (bot) webhook-mailer at python.org
Mon Mar 9 14:52:32 EDT 2020


https://github.com/python/cpython/commit/5854d451cb35ac38bc07b95afeb077e8a35d5c7d
commit: 5854d451cb35ac38bc07b95afeb077e8a35d5c7d
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-03-09T11:52:27-07:00
summary:

bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)


python-gdb.py now checks for "take_gil" function name to check if a
frame tries to acquire the GIL, instead of checking for
"pthread_cond_timedwait" which is specific to Linux and can be a
different condition than the GIL.
(cherry picked from commit 6d0ee60740f2862a878f009671b1aaa75aeb0c2a)

Co-authored-by: Victor Stinner <vstinner at python.org>

files:
A Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst
M Tools/gdb/libpython.py

diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst b/Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst
new file mode 100644
index 0000000000000..2c845e7df7935
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst
@@ -0,0 +1,4 @@
+Port python-gdb.py to FreeBSD. python-gdb.py now checks for "take_gil"
+function name to check if a frame tries to acquire the GIL, instead of
+checking for "pthread_cond_timedwait" which is specific to Linux and can be
+a different condition than the GIL.
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 93f997c21e770..9496ff2e0d8d2 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -1600,7 +1600,7 @@ def is_waiting_for_gil(self):
         # This assumes the _POSIX_THREADS version of Python/ceval_gil.h:
         name = self._gdbframe.name()
         if name:
-            return 'pthread_cond_timedwait' in name
+            return (name == 'take_gil')
 
     def is_gc_collect(self):
         '''Is this frame "collect" within the garbage-collector?'''



More information about the Python-checkins mailing list