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 00000000000..2c845e7df79 --- /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 2ab7d3b11ca..cd7ae1097d4 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -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?'''