aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-06-21 01:11:45 +0100
committerPedro Alves <palves@redhat.com>2016-06-21 01:11:45 +0100
commitcb814510676f7f6c08b329af2f57006fa598b619 (patch)
treedbc063197b94b01d4bfaf13288ca81f18890b7cf /gdb/infcall.c
parent79aa2fe86f105fae162f780f760d655f212eaeb6 (diff)
downloadfsf-binutils-gdb-cb814510676f7f6c08b329af2f57006fa598b619.zip
fsf-binutils-gdb-cb814510676f7f6c08b329af2f57006fa598b619.tar.gz
fsf-binutils-gdb-cb814510676f7f6c08b329af2f57006fa598b619.tar.bz2
Make the interpreters be per UI
Make each UI have its own interpreter list, top level interpreter, current interpreter, etc. The "interpreter_async" global is not really specific to an struct interp (it crosses interpreter-exec ...), so I moved it to "struct ui" directly, while the other globals were left hidden in interps.c, opaque to the rest of GDB. gdb/ChangeLog: 2016-06-21 Pedro Alves <palves@redhat.com> * breakpoint.c (bpstat_do_actions_1): Access the current UI's async field instead of the interpreter_async global. * cli/cli-script.c (execute_user_command, while_command) (if_command, script_from_file): Likewise. * compile/compile.c: Include top.h instead of interps.h. (compile_file_command, compile_code_command) (compile_print_command): Access the current UI's async field instead of the interpreter_async global. * guile/guile.c: Include top.h instead of interps.h. (guile_repl_command, guile_command, gdbscm_execute_gdb_command): Access the current UI's async field instead of the interpreter_async global. * guile/scm-ports.c: Include top.h instead of interps.h. (ioscm_with_output_to_port_worker): Access the current UI's async field instead of the interpreter_async global. * inf-loop.c (inferior_event_handler): Likewise. * infcall.c (run_inferior_call): Likewise. * infrun.c (reinstall_readline_callback_handler_cleanup) (fetch_inferior_event): Likewise. * interps.c (interpreter_async): Delete. (struct ui_interp_info): New. (get_current_interp_info): New function. (interp_list, current_interpreter, top_level_interpreter_ptr): Delete. (interp_add, interp_set, interp_lookup, interp_ui_out) (current_interp_set_logging, interp_set_temp) (current_interp_named_p): Adjust to per-UI interpreters. (command_interpreter): Delete. (command_interp, current_interp_command_loop, interp_quiet_p) (interp_exec, interpreter_exec_cmd, interpreter_completer) (top_level_interpreter, top_level_interpreter_data): Adjust to per-UI interpreters. * interps.h (interpreter_async): Delete. * main.c (captured_command_loop): Access the current UI's async field instead of the interpreter_async global. * python/python.c (python_interactive_command, python_command) (execute_gdb_command): Likewise. * top.c (maybe_wait_sync_command_done, execute_command_to_string): Access the current UI's async field instead of the interpreter_async global. * top.h (struct tl_interp_info): Forward declare. (struct ui) <interp_info, async>: New fields.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 77cd931..11f5aba 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -560,13 +560,13 @@ run_inferior_call (struct call_thread_fsm *sm,
ptid_t call_thread_ptid = call_thread->ptid;
int saved_sync_execution = sync_execution;
int was_running = call_thread->state == THREAD_RUNNING;
- int saved_interpreter_async = interpreter_async;
+ int saved_ui_async = current_ui->async;
/* Infcalls run synchronously, in the foreground. */
sync_execution = 1;
/* So that we don't print the prompt prematurely in
fetch_inferior_event. */
- interpreter_async = 0;
+ current_ui->async = 0;
call_thread->control.in_infcall = 1;
@@ -601,7 +601,7 @@ run_inferior_call (struct call_thread_fsm *sm,
again here. In other cases, stdin will be re-enabled by
inferior_event_handler, when an exception is thrown. */
sync_execution = saved_sync_execution;
- interpreter_async = saved_interpreter_async;
+ current_ui->async = saved_ui_async;
/* At this point the current thread may have changed. Refresh
CALL_THREAD as it could be invalid if its thread has exited. */