From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "Ulrich Weigand" <uweigand@de.ibm.com>, drow@false.org, dje@google.com
Subject: Re: [rfa/gdbserver] Updated: Fix crash in thread_db_get_tls_address
Date: Fri, 03 Apr 2009 18:26:00 -0000 [thread overview]
Message-ID: <200904031926.56114.pedro@codesourcery.com> (raw)
In-Reply-To: <200904031806.n33I6tjw016918@d12av02.megacenter.de.ibm.com>
On Friday 03 April 2009 19:06:55, Ulrich Weigand wrote:
> Index: src/gdb/gdbserver/thread-db.c
> ===================================================================
> --- src.orig/gdb/gdbserver/thread-db.c
> +++ src/gdb/gdbserver/thread-db.c
> @@ -382,6 +382,10 @@ thread_db_get_tls_address (struct thread
> struct lwp_info *lwp;
> struct thread_info *saved_inferior;
>
> + /* If the thread layer is not (yet) initialized, fail. */
> + if (!current_process()->all_symbols_looked_up)
> + return TD_ERR;
> +
(note the missing space after current_process)
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;
Alternatively you could make sure you call current_process (),
after temporarily having switched the current inferior, like
we do a bit below.
Sorry for the extra work...
--
Pedro Alves
next prev parent reply other threads:[~2009-04-03 18:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 22:57 [rfa/gdbserver] " Ulrich Weigand
2009-01-22 9:18 ` Doug Evans
2009-01-22 15:06 ` Ulrich Weigand
2009-01-23 1:08 ` Doug Evans
2009-04-03 18:07 ` [rfa/gdbserver] Updated: " Ulrich Weigand
2009-04-03 18:26 ` Pedro Alves [this message]
2009-04-03 19:20 ` Ulrich Weigand
2009-04-03 19:24 ` Pedro Alves
2009-04-03 20:17 ` Ulrich Weigand
2009-04-03 18:29 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904031926.56114.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dje@google.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox