From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12278 invoked by alias); 8 Aug 2002 23:36:17 -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 12264 invoked from network); 8 Aug 2002 23:36:16 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 8 Aug 2002 23:36:16 -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 g78NN3l15617 for ; Thu, 8 Aug 2002 19:23:03 -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 g78NaDu00472 for ; Thu, 8 Aug 2002 19:36:14 -0400 Received: from romulus.sfbay.redhat.com (IDENT:fgKuu3dYCvApwIRcghevWgngEKoqcR/w@romulus.sfbay.redhat.com [172.16.27.251]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g78NaCe12004 for ; Thu, 8 Aug 2002 16:36:12 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g78NaA025839 for gdb-patches@sources.redhat.com; Thu, 8 Aug 2002 16:36:10 -0700 Date: Thu, 08 Aug 2002 16:36:00 -0000 From: Kevin Buettner Message-Id: <1020808233610.ZM25838@localhost.localdomain> To: gdb-patches@sources.redhat.com Subject: [PATCH] Multiarch FRAME_INIT_SAVED_REGS for mips MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00192.txt.bz2 I've just committed the patch below. * mips-tdep.c (mips_find_saved_regs): Make static. (mips_frame_init_saved_regs): New function. (mips_gdbarch_init): Setup FRAME_INIT_SAVED_REGS method. * config/mips/tm-mips.h (FRAME_INIT_SAVED_REGS): Delete macro. (mips_find_saved_regs): Delete declaration. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.92 diff -u -p -r1.92 mips-tdep.c --- mips-tdep.c 8 Aug 2002 00:26:51 -0000 1.92 +++ mips-tdep.c 8 Aug 2002 23:26:16 -0000 @@ -1259,7 +1259,7 @@ mips_next_pc (CORE_ADDR pc) /* Guaranteed to set fci->saved_regs to some values (it never leaves it NULL). */ -void +static void mips_find_saved_regs (struct frame_info *fci) { int ireg; @@ -1437,6 +1437,23 @@ mips_find_saved_regs (struct frame_info fci->saved_regs[PC_REGNUM] = fci->saved_regs[RA_REGNUM]; } +/* Set up the 'saved_regs' array. This is a data structure containing + the addresses on the stack where each register has been saved, for + each stack frame. Registers that have not been saved will have + zero here. The stack pointer register is special: rather than the + address where the stack register has been saved, saved_regs[SP_REGNUM] + will have the actual value of the previous frame's stack register. */ + +static void +mips_frame_init_saved_regs (struct frame_info *frame) +{ + if (frame->saved_regs == NULL) + { + mips_find_saved_regs (frame); + } + frame->saved_regs[SP_REGNUM] = frame->frame; +} + static CORE_ADDR read_next_frame_reg (struct frame_info *fi, int regno) { @@ -4715,6 +4732,7 @@ mips_gdbarch_init (struct gdbarch_info i /* Initialize a frame */ set_gdbarch_init_extra_frame_info (gdbarch, mips_init_extra_frame_info); + set_gdbarch_frame_init_saved_regs (gdbarch, mips_frame_init_saved_regs); /* MIPS version of CALL_DUMMY */ Index: config/mips/tm-mips.h =================================================================== RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v retrieving revision 1.29 diff -u -p -r1.29 tm-mips.h --- config/mips/tm-mips.h 8 Aug 2002 22:44:46 -0000 1.29 +++ config/mips/tm-mips.h 8 Aug 2002 23:26:16 -0000 @@ -304,19 +304,6 @@ extern int mips_frame_num_args (struct f #define FRAME_ARGS_SKIP 0 -/* Put here the code to store, into a struct frame_saved_regs, - the addresses of the saved registers of frame described by FRAME_INFO. - This includes special registers such as pc and fp saved in special - ways in the stack frame. sp is even more special: - the address we return for it IS the sp for the next frame. */ - -#define FRAME_INIT_SAVED_REGS(frame_info) \ - do { \ - if ((frame_info)->saved_regs == NULL) \ - mips_find_saved_regs (frame_info); \ - (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \ - } while (0) -extern void mips_find_saved_regs (struct frame_info *); /* Things needed for making the inferior call functions. */