binutils-gdb/gdb/python
Tom Tromey b5eba2d8c0 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.
2019-01-30 07:06:20 -07:00
..
lib/gdb Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-all-events.def Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-arch.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-auto-load.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-block.c Remove duplicate or commented-out #includes 2019-01-21 11:14:07 -07:00
py-bpevent.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-breakpoint.c Style improvements in gdb/python 2019-01-02 09:32:06 -07:00
py-cmd.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-continueevent.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-event-types.def Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-event.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-event.h Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-events.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-evtregistry.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-evts.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-exitedevent.c Change inferior_to_inferior_object to return a gdbpy_ref 2019-01-02 16:28:33 -07:00
py-finishbreakpoint.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-frame.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-framefilter.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-function.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-gdb-readline.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-inferior.c Normalize includes to use common/ 2019-01-25 15:28:16 -07:00
py-infevents.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-infthread.c Change inferior_to_inferior_object to return a gdbpy_ref 2019-01-02 16:28:33 -07:00
py-instruction.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-instruction.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-lazy-string.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-linetable.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-newobjfileevent.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-objfile.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-param.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-prettyprint.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-progspace.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-record-btrace.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-record-btrace.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-record-full.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-record-full.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-record.c Simplify gdbpy_stop_recording 2019-01-03 14:49:18 -07:00
py-record.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-ref.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-signalevent.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-stopevent.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-stopevent.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-symbol.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-symtab.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-threadevent.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-type.c Normalize includes to use common/ 2019-01-25 15:28:16 -07:00
py-unwind.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-utils.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-value.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-varobj.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-xmethods.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
python-config.py configure uses incorrect link order when testing libpython 2018-05-04 10:08:09 -04:00
python-internal.h Release the GIL while running a gdb command or expression 2019-01-30 07:06:20 -07:00
python.c Release the GIL while running a gdb command or expression 2019-01-30 07:06:20 -07:00
python.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00