This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]