This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use console uiout when executing breakpoint commands
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: gdb-patches at sourceware dot org
- Cc: eliz at gnu dot org
- Date: Tue, 31 Oct 2017 21:37:09 -0400
- Subject: Re: [PATCH] Use console uiout when executing breakpoint commands
- Authentication-results: sourceware.org; auth=none
- References: <83vaj8c3fj.fsf@gnu.org> <20171021184121.694-1-simon.marchi@polymtl.ca>
On 2017-10-21 02:41 PM, Simon Marchi wrote:
> As reported here
>
> https://sourceware.org/ml/gdb/2017-10/msg00020.html
>
> the output of certain commands, like backtrace, doesn't appear anywhere
> when it is run as a breakpoint command and when using MI.
>
> The reason is that the current_uiout is set to the mi_ui_out while these
> commands run, whereas we want the output as CLI output. Some commands
> like "print" work, because they use printf_filtered (gdb_stdout, ...)
> directly, bypassing the current ui_out.
>
> The fix I did is to force setting the cli_uiout as the current_uiout
> when calling execute_control_command. I am not sure if this is the
> right way to fix the problem, comments about the approach would be
> appreciated.
>
> I enhanced gdb.mi/mi-break.exp to test the backtrace command.
>
> Regtested on the buildbot.
I pushed this patch in.
Simon