mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 13:27:26 +08:00
Change captured_mi_execute_command to use scoped_restore
Change captured_mi_execute_command to use a scoped_restore, removing a cleanup. The old code copied the current token, but I don't believe that is necessary. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-main.c (captured_mi_execute_command): Use scope_restore.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2017-09-29 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* mi/mi-main.c (captured_mi_execute_command): Use scope_restore.
|
||||||
|
|
||||||
2017-09-29 Tom Tromey <tom@tromey.com>
|
2017-09-29 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions): Update.
|
* mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions): Update.
|
||||||
|
@ -1875,20 +1875,19 @@ mi_cmd_remove_inferior (const char *command, char **argv, int argc)
|
|||||||
Return <0 for error; >=0 for ok.
|
Return <0 for error; >=0 for ok.
|
||||||
|
|
||||||
args->action will tell mi_execute_command what action
|
args->action will tell mi_execute_command what action
|
||||||
to perfrom after the given command has executed (display/suppress
|
to perform after the given command has executed (display/suppress
|
||||||
prompt, display error). */
|
prompt, display error). */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context)
|
captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context)
|
||||||
{
|
{
|
||||||
struct mi_interp *mi = (struct mi_interp *) command_interp ();
|
struct mi_interp *mi = (struct mi_interp *) command_interp ();
|
||||||
struct cleanup *cleanup;
|
|
||||||
|
|
||||||
if (do_timings)
|
if (do_timings)
|
||||||
current_command_ts = context->cmd_start;
|
current_command_ts = context->cmd_start;
|
||||||
|
|
||||||
current_token = xstrdup (context->token);
|
scoped_restore save_token = make_scoped_restore (¤t_token,
|
||||||
cleanup = make_cleanup (free_current_contents, ¤t_token);
|
context->token);
|
||||||
|
|
||||||
running_result_record_printed = 0;
|
running_result_record_printed = 0;
|
||||||
mi_proceeded = 0;
|
mi_proceeded = 0;
|
||||||
@ -1964,8 +1963,6 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_cleanups (cleanup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print a gdb exception to the MI output stream. */
|
/* Print a gdb exception to the MI output stream. */
|
||||||
|
Reference in New Issue
Block a user