inferior_ptid vs current_inferior(): keep them in sync?

Doug Evans <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CADPb22QE-FeTcNw-vObx3But7xv8ENML9hrSQMxoFq-2rrYNOg@mail.gmail.com>
Hi.
Is there any case where we want inferior_ptid to not necessarily
correspond to current_inferior?

I'm adding an inferior attribute to the Python newobjfile event, and
while the inferior value is correct, it's only accidentally so (the
two get out of sync in linux_child_follow_fork and only get back into
sync due to a cleanup performed during breakpoint resetting ...  there
may be more going on, I stopped digging once I saw that).

Before I try to reason out what The Right solution is, an answer to
the above question would be most welcome. :-)

inferior_ptid,current_inferior become not-in-sync, for example, in the
!detach case of linux_child_follow_fork.  The function sets
inferior_ptid but doesn't update current_inferior before calling
clone_program_space.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.