From 47ccd6b84bdf35688fb1516f06db68462bd24585 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 29 Mar 2022 14:36:10 -0600 Subject: Only allow QUIT on the main thread Pedro pointed out that gdb worker threads should not react to quits. While I don't think that the new DWARF reader can call QUIT from a worker thread (and I don't think the existing minsym threading code can either), it seems safest to address this before checking in the new code. This patch arranges for the QUIT macro to only work on the main thread. --- gdb/utils.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/utils.c') diff --git a/gdb/utils.c b/gdb/utils.c index 2df9b1d..9ca268a 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -78,6 +78,7 @@ #include "bt-utils.h" #include "gdbsupport/buildargv.h" #include "pager.h" +#include "run-on-main-thread.h" void (*deprecated_error_begin_hook) (void); @@ -681,6 +682,9 @@ quit (void) void maybe_quit (void) { + if (!is_main_thread ()) + return; + if (sync_quit_force_run) quit (); -- cgit v1.1