>inferior_thread () returns the currently selected thread, >which is not
>necessarily the thread named by the ptid argument. Since
>thread_has_single_step_breakpoints_set () is a per-thread >query, asking
>it about the wrong thread would give the wrong answer for
>last_resume_step.
>The else branch a few lines below already resolves the >thread from the
>argument:
> thread = current_inferior ()->find_thread (ptid);
>Would that be more appropriate here? I am also unsure what >the flag
>should be when ptid.tid () == 0 and the resume covers more >than one
>thread.
>
>Separately, would it be worth adding testsuite coverage for >this? The
>benchmark program creates all 20 threads before do_steps (), >so the
>thread population never changes after the first stop and it >cannot
>exercise the case the v1 logic got wrong.
>Something that creates threads between two breakpoint stops >and checks
>"info threads" at the second one would cover it, and a >"next" over a
>call that spawns a thread would cover Simon's point. I >don't have an
>AIX machine to run it on, so I can't offer a patch for it >myself.
Have done the same in v3 version of this patch and also corrected the thread_has_single_step_breakpoints_set () to use ptid. Thanks for the suggestions. Let me know your thoughts and if I missed anything.
Have a nice day.
Thanks and regards,
Aditya.