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

Ulrich Weigand
2009-04-03T19:20:20Z

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:
>
> 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?

> 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?

Bye,