Re: [Fwd: Re: [Fwd: Re: gdb/725: Crash using debug target and regcaches (in 5.3 branch?)]]

Daniel Jacobowitz
2002-12-03T21:46:48Z

On Tue, Dec 03, 2002 at 04:40:49PM -0500, Andrew Cagney wrote:
> >
> >It's not an assumption at this point. proc-service.c:230 to
> >thread_db_fetch_registers is the only path into lin_lwp_fetch_registers.
> >And that does:
> > inferior_ptid = BUILD_LWP (lwpid, ph->pid);
> >
> >So at this point we _know_ that the thread we're querying has its
> >registers in the LWP. That's the whole point.
>
> To just to clarify something, I'm being critical of the overall design
> here, not your patch. The comment is for sparc-nat.c (which also gets
> used on sun-4 and free bsd systems).

Oh :) Sparc-nat is, um, a mess. I was just cleaning it up for
completeness here.

> The target/*-nat interface shouldn't be be making assumptions such as
> this (global state, only ever one LWP / thread active, ...). Doing so
> is poor design, it leads to bugs just like the one being discussed here.
>
> If, instead, the code had been correctly implemented (what 5 years ago?)
> this bug, and these on-going problems, wouldn't have occured.

If the comment's for sparc-nat then I've got no objection to your
revision - I'd still really like to see this patch in 5.3. I'm kind of
curious why it causes killed.exp to fail for you, since I've never once
seen killed.exp _pass_.

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer