/* Add line to history if appropriate. */
if (*linebuffer && input_from_terminal_p ())
- add_history (linebuffer);
+ gdb_add_history (linebuffer);
/* Note: lines consisting solely of comments are added to the command
history. This is useful when you type a command, and then
{
signal (sig, handle_sigterm);
- /* Call quit_force in a signal safe way.
- quit_force itself is not signal safe. */
- if (target_can_async_p ())
- mark_async_signal_handler (async_sigterm_token);
- else
- {
- sync_quit_force_run = 1;
- set_quit_flag ();
- }
+ sync_quit_force_run = 1;
+ set_quit_flag ();
+
+ mark_async_signal_handler (async_sigterm_token);
}
/* Do the quit. All the checks have been done by the caller. */
static void
async_disconnect (gdb_client_data arg)
{
- volatile struct gdb_exception exception;
- TRY_CATCH (exception, RETURN_MASK_ALL)
+ TRY
{
quit_cover ();
}
- if (exception.reason < 0)
+ CATCH (exception, RETURN_MASK_ALL)
{
fputs_filtered ("Could not kill the program being debugged",
gdb_stderr);
exception_print (gdb_stderr, exception);
}
+ END_CATCH
- TRY_CATCH (exception, RETURN_MASK_ALL)
+ TRY
{
pop_all_targets ();
}
+ CATCH (exception, RETURN_MASK_ALL)
+ {
+ }
+ END_CATCH
signal (SIGHUP, SIG_DFL); /*FIXME: ??????????? */
raise (SIGHUP);