mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
Remove remaining cleanup from fetch_inferior_event
This removes the remaining cleanup from fetch_inferior_event, replacing it with a SCOPE_EXIT. This required introducing a new scope and reindenting. gdb/ChangeLog: 2019-01-23 Tom Tromey <tom@tromey.com> Pedro Alves <palves@redhat.com> * infrun.c (reinstall_readline_callback_handler_cleanup): Remove parameter. (fetch_inferior_event): Use SCOPE_EXIT.
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
2019-01-23 Tom Tromey <tom@tromey.com>
|
||||
Pedro Alves <palves@redhat.com>
|
||||
|
||||
* infrun.c (reinstall_readline_callback_handler_cleanup): Remove
|
||||
parameter.
|
||||
(fetch_inferior_event): Use SCOPE_EXIT.
|
||||
|
||||
|
||||
2019-01-23 Tom Tromey <tom@tromey.com>
|
||||
Pedro Alves <palves@redhat.com>
|
||||
|
||||
|
14
gdb/infrun.c
14
gdb/infrun.c
@ -3585,7 +3585,7 @@ wait_for_inferior (void)
|
||||
input. */
|
||||
|
||||
static void
|
||||
reinstall_readline_callback_handler_cleanup (void *arg)
|
||||
reinstall_readline_callback_handler_cleanup ()
|
||||
{
|
||||
struct ui *ui = current_ui;
|
||||
|
||||
@ -3687,7 +3687,6 @@ fetch_inferior_event (void *client_data)
|
||||
{
|
||||
struct execution_control_state ecss;
|
||||
struct execution_control_state *ecs = &ecss;
|
||||
struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
|
||||
int cmd_done = 0;
|
||||
ptid_t waiton_ptid = minus_one_ptid;
|
||||
|
||||
@ -3699,7 +3698,8 @@ fetch_inferior_event (void *client_data)
|
||||
scoped_restore save_ui = make_scoped_restore (¤t_ui, main_ui);
|
||||
|
||||
/* End up with readline processing input, if necessary. */
|
||||
make_cleanup (reinstall_readline_callback_handler_cleanup, NULL);
|
||||
{
|
||||
SCOPE_EXIT { reinstall_readline_callback_handler_cleanup (); };
|
||||
|
||||
/* We're handling a live event, so make sure we're doing live
|
||||
debugging. If we're looking at traceframes while the target is
|
||||
@ -3729,7 +3729,8 @@ fetch_inferior_event (void *client_data)
|
||||
target_dcache_invalidate ();
|
||||
|
||||
scoped_restore save_exec_dir
|
||||
= make_scoped_restore (&execution_direction, target_execution_direction ());
|
||||
= make_scoped_restore (&execution_direction,
|
||||
target_execution_direction ());
|
||||
|
||||
ecs->ptid = do_target_wait (waiton_ptid, &ecs->ws,
|
||||
target_can_async_p () ? TARGET_WNOHANG : 0);
|
||||
@ -3807,8 +3808,9 @@ fetch_inferior_event (void *client_data)
|
||||
/* No error, don't finish the thread states yet. */
|
||||
finish_state.release ();
|
||||
|
||||
/* Revert thread and frame. */
|
||||
do_cleanups (old_chain);
|
||||
/* This scope is used to ensure that readline callbacks are
|
||||
reinstalled here. */
|
||||
}
|
||||
|
||||
/* If a UI was in sync execution mode, and now isn't, restore its
|
||||
prompt (a synchronous execution command has finished, and we're
|
||||
|
Reference in New Issue
Block a user