This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfa/gdbserver] Updated: Fix crash in thread_db_get_tls_address
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedro at codesourcery dot com (Pedro Alves)
- Cc: gdb-patches at sourceware dot org, drow at false dot org, dje at google dot com
- Date: Fri, 3 Apr 2009 21:20:09 +0200 (CEST)
- Subject: Re: [rfa/gdbserver] Updated: Fix crash in thread_db_get_tls_address
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,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com