diff options
Diffstat (limited to 'gdb/cli/cli-script.c')
-rw-r--r-- | gdb/cli/cli-script.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index da4a410..f8ac610 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -392,10 +392,6 @@ execute_cmd_post_hook (struct cmd_list_element *c) void execute_control_commands (struct command_line *cmdlines, int from_tty) { - /* Set the instream to 0, indicating execution of a - user-defined function. */ - scoped_restore restore_instream - = make_scoped_restore (¤t_ui->instream, nullptr); scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0); scoped_restore save_nesting = make_scoped_restore (&command_nest_depth, command_nest_depth + 1); @@ -464,6 +460,11 @@ execute_user_command (struct cmd_list_element *c, const char *args) if (user_args_stack.size () > max_user_call_depth) error (_("Max user call depth exceeded -- command aborted.")); + /* Set the instream to nullptr, indicating execution of a + user-defined function. */ + scoped_restore restore_instream + = make_scoped_restore (¤t_ui->instream, nullptr); + execute_control_commands (cmdlines, 0); } |