]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 9 Mar 2020 18:52:27 +0000 (11:52 -0700)
committerGitHub <noreply@github.com>
Mon, 9 Mar 2020 18:52:27 +0000 (11:52 -0700)
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@python.org>
Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst [new file with mode: 0644]
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 (file)
index 0000000..2c845e7
--- /dev/null
@@ -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.
index 93f997c21e7706dbb90df78f0ae0c89593c892d1..9496ff2e0d8d24d84755f4b37026204e55e95365 100755 (executable)
@@ -1600,7 +1600,7 @@ class Frame(object):
         # 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?'''