From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7093 invoked by alias); 6 Sep 2010 09:46:19 -0000 Received: (qmail 7078 invoked by uid 22791); 6 Sep 2010 09:46:16 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Sep 2010 09:46:10 +0000 Received: (qmail 6958 invoked from network); 6 Sep 2010 09:46:08 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Sep 2010 09:46:08 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [gdbserver] Remove unused variables Date: Mon, 06 Sep 2010 10:45:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: Yao Qi References: <4C7F7273.6090708@codesourcery.com> In-Reply-To: <4C7F7273.6090708@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009061046.06062.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: 2010-09/txt/msg00148.txt.bz2 On Thursday 02 September 2010 10:46:27, Yao Qi wrote: > Hi, > This patch is to remove unused variables in order to fix some build > failures I find today on GDB CVS HEAD. (...) Most of the patch is okay, except: > if (debug_threads) > fprintf (stderr, "lk_1: killing lwp %ld, for pid: %d\n", > @@ -1201,9 +1199,6 @@ linux_fast_tracepoint_collecting (struct > static int > maybe_move_out_of_jump_pad (struct lwp_info *lwp, int *wstat) > { > - struct thread_info *saved_inferior; > - > - saved_inferior = current_inferior; > current_inferior = get_lwp_thread (lwp); ... this bit, that revealed a bug. saved_inferior should be used. Please add a "current_inferior = saved_inferior;" statement before every return path in this function instead. Bonus points if you do that in a separate patch from the "remove unused variables" one. -- Pedro Alves