From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16101 invoked by alias); 8 Feb 2002 03:01:39 -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 15951 invoked from network); 8 Feb 2002 03:01:30 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 8 Feb 2002 03:01:30 -0000 Received: from localhost.redhat.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id TAA25946 for ; Thu, 7 Feb 2002 19:01:28 -0800 (PST) Received: by localhost.redhat.com (Postfix, from userid 469) id 391A1112E4; Thu, 7 Feb 2002 22:01:26 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15459.16261.845953.879703@localhost.redhat.com> Date: Thu, 07 Feb 2002 19:01:00 -0000 To: gdb-patches@sources.redhat.com Subject: [PATCH] sh-tdep.c update to real size of saved_regs[] X-Mailer: VM 7.00 under Emacs 20.7.1 X-SW-Source: 2002-02/txt/msg00215.txt.bz2 The array saved_regs is now NUM_REGS + NUM_PSEUDO_REGS big. This patches updates things accordingly. Elena 2002-02-07 Elena Zannoni * sh-tdep.c (sh_nofp_frame_init_saved_regs): Extend where[] array to include space for pseudoregs as well. Update loops accordingly. (sh_fp_frame_init_saved_regs): Ditto. (sh_init_extra_frame_info, sh_pop_frame): Split long lines. Index: sh-tdep.c =================================================================== RCS file: /cvs/uberbaum/gdb/sh-tdep.c,v retrieving revision 1.47 diff -u -p -r1.47 sh-tdep.c --- sh-tdep.c 2002/01/23 04:00:55 1.47 +++ sh-tdep.c 2002/02/08 02:59:48 @@ -484,7 +484,7 @@ sh_find_callers_reg (struct frame_info * static void sh_nofp_frame_init_saved_regs (struct frame_info *fi) { - int where[NUM_REGS]; + int where[NUM_REGS + NUM_PSEUDO_REGS]; int rn; int have_fp = 0; int depth; @@ -511,7 +511,7 @@ sh_nofp_frame_init_saved_regs (struct fr fi->extra_info->leaf_function = 1; fi->extra_info->f_offset = 0; - for (rn = 0; rn < NUM_REGS; rn++) + for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++) where[rn] = -1; depth = 0; @@ -572,7 +572,7 @@ sh_nofp_frame_init_saved_regs (struct fr /* Now we know how deep things are, we can work out their addresses */ - for (rn = 0; rn < NUM_REGS; rn++) + for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++) { if (where[rn] >= 0) { @@ -626,7 +626,7 @@ dr_reg_base_num (int dr_regnum) static void sh_fp_frame_init_saved_regs (struct frame_info *fi) { - int where[NUM_REGS]; + int where[NUM_REGS + NUM_PSEUDO_REGS]; int rn; int have_fp = 0; int depth; @@ -654,7 +654,7 @@ sh_fp_frame_init_saved_regs (struct fram fi->extra_info->leaf_function = 1; fi->extra_info->f_offset = 0; - for (rn = 0; rn < NUM_REGS; rn++) + for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++) where[rn] = -1; depth = 0; @@ -726,7 +726,7 @@ sh_fp_frame_init_saved_regs (struct fram /* Now we know how deep things are, we can work out their addresses */ - for (rn = 0; rn < NUM_REGS; rn++) + for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++) { if (where[rn] >= 0) { @@ -743,7 +743,8 @@ sh_fp_frame_init_saved_regs (struct fram if (have_fp) { - fi->saved_regs[SP_REGNUM] = read_memory_integer (fi->saved_regs[FP_REGNUM], 4); + fi->saved_regs[SP_REGNUM] = + read_memory_integer (fi->saved_regs[FP_REGNUM], 4); } else { @@ -772,7 +773,8 @@ sh_init_extra_frame_info (int fromleaf, by assuming it's always FP. */ fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM); - fi->extra_info->return_pc = generic_read_register_dummy (fi->pc, fi->frame, + fi->extra_info->return_pc = generic_read_register_dummy (fi->pc, + fi->frame, PC_REGNUM); fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4); fi->extra_info->leaf_function = 0; @@ -781,7 +783,8 @@ sh_init_extra_frame_info (int fromleaf, else { FRAME_INIT_SAVED_REGS (fi); - fi->extra_info->return_pc = sh_find_callers_reg (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM); + fi->extra_info->return_pc = + sh_find_callers_reg (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM); } } @@ -817,9 +820,10 @@ sh_pop_frame (void) FRAME_INIT_SAVED_REGS (frame); /* Copy regs from where they were saved in the frame */ - for (regnum = 0; regnum < NUM_REGS; regnum++) + for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) if (frame->saved_regs[regnum]) - write_register (regnum, read_memory_integer (frame->saved_regs[regnum], 4)); + write_register (regnum, + read_memory_integer (frame->saved_regs[regnum], 4)); write_register (PC_REGNUM, frame->extra_info->return_pc); write_register (SP_REGNUM, fp + 4);