From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7162 invoked by alias); 13 Dec 2002 23:20:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7106 invoked from network); 13 Dec 2002 23:20:37 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 13 Dec 2002 23:20:37 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 486C13E87; Fri, 13 Dec 2002 18:20:31 -0500 (EST) Message-ID: <3DFA6B3F.4010207@redhat.com> Date: Fri, 13 Dec 2002 15:26:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Add get_frame_saved_regs() and get_frame_saved_regs_p() References: <3DF7A7C9.9040306@redhat.com> Content-Type: multipart/mixed; boundary="------------040906050205020502010201" X-SW-Source: 2002-12/txt/msg00441.txt.bz2 This is a multi-part message in MIME format. --------------040906050205020502010201 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 389 > Hello, > > This adds accessor methods for the `struct frame_info' field ->saved_regs. Since get_frame_saved_regs() and frame_saved_regs_zalloc() are almost equivalent, I also eliminated the latter. > > I'll look to commit in a few days, > Andrew Given the updated interface to `extra_info'. I've revised (and seriously shrunk) this change down to the attached. committed, Andrew --------------040906050205020502010201 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2318 2002-12-13 Andrew Cagney * frame.h (get_frame_saved_regs): Declare. (frame_saved_regs_zalloc): Change return type to CORE_ADDR pointer. * frame.c (get_frame_saved_regs): New function. (frame_saved_regs_zalloc): Return the allocated saved_regs. Index: frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.46 diff -u -r1.46 frame.c --- frame.c 13 Dec 2002 21:57:40 -0000 1.46 +++ frame.c 13 Dec 2002 23:09:11 -0000 @@ -461,14 +461,20 @@ return obstack_alloc (&frame_cache_obstack, size); } -void +CORE_ADDR * frame_saved_regs_zalloc (struct frame_info *fi) { fi->saved_regs = (CORE_ADDR *) frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS); memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS); + return fi->saved_regs; } +CORE_ADDR * +get_frame_saved_regs (struct frame_info *fi) +{ + return fi->saved_regs; +} /* Return the innermost (currently executing) stack frame. */ Index: frame.h =================================================================== RCS file: /cvs/src/src/gdb/frame.h,v retrieving revision 1.51 diff -u -r1.51 frame.h --- frame.h 13 Dec 2002 21:57:40 -0000 1.51 +++ frame.h 13 Dec 2002 23:09:11 -0000 @@ -473,7 +473,6 @@ (sizeof (CORE_ADDR) * (NUM_REGS+NUM_PSEUDO_REGS)) extern void *frame_obstack_alloc (unsigned long size); -extern void frame_saved_regs_zalloc (struct frame_info *); /* Define a default FRAME_CHAIN_VALID, in the form that is suitable for most targets. If FRAME_CHAIN_VALID returns zero it means that the given frame @@ -653,6 +652,13 @@ extern struct frame_extra_info *frame_extra_info_zalloc (struct frame_info *fi, long size); extern struct frame_extra_info *get_frame_extra_info (struct frame_info *fi); + +/* Create/access the frame's `saved_regs'. The saved regs are used by + older code to store the address of each register (except for + SP_REGNUM where the value of the register in the previous frame is + stored). */ +extern CORE_ADDR *frame_saved_regs_zalloc (struct frame_info *); +extern CORE_ADDR *get_frame_saved_regs (struct frame_info *); /* FIXME: cagney/2002-12-06: Has the PC in the current frame changed? "infrun.c", Thanks to DECR_PC_AFTER_BREAK, can change the PC after --------------040906050205020502010201--