mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-30 00:52:16 +08:00
* tic80-tdep.c (tic80_init_extra_frame_info): Allow zero
as a valid SP-relative offset of a saved register.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Tue Aug 5 23:56:14 1997 Mark Alexander <marka@cygnus.com>
|
||||||
|
|
||||||
|
* tic80-tdep.c (tic80_init_extra_frame_info): Allow zero
|
||||||
|
as a valid SP-relative offset of a saved register.
|
||||||
|
|
||||||
Wed Aug 6 00:24:08 1997 Jeffrey A Law (law@cygnus.com)
|
Wed Aug 6 00:24:08 1997 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
* hpread.c (hpread_read_struct_type): Use accessor macros rather
|
* hpread.c (hpread_read_struct_type): Use accessor macros rather
|
||||||
|
@ -176,7 +176,10 @@ tic80_init_extra_frame_info (fi)
|
|||||||
if (fi->next)
|
if (fi->next)
|
||||||
fi->pc = FRAME_SAVED_PC (fi->next);
|
fi->pc = FRAME_SAVED_PC (fi->next);
|
||||||
|
|
||||||
memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs);
|
/* Because zero is a valid register offset relative to SP, we initialize
|
||||||
|
the offsets to -1 to indicate unused entries. */
|
||||||
|
for (reg = 0; reg < NUM_REGS; reg++)
|
||||||
|
fi->fsr.regs[reg] = -1;
|
||||||
|
|
||||||
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
|
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
|
||||||
{
|
{
|
||||||
@ -194,11 +197,17 @@ tic80_init_extra_frame_info (fi)
|
|||||||
if (!fi->next) /* this is the innermost frame? */
|
if (!fi->next) /* this is the innermost frame? */
|
||||||
fi->frame = read_register (fi->framereg);
|
fi->frame = read_register (fi->framereg);
|
||||||
else /* not the innermost frame */
|
else /* not the innermost frame */
|
||||||
if (fi->framereg == FP_REGNUM) /* we have an FP */
|
/* If this function uses FP as the frame register, and the function
|
||||||
if (fi->next->fsr.regs[FP_REGNUM] != 0) /* caller saved our FP */
|
it called saved the FP, get the saved FP. */
|
||||||
|
if (fi->framereg == FP_REGNUM &&
|
||||||
|
fi->next->fsr.regs[FP_REGNUM] != (unsigned) -1)
|
||||||
fi->frame = read_memory_integer (fi->next->fsr.regs[FP_REGNUM], 4);
|
fi->frame = read_memory_integer (fi->next->fsr.regs[FP_REGNUM], 4);
|
||||||
|
|
||||||
|
/* Convert SP-relative offsets of saved registers to real addresses. */
|
||||||
for (reg = 0; reg < NUM_REGS; reg++)
|
for (reg = 0; reg < NUM_REGS; reg++)
|
||||||
if (fi->fsr.regs[reg] != 0)
|
if (fi->fsr.regs[reg] == (unsigned) -1)
|
||||||
|
fi->fsr.regs[reg] = 0; /* unused entry */
|
||||||
|
else
|
||||||
fi->fsr.regs[reg] += fi->frame - fi->frameoffset;
|
fi->fsr.regs[reg] += fi->frame - fi->frameoffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user