+2017-10-31 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * cli/cli-script.c (execute_control_command): Rename to ...
+ (execute_control_command_1): ... this.
+ (execute_control_command): New function.
+
2017-10-31 Simon Marchi <simon.marchi@ericsson.com>
* tracepoint.c (tfind_command): Remove const_cast.
printf_filtered ("%s\n", cmd);
}
-enum command_control_type
-execute_control_command (struct command_line *cmd)
+/* Helper for execute_control_command. */
+
+static enum command_control_type
+execute_control_command_1 (struct command_line *cmd)
{
struct command_line *current;
struct value *val;
{
scoped_restore save_nesting
= make_scoped_restore (&command_nest_depth, command_nest_depth + 1);
- ret = execute_control_command (current);
+ ret = execute_control_command_1 (current);
/* If we got an error, or a "break" command, then stop
looping. */
{
scoped_restore save_nesting
= make_scoped_restore (&command_nest_depth, command_nest_depth + 1);
- ret = execute_control_command (current);
+ ret = execute_control_command_1 (current);
/* If we got an error, get out. */
if (ret != simple_control)
return ret;
}
+enum command_control_type
+execute_control_command (struct command_line *cmd)
+{
+ /* 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 (¤t_uiout, interp_ui_out (console));
+
+ return execute_control_command_1 (cmd);
+}
+
/* Like execute_control_command, but first set
suppress_next_print_command_trace. */
-number 9 -disp keep -func callee2 -file ".*basics.c" \
-line $line_callee2_body
- mi_gdb_test "-break-commands 9 \"set \$i=0\" \"while \$i<10\" \"print \$i\" \"set \$i=\$i+1\" \"end\" \"continue\" " \
+ mi_gdb_test "-break-commands 9 \"bt\" \"set \$i=0\" \"while \$i<10\" \"print \$i\" \"set \$i=\$i+1\" \"end\" \"continue\" " \
"\\^done" \
"breakpoint commands: set commands"
set test "intermediate stop and continue, bp commands"
gdb_expect {
-i $gdb_main_spawn_id
- -re ".*\\\$1 = 0.*\\\$10 = 9" {
+ -re ".*callee2.*callee1.*main.*\\\$1 = 0.*\\\$10 = 9" {
pass $test
}
timeout {