From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25127 invoked by alias); 23 Mar 2011 17:16:20 -0000 Received: (qmail 25074 invoked by uid 22791); 23 Mar 2011 17:16:18 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Mar 2011 17:16:13 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9831D2BB21E for ; Wed, 23 Mar 2011 13:16:12 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YAgj1Mg-5LCC for ; Wed, 23 Mar 2011 13:16:12 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6DBAD2BB21C for ; Wed, 23 Mar 2011 13:16:12 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5DC1F1459AD; Wed, 23 Mar 2011 10:16:01 -0700 (PDT) Date: Wed, 23 Mar 2011 17:42:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: New ARI warning Sat Mar 19 01:54:11 UTC 2011 Message-ID: <20110323171601.GH2520@adacore.com> References: <20110319015411.GA24081@sourceware.org> <20110319042539.GC2520@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110319042539.GC2520@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-SW-Source: 2011-03/txt/msg01035.txt.bz2 > This was a large diff, but in fact, there is only one new warning: > > > gdb/i386-tdep.c:1693: obsolete: frame_register_read: Replace frame_register_read() with get_frame_register(), or possibly introduce a new method safe_get_frame_register() > gdb/i386-tdep.c:1693: && frame_register_read (this_frame, cache->saved_sp_reg, buf)) I just had a look at this ARI warning. The comment on frame_register_read says: /* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a function called get_frame_register_p(). This slightly weird (and older) variant of get_frame_register() returns zero (indicating the register value is unavailable/invalid) if either: the register isn't cached; or the register has been optimized out; or the register contents are unavailable (because they haven't been collected in a traceframe). Problem is, neither check is exactly correct. A register can't be optimized out (it may not have been saved as part of a function call); The fact that a register isn't in the register cache doesn't mean that the register isn't available (it could have been fetched from memory). */ I have had this feeling that we have way too many ways to read/write frame registers, but I'm wondering if this comment might not be too zealous in this case. This function seems useful, because it returns a status as opposed to get_frame_register, which has the exact same profile except that it throws instead of returning. So I'm thinking we should remove the "deprecation" fixme, and just keep the FIXME for fixing whatever incorrectness might be left, and then remove this from the ARI. Thoughts? -- Joel