2013-01-21 15:54:01 +00:00
|
|
|
We may abort the process of detaching threads with multiple SIGINTs - which are
|
|
|
|
being sent during a testcase terminating its child GDB.
|
|
|
|
|
|
|
|
Some of the threads may not be properly PTRACE_DETACHed which hurts if they
|
|
|
|
should have been detached with SIGSTOP (as they are accidentally left running
|
|
|
|
on the debugger termination).
|
|
|
|
|
2014-06-19 20:14:32 +00:00
|
|
|
Index: gdb-7.7.90.20140613/gdb/defs.h
|
2013-01-21 15:54:01 +00:00
|
|
|
===================================================================
|
2014-06-19 20:14:32 +00:00
|
|
|
--- gdb-7.7.90.20140613.orig/gdb/defs.h 2014-06-13 23:10:18.876623018 +0200
|
|
|
|
+++ gdb-7.7.90.20140613/gdb/defs.h 2014-06-13 23:10:52.450660505 +0200
|
|
|
|
@@ -174,6 +174,7 @@ extern void set_quit_flag (void);
|
|
|
|
/* Flag that function quit should call quit_force. */
|
|
|
|
extern volatile int sync_quit_force_run;
|
2013-01-21 15:54:01 +00:00
|
|
|
|
|
|
|
+extern int quit_flag_cleanup;
|
|
|
|
extern int immediate_quit;
|
|
|
|
|
|
|
|
extern void quit (void);
|
2014-06-19 20:14:32 +00:00
|
|
|
Index: gdb-7.7.90.20140613/gdb/top.c
|
2013-01-21 15:54:01 +00:00
|
|
|
===================================================================
|
2014-06-19 20:14:32 +00:00
|
|
|
--- gdb-7.7.90.20140613.orig/gdb/top.c 2014-06-13 23:10:15.910619715 +0200
|
|
|
|
+++ gdb-7.7.90.20140613/gdb/top.c 2014-06-13 23:10:18.877623020 +0200
|
|
|
|
@@ -1378,7 +1378,9 @@ quit_force (char *args, int from_tty)
|
2013-08-02 20:26:03 +00:00
|
|
|
if (ex.reason < 0) \
|
|
|
|
exception_print (gdb_stderr, ex)
|
2013-01-21 15:54:01 +00:00
|
|
|
|
|
|
|
- /* We want to handle any quit errors and exit regardless. */
|
|
|
|
+ /* We want to handle any quit errors and exit regardless but we should never
|
|
|
|
+ get user-interrupted to properly detach the inferior. */
|
|
|
|
+ quit_flag_cleanup = 1;
|
|
|
|
|
2013-08-02 20:26:03 +00:00
|
|
|
/* Get out of tfind mode, and kill or detach all inferiors. */
|
|
|
|
DO_TRY
|
2014-06-19 20:14:32 +00:00
|
|
|
Index: gdb-7.7.90.20140613/gdb/utils.c
|
2013-01-21 15:54:01 +00:00
|
|
|
===================================================================
|
2014-06-19 20:14:32 +00:00
|
|
|
--- gdb-7.7.90.20140613.orig/gdb/utils.c 2014-06-13 23:10:18.878623021 +0200
|
|
|
|
+++ gdb-7.7.90.20140613/gdb/utils.c 2014-06-13 23:10:38.307644652 +0200
|
|
|
|
@@ -125,6 +125,11 @@ int job_control;
|
2013-01-21 15:54:01 +00:00
|
|
|
|
|
|
|
int immediate_quit;
|
|
|
|
|
|
|
|
+/* Nonzero means we are already processing the quitting cleanups and we should
|
|
|
|
+ no longer get aborted. */
|
|
|
|
+
|
|
|
|
+int quit_flag_cleanup;
|
|
|
|
+
|
2014-06-19 20:14:32 +00:00
|
|
|
/* Nonzero means that strings with character values >0x7F should be printed
|
|
|
|
as octal escapes. Zero means just print the value (e.g. it's an
|
|
|
|
international character, and the terminal or window can cope.) */
|
|
|
|
Index: gdb-7.7.90.20140613/gdb/extension.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-7.7.90.20140613.orig/gdb/extension.c 2014-06-13 03:59:36.000000000 +0200
|
|
|
|
+++ gdb-7.7.90.20140613/gdb/extension.c 2014-06-13 23:11:32.434704853 +0200
|
|
|
|
@@ -817,6 +817,9 @@ check_quit_flag (void)
|
|
|
|
int i, result = 0;
|
|
|
|
const struct extension_language_defn *extlang;
|
2013-01-21 15:54:01 +00:00
|
|
|
|
|
|
|
+ if (quit_flag_cleanup)
|
|
|
|
+ return 0;
|
|
|
|
+
|
2014-06-19 20:14:32 +00:00
|
|
|
ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
|
2013-01-21 15:54:01 +00:00
|
|
|
{
|
2014-06-19 20:14:32 +00:00
|
|
|
if (extlang->ops->check_quit_flag != NULL)
|