This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Breakpoint commands in MI mode and "backtrace"
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Simon Marchi <simark at simark dot ca>
- Cc: gdb at sourceware dot org, gdb-patches at sourceware dot org
- Date: Sat, 21 Oct 2017 11:26:08 +0300
- Subject: Re: Breakpoint commands in MI mode and "backtrace"
- Authentication-results: sourceware.org; auth=none
- References: <8360bqt0im.fsf@gnu.org> <8a3d7153-7486-032f-aabc-6c3453f96459@simark.ca> <83shetsdg2.fsf@gnu.org> <e65519d3-37e8-06f0-cd5a-d7e6b7aaf31d@simark.ca> <83o9phs8zw.fsf@gnu.org> <b0ce9014-a231-6d57-8a72-6da1eb80f67b@simark.ca> <83d15wsrvw.fsf@gnu.org> <83bmlgsqpm.fsf@gnu.org> <fb95da6b-2390-f486-0806-291d24fbe766@simark.ca>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Cc: gdb@sourceware.org
> From: Simon Marchi <simark@simark.ca>
> Date: Mon, 9 Oct 2017 08:02:24 -0400
>
> Anyhow, can you try this patch here? It changes the uiout manually instead of
> going through safe_execute_command.
Since this worked for me, in GDB 8.0, can something similar be put in
the current master, so the next GDB release will have this bug fixed?
Thanks.
> diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
> index f1db954a69..b08954132b 100644
> --- a/gdb/cli/cli-script.c
> +++ b/gdb/cli/cli-script.c
> @@ -472,6 +472,8 @@ print_command_trace (const char *cmd)
> printf_filtered ("%s\n", cmd);
> }
>
> +static void restore_interp (void *arg);
> +
> enum command_control_type
> execute_control_command (struct command_line *cmd)
> {
> @@ -491,8 +493,17 @@ execute_control_command (struct command_line *cmd)
> {
> /* A simple command, execute it and return. */
> std::string new_line = insert_user_defined_cmd_args (cmd->line);
> +
> + struct interp *old_interp = interp_set_temp (INTERP_CONSOLE);
> + struct cleanup *old_chain = make_cleanup (restore_interp, old_interp);
> + scoped_restore save_uiout
> + = make_scoped_restore (¤t_uiout,
> + current_interpreter ()->interp_ui_out ());
> +
> execute_command (&new_line[0], 0);
> ret = cmd->control_type;
> +
> + do_cleanups (old_chain);
> break;
> }
>
>
>