From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13963 invoked by alias); 14 May 2002 16:00:11 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13938 invoked from network); 14 May 2002 16:00:08 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 14 May 2002 16:00:08 -0000 Received: by fw-cam.cambridge.arm.com; id RAA06018; Tue, 14 May 2002 17:00:04 +0100 (BST) Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma005760; Tue, 14 May 02 16:59:48 +0100 Received: from cam-mail2.cambridge.arm.com (cam-mail2.cambridge.arm.com [172.16.1.91]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id QAA23601; Tue, 14 May 2002 16:59:48 +0100 (BST) Received: from sun18.cambridge.arm.com (sun18.cambridge.arm.com [172.16.2.18]) by cam-mail2.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id QAA23440; Tue, 14 May 2002 16:59:46 +0100 (BST) Message-Id: <200205141559.QAA23440@cam-mail2.cambridge.arm.com> To: Andrew Cagney cc: Richard.Earnshaw@arm.com, gdb@sources.redhat.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: Re: frame_register_read() In-reply-to: Your message of "Tue, 14 May 2002 10:41:25 EDT." <3CE12215.1020308@cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 May 2002 09:00:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-05/txt/msg00153.txt.bz2 > > Andrew, > > > > frame_register_read() contains the comment > > > > /* FIXME: cagney/2002-04-10: This test is just bogus. It is no > > indication of the validity of the register. The value could > > easily be found (on the stack) even though the corresponding > > register isn't available. */ > > if (register_cached (regnum) < 0) > > return 0; /* register value not available */ > > > > But in regcache.c we have > > > > /* REGISTER_VALID is 0 if the register needs to be fetched, > > 1 if it has been fetched, and > > -1 if the register value was not available. > > "Not available" means don't try to fetch it again. */ > > > > So why is the code in frame_register_read incorrect? It's simply testing > > that the register exists for this target. If it doesn't exist, then how > > can it be recovered from the stack? > > Introspect (tracepoints, target snapshots) do this. If a specific > snapshot doesn't contain a register then the register is unavailable. > The corresponding hardware still has the register so its value can be > found on the stack. So it seems the comment in regcache.c is incomplete/misleading. Could you clarify it? R.