Remove ALL_BREAKPOINTS_SAFE

There's just a single remaining use of the ALL_BREAKPOINTS_SAFE macro;
this patch replaces it with a for-each and an explicit temporary
variable.
This commit is contained in:
Tom Tromey
2023-04-16 09:35:49 -06:00
parent 8e8d48f91c
commit 7a8de0c330

View File

@@ -611,15 +611,6 @@ static int overlay_events_enabled;
/* See description in breakpoint.h. */ /* See description in breakpoint.h. */
bool target_exact_watchpoints = false; bool target_exact_watchpoints = false;
/* Walk the following statement or block through all breakpoints.
ALL_BREAKPOINTS_SAFE does so even if the statement deletes the
current breakpoint. */
#define ALL_BREAKPOINTS_SAFE(B,TMP) \
for (B = breakpoint_chain; \
B ? (TMP=B->next, 1): 0; \
B = TMP)
/* Chains of all breakpoints defined. */ /* Chains of all breakpoints defined. */
static struct breakpoint *breakpoint_chain; static struct breakpoint *breakpoint_chain;
@@ -7617,9 +7608,9 @@ set_longjmp_breakpoint_for_call_dummy (void)
void void
check_longjmp_breakpoint_for_call_dummy (struct thread_info *tp) check_longjmp_breakpoint_for_call_dummy (struct thread_info *tp)
{ {
struct breakpoint *b, *b_tmp; for (struct breakpoint *b : all_breakpoints_safe ())
{
ALL_BREAKPOINTS_SAFE (b, b_tmp) struct breakpoint *b_tmp = b->next;
if (b->type == bp_longjmp_call_dummy && b->thread == tp->global_num) if (b->type == bp_longjmp_call_dummy && b->thread == tp->global_num)
{ {
struct breakpoint *dummy_b = b->related_breakpoint; struct breakpoint *dummy_b = b->related_breakpoint;
@@ -7683,6 +7674,7 @@ check_longjmp_breakpoint_for_call_dummy (struct thread_info *tp)
} }
delete_breakpoint (b); delete_breakpoint (b);
} }
}
} }
void void