2008-08-27 11:07:47 +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).
|
|
|
|
|
2011-01-01 00:27:30 +00:00
|
|
|
Index: gdb-7.2.50.20101231/gdb/defs.h
|
2008-12-14 14:05:20 +00:00
|
|
|
===================================================================
|
2011-01-01 00:27:30 +00:00
|
|
|
--- gdb-7.2.50.20101231.orig/gdb/defs.h 2011-01-01 01:00:29.000000000 +0100
|
|
|
|
+++ gdb-7.2.50.20101231/gdb/defs.h 2011-01-01 01:09:17.000000000 +0100
|
|
|
|
@@ -165,6 +165,7 @@ extern char *python_libdir;
|
2008-08-27 11:07:47 +00:00
|
|
|
extern char *debug_file_directory;
|
|
|
|
|
|
|
|
extern int quit_flag;
|
|
|
|
+extern int quit_flag_cleanup;
|
|
|
|
extern int immediate_quit;
|
|
|
|
extern int sevenbit_strings;
|
|
|
|
|
2011-01-01 00:27:30 +00:00
|
|
|
@@ -178,7 +179,7 @@ extern void quit (void);
|
2008-12-14 14:05:20 +00:00
|
|
|
needed. */
|
|
|
|
|
2008-08-27 11:07:47 +00:00
|
|
|
#define QUIT { \
|
|
|
|
- if (quit_flag) quit (); \
|
|
|
|
+ if (quit_flag && !quit_flag_cleanup) quit (); \
|
|
|
|
if (deprecated_interactive_hook) deprecated_interactive_hook (); \
|
|
|
|
}
|
2008-12-14 14:05:20 +00:00
|
|
|
|
2011-01-01 00:27:30 +00:00
|
|
|
Index: gdb-7.2.50.20101231/gdb/event-top.c
|
2008-12-14 14:05:20 +00:00
|
|
|
===================================================================
|
2011-01-01 00:27:30 +00:00
|
|
|
--- gdb-7.2.50.20101231.orig/gdb/event-top.c 2011-01-01 01:07:37.000000000 +0100
|
|
|
|
+++ gdb-7.2.50.20101231/gdb/event-top.c 2011-01-01 01:09:39.000000000 +0100
|
|
|
|
@@ -904,7 +904,7 @@ async_request_quit (gdb_client_data arg)
|
2008-08-27 11:07:47 +00:00
|
|
|
is no reason to call quit again here, unless immediate_quit is
|
2011-01-01 00:27:30 +00:00
|
|
|
set. */
|
2008-08-27 11:07:47 +00:00
|
|
|
|
|
|
|
- if (quit_flag || immediate_quit)
|
|
|
|
+ if ((quit_flag || immediate_quit) && !quit_flag_cleanup)
|
|
|
|
quit ();
|
|
|
|
}
|
|
|
|
|
2011-01-01 00:27:30 +00:00
|
|
|
Index: gdb-7.2.50.20101231/gdb/top.c
|
2008-12-14 14:05:20 +00:00
|
|
|
===================================================================
|
2011-01-01 00:27:30 +00:00
|
|
|
--- gdb-7.2.50.20101231.orig/gdb/top.c 2011-01-01 01:00:29.000000000 +0100
|
|
|
|
+++ gdb-7.2.50.20101231/gdb/top.c 2011-01-01 01:09:17.000000000 +0100
|
|
|
|
@@ -1254,7 +1254,9 @@ quit_force (char *args, int from_tty)
|
2008-08-27 11:07:47 +00:00
|
|
|
qt.args = args;
|
|
|
|
qt.from_tty = from_tty;
|
|
|
|
|
|
|
|
- /* 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;
|
|
|
|
catch_errors (quit_target, &qt,
|
|
|
|
"Quitting: ", RETURN_MASK_ALL);
|
|
|
|
|
2011-01-01 00:27:30 +00:00
|
|
|
Index: gdb-7.2.50.20101231/gdb/utils.c
|
2008-12-14 14:05:20 +00:00
|
|
|
===================================================================
|
2011-01-01 00:27:30 +00:00
|
|
|
--- gdb-7.2.50.20101231.orig/gdb/utils.c 2011-01-01 01:00:29.000000000 +0100
|
|
|
|
+++ gdb-7.2.50.20101231/gdb/utils.c 2011-01-01 01:09:17.000000000 +0100
|
|
|
|
@@ -121,6 +121,11 @@ int job_control;
|
2008-08-27 11:07:47 +00:00
|
|
|
|
|
|
|
int quit_flag;
|
|
|
|
|
|
|
|
+/* Nonzero means we are already processing the quitting cleanups and we should
|
|
|
|
+ no longer get aborted. */
|
|
|
|
+
|
|
|
|
+int quit_flag_cleanup;
|
|
|
|
+
|
|
|
|
/* Nonzero means quit immediately if Control-C is typed now, rather
|
|
|
|
than waiting until QUIT is executed. Be careful in setting this;
|
|
|
|
code which executes with immediate_quit set has to be very careful
|