binutils-gdb/gdb/cli
Simon Marchi 3a87ae656c Use console uiout when executing breakpoint commands
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.

gdb/ChangeLog:

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

gdb/testsuite/ChangeLog:

	* gdb.mi/mi-break.exp (test_breakpoint_commands): Test backtrace
	as a breakpoint command.
2017-10-31 21:34:24 -04:00
..
cli-cmds.c Constify add_prefix_cmd 2017-10-11 16:21:02 -06:00
cli-cmds.h Constify cd_command 2017-09-27 08:44:51 -06:00
cli-decode.c Constify add_prefix_cmd 2017-10-11 16:21:02 -06:00
cli-decode.h Constify not_just_help_class_command 2017-09-27 08:44:15 -06:00
cli-dump.c Constify add_prefix_cmd 2017-10-11 16:21:02 -06:00
cli-interp.c Remove unnecessary function prototypes. 2017-09-09 11:02:37 -07:00
cli-interp.h C++-fy struct interp/cli_interp/tui_interp/mi_interp 2017-02-03 16:30:04 +00:00
cli-logging.c Constify add_prefix_cmd 2017-10-11 16:21:02 -06:00
cli-script.c Use console uiout when executing breakpoint commands 2017-10-31 21:34:24 -04:00
cli-script.h Move command lines types/declarations to cli-script.h 2017-09-04 19:09:12 +02:00
cli-setshow.c Rename _const functions to use overloading instead 2017-09-11 15:46:12 -06:00
cli-setshow.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cli-utils.c Make extract_arg return a std::string 2017-09-11 15:46:14 -06:00
cli-utils.h Make extract_arg return a std::string 2017-09-11 15:46:14 -06:00