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: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Ulrich Weigand" <uweigand at de dot ibm dot com>, drow at false dot org, dje at google dot com
- Date: Fri, 3 Apr 2009 20:24:45 +0100
- Subject: Re: [rfa/gdbserver] Updated: Fix crash in thread_db_get_tls_address
- References: <200904031920.n33JK9Mn029781@d12av02.megacenter.de.ibm.com>
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