summaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-09-28 17:44:57 -0400
committerPedro Alves <palves@redhat.com>2016-09-28 17:44:57 -0400
commit6d61dee599fb314f0561c3bd0dd17ac0cfa05e35 (patch)
tree88c7f9ed27d42ada701666b52f364cd7af7e4058 /gdb/infcall.c
parent4435e1cc6214e6ef44bd90fcde8ae2de9d8be418 (diff)
downloadbinutils-gdb-6d61dee599fb314f0561c3bd0dd17ac0cfa05e35.tar.gz
Fix PR 20345 - call_function_by_hand_dummy: Assertion `tp->thread_fsm == &sm->thread_fsm' failed
If you run an infcall from the command line, and immediately after run some other command, GDB incorrectly processes the other command before the infcall finishes. The problem is that the fix for PR gdb/20418 (Problems with synchronous commands and new-ui, git 3eb7562a983b) moved the add_file_handler/delete_file_handler calls out of target_terminal_$foo, and missed adjusting the infcall code. gdb/ChangeLog: 2016-09-28 Pedro Alves <palves@redhat.com> * infcall.c (run_inferior_call): Remove input from the event loop while running the infcall. gdb/testsuite/ChangeLog: 2016-09-28 Pedro Alves <palves@redhat.com> * gdb.base/infcall-input.c: New file. * gdb.base/infcall-input.exp: New file.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 3c33c11d6a3..ab7426d6f3c 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -584,6 +584,8 @@ run_inferior_call (struct call_thread_fsm *sm,
fetch_inferior_event. */
current_ui->async = 0;
+ delete_file_handler (current_ui->input_fd);
+
call_thread->control.in_infcall = 1;
clear_proceed_status (0);
@@ -617,6 +619,10 @@ run_inferior_call (struct call_thread_fsm *sm,
state again here. In other cases, stdin will be re-enabled by
inferior_event_handler, when an exception is thrown. */
current_ui->prompt_state = saved_prompt_state;
+ if (current_ui->prompt_state == PROMPT_BLOCKED)
+ delete_file_handler (current_ui->input_fd);
+ else
+ ui_register_input_event_handler (current_ui);
current_ui->async = saved_ui_async;
/* At this point the current thread may have changed. Refresh