Re: [PATCH 09/12] gdb: move displaced stepping logic to gdbarch, allow starting concurrent displaced steps

Pedro Alves
2020-11-26T14:25:23Z

On 11/25/20 7:35 PM, Simon Marchi wrote:
> On 2020-11-25 2:29 p.m., Simon Marchi via Gdb-patches wrote:
>> True, changed for:
>>
>> for (thread_info *iter = tp->step_over_next; iter != tp; iter->step_over_next)
>> ++num;
>
> Good thing the compiler didn't let me compile that, it would have made
> an infinite loop! Here's the correct one:
>
> for (thread_info *iter = tp->step_over_next; iter != tp;
> iter = iter->step_over_next)
> ++num;

My personal preference is that when you need to put one of the
statements in its own line, then put all statements in their own line:

for (thread_info *iter = tp->step_over_next;
iter != tp;
iter = iter->step_over_next)
++num;