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

Tom Tromey
2020-04-17T18:53:04Z

>>>>> "Pedro" == Pedro Alves via Gdb-patches <gdb-patches@sourceware.org> writes:

Pedro> My next attempt is the one that I'm proposing, which is to bite the
Pedro> bullet and break the connection between inferior_ptid and
Pedro> inferior_thread(), aka the current thread. I.e., make the current
Pedro> thread be a global thread_info pointer that is written to directly by
Pedro> switch_to_thread, etc., and making inferior_thread() return that
Pedro> pointer, instead of having inferior_thread() lookup up the
Pedro> inferior_ptid thread, by ptid_t.

Does this mean that now the current thread and current inferior can get
out of sync? Or that these can be out of sync with inferior_ptid?

This patch looks like it tries to avoid that when writing to the current
thread -- but in the cover letter you mentioned that there are other
assignments to inferior_ptid.

I wouldn't block the patches based on this but I'd like to understand
the direction. I guess I'd prefer to remove globals and possibilities
for divergence if it's possible.

Tom