[review] [gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI ...

Tom de Vries (Code Review) gerrit@gnutoolchain-gerrit.osci.io
Tue Oct 22 05:24:00 GMT 2019


Tom de Vries has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/28
......................................................................


Patch Set 1:

(1 comment)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/28/1/gdb/cli/cli-script.c 
File gdb/cli/cli-script.c:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/28/1/gdb/cli/cli-script.c@699 
PS1, Line 699:  if (!current_uiout->is_mi_like_p ())
             :     return execute_control_command_1 (cmd, from_tty);
             : 
             :   /* Make sure we use the console uiout.  It's possible that we are executing
             :      breakpoint commands while running the MI interpreter.  */
             :   interp *console = interp_lookup (current_ui, INTERP_CONSOLE);
             :   scoped_restore save_uiout
             :     = make_scoped_restore (&current_uiout, console->interp_ui_out ());
             : 
             :   return execute_control_command_1 (cmd, from_tty);
> For the sake of making things a bit more compact, how about something like this: […]
I understand your suggestion, it indeed is more compact and shares the return between both branches, but I prefer the early-exit style.





More information about the Gdb-patches mailing list