From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7510 invoked by alias); 3 Apr 2009 19:20:20 -0000 Received: (qmail 7444 invoked by uid 22791); 3 Apr 2009 19:20:18 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Apr 2009 19:20:13 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id n33JKBpG004235 for ; Fri, 3 Apr 2009 19:20:11 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n33JKArF3387538 for ; Fri, 3 Apr 2009 21:20:11 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n33JKA6k029786 for ; Fri, 3 Apr 2009 21:20:10 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n33JK9Mn029781; Fri, 3 Apr 2009 21:20:09 +0200 Message-Id: <200904031920.n33JK9Mn029781@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 03 Apr 2009 21:20:09 +0200 Subject: Re: [rfa/gdbserver] Updated: Fix crash in thread_db_get_tls_address To: pedro@codesourcery.com (Pedro Alves) Date: Fri, 03 Apr 2009 19:20:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, drow@false.org, dje@google.com In-Reply-To: <200904031926.56114.pedro@codesourcery.com> from "Pedro Alves" at Apr 03, 2009 07:26:55 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00083.txt.bz2 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