Cleanup delete_breakpoint cleanups.
authorAndrew Cagney <cagney@redhat.com>
Mon, 15 May 2000 05:54:02 +0000 (05:54 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 15 May 2000 05:54:02 +0000 (05:54 +0000)
gdb/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h
gdb/hppa-tdep.c
gdb/infcmd.c

index 339479145cd0fb7192a53e2f0b81b57df27f074b..04b6f7927e96bd08350d2afc7b331a3f12bac422 100644 (file)
@@ -1,3 +1,15 @@
+Mon May 15 14:06:23 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * breakpoint.h (make_cleanup_delete_breakpoint,
+       make_exec_cleanup_delete_breakpoint): Declare.
+       * breakpoint.c (make_cleanup_delete_breakpoint,
+       make_exec_cleanup_delete_breakpoint,
+       do_delete_breakpoint_cleanup): New fuctions.
+       
+       * infcmd.c (finish_command), hppa-tdep.c (hppa_pop_frame),
+       breakpoint.c (until_break_command, until_break_command): Replace
+       call to make_cleanup / make_exec_cleanup.
+
 Mon May 15 13:25:57 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * defs.h (core_addr_greaterthan, core_addr_lessthan), utils.c
index 98bd2367a88177fc131c2d8b15c612998733701c..7826a65407629a50ad336724dff692a4b78faca9 100644 (file)
@@ -5752,10 +5752,9 @@ until_break_command (arg, from_tty)
   breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);
 
   if (!event_loop_p || !target_can_async_p ())
-    old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, 
-                             breakpoint);
+    old_chain = make_cleanup_delete_breakpoint (breakpoint);
   else
-    old_chain = make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+    old_chain = make_exec_cleanup_delete_breakpoint (breakpoint);
 
   /* If we are running asynchronously, and the target supports async
      execution, we are not waiting for the target to stop, in the call
@@ -5786,9 +5785,9 @@ until_break_command (arg, from_tty)
       sal.pc = prev_frame->pc;
       breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
       if (!event_loop_p || !target_can_async_p ())
-       make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+       make_cleanup_delete_breakpoint (breakpoint);
       else
-       make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+       make_exec_cleanup_delete_breakpoint (breakpoint);
     }
 
   proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
@@ -7068,6 +7067,24 @@ delete_breakpoint (bpt)
   free ((PTR) bpt);
 }
 
+static void
+do_delete_breakpoint_cleanup (void *b)
+{
+  delete_breakpoint (b);
+}
+
+struct cleanup *
+make_cleanup_delete_breakpoint (struct breakpoint *b)
+{
+  return make_cleanup (do_delete_breakpoint_cleanup, b);
+}
+
+struct cleanup *
+make_exec_cleanup_delete_breakpoint (struct breakpoint *b)
+{
+  return make_exec_cleanup (do_delete_breakpoint_cleanup, b);
+}
+
 void
 delete_command (arg, from_tty)
      char *arg;
index 1b4e02aa7b20396b5e2db8019ca97c7d23eb2aaf..12f110f895c1d652fbe8fc05ef2eaf83089d157c 100644 (file)
@@ -543,6 +543,10 @@ extern void mark_breakpoints_out PARAMS ((void));
 
 extern void breakpoint_init_inferior PARAMS ((enum inf_context));
 
+extern struct cleanup *make_cleanup_delete_breakpoint (struct breakpoint *);
+
+extern struct cleanup *make_exec_cleanup_delete_breakpoint (struct breakpoint *);
+
 extern void delete_breakpoint PARAMS ((struct breakpoint *));
 
 extern void breakpoint_auto_delete PARAMS ((bpstat));
index f97b3c84eda06df0b9fc0234cdac8a9dcd37f02f..e7adf10bb814509f73243bf3199ef837e90386c3 100644 (file)
@@ -1618,7 +1618,7 @@ hppa_pop_frame ()
       breakpoint->silent = 1;
 
       /* So we can clean things up.  */
-      old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+      old_chain = make_cleanup_delete_breakpoint (breakpoint);
 
       /* Start up the inferior.  */
       clear_proceed_status ();
index 162b824a53044a98cd0205260b8e392a383a948e..19f52602696fe1612f9700edd542a8ec8579cf06 100644 (file)
@@ -1194,9 +1194,9 @@ finish_command (arg, from_tty)
   breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);
 
   if (!event_loop_p || !target_can_async_p ())
-    old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+    old_chain = make_cleanup_delete_breakpoint (breakpoint);
   else
-    old_chain = make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+    old_chain = make_exec_cleanup_delete_breakpoint (breakpoint);
 
   /* Find the function we will return from.  */