From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1157 invoked by alias); 27 May 2018 03:42:18 -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 1102 invoked by uid 89); 27 May 2018 03:42:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Reading, sk:pseudo_ X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.123) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 27 May 2018 03:42:13 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id B531C32CBD for ; Sat, 26 May 2018 22:42:11 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id MmZPfhwzGaSeyMmZPfTKjh; Sat, 26 May 2018 22:42:11 -0500 X-Authority-Reason: nr=8 Received: from 174-29-44-154.hlrn.qwest.net ([174.29.44.154]:42432 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fMmZP-00208l-Cy; Sat, 26 May 2018 22:42:11 -0500 From: Tom Tromey To: Simon Marchi Cc: gdb-patches@sourceware.org, Simon Marchi Subject: Re: [RFC PATCH] Read pseudo registers from frame instead of regcache References: <20180526002406.18166-1-simon.marchi@polymtl.ca> Date: Sun, 27 May 2018 05:14:00 -0000 In-Reply-To: <20180526002406.18166-1-simon.marchi@polymtl.ca> (Simon Marchi's message of "Fri, 25 May 2018 20:24:06 -0400") Message-ID: <87r2lxzrvx.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fMmZP-00208l-Cy X-Source-Sender: 174-29-44-154.hlrn.qwest.net (bapiya) [174.29.44.154]:42432 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-05/txt/msg00711.txt.bz2 >>>>> "Simon" == Simon Marchi writes: Simon> The problem: Reading pseudo registers from an upper stack frame does not Simon> work. The raw registers needed to compose the pseudo registers are Simon> always read from the current thread's regcache, which is effectively Simon> frame #0's registers. [...] Simon> The gdbarch hooks Simon> - pseudo_register_read Simon> - pseudo_register_read_value Simon> - pseudo_register_write Simon> receive a regcache as a parameter, as a way to get the values of the raw Simon> registers required to compute the pseudo register value. However, the Simon> regcache object always contains the current register values, not the Simon> values unwound to the frame we're interested in. I don't know this area very well, so apologies if this is really off target; but I am wondering why not just make a regcache for the desired frame and pass that to the gdbarch hooks? Another thing I am curious about is how far back this bug goes. Like, if it were introduced in one of the last few releases, then it might be worth bisecting to find out what happened. Tom