From cd4bffcfe058290f107bddd6105997da9d22cb69 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Fri, 8 Feb 2002 03:01:11 +0000 Subject: [PATCH] 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. --- gdb/ChangeLog | 7 +++++++ gdb/sh-tdep.c | 26 +++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7ab7efc85e1..6ec89e9e7d3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +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. + 2002-02-07 Andrew Cagney * MAINTAINERS: Andreas Schwab is GNU/Linux m68k maintainer. diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index bc35d2df145..3f7bc6a1732 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -484,7 +484,7 @@ sh_find_callers_reg (struct frame_info *fi, int regnum) 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 frame_info *fi) 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 frame_info *fi) /* 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 frame_info *fi) 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 frame_info *fi) /* 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 frame_info *fi) 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, struct frame_info *fi) 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, struct frame_info *fi) 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); -- 2.30.2