From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12207 invoked by alias); 22 Oct 2012 21:38:46 -0000 Received: (qmail 12199 invoked by uid 22791); 22 Oct 2012 21:38:45 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,RP_MATCHES_RCVD 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; Mon, 22 Oct 2012 21:38:41 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DD50F1C7351; Mon, 22 Oct 2012 17:38:40 -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 zHp03Qqp+oiH; Mon, 22 Oct 2012 17:38:40 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C4C3C1C72B5; Mon, 22 Oct 2012 17:38:40 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7E30CC7F78; Mon, 22 Oct 2012 17:38:40 -0400 (EDT) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [RFC] Document replacement for frame_register_read (deprecated). Date: Mon, 22 Oct 2012 21:38:00 -0000 Message-Id: <1350941919-9862-1-git-send-email-brobecker@adacore.com> 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: 2012-10/txt/msg00391.txt.bz2 Hello, This is inspired by a discussion from a long time ago: http://www.sourceware.org/ml/gdb-patches/2011-03/msg01095.html If you agree with the patch, we will also have to update the ARI script to mention get_frame_register_value as the alternative. And we might also want to rename the function as well. I don't think we can rely on the ARI alone to avoid new uses of this function. And once new uses are in, it's much harder to make sure we undo them. Thoughts? gdb/ChangeLog: * frame.h (frame_register_read): Remove FIXME comment. * frame.c (frame_register_read): Add suggestion explaining which function to use in place of this one. Thanks, -- Joel --- gdb/frame.c | 3 ++- gdb/frame.h | 12 ------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/gdb/frame.c b/gdb/frame.c index a2f23a4..ea0cb90 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1093,7 +1093,8 @@ put_frame_register (struct frame_info *frame, int regnum, } } -/* frame_register_read () +/* This function is deprecated. Use get_frame_register_value instead, + which provides more accurate information. Find and return the value of REGNUM for the specified stack frame. The number of bytes copied is REGISTER_SIZE (REGNUM). diff --git a/gdb/frame.h b/gdb/frame.h index fa80663..c0559d9 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -673,18 +673,6 @@ extern struct frame_info *block_innermost_frame (const struct block *); extern int deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc); -/* 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). */ - extern int frame_register_read (struct frame_info *frame, int regnum, gdb_byte *buf); -- 1.7.9.5