+2005-11-25 Andrew Stubbs <andrew.stubbs@st.com>
+
+ * event-top.h (async_init_signals): Add SIGTERM handler.
+ (handle_sigterm): New function.
+ * event-top.h (handle_sigterm): New prototype.
+
2005-11-25 Andrew Stubbs <andrew.stubbs@st.com>
* cli-decode.c (find_command_name_length): New function.
signal (SIGINT, handle_sigint);
sigint_token =
create_async_signal_handler (async_request_quit, NULL);
+ signal (SIGTERM, handle_sigterm);
/* If SIGTRAP was set to SIG_IGN, then the SIG_IGN will get passed
to the inferior and breakpoints will be ignored. */
mark_async_signal_handler_wrapper (sigint_token);
}
+/* Quit GDB if SIGTERM is received.
+ GDB would quit anyway, but this way it will clean up properly. */
+void
+handle_sigterm (int sig)
+{
+ signal (sig, handle_sigterm);
+ quit_force ((char *) 0, stdin == instream);
+}
+
/* Do the quit. All the checks have been done by the caller. */
void
async_request_quit (gdb_client_data arg)
#endif
#endif
extern void handle_sigint (int sig);
+extern void handle_sigterm (int sig);
extern void pop_prompt (void);
extern void push_prompt (char *prefix, char *prompt, char *suffix);
extern void gdb_readline2 (void *client_data);