Re: [PATCH 00/28] Decouple inferior_ptid/inferior_thread(); dup ptids in thread list (PR/25412)

Pedro Alves
2020-06-18T22:30:18Z

On 4/14/20 6:54 PM, Pedro Alves via Gdb-patches wrote:
> In PR/25412, Simon noticed that after the multi-target series, the
> tid-reuse.exp testcase manages to create a duplicate thread in the
> thread list. Or rather, two threads with the same PTID.
>
> This in turn exposes a design problem in GDB. The inferior_thread()
> function looks up the current thread based on inferior_ptid:
>

...

> This series fixes this by making the current thread be a global
> thread_info pointer that is written to directly by switch_to_thread,
> etc., and making inferior_thread() return that pointer, instead of
> having inferior_thread() lookup up the inferior_ptid thread, by
> ptid_t. You can look at this as a continuation of the effort of using
> more thread_info pointers instead of ptids when possible.

I've pushed this now.

Thanks,
Pedro Alves