From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3232 invoked by alias); 14 May 2002 10:19:51 -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 3225 invoked from network); 14 May 2002 10:19:49 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 14 May 2002 10:19:49 -0000 Received: by fw-cam.cambridge.arm.com; id LAA18572; Tue, 14 May 2002 11:19:46 +0100 (BST) Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma017722; Tue, 14 May 02 11:19:08 +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 LAA19606; Tue, 14 May 2002 11:19:07 +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 LAA14302; Tue, 14 May 2002 11:19:06 +0100 (BST) Message-Id: <200205141019.LAA14302@cam-mail2.cambridge.arm.com> To: gdb@sources.redhat.com cc: Richard.Earnshaw@arm.com, Andrew Cagney 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: frame_register_read() Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 May 2002 03:19:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-05/txt/msg00147.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? I guess it is possible that the check should be moved into default_get_saved_register, for the case where we are trying to fetch the register directly from the regcache, but either the target has this register, or it doesn't. R.