From cb814510676f7f6c08b329af2f57006fa598b619 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 21 Jun 2016 01:11:45 +0100 Subject: 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 * 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) : New fields. --- gdb/guile/guile.c | 14 +++++++------- gdb/guile/scm-ports.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'gdb/guile') diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c index b010e59b34..117561d86b 100644 --- a/gdb/guile/guile.c +++ b/gdb/guile/guile.c @@ -27,7 +27,7 @@ #include "cli/cli-utils.h" #include "command.h" #include "gdbcmd.h" -#include "interps.h" +#include "top.h" #include "extension-priv.h" #include "utils.h" #include "version.h" @@ -165,8 +165,8 @@ guile_repl_command (char *arg, int from_tty) { struct cleanup *cleanup; - cleanup = make_cleanup_restore_integer (&interpreter_async); - interpreter_async = 0; + cleanup = make_cleanup_restore_integer (¤t_ui->async); + current_ui->async = 0; arg = skip_spaces (arg); @@ -198,8 +198,8 @@ guile_command (char *arg, int from_tty) { struct cleanup *cleanup; - cleanup = make_cleanup_restore_integer (&interpreter_async); - interpreter_async = 0; + cleanup = make_cleanup_restore_integer (¤t_ui->async); + current_ui->async = 0; arg = skip_spaces (arg); @@ -328,8 +328,8 @@ gdbscm_execute_gdb_command (SCM command_scm, SCM rest) { struct cleanup *inner_cleanups; - inner_cleanups = make_cleanup_restore_integer (&interpreter_async); - interpreter_async = 0; + inner_cleanups = make_cleanup_restore_integer (¤t_ui->async); + current_ui->async = 0; prevent_dont_repeat (); if (to_string) diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c index b0f576e349..5559475a1b 100644 --- a/gdb/guile/scm-ports.c +++ b/gdb/guile/scm-ports.c @@ -23,7 +23,7 @@ #include "defs.h" #include "gdb_select.h" -#include "interps.h" +#include "top.h" #include "target.h" #include "guile-internal.h" @@ -517,8 +517,8 @@ ioscm_with_output_to_port_worker (SCM port, SCM thunk, enum oport oport, cleanups = set_batch_flag_and_make_cleanup_restore_page_info (); - make_cleanup_restore_integer (&interpreter_async); - interpreter_async = 0; + make_cleanup_restore_integer (¤t_ui->async); + current_ui->async = 0; port_file = ioscm_file_port_new (port); -- cgit v1.2.3