From: Eli Zaretskii <eliz@gnu.org>
To: Simon Marchi <simark@simark.ca>
Cc: gdb@sourceware.org, gdb-patches@sourceware.org
Subject: Re: Breakpoint commands in MI mode and "backtrace"
Date: Sat, 21 Oct 2017 08:26:00 -0000 [thread overview]
Message-ID: <83vaj8c3fj.fsf@gnu.org> (raw)
In-Reply-To: <fb95da6b-2390-f486-0806-291d24fbe766@simark.ca> (message from Simon Marchi on Mon, 9 Oct 2017 08:02:24 -0400)
> 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;
> }
>
>
>
next parent reply other threads:[~2017-10-21 8:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8360bqt0im.fsf@gnu.org>
[not found] ` <8a3d7153-7486-032f-aabc-6c3453f96459@simark.ca>
[not found] ` <83shetsdg2.fsf@gnu.org>
[not found] ` <e65519d3-37e8-06f0-cd5a-d7e6b7aaf31d@simark.ca>
[not found] ` <83o9phs8zw.fsf@gnu.org>
[not found] ` <b0ce9014-a231-6d57-8a72-6da1eb80f67b@simark.ca>
[not found] ` <83d15wsrvw.fsf@gnu.org>
[not found] ` <83bmlgsqpm.fsf@gnu.org>
[not found] ` <fb95da6b-2390-f486-0806-291d24fbe766@simark.ca>
2017-10-21 8:26 ` Eli Zaretskii [this message]
[not found] ` <f54ff4bc-fb7c-397f-153d-83cafb6966bd@simark.ca>
2017-10-21 16:27 ` Eli Zaretskii
2017-10-21 18:41 ` [PATCH] Use console uiout when executing breakpoint commands Simon Marchi
2017-11-01 1:37 ` Simon Marchi
2017-11-01 3:45 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83vaj8c3fj.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=gdb@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox