This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[review] [gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI ...
- From: "Tom de Vries (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: gdb-patches at sourceware dot org
- Cc: Luis Machado <luis dot machado at linaro dot org>, Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Tue, 22 Oct 2019 01:24:13 -0400
- Subject: [review] [gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI ...
- Auto-submitted: auto-generated
- References: <gerrit.1571042535000.Id1771e7fcc9496a7d97ec2b2ea6b1487596f1ef7@gnutoolchain-gerrit.osci.io>
- Reply-to: tdevries at suse dot de, andrew dot burgess at embecosm dot com, luis dot machado at linaro dot org, gdb-patches at sourceware dot org
Tom de Vries has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/28
......................................................................
Patch Set 1:
(1 comment)
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/28/1/gdb/cli/cli-script.c
File gdb/cli/cli-script.c:
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/28/1/gdb/cli/cli-script.c@699
PS1, Line 699: if (!current_uiout->is_mi_like_p ())
: return execute_control_command_1 (cmd, from_tty);
:
: /* Make sure we use the console uiout. It's possible that we are executing
: breakpoint commands while running the MI interpreter. */
: interp *console = interp_lookup (current_ui, INTERP_CONSOLE);
: scoped_restore save_uiout
: = make_scoped_restore (¤t_uiout, console->interp_ui_out ());
:
: return execute_control_command_1 (cmd, from_tty);
> For the sake of making things a bit more compact, how about something like this: […]
I understand your suggestion, it indeed is more compact and shares the return between both branches, but I prefer the early-exit style.