]>
Commit | Line | Data |
---|---|---|
3a58abaf AM |
1 | We may abort the process of detaching threads with multiple SIGINTs - which are |
2 | being sent during a testcase terminating its child GDB. | |
3 | ||
4 | Some of the threads may not be properly PTRACE_DETACHed which hurts if they | |
5 | should have been detached with SIGSTOP (as they are accidentally left running | |
6 | on the debugger termination). | |
7 | ||
8 | Index: gdb-6.8.50.20081128/gdb/defs.h | |
9 | =================================================================== | |
10 | --- gdb-6.8.50.20081128.orig/gdb/defs.h 2008-11-27 10:23:01.000000000 +0100 | |
11 | +++ gdb-6.8.50.20081128/gdb/defs.h 2008-12-06 21:49:32.000000000 +0100 | |
12 | @@ -155,6 +155,7 @@ extern char *gdb_sysroot; | |
13 | extern char *debug_file_directory; | |
14 | ||
15 | extern int quit_flag; | |
16 | +extern int quit_flag_cleanup; | |
17 | extern int immediate_quit; | |
18 | extern int sevenbit_strings; | |
19 | ||
20 | @@ -168,7 +169,7 @@ extern void quit (void); | |
21 | needed. */ | |
22 | ||
23 | #define QUIT { \ | |
24 | - if (quit_flag) quit (); \ | |
25 | + if (quit_flag && !quit_flag_cleanup) quit (); \ | |
26 | if (deprecated_interactive_hook) deprecated_interactive_hook (); \ | |
27 | } | |
28 | ||
29 | Index: gdb-6.8.50.20081128/gdb/event-top.c | |
30 | =================================================================== | |
31 | --- gdb-6.8.50.20081128.orig/gdb/event-top.c 2008-12-04 10:34:31.000000000 +0100 | |
32 | +++ gdb-6.8.50.20081128/gdb/event-top.c 2008-12-06 21:49:07.000000000 +0100 | |
33 | @@ -939,7 +939,7 @@ async_request_quit (gdb_client_data arg) | |
34 | is no reason to call quit again here, unless immediate_quit is | |
35 | set.*/ | |
36 | ||
37 | - if (quit_flag || immediate_quit) | |
38 | + if ((quit_flag || immediate_quit) && !quit_flag_cleanup) | |
39 | quit (); | |
40 | } | |
41 | ||
42 | Index: gdb-6.8.50.20081128/gdb/top.c | |
43 | =================================================================== | |
44 | --- gdb-6.8.50.20081128.orig/gdb/top.c 2008-12-04 10:23:12.000000000 +0100 | |
45 | +++ gdb-6.8.50.20081128/gdb/top.c 2008-12-06 21:49:07.000000000 +0100 | |
46 | @@ -1299,7 +1299,9 @@ quit_force (char *args, int from_tty) | |
47 | qt.args = args; | |
48 | qt.from_tty = from_tty; | |
49 | ||
50 | - /* We want to handle any quit errors and exit regardless. */ | |
51 | + /* We want to handle any quit errors and exit regardless but we should never | |
52 | + get user-interrupted to properly detach the inferior. */ | |
53 | + quit_flag_cleanup = 1; | |
54 | catch_errors (quit_target, &qt, | |
55 | "Quitting: ", RETURN_MASK_ALL); | |
56 | ||
57 | Index: gdb-6.8.50.20081128/gdb/utils.c | |
58 | =================================================================== | |
59 | --- gdb-6.8.50.20081128.orig/gdb/utils.c 2008-12-04 10:31:00.000000000 +0100 | |
60 | +++ gdb-6.8.50.20081128/gdb/utils.c 2008-12-06 21:49:07.000000000 +0100 | |
61 | @@ -114,6 +114,11 @@ int job_control; | |
62 | ||
63 | int quit_flag; | |
64 | ||
65 | +/* Nonzero means we are already processing the quitting cleanups and we should | |
66 | + no longer get aborted. */ | |
67 | + | |
68 | +int quit_flag_cleanup; | |
69 | + | |
70 | /* Nonzero means quit immediately if Control-C is typed now, rather | |
71 | than waiting until QUIT is executed. Be careful in setting this; | |
72 | code which executes with immediate_quit set has to be very careful |