This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[patch] cleanup delete_breakpoint cleanup
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [patch] cleanup delete_breakpoint cleanup
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 15 May 2000 15:57:03 +1000
- Organization: Cygnus Solutions
FYI,
I've checked in the attached. It eliminates a few more
make_cleanup_funcs.
Andrew
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.
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.9
diff -p -r1.9 breakpoint.c
*** breakpoint.c 2000/05/15 03:16:14 1.9
--- breakpoint.c 2000/05/15 05:44:57
*************** until_break_command (arg, from_tty)
*** 5752,5761 ****
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);
else
! old_chain = make_exec_cleanup ((make_cleanup_func) 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
--- 5752,5760 ----
breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);
if (!event_loop_p || !target_can_async_p ())
! old_chain = make_cleanup_delete_breakpoint (breakpoint);
else
! 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
*************** until_break_command (arg, from_tty)
*** 5786,5794 ****
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);
else
! make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
}
proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
--- 5785,5793 ----
sal.pc = prev_frame->pc;
breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
if (!event_loop_p || !target_can_async_p ())
! make_cleanup_delete_breakpoint (breakpoint);
else
! make_exec_cleanup_delete_breakpoint (breakpoint);
}
proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
*************** delete_breakpoint (bpt)
*** 7066,7071 ****
--- 7065,7088 ----
bpt->type = bp_none;
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
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.2
diff -p -r1.2 breakpoint.h
*** breakpoint.h 2000/03/29 00:51:17 1.2
--- breakpoint.h 2000/05/15 05:44:59
*************** extern void mark_breakpoints_out PARAMS
*** 543,548 ****
--- 543,552 ----
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: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.3
diff -p -r1.3 hppa-tdep.c
*** hppa-tdep.c 2000/04/14 18:43:41 1.3
--- hppa-tdep.c 2000/05/15 05:45:10
*************** hppa_pop_frame ()
*** 1618,1624 ****
breakpoint->silent = 1;
/* So we can clean things up. */
! old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
/* Start up the inferior. */
clear_proceed_status ();
--- 1618,1624 ----
breakpoint->silent = 1;
/* So we can clean things up. */
! old_chain = make_cleanup_delete_breakpoint (breakpoint);
/* Start up the inferior. */
clear_proceed_status ();
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.4
diff -p -r1.4 infcmd.c
*** infcmd.c 2000/04/19 07:51:26 1.4
--- infcmd.c 2000/05/15 05:45:14
*************** finish_command (arg, from_tty)
*** 1194,1202 ****
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);
else
! old_chain = make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
/* Find the function we will return from. */
--- 1194,1202 ----
breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);
if (!event_loop_p || !target_can_async_p ())
! old_chain = make_cleanup_delete_breakpoint (breakpoint);
else
! old_chain = make_exec_cleanup_delete_breakpoint (breakpoint);
/* Find the function we will return from. */