From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51781 invoked by alias); 17 Mar 2018 18:08:17 -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 51772 invoked by uid 89); 17 Mar 2018 18:08:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 17 Mar 2018 18:08:15 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 1B1001E4B0; Sat, 17 Mar 2018 14:08:12 -0400 (EDT) Subject: Re: [RFC PATCH v5 3/9] Add scoped_restore_regcache_ptid To: Philipp Rudo , gdb-patches@sourceware.org Cc: Omair Javaid , Yao Qi , arnez@linux.vnet.ibm.com References: <20180312153115.47321-1-prudo@linux.vnet.ibm.com> <20180312153115.47321-4-prudo@linux.vnet.ibm.com> From: Simon Marchi Message-ID: <31613f15-ac19-725e-b2de-404133793d96@simark.ca> Date: Sat, 17 Mar 2018 18:08:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180312153115.47321-4-prudo@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-03/txt/msg00338.txt.bz2 On 2018-03-12 11:31 AM, Philipp Rudo wrote: > When a target and its target beneath use different ptids to identify a > thread the regcaches ptid has to be set/restored when calls are passed down > to the target beneath to e.g. fetch_registers. Add a scoped_restore to > simplify this. Though I don't understand yet why this is needed (I'll find out when reading the following patches), the implementation looks ok. I don't think this is an issue (at least for now), but there is this observer "thread_ptid_changed" that indicates when a thread changes ptid. If this observer is triggered while we have temporarily changed a regcache's ptid, I guess we could miss updating a regcache's ptid, as scoped_restore_regcache_ptid will reset it to the old ptid. It's probably not a problem but I think it's good to be aware of this. Simon