[07/12] Remove delete_just_stopped_threads_infrun_breakpoints_cleanup

Message ID 20190109033426.16062-8-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Jan. 9, 2019, 3:34 a.m. UTC
  This removes delete_just_stopped_threads_infrun_breakpoints_cleanup,
replacing it with a use of cleanup_function.

gdb/ChangeLog
2019-01-08  Tom Tromey  <tom@tromey.com>

	* infrun.c (wait_for_inferior): Use cleanup_function.
	(delete_just_stopped_threads_infrun_breakpoints_cleanup): Remove.
---
 gdb/ChangeLog |  5 +++++
 gdb/infrun.c  | 17 ++---------------
 2 files changed, 7 insertions(+), 15 deletions(-)
  

Patch

diff --git a/gdb/infrun.c b/gdb/infrun.c
index d84ed10b61..9e3b1fb6ef 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3248,14 +3248,6 @@  delete_just_stopped_threads_single_step_breakpoints (void)
   for_each_just_stopped_thread (delete_single_step_breakpoints);
 }
 
-/* A cleanup wrapper.  */
-
-static void
-delete_just_stopped_threads_infrun_breakpoints_cleanup (void *arg)
-{
-  delete_just_stopped_threads_infrun_breakpoints ();
-}
-
 /* See infrun.h.  */
 
 void
@@ -3539,15 +3531,12 @@  prepare_for_detach (void)
 void
 wait_for_inferior (void)
 {
-  struct cleanup *old_cleanups;
-
   if (debug_infrun)
     fprintf_unfiltered
       (gdb_stdlog, "infrun: wait_for_inferior ()\n");
 
-  old_cleanups
-    = make_cleanup (delete_just_stopped_threads_infrun_breakpoints_cleanup,
-		    NULL);
+  cleanup_function defer_delete_threads
+    (delete_just_stopped_threads_infrun_breakpoints);
 
   /* If an error happens while handling the event, propagate GDB's
      knowledge of the executing state to the frontend/user running
@@ -3584,8 +3573,6 @@  wait_for_inferior (void)
 
   /* No error, don't finish the state yet.  */
   finish_state.release ();
-
-  do_cleanups (old_cleanups);
 }
 
 /* Cleanup that reinstalls the readline callback handler, if the