[Bug mi/25055] breakpoint command output not visible in MI mode

vries at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Wed Oct 2 08:52:00 GMT 2019


Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |8.1

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by
Use console uiout when executing breakpoint commands

As reported here


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

I enhanced gdb.mi/mi-break.exp to test the backtrace command.

Regtested on the buildbot.


* cli/cli-script.c (execute_control_command): Rename to ...
(execute_control_command_1): ... this.
(execute_control_command): New function.


* gdb.mi/mi-break.exp (test_breakpoint_commands): Test backtrace
as a breakpoint command.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Gdb-prs mailing list