diff options
Diffstat (limited to 'gdb/cli/cli-interp.c')
-rw-r--r-- | gdb/cli/cli-interp.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index d3badcd..dc09b24 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -87,6 +87,24 @@ cli_on_no_history (void) print_no_history_reason (cli_uiout); } +/* Observer for the sync_execution_done notification. */ + +static void +cli_on_sync_execution_done (void) +{ + if (!interp_quiet_p (cli_interp)) + display_gdb_prompt (NULL); +} + +/* Observer for the command_error notification. */ + +static void +cli_on_command_error (void) +{ + if (!interp_quiet_p (cli_interp)) + display_gdb_prompt (NULL); +} + /* These implement the cli out interpreter: */ static void * @@ -98,6 +116,8 @@ cli_interpreter_init (struct interp *self, int top_level) observer_attach_signal_exited (cli_on_signal_exited); observer_attach_exited (cli_on_exited); observer_attach_no_history (cli_on_no_history); + observer_attach_sync_execution_done (cli_on_sync_execution_done); + observer_attach_command_error (cli_on_command_error); return NULL; } @@ -135,16 +155,6 @@ cli_interpreter_suspend (void *data) return 1; } -/* Don't display the prompt if we are set quiet. */ -static int -cli_interpreter_display_prompt_p (void *data) -{ - if (interp_quiet_p (NULL)) - return 0; - else - return 1; -} - static struct gdb_exception cli_interpreter_exec (void *data, const char *command_str) { @@ -209,7 +219,6 @@ _initialize_cli_interp (void) cli_interpreter_resume, /* resume_proc */ cli_interpreter_suspend, /* suspend_proc */ cli_interpreter_exec, /* exec_proc */ - cli_interpreter_display_prompt_p, /* prompt_proc_p */ cli_ui_out, /* ui_out_proc */ NULL, /* set_logging_proc */ cli_command_loop /* command_loop_proc */ |