Re: [RFC] remote-mips.c: Fix bit rot associated with the inferior's state

Kevin Buettner
2010-03-05T16:26:45Z

On Fri, 5 Mar 2010 15:53:46 +0000
Pedro Alves <pedro@codesourcery.com> wrote:

> > I tried setting attach_flag in the inferior and making mips_kill throw
> > an error, but that messes up gdb.base/opaque.exp.
[...]
>
> I'd call it a test bug to be trying to kill on such
> configuration...

I think you might be right since gdb.base/opaque.exp is one of the few
tests for which this is a problem. (It might even be the only test for
which this is a problem.)

> > * remote-mips.c (gdbthread.h): Include.
> > (remote_mips_ptid): Declare.
> > (mips_error): Only mourn the inferior when inferior_ptid is non-null.
> > (common_open): Set inferior_ptid, add it as an inferior, and
> > as a thread too. Delete FIXME comment regarding start_remote().
> > (mips_close): Invoke generic_mourn_inferior().
> > (mips_kill): Make sure that target_mourn_inferior is invoked.
> > (mips_mourn_inferior): Don't invoke generic_mourn_inferior, as
> > it's now invoked from mips_close().
> > (mips_load): Don't null out inferior_ptid. Don't call
> > clear_symtab_users().
> > (mips_thread_alive, mips_pid_to_str): New functions.
> > (_initialize_remote_mips): Initialize remote_mips_ptid. Initialize
> > to_thread_alive and to_pid_to_str operations.
>
> Looks good to me. Thanks.

I've committed this patch. Thanks again for your reviews.

Kevin