diff options
author | Pedro Alves <palves@redhat.com> | 2011-09-05 14:53:13 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-09-05 14:53:13 +0000 |
commit | 0f641c01197d8f614a1ecb4a54c7d508f500367a (patch) | |
tree | 89330359ed322781a8daa5161afe975b6464504a /gdb/infrun.c | |
parent | 4a5818a296344d7f6a2ffa1492bc36fbbb7543d3 (diff) | |
download | gdb-0f641c01197d8f614a1ecb4a54c7d508f500367a.zip gdb-0f641c01197d8f614a1ecb4a54c7d508f500367a.tar.gz gdb-0f641c01197d8f614a1ecb4a54c7d508f500367a.tar.bz2 |
2011-09-05 Pedro Alves <pedro@codesourcery.com>
* inf-loop.c (execute_command): Don't check if the current thread
if running before synchronously waiting for command completion.
* infrun.c (fetch_inferior_event): Handle "set exec-done-display"
here.
(normal_stop): Call async_enable_stdin here.
* inf-loop.c (inferior_event_handler): Don't call
async_enable_stdin, nor handle "set exec-done-display" here.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index f9b814d..fee302c 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2713,6 +2713,7 @@ fetch_inferior_event (void *client_data) struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); struct cleanup *ts_old_chain; int was_sync = sync_execution; + int cmd_done = 0; memset (ecs, 0, sizeof (*ecs)); @@ -2804,7 +2805,10 @@ fetch_inferior_event (void *client_data) && ecs->event_thread->control.stop_step) inferior_event_handler (INF_EXEC_CONTINUE, NULL); else - inferior_event_handler (INF_EXEC_COMPLETE, NULL); + { + inferior_event_handler (INF_EXEC_COMPLETE, NULL); + cmd_done = 1; + } } /* No error, don't finish the thread states yet. */ @@ -2814,9 +2818,17 @@ fetch_inferior_event (void *client_data) do_cleanups (old_chain); /* If the inferior was in sync execution mode, and now isn't, - restore the prompt. */ + restore the prompt (a synchronous execution command has finished, + and we're ready for input). */ if (interpreter_async && was_sync && !sync_execution) display_gdb_prompt (0); + + if (cmd_done + && !was_sync + && exec_done_display_p + && (ptid_equal (inferior_ptid, null_ptid) + || !is_running (inferior_ptid))) + printf_unfiltered (_("completed.\n")); } /* Record the frame and location we're currently stepping through. */ @@ -5814,6 +5826,7 @@ normal_stop (void) goto done; target_terminal_ours (); + async_enable_stdin (); /* Set the current source location. This will also happen if we display the frame below, but the current SAL will be incorrect |