This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI mode
- From: Pedro Alves <palves at redhat dot com>
- To: Tom de Vries <tdevries at suse dot de>, Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tom at tromey dot com>, Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Thu, 3 Oct 2019 13:10:55 +0100
- Subject: Re: [PATCH][gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI mode
- References: <20190905095815.GA27717@delia> <20190924173122.GN4962@embecosm.com> <f9ec5b8d-f1fe-fcc4-0974-cbd1cdca4817@suse.de> <20190925083642.GO4962@embecosm.com> <6a13b015-6b46-a2a3-0d6b-89a01ef3ab16@suse.de> <6dc5e6b5-4f63-23a8-581b-c78a184d8f08@suse.de>
On 10/3/19 11:01 AM, Tom de Vries wrote:
> The problem is that the '#0 main () at test.c:19' ends up in the gdb output
> output rather than in gdb.txt. This is due to the fact that the redirect is
> setup for the current ui_out (which is tui->interp_ui_out ()), while the
> backtrace output is printed to the INTERP_CONSOLE ui_out.
>
> Fix this by limiting switching to INTERP_CONSOLE ui_out to when INTERP_MI is
> active.
> --- a/gdb/cli/cli-script.c
> +++ b/gdb/cli/cli-script.c
> @@ -697,6 +697,9 @@ execute_control_command_1 (struct command_line *cmd, int from_tty)
> enum command_control_type
> execute_control_command (struct command_line *cmd, int from_tty)
> {
> + if (!current_interp_named_p (INTERP_MI))
> + return execute_control_command_1 (cmd, from_tty);
Wouldn't we need to handle INTERP_MI1/INTERP_MI2/INTERP_MI3 as well?
Would
if (current_uiout->is_mi_like_p ())
instead work?
Thanks,
Pedro Alves