From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14094 invoked by alias); 10 Dec 2014 19:14:00 -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 14011 invoked by uid 89); 10 Dec 2014 19:13:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e32.co.us.ibm.com Received: from e32.co.us.ibm.com (HELO e32.co.us.ibm.com) (32.97.110.150) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 10 Dec 2014 19:13:58 +0000 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Dec 2014 12:13:56 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Dec 2014 12:13:53 -0700 Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id A16DF1FF001C for ; Wed, 10 Dec 2014 12:02:37 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBAJEXmM47055008 for ; Wed, 10 Dec 2014 12:14:33 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBAJDqtk007823 for ; Wed, 10 Dec 2014 12:13:53 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id sBAJDpc9007580; Wed, 10 Dec 2014 12:13:51 -0700 Message-Id: <201412101913.sBAJDpc9007580@d03av02.boulder.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 10 Dec 2014 20:13:50 +0100 Subject: Re: [PATCH v3 2/3] gdbserver: Prevent stale/random values in register cache To: arnez@linux.vnet.ibm.com (Andreas Arnez) Date: Wed, 10 Dec 2014 19:14:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <1418133563-16378-3-git-send-email-arnez@linux.vnet.ibm.com> from "Andreas Arnez" at Dec 09, 2014 02:59:22 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121019-0005-0000-0000-000007099BB4 X-SW-Source: 2014-12/txt/msg00227.txt.bz2 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. Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com