From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32580 invoked by alias); 9 Aug 2002 20:37:15 -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 32573 invoked from network); 9 Aug 2002 20:37:14 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 9 Aug 2002 20:37:14 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g79KNsl30941 for ; Fri, 9 Aug 2002 16:23:54 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g79Kb8u08042; Fri, 9 Aug 2002 16:37:08 -0400 Received: from romulus.sfbay.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g79Kb7e01139; Fri, 9 Aug 2002 13:37:07 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g79Kb5P10960; Fri, 9 Aug 2002 13:37:05 -0700 Date: Fri, 09 Aug 2002 13:37:00 -0000 From: Kevin Buettner Message-Id: <1020809203705.ZM10959@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: [RFA] Call FRAME_INIT_SAVED_REGS instead of mips_find_saved_regs" (Aug 9, 12:19am) References: <1020809001129.ZM26138@localhost.localdomain> <3D5342DC.7060500@ges.redhat.com> To: Andrew Cagney , Kevin Buettner Subject: Re: [RFA] Call FRAME_INIT_SAVED_REGS instead of mips_find_saved_regs Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00221.txt.bz2 On Aug 9, 12:19am, Andrew Cagney wrote: > Subject: Re: [RFA] Call FRAME_INIT_SAVED_REGS instead of mips_find_saved_r > > > In the course of multiarching FRAME_INIT_SAVED_REGS, I did consider > > adding the necessary bits of code for setting > > frame->saved_regs[SP_REGNUM] in mips_find_saved_regs, but decided it > > would be more obvious if I did a straightforward translation of the > > (now replaced) macro. The elimination of mips_find_saved_regs() can > > wait for another day. After this patch though, there'll only be one > > caller, so it'll be easier to merge mips_find_saved_regs into > > mips_frame_init_saved_regs(). > > Can you please add a comment to mips_find_saved_regs() indicating this. > > Otherwize approved. Committed. For the record, here's what went in: (Hmm... gotta fix the comment delimiter. I'll do that in a moment.) Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.94 diff -u -p -r1.94 mips-tdep.c --- mips-tdep.c 9 Aug 2002 01:42:41 -0000 1.94 +++ mips-tdep.c 9 Aug 2002 20:28:30 -0000 @@ -1256,7 +1256,16 @@ mips_next_pc (CORE_ADDR pc) } /* Guaranteed to set fci->saved_regs to some values (it never leaves it - NULL). */ + NULL). + + Note: kevinb/2002-08-09: The only caller of this function is (and + should remain) mips_frame_init_saved_regs(). In fact, + aside from calling mips_find_saved_regs(), mips_frame_init_saved_regs() + does nothing more than set frame->saved_regs[SP_REGNUM]. These two + functions should really be combined and now that there is only one + caller, it should be straightforward. (Watch out for multiple returns + though.) +*/ static void mips_find_saved_regs (struct frame_info *fci) @@ -1465,7 +1474,7 @@ read_next_frame_reg (struct frame_info * else { if (fi->saved_regs == NULL) - mips_find_saved_regs (fi); + FRAME_INIT_SAVED_REGS (fi); if (fi->saved_regs[regno]) return read_memory_integer (ADDR_BITS_REMOVE (fi->saved_regs[regno]), MIPS_SAVED_REGSIZE); } @@ -2890,7 +2905,7 @@ mips_pop_frame (void) write_register (PC_REGNUM, FRAME_SAVED_PC (frame)); if (frame->saved_regs == NULL) - mips_find_saved_regs (frame); + FRAME_INIT_SAVED_REGS (frame); for (regnum = 0; regnum < NUM_REGS; regnum++) { if (regnum != SP_REGNUM && regnum != PC_REGNUM