mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
Introduce common cleanup for restoring integers.
* defs.h (make_cleanup_restore_integer): New declaration. (struct cleanup): New field free_arg. (make_my_cleanup_2): New. * utils.c (restore_integer_closure, restore_integer) (make_cleanup_restore_integer): New. (make_my_cleanup): Initialize the free_arg field and renamed to make_my_cleanup_2. (do_my_cleanups): Call free_arg. (discard_cleanups): Call free_arg. * breakpoint.c (restore_always_inserted_mode): Remove. (update_breakpoints_after_exec): Use make_cleanup_restore_integer.
This commit is contained in:
@ -1435,12 +1435,6 @@ reattach_breakpoints (int pid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
restore_always_inserted_mode (void *p)
|
||||
{
|
||||
always_inserted_mode = (uintptr_t) p;
|
||||
}
|
||||
|
||||
void
|
||||
update_breakpoints_after_exec (void)
|
||||
{
|
||||
@ -1456,8 +1450,7 @@ update_breakpoints_after_exec (void)
|
||||
/* The binary we used to debug is now gone, and we're updating
|
||||
breakpoints for the new binary. Until we're done, we should not
|
||||
try to insert breakpoints. */
|
||||
cleanup = make_cleanup (restore_always_inserted_mode,
|
||||
(void *) (uintptr_t) always_inserted_mode);
|
||||
cleanup = make_cleanup_restore_integer (&always_inserted_mode);
|
||||
always_inserted_mode = 0;
|
||||
|
||||
ALL_BREAKPOINTS_SAFE (b, temp)
|
||||
|
Reference in New Issue
Block a user