diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-02-08 03:01:11 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-02-08 03:01:11 +0000 |
commit | cd4bffcfe058290f107bddd6105997da9d22cb69 (patch) | |
tree | d009041519f6f7f8cb11a921a566a810788a992e /gdb/sh-tdep.c | |
parent | 26806ce251d8ea29879199b4b8e50f246497adaf (diff) | |
download | gdb-cd4bffcfe058290f107bddd6105997da9d22cb69.zip gdb-cd4bffcfe058290f107bddd6105997da9d22cb69.tar.gz gdb-cd4bffcfe058290f107bddd6105997da9d22cb69.tar.bz2 |
2002-02-07 Elena Zannoni <ezannoni@redhat.com>
* 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.
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r-- | gdb/sh-tdep.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index bc35d2d..3f7bc6a 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); |