From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24444 invoked by alias); 3 Apr 2009 19:24:43 -0000 Received: (qmail 24089 invoked by uid 22791); 3 Apr 2009 19:24:41 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Apr 2009 19:24:30 +0000 Received: (qmail 2165 invoked from network); 3 Apr 2009 19:24:28 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Apr 2009 19:24:28 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [rfa/gdbserver] Updated: Fix crash in thread_db_get_tls_address Date: Fri, 03 Apr 2009 19:24:00 -0000 User-Agent: KMail/1.9.10 Cc: "Ulrich Weigand" , drow@false.org, dje@google.com References: <200904031920.n33JK9Mn029781@d12av02.megacenter.de.ibm.com> In-Reply-To: <200904031920.n33JK9Mn029781@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904032024.46136.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00084.txt.bz2 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