From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30960 invoked by alias); 18 May 2016 17:51:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 30923 invoked by uid 89); 18 May 2016 17:51:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=opaque, interpreter, Hx-languages-length:2949, uis X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 18 May 2016 17:51:00 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id E5.FA.09012.243AC375; Wed, 18 May 2016 19:15:46 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.248.2; Wed, 18 May 2016 13:50:57 -0400 Subject: Re: [PATCH v3 05/34] Make the interpreters be per UI To: Pedro Alves , References: <1462538104-19109-1-git-send-email-palves@redhat.com> <1462538104-19109-6-git-send-email-palves@redhat.com> From: Simon Marchi Message-ID: <573CAB81.1070305@ericsson.com> Date: Wed, 18 May 2016 17:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1462538104-19109-6-git-send-email-palves@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00310.txt.bz2 On 16-05-06 08:34 AM, Pedro Alves wrote: > 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: > yyyy-mm-dd 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_interpretertop_level_interpreter) Two pastes here. > diff --git a/gdb/interps.c b/gdb/interps.c > index b188d08..7f57132 100644 > --- a/gdb/interps.c > +++ b/gdb/interps.c > @@ -39,11 +39,31 @@ > #include "top.h" /* For command_loop. */ > #include "continuations.h" > > -/* True if the current interpreter in is async mode. See interps.h > - for more details. This starts out disabled, until all the explicit > - command line arguments (e.g., `gdb -ex "start" -ex "next"') are > - processed. */ > -int interpreter_async = 0; > +/* Each UI has its own independent set of interpreters. */ > + > +struct ui_interp_info > +{ > + /* Each top level has its own independent set of interpreters. */ > + struct interp *interp_list; > + struct interp *current_interpreter; > + struct interp *top_level_interpreter_ptr; Could this be renamed top_level_interpreter? I guess it was named _ptr to avoid clash in the global namespace.