This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Release the GIL while running a gdb command or expression
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Wed, 30 Jan 2019 09:51:00 -0500
- Subject: [binutils-gdb] Release the GIL while running a gdb command or expression
*** TEST RESULTS FOR COMMIT b5eba2d8c050b39943918057283470959a5d18c3 ***
Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: b5eba2d8c050b39943918057283470959a5d18c3
Release the GIL while running a gdb command or expression
PR python/23615 points out that gdb.execute_gdb_command does not
release the Python GIL. This means that, while the gdb command is
running, other Python threads do not run.
This patch solves the problem by introducing a new RAII class that can
be used to temporarily release and then re-acquire the GIL, then puts
this into the appropriate places in execute_gdb_command and
gdbpy_parse_and_eval.
This does not include a test case, because after some research I could
not find a way to write one that was not racy.
gdb/ChangeLog
2019-01-30 Tom Tromey <tom@tromey.com>
PR python/23615:
* python/python.c (execute_gdb_command): Use gdbpy_allow_threads.
(gdbpy_parse_and_eval): Likewise.
* python/python-internal.h (gdbpy_allow_threads): New class.
- Follow-Ups:
- Failures on RHEL-s390x-m64, branch master
- Failures on Fedora-i686, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master