aboutsummaryrefslogtreecommitdiff
path: root/gdb/nios2-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/nios2-tdep.c')
-rw-r--r--gdb/nios2-tdep.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index 008b1d4..c972b4b 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -1202,8 +1202,6 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
struct reg_value *value = cache->reg_value;
struct reg_value temp_value[NIOS2_NUM_REGS];
- int i;
-
/* Save the starting PC so we can correct the pc after running
through the prolog, using symbol info. */
CORE_ADDR pc = start_pc;
@@ -1285,7 +1283,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
/* If any registers were saved on the stack before then
we can't backtrace into them now. */
- for (i = 0 ; i < NIOS2_NUM_REGS ; i++)
+ for (int i = 0 ; i < NIOS2_NUM_REGS ; i++)
{
if (cache->reg_saved[i].basereg == NIOS2_SP_REGNUM)
cache->reg_saved[i].basereg = -1;
@@ -1416,7 +1414,6 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
/* PUSH.N {reglist}, adjust
or
STWM {reglist}, --(SP)[, writeback] */
- int i;
int off = 0;
if (ra != NIOS2_SP_REGNUM || id != 0)
@@ -1424,7 +1421,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
part of the prologue. */
break;
- for (i = 31; i >= 0; i--)
+ for (int i = 31; i >= 0; i--)
if (reglist & (1 << i))
{
int orig = value[i].reg;
@@ -1469,9 +1466,9 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
if ra has been stored into r8 beforehand and if it's
before the stack adjust.
Note mcount corrupts r2-r3, r9-r15 & ra. */
- for (i = 2 ; i <= 3 ; i++)
+ for (int i = 2 ; i <= 3 ; i++)
value[i].reg = -1;
- for (i = 9 ; i <= 15 ; i++)
+ for (int i = 9 ; i <= 15 ; i++)
value[i].reg = -1;
value[NIOS2_RA_REGNUM].reg = -1;
@@ -1621,14 +1618,14 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
/* Adjust all the saved registers such that they contain addresses
instead of offsets. */
- for (i = 0; i < NIOS2_NUM_REGS; i++)
+ for (int i = 0; i < NIOS2_NUM_REGS; i++)
if (cache->reg_saved[i].basereg == NIOS2_SP_REGNUM)
{
cache->reg_saved[i].basereg = NIOS2_Z_REGNUM;
cache->reg_saved[i].addr += frame_high;
}
- for (i = 0; i < NIOS2_NUM_REGS; i++)
+ for (int i = 0; i < NIOS2_NUM_REGS; i++)
if (cache->reg_saved[i].basereg == NIOS2_GP_REGNUM)
{
CORE_ADDR gp = get_frame_register_unsigned (this_frame,
@@ -1818,7 +1815,7 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
int argreg;
int argnum;
- int len = 0;
+ int arg_space = 0;
int stack_offset = 0;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -1828,8 +1825,8 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
- sp -= len;
+ arg_space += align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
+ sp -= arg_space;
/* Initialize the register pointer. */
argreg = NIOS2_FIRST_ARGREG;