Replace finish_thread_state_cleanup with a RAII class

gdb/ChangeLog:
2018-04-10  Pedro Alves  <palves@redhat.com>

	* gdbthread.h (finish_thread_state_cleanup): Delete declaration.
	(scoped_finish_thread_state): New class.
	* infcmd.c (run_command_1): Use it instead of finish_thread_state
	cleanup.
	* infrun.c (proceed, prepare_for_detach, wait_for_inferior)
	(fetch_inferior_event, normal_stop): Likewise.
	* thread.c (finish_thread_state_cleanup): Delete.
This commit is contained in:
Pedro Alves
2018-04-10 14:49:30 +01:00
parent d4ae193277
commit 731f534f91
5 changed files with 63 additions and 50 deletions

View File

@@ -1040,16 +1040,6 @@ finish_thread_state (ptid_t ptid)
gdb::observers::target_resumed.notify (ptid);
}
void
finish_thread_state_cleanup (void *arg)
{
ptid_t *ptid_p = (ptid_t *) arg;
gdb_assert (arg);
finish_thread_state (*ptid_p);
}
/* See gdbthread.h. */
void