Re: [PATCH 2/9] gdb: add all_breakpoints_safe function

Tom Tromey
2021-05-27T17:35:44Z

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> @@ -3143,9 +3154,7 @@ remove_breakpoints (void)
Simon> static void
Simon> remove_threaded_breakpoints (struct thread_info *tp, int silent)
Simon> {
Simon> - struct breakpoint *b, *b_tmp;
Simon> -
Simon> - ALL_BREAKPOINTS_SAFE (b, b_tmp)
Simon> + for (breakpoint *b : all_breakpoints ())
Simon> {
Simon> if (b->thread == tp->global_num && user_breakpoint_p (b))
Simon> {

I had to go look, but this one is ok to convert to the non-safe
iterator, as it doesn't modify the collection in the loop.

Tom