From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31890 invoked by alias); 11 Dec 2014 17:05:04 -0000 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 Received: (qmail 31767 invoked by uid 89); 11 Dec 2014 17:05:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp15.uk.ibm.com Received: from e06smtp15.uk.ibm.com (HELO e06smtp15.uk.ibm.com) (195.75.94.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 11 Dec 2014 17:05:02 +0000 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Dec 2014 17:04:59 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 Dec 2014 17:04:57 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 51B7D1B0804B for ; Thu, 11 Dec 2014 17:05:18 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBBH4uqs55967820 for ; Thu, 11 Dec 2014 17:04:56 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBBH4t7m003691 for ; Thu, 11 Dec 2014 10:04:56 -0700 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sBBH4tZR003672; Thu, 11 Dec 2014 10:04:55 -0700 From: Andreas Arnez To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 2/3] gdbserver: Prevent stale/random values in register cache References: <201412101913.sBAJDpc9007580@d03av02.boulder.ibm.com> Date: Thu, 11 Dec 2014 17:05:00 -0000 In-Reply-To: <201412101913.sBAJDpc9007580@d03av02.boulder.ibm.com> (Ulrich Weigand's message of "Wed, 10 Dec 2014 20:13:50 +0100 (CET)") Message-ID: <87bnnam820.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121117-0021-0000-0000-0000021B356E X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00248.txt.bz2 On Wed, Dec 10 2014, Ulrich Weigand wrote: > Andreas Arnez wrote: > >> @@ -52,6 +52,11 @@ get_thread_regcache (struct thread_info *thread, int fetch) >> struct thread_info *saved_thread = current_thread; >> >> current_thread = thread; >> +#ifndef IN_PROCESS_AGENT >> + /* Invalidate all registers, to prevent stale left-overs. */ >> + memset (regcache->register_status, REG_UNAVAILABLE, >> + regcache->tdesc->num_registers); >> +#endif >> fetch_inferior_registers (regcache, -1); >> current_thread = saved_thread; >> regcache->registers_valid = 1; > > The whole get_thread_regcache routine is already under #ifndef IN_PROCESS_AGENT, > so the ifdef seems redundant here. Correct ;-) Will be removed in the next version.