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).
|
|
|
|
|
2016-07-17 14:35:49 +00:00
|
|
|
Index: gdb-7.11.50.20160630/gdb/defs.h
|
|
|
|
===================================================================
|
|
|
|
--- gdb-7.11.50.20160630.orig/gdb/defs.h 2016-07-03 16:40:43.423078926 +0200
|
|
|
|
+++ gdb-7.11.50.20160630/gdb/defs.h 2016-07-03 16:41:08.568271741 +0200
|
|
|
|
@@ -175,6 +175,10 @@
|
2014-06-19 20:14:32 +00:00
|
|
|
/* Flag that function quit should call quit_force. */
|
|
|
|
extern volatile int sync_quit_force_run;
|
2013-01-21 15:54:01 +00:00
|
|
|
|
2016-01-09 14:11:44 +00:00
|
|
|
+#ifdef NEED_DETACH_SIGSTOP
|
2013-01-21 15:54:01 +00:00
|
|
|
+extern int quit_flag_cleanup;
|
2016-01-09 14:11:44 +00:00
|
|
|
+#endif
|
2016-07-17 14:35:49 +00:00
|
|
|
+
|
2013-01-21 15:54:01 +00:00
|
|
|
extern void quit (void);
|
2016-07-17 14:35:49 +00:00
|
|
|
|
|
|
|
/* Helper for the QUIT macro. */
|
|
|
|
Index: gdb-7.11.50.20160630/gdb/extension.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-7.11.50.20160630.orig/gdb/extension.c 2016-07-03 16:40:41.723065890 +0200
|
|
|
|
+++ gdb-7.11.50.20160630/gdb/extension.c 2016-07-03 16:41:44.896550309 +0200
|
|
|
|
@@ -830,6 +830,11 @@
|
2016-01-09 14:11:44 +00:00
|
|
|
int i, result = 0;
|
|
|
|
const struct extension_language_defn *extlang;
|
|
|
|
|
|
|
|
+#ifdef NEED_DETACH_SIGSTOP
|
|
|
|
+ if (quit_flag_cleanup)
|
|
|
|
+ return 0;
|
|
|
|
+#endif
|
2016-07-17 14:35:49 +00:00
|
|
|
+
|
2016-01-09 14:11:44 +00:00
|
|
|
ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
|
|
|
|
{
|
|
|
|
if (extlang->ops->check_quit_flag != NULL)
|
2016-07-17 14:35:49 +00:00
|
|
|
Index: gdb-7.11.50.20160630/gdb/top.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-7.11.50.20160630.orig/gdb/top.c 2016-07-03 16:40:41.724065898 +0200
|
|
|
|
+++ gdb-7.11.50.20160630/gdb/top.c 2016-07-03 16:40:43.424078934 +0200
|
|
|
|
@@ -1617,7 +1617,13 @@
|
2015-05-31 18:47:21 +00:00
|
|
|
qt.args = args;
|
|
|
|
qt.from_tty = from_tty;
|
2013-01-21 15:54:01 +00:00
|
|
|
|
2016-01-09 14:11:44 +00:00
|
|
|
+#ifndef NEED_DETACH_SIGSTOP
|
|
|
|
/* We want to handle any quit errors and exit regardless. */
|
|
|
|
+#else
|
2013-01-21 15:54:01 +00:00
|
|
|
+ /* 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;
|
2016-01-09 14:11:44 +00:00
|
|
|
+#endif
|
2013-01-21 15:54:01 +00:00
|
|
|
|
2013-08-02 20:26:03 +00:00
|
|
|
/* Get out of tfind mode, and kill or detach all inferiors. */
|
2015-05-31 18:47:21 +00:00
|
|
|
TRY
|
2016-07-17 14:35:49 +00:00
|
|
|
Index: gdb-7.11.50.20160630/gdb/utils.c
|
|
|
|
===================================================================
|
|
|
|
--- gdb-7.11.50.20160630.orig/gdb/utils.c 2016-07-03 16:40:41.725065905 +0200
|
|
|
|
+++ gdb-7.11.50.20160630/gdb/utils.c 2016-07-03 16:41:38.961504799 +0200
|
|
|
|
@@ -109,6 +109,13 @@
|
2013-01-21 15:54:01 +00:00
|
|
|
|
2016-07-17 14:35:49 +00:00
|
|
|
int job_control;
|
2013-01-21 15:54:01 +00:00
|
|
|
|
2016-01-09 14:11:44 +00:00
|
|
|
+#ifdef NEED_DETACH_SIGSTOP
|
2013-01-21 15:54:01 +00:00
|
|
|
+/* Nonzero means we are already processing the quitting cleanups and we should
|
|
|
|
+ no longer get aborted. */
|
|
|
|
+
|
|
|
|
+int quit_flag_cleanup;
|
2016-01-09 14:11:44 +00:00
|
|
|
+#endif
|
2016-07-17 14:35:49 +00:00
|
|
|
+
|
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.) */
|