Re: [rfa/gdbserver] Updated: Fix crash in thread_db_get_tls_address

Pedro Alves
2009-04-03T19:24:43Z

A Friday 03 April 2009 20:20:09, Ulrich Weigand escreveu:
> Pedro Alves wrote:
>
> > The qGetTLSAddr packet takes an explicit thread id, so in this
> > case, it may be that the current process isn't the
> > correct one. I think in this case the best would be to
> > inferior.c:get_thread_process and use that, like:

^ export

> >
> > if (!get_thread_process (thread)->all_symbols_looked_up)
> > return TD_ERR;
>
> That function is currently static to inferior.c; I guess it
> should be exported?

Yes. That's what I meant, but fingers slipped. :-)

> > Alternatively you could make sure you call current_process (),
> > after temporarily having switched the current inferior, like
> > we do a bit below.
>
> Hmm, I want to guard against find_one_thread blowing up due to
> a NULL proc->thread_agent -- but "proc" is always refering to
> current_process () as well. This is probably incorrect too,
> and find_one_thread ought to use get_thread_process?

Indeed.

--
Pedro Alves