struct thread_info *call_thread, CORE_ADDR real_pc)
{
struct gdb_exception caught_error;
- int saved_in_infcall = call_thread->control.in_infcall;
ptid_t call_thread_ptid = call_thread->ptid;
- enum prompt_state saved_prompt_state = current_ui->prompt_state;
int was_running = call_thread->state == THREAD_RUNNING;
- int saved_ui_async = current_ui->async;
-
- /* Infcalls run synchronously, in the foreground. */
- current_ui->prompt_state = PROMPT_BLOCKED;
- /* So that we don't print the prompt prematurely in
- fetch_inferior_event. */
- current_ui->async = 0;
delete_file_handler (current_ui->input_fd);
- call_thread->control.in_infcall = 1;
+ scoped_restore restore_in_infcall
+ = make_scoped_restore (&call_thread->control.in_infcall, 1);
clear_proceed_status (0);
try
{
+ /* Infcalls run synchronously, in the foreground. */
+ scoped_restore restore_prompt_state
+ = make_scoped_restore (¤t_ui->prompt_state, PROMPT_BLOCKED);
+
+ /* So that we don't print the prompt prematurely in
+ fetch_inferior_event. */
+ scoped_restore restore_ui_async
+ = make_scoped_restore (¤t_ui->async, 0);
+
proceed (real_pc, GDB_SIGNAL_0);
/* Inferior function calls are always synchronous, even if the
so. normal_stop calls async_enable_stdin, so reset the prompt
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;
/* If the infcall does NOT succeed, normal_stop will have already
finished the thread states. However, on success, normal_stop
breakpoint_auto_delete (call_thread->control.stop_bpstat);
}
- call_thread->control.in_infcall = saved_in_infcall;
-
return caught_error;
}