* alpha-tdep.c: Use get_frame_saved_regs.
* arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
* h8300-tdep.c, i386-tdep.c, ia64-tdep.c, m68hc11-tdep.c: Ditto.
* m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Ditto.
* ns32k-tdep.c, s390-tdep.c, sh-tdep.c, v850-tdep.c: Ditto.
* vax-tdep.c, xstormy16-tdep.c: Ditto.
+2003-01-03 Andrew Cagney <ac131313@redhat.com>
+
+ * alpha-tdep.c: Use get_frame_saved_regs.
+ * arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
+ * h8300-tdep.c, i386-tdep.c, ia64-tdep.c, m68hc11-tdep.c: Ditto.
+ * m68k-tdep.c, mcore-tdep.c, mips-tdep.c, mn10300-tdep.c: Ditto.
+ * ns32k-tdep.c, s390-tdep.c, sh-tdep.c, v850-tdep.c: Ditto.
+ * vax-tdep.c, xstormy16-tdep.c: Ditto.
+
2003-01-03 Mark Kettenis <kettenis@gnu.org>
* configure.in: Remove all use of the SUBDIRS variable; add
for (ireg = 0; ireg < 32; ireg++)
{
reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8;
- frame->saved_regs[ireg] = reg_position;
+ get_frame_saved_regs (frame)[ireg] = reg_position;
}
for (ireg = 0; ireg < 32; ireg++)
{
reg_position = sigcontext_addr + SIGFRAME_FPREGSAVE_OFF + ireg * 8;
- frame->saved_regs[FP0_REGNUM + ireg] = reg_position;
+ get_frame_saved_regs (frame)[FP0_REGNUM + ireg] = reg_position;
}
- frame->saved_regs[PC_REGNUM] = sigcontext_addr + SIGFRAME_PC_OFF;
+ get_frame_saved_regs (frame)[PC_REGNUM] = sigcontext_addr + SIGFRAME_PC_OFF;
return;
}
register number. */
if (mask & (1 << returnreg))
{
- frame->saved_regs[returnreg] = reg_position;
+ get_frame_saved_regs (frame)[returnreg] = reg_position;
reg_position += 8;
mask &= ~(1 << returnreg); /* Clear bit for RA so we
don't save again later. */
for (ireg = 0; ireg <= 31; ++ireg)
if (mask & (1 << ireg))
{
- frame->saved_regs[ireg] = reg_position;
+ get_frame_saved_regs (frame)[ireg] = reg_position;
reg_position += 8;
}
for (ireg = 0; ireg <= 31; ++ireg)
if (mask & (1 << ireg))
{
- frame->saved_regs[FP0_REGNUM + ireg] = reg_position;
+ get_frame_saved_regs (frame)[FP0_REGNUM + ireg] = reg_position;
reg_position += 8;
}
- frame->saved_regs[PC_REGNUM] = frame->saved_regs[returnreg];
+ get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_saved_regs (frame)[returnreg];
}
static void
alpha_frame_init_saved_regs (struct frame_info *fi)
{
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
alpha_find_saved_regs (fi);
- fi->saved_regs[SP_REGNUM] = fi->frame;
+ get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame;
}
static CORE_ADDR
return fi->frame;
else
{
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
alpha_find_saved_regs (fi);
- if (fi->saved_regs[regno])
- return read_memory_integer (fi->saved_regs[regno], 8);
+ if (get_frame_saved_regs (fi)[regno])
+ return read_memory_integer (get_frame_saved_regs (fi)[regno], 8);
}
}
return read_register (regno);
frame->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
- frame->saved_regs = NULL;
+ /* NOTE: cagney/2003-01-03: No need to set saved_regs to NULL,
+ always NULL by default. */
+ /* frame->saved_regs = NULL; */
frame->extra_info->localoff = 0;
frame->extra_info->pc_reg = ALPHA_RA_REGNUM;
frame->extra_info->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc;
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
if (!PC_IN_SIGTRAMP (get_frame_pc (frame), name))
{
- frame->saved_regs = (CORE_ADDR *)
- frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
- memcpy (frame->saved_regs, temp_saved_regs,
+ frame_saved_regs_zalloc (frame);
+ memcpy (get_frame_saved_regs (frame), temp_saved_regs,
SIZEOF_FRAME_SAVED_REGS);
- frame->saved_regs[PC_REGNUM]
- = frame->saved_regs[ALPHA_RA_REGNUM];
+ get_frame_saved_regs (frame)[PC_REGNUM]
+ = get_frame_saved_regs (frame)[ALPHA_RA_REGNUM];
}
}
}
For now, we don't save a copy... */
write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
- if (frame->saved_regs == NULL)
+ if (get_frame_saved_regs (frame) == NULL)
alpha_find_saved_regs (frame);
if (proc_desc)
{
for (regnum = 32; --regnum >= 0;)
if (PROC_REG_MASK (proc_desc) & (1 << regnum))
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum],
+ read_memory_integer (get_frame_saved_regs (frame)[regnum],
8));
for (regnum = 32; --regnum >= 0;)
if (PROC_FREG_MASK (proc_desc) & (1 << regnum))
write_register (regnum + FP0_REGNUM,
- read_memory_integer (frame->saved_regs[regnum + FP0_REGNUM], 8));
+ read_memory_integer (get_frame_saved_regs (frame)[regnum + FP0_REGNUM], 8));
}
write_register (SP_REGNUM, new_sp);
flush_cached_frames ();
if (mask & (1 << regno))
{
fi->extra_info->framesize += 4;
- fi->saved_regs[saved_reg[regno]] =
+ get_frame_saved_regs (fi)[saved_reg[regno]] =
-(fi->extra_info->framesize);
/* Reset saved register map. */
saved_reg[regno] = regno;
fi->extra_info->framesize = prologue_cache.extra_info->framesize;
fi->extra_info->frameoffset = prologue_cache.extra_info->frameoffset;
for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
- fi->saved_regs[i] = prologue_cache.saved_regs[i];
+ get_frame_saved_regs (fi)[i] = get_frame_saved_regs (&prologue_cache)[i];
return 1;
}
else
prologue_cache.extra_info->frameoffset = fi->extra_info->frameoffset;
for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
- prologue_cache.saved_regs[i] = fi->saved_regs[i];
+ get_frame_saved_regs (&prologue_cache)[i] = get_frame_saved_regs (fi)[i];
}
if (mask & (1 << regno))
{
sp_offset -= 4;
- fi->saved_regs[regno] = sp_offset;
+ get_frame_saved_regs (fi)[regno] = sp_offset;
}
}
else if ((insn & 0xffffc000) == 0xe54b0000 || /* strb rx,[r11,#-n] */
{
sp_offset -= 12;
regno = ARM_F0_REGNUM + ((insn >> 12) & 0x07);
- fi->saved_regs[regno] = sp_offset;
+ get_frame_saved_regs (fi)[regno] = sp_offset;
}
else if ((insn & 0xffbf0fff) == 0xec2d0200) /* sfmfd f0, 4, [sp!] */
{
for (; fp_start_reg < fp_bound_reg; fp_start_reg++)
{
sp_offset -= 12;
- fi->saved_regs[fp_start_reg++] = sp_offset;
+ get_frame_saved_regs (fi)[fp_start_reg++] = sp_offset;
}
}
else if ((insn & 0xf0000000) != 0xe0000000)
{
return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
}
- else if (fi->saved_regs[regnum] != 0)
+ else if (get_frame_saved_regs (fi)[regnum] != 0)
{
/* NOTE: cagney/2002-05-03: This would normally need to
handle ARM_SP_REGNUM as a special case as, according to
the frame.h comments, saved_regs[SP_REGNUM] contains the
SP value not its address. It appears that the ARM isn't
doing this though. */
- return read_memory_integer (fi->saved_regs[regnum],
+ return read_memory_integer (get_frame_saved_regs (fi)[regnum],
REGISTER_RAW_SIZE (regnum));
}
}
int reg;
CORE_ADDR sp;
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
fi->extra_info = (struct frame_extra_info *)
if (fi->next)
deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
- memset (fi->saved_regs, '\000', sizeof fi->saved_regs);
+ memset (get_frame_saved_regs (fi), '\000', sizeof get_frame_saved_regs (fi));
/* Compute stack pointer for this frame. We use this value for both
the sigtramp and call dummy cases. */
&& ((get_frame_type (fi) == SIGTRAMP_FRAME) || PC_IN_SIGTRAMP (get_frame_pc (fi), (char *)0)))
{
for (reg = 0; reg < NUM_REGS; reg++)
- fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, get_frame_pc (fi), reg);
+ get_frame_saved_regs (fi)[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, get_frame_pc (fi), reg);
/* FIXME: What about thumb mode? */
fi->extra_info->framereg = ARM_SP_REGNUM;
fi->frame =
- read_memory_integer (fi->saved_regs[fi->extra_info->framereg],
+ read_memory_integer (get_frame_saved_regs (fi)[fi->extra_info->framereg],
REGISTER_RAW_SIZE (fi->extra_info->framereg));
fi->extra_info->framesize = 0;
fi->extra_info->frameoffset = 0;
{
/* not the innermost frame */
/* If we have an FP, the callee saved it. */
- if (fi->next->saved_regs[fi->extra_info->framereg] != 0)
+ if (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg] != 0)
fi->frame =
- read_memory_integer (fi->next
- ->saved_regs[fi->extra_info->framereg], 4);
+ read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg], 4);
else if (fromleaf)
/* If we were called by a frameless fn. then our frame is
still in the frame pointer register on the board... */
/* Calculate actual addresses of saved registers using offsets
determined by arm_scan_prologue. */
for (reg = 0; reg < NUM_REGS; reg++)
- if (fi->saved_regs[reg] != 0)
- fi->saved_regs[reg] += (fi->frame + fi->extra_info->framesize
- - fi->extra_info->frameoffset);
+ if (get_frame_saved_regs (fi)[reg] != 0)
+ get_frame_saved_regs (fi)[reg] += (fi->frame + fi->extra_info->framesize
+ - fi->extra_info->frameoffset);
}
}
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame - fi->extra_info->frameoffset,
fi->frame))
{
- return read_memory_integer (fi->saved_regs[ARM_PC_REGNUM],
+ return read_memory_integer (get_frame_saved_regs (fi)[ARM_PC_REGNUM],
REGISTER_RAW_SIZE (ARM_PC_REGNUM));
}
else
arm_frame_init_saved_regs (struct frame_info *fip)
{
- if (fip->saved_regs)
+ if (get_frame_saved_regs (fip))
return;
arm_init_extra_frame_info (0, fip);
}
for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (frame->saved_regs[regnum] != 0)
+ if (get_frame_saved_regs (frame)[regnum] != 0)
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum],
+ read_memory_integer (get_frame_saved_regs (frame)[regnum],
REGISTER_RAW_SIZE (regnum)));
write_register (ARM_PC_REGNUM, FRAME_SAVED_PC (frame));
/* We can't use SIZEOF_FRAME_SAVED_REGS here, since that still
references the old architecture vector, not the one we are
building here. */
- if (prologue_cache.saved_regs != NULL)
- xfree (prologue_cache.saved_regs);
+ if (get_frame_saved_regs (&prologue_cache) != NULL)
+ xfree (get_frame_saved_regs (&prologue_cache));
/* We can't use NUM_REGS nor NUM_PSEUDO_REGS here, since that still
references the old architecture vector, not the one we are
if (num_pushes)
{
int from;
- fi->saved_regs[AVR_FP_REGNUM + 1] = num_pushes;
+ get_frame_saved_regs (fi)[AVR_FP_REGNUM + 1] = num_pushes;
if (num_pushes >= 2)
- fi->saved_regs[AVR_FP_REGNUM] = num_pushes - 1;
+ get_frame_saved_regs (fi)[AVR_FP_REGNUM] = num_pushes - 1;
i = 0;
for (from = AVR_LAST_PUSHED_REGNUM + 1 - (num_pushes - 2);
from <= AVR_LAST_PUSHED_REGNUM; ++from)
- fi->saved_regs[from] = ++i;
+ get_frame_saved_regs (fi)[from] = ++i;
}
fi->extra_info->locals_size = loc_size;
fi->extra_info->framesize = loc_size + num_pushes;
if (memcmp (prologue, img, sizeof (img)) == 0)
{
vpc += sizeof (img);
- fi->saved_regs[0] = 2;
- fi->saved_regs[1] = 1;
+ get_frame_saved_regs (fi)[0] = 2;
+ get_frame_saved_regs (fi)[1] = 1;
fi->extra_info->framesize += 3;
}
else if (memcmp (img + 1, prologue, sizeof (img) - 1) == 0)
{
vpc += sizeof (img) - 1;
- fi->saved_regs[0] = 2;
- fi->saved_regs[1] = 1;
+ get_frame_saved_regs (fi)[0] = 2;
+ get_frame_saved_regs (fi)[1] = 1;
fi->extra_info->framesize += 3;
}
}
/* Bits 4-9 contain a mask for registers R0-R32. */
regno = (insn & 0x1f0) >> 4;
++fi->extra_info->framesize;
- fi->saved_regs[regno] = fi->extra_info->framesize;
+ get_frame_saved_regs (fi)[regno] = fi->extra_info->framesize;
scan_stage = 1;
}
else
for (; next_fi; next_fi = next_fi->next)
{
/* look for saved AVR_FP_REGNUM */
- if (next_fi->saved_regs[AVR_FP_REGNUM] && !fp)
- fp = next_fi->saved_regs[AVR_FP_REGNUM];
+ if (get_frame_saved_regs (next_fi)[AVR_FP_REGNUM] && !fp)
+ fp = get_frame_saved_regs (next_fi)[AVR_FP_REGNUM];
/* look for saved AVR_FP_REGNUM + 1 */
- if (next_fi->saved_regs[AVR_FP_REGNUM + 1] && !fp1)
- fp1 = next_fi->saved_regs[AVR_FP_REGNUM + 1];
+ if (get_frame_saved_regs (next_fi)[AVR_FP_REGNUM + 1] && !fp1)
+ fp1 = get_frame_saved_regs (next_fi)[AVR_FP_REGNUM + 1];
}
fp_low = (fp ? read_memory_unsigned_integer (avr_make_saddr (fp), 1)
: read_register (AVR_FP_REGNUM)) & 0xff;
/* Resolve a pushed registers addresses */
for (i = 0; i < NUM_REGS; i++)
{
- if (fi->saved_regs[i])
- fi->saved_regs[i] = addr - fi->saved_regs[i];
+ if (get_frame_saved_regs (fi)[i])
+ get_frame_saved_regs (fi)[i] = addr - get_frame_saved_regs (fi)[i];
}
}
}
{
/* Don't forget AVR_SP_REGNUM in a frame_saved_regs struct is the
actual value we want, not the address of the value we want. */
- if (frame->saved_regs[regnum] && regnum != AVR_SP_REGNUM)
+ if (get_frame_saved_regs (frame)[regnum] && regnum != AVR_SP_REGNUM)
{
- saddr = avr_make_saddr (frame->saved_regs[regnum]);
+ saddr = avr_make_saddr (get_frame_saved_regs (frame)[regnum]);
write_register (regnum,
read_memory_unsigned_integer (saddr, 1));
}
- else if (frame->saved_regs[regnum] && regnum == AVR_SP_REGNUM)
+ else if (get_frame_saved_regs (frame)[regnum] && regnum == AVR_SP_REGNUM)
write_register (regnum, frame->frame + 2);
}
/* We only want to know the end of the prologue when fi->saved_regs == 0.
When the saved registers are allocated full information is required. */
- if (fi->saved_regs)
+ if (get_frame_saved_regs (fi))
{
for (regno = 0; regno < NUM_REGS; regno++)
- fi->saved_regs[regno] = 0;
+ get_frame_saved_regs (fi)[regno] = 0;
}
/* Find the prologue instructions. */
/* We only want to know the end of the prologue when
fi->saved_regs == 0. */
- if (!fi->saved_regs)
+ if (!get_frame_saved_regs (fi))
return ip;
if (have_fp)
{
- fi->saved_regs[FP_REGNUM] = get_frame_base (fi);
+ get_frame_saved_regs (fi)[FP_REGNUM] = get_frame_base (fi);
/* Calculate the addresses. */
for (regno = regsave; regno >= 0; regno--)
{
- fi->saved_regs[regno] = get_frame_base (fi) - val;
+ get_frame_saved_regs (fi)[regno] = get_frame_base (fi) - val;
val -= 4;
}
if (fi->extra_info->leaf_function)
{
/* Set the register SP to contain the stack pointer of
the caller. */
- fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 4;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) + 4;
}
else
{
/* Set the register SP to contain the stack pointer of
the caller. */
- fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 8;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) + 8;
/* Set the register SRP to contain the return address of
the caller. */
- fi->saved_regs[SRP_REGNUM] = get_frame_base (fi) + 4;
+ get_frame_saved_regs (fi)[SRP_REGNUM] = get_frame_base (fi) + 4;
}
}
return ip;
/* frame_info now contains dynamic memory. Since fi is a dummy here,
I use static memory for extra_info, and don't bother allocating
memory for saved_regs. */
- fi.saved_regs = 0;
+ memset (&fi, 0, sizeof (fi));
fi.extra_info = &fei;
/* If there is no symbol information then sal.end == 0, and we end up
register int frameless_p = 0;
/* Has this frame's registers already been initialized? */
- if (fi->saved_regs)
+ if (get_frame_saved_regs (fi))
return;
frame_saved_regs_zalloc (fi);
/* Check fromleaf/frameless_function_invocation. (FIXME) */
- if (fi->saved_regs[SRP_REGNUM] != 0)
+ if (get_frame_saved_regs (fi)[SRP_REGNUM] != 0)
{
/* SRP was saved on the stack; non-leaf function. */
fi->extra_info->return_pc =
- read_memory_integer (fi->saved_regs[SRP_REGNUM],
+ read_memory_integer (get_frame_saved_regs (fi)[SRP_REGNUM],
REGISTER_RAW_SIZE (SRP_REGNUM));
}
else
after SP was saved. */
for (regno = 0; regno < FP_REGNUM; regno++)
{
- if (fi->saved_regs[regno])
+ if (get_frame_saved_regs (fi)[regno])
{
write_register (regno,
- read_memory_integer (fi->saved_regs[regno], 4));
+ read_memory_integer (get_frame_saved_regs (fi)[regno], 4));
}
}
- if (fi->saved_regs[FP_REGNUM])
+ if (get_frame_saved_regs (fi)[FP_REGNUM])
{
/* Pop the frame pointer (R8). It was pushed before SP
was saved. */
write_register (FP_REGNUM,
- read_memory_integer (fi->saved_regs[FP_REGNUM], 4));
+ read_memory_integer (get_frame_saved_regs (fi)[FP_REGNUM], 4));
stack_offset += 4;
/* Not a leaf function. */
- if (fi->saved_regs[SRP_REGNUM])
+ if (get_frame_saved_regs (fi)[SRP_REGNUM])
{
/* SRP was pushed before SP was saved. */
stack_offset += 4;
}
/* Restore the SP and adjust for R8 and (possibly) SRP. */
- write_register (SP_REGNUM, fi->saved_regs[FP_REGNUM] + stack_offset);
+ write_register (SP_REGNUM, get_frame_saved_regs (fi)[FP_REGNUM] + stack_offset);
}
else
{
/* now update the current registers with the old values */
for (regnum = A0_REGNUM; regnum < A0_REGNUM + NR_A_REGS; regnum++)
{
- if (fi->saved_regs[regnum])
+ if (get_frame_saved_regs (fi)[regnum])
{
- read_memory (fi->saved_regs[regnum], raw_buffer, REGISTER_RAW_SIZE (regnum));
+ read_memory (get_frame_saved_regs (fi)[regnum], raw_buffer, REGISTER_RAW_SIZE (regnum));
deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer,
REGISTER_RAW_SIZE (regnum));
}
}
for (regnum = 0; regnum < SP_REGNUM; regnum++)
{
- if (fi->saved_regs[regnum])
+ if (get_frame_saved_regs (fi)[regnum])
{
- write_register (regnum, read_memory_unsigned_integer (fi->saved_regs[regnum], REGISTER_RAW_SIZE (regnum)));
+ write_register (regnum, read_memory_unsigned_integer (get_frame_saved_regs (fi)[regnum], REGISTER_RAW_SIZE (regnum)));
}
}
- if (fi->saved_regs[PSW_REGNUM])
+ if (get_frame_saved_regs (fi)[PSW_REGNUM])
{
- write_register (PSW_REGNUM, read_memory_unsigned_integer (fi->saved_regs[PSW_REGNUM], REGISTER_RAW_SIZE (PSW_REGNUM)));
+ write_register (PSW_REGNUM, read_memory_unsigned_integer (get_frame_saved_regs (fi)[PSW_REGNUM], REGISTER_RAW_SIZE (PSW_REGNUM)));
}
write_register (PC_REGNUM, read_register (LR_REGNUM));
return (CORE_ADDR) 0;
}
- if (!fi->saved_regs[FP_REGNUM])
+ if (!get_frame_saved_regs (fi)[FP_REGNUM])
{
- if (!fi->saved_regs[SP_REGNUM]
- || fi->saved_regs[SP_REGNUM] == STACK_START)
+ if (!get_frame_saved_regs (fi)[SP_REGNUM]
+ || get_frame_saved_regs (fi)[SP_REGNUM] == STACK_START)
return (CORE_ADDR) 0;
- return fi->saved_regs[SP_REGNUM];
+ return get_frame_saved_regs (fi)[SP_REGNUM];
}
- addr = read_memory_unsigned_integer (fi->saved_regs[FP_REGNUM],
+ addr = read_memory_unsigned_integer (get_frame_saved_regs (fi)[FP_REGNUM],
REGISTER_RAW_SIZE (FP_REGNUM));
if (addr == 0)
return (CORE_ADDR) 0;
{
n = (op & 0x1E0) >> 5;
next_addr -= 2;
- fi->saved_regs[n] = next_addr;
+ get_frame_saved_regs (fi)[n] = next_addr;
return 1;
}
{
n = (op & 0x1E0) >> 5;
next_addr -= 4;
- fi->saved_regs[n] = next_addr;
- fi->saved_regs[n + 1] = next_addr + 2;
+ get_frame_saved_regs (fi)[n] = next_addr;
+ get_frame_saved_regs (fi)[n + 1] = next_addr + 2;
return 1;
}
if ((op & 0x7E1F) == 0x681E)
{
n = (op & 0x1E0) >> 5;
- fi->saved_regs[n] = next_addr;
+ get_frame_saved_regs (fi)[n] = next_addr;
return 1;
}
if ((op & 0x7E3F) == 0x3A1E)
{
n = (op & 0x1E0) >> 5;
- fi->saved_regs[n] = next_addr;
- fi->saved_regs[n + 1] = next_addr + 2;
+ get_frame_saved_regs (fi)[n] = next_addr;
+ get_frame_saved_regs (fi)[n + 1] = next_addr + 2;
return 1;
}
int i;
fp = fi->frame;
- memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
next_addr = 0;
pc = get_pc_function_start (get_frame_pc (fi));
/* st rn, @(offset,sp) */
short offset = op & 0xFFFF;
short n = (op >> 20) & 0xF;
- fi->saved_regs[n] = next_addr + offset;
+ get_frame_saved_regs (fi)[n] = next_addr + offset;
}
else if ((op & 0x3F1F0000) == 0x350F0000)
{
/* st2w rn, @(offset,sp) */
short offset = op & 0xFFFF;
short n = (op >> 20) & 0xF;
- fi->saved_regs[n] = next_addr + offset;
- fi->saved_regs[n + 1] = next_addr + offset + 2;
+ get_frame_saved_regs (fi)[n] = next_addr + offset;
+ get_frame_saved_regs (fi)[n + 1] = next_addr + offset + 2;
}
else
break;
fp = d10v_read_sp ();
for (i = 0; i < NUM_REGS - 1; i++)
- if (fi->saved_regs[i])
+ if (get_frame_saved_regs (fi)[i])
{
- fi->saved_regs[i] = fp - (next_addr - fi->saved_regs[i]);
+ get_frame_saved_regs (fi)[i] = fp - (next_addr - get_frame_saved_regs (fi)[i]);
}
- if (fi->saved_regs[LR_REGNUM])
+ if (get_frame_saved_regs (fi)[LR_REGNUM])
{
CORE_ADDR return_pc
- = read_memory_unsigned_integer (fi->saved_regs[LR_REGNUM],
+ = read_memory_unsigned_integer (get_frame_saved_regs (fi)[LR_REGNUM],
REGISTER_RAW_SIZE (LR_REGNUM));
fi->extra_info->return_pc = d10v_make_iaddr (return_pc);
}
}
/* The SP is not normally (ever?) saved, but check anyway */
- if (!fi->saved_regs[SP_REGNUM])
+ if (!get_frame_saved_regs (fi)[SP_REGNUM])
{
/* if the FP was saved, that means the current FP is valid, */
/* otherwise, it isn't being used, so we use the SP instead */
if (uses_frame)
- fi->saved_regs[SP_REGNUM]
+ get_frame_saved_regs (fi)[SP_REGNUM]
= d10v_read_fp () + fi->extra_info->size;
else
{
- fi->saved_regs[SP_REGNUM] = fp + fi->extra_info->size;
+ get_frame_saved_regs (fi)[SP_REGNUM] = fp + fi->extra_info->size;
fi->extra_info->frameless = 1;
- fi->saved_regs[FP_REGNUM] = 0;
+ get_frame_saved_regs (fi)[FP_REGNUM] = 0;
}
}
}
{
CORE_ADDR func_addr, func_end;
- if (!fi->saved_regs)
+ if (!get_frame_saved_regs (fi))
{
frame_saved_regs_zalloc (fi);
struct symtab_and_line sal = find_pc_line (func_addr, 0);
CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi)) ? sal.end : get_frame_pc (fi);
/* This will fill in fields in fi. */
- h8300_examine_prologue (func_addr, limit, fi->frame, fi->saved_regs, fi);
+ h8300_examine_prologue (func_addr, limit, fi->frame, get_frame_saved_regs (fi), fi);
}
/* Else we're out of luck (can't debug completely stripped code).
FIXME. */
E_PC_REGNUM);
return thisframe->frame;
}
- return thisframe->saved_regs[E_SP_REGNUM];
+ return get_frame_saved_regs (thisframe)[E_SP_REGNUM];
}
/* Return the saved PC from this frame.
{
/* Don't forget E_SP_REGNUM is a frame_saved_regs struct is the
actual value we want, not the address of the value we want. */
- if (frame->saved_regs[regno] && regno != E_SP_REGNUM)
+ if (get_frame_saved_regs (frame)[regno] && regno != E_SP_REGNUM)
write_register (regno,
- read_memory_integer (frame->saved_regs[regno],
+ read_memory_integer (get_frame_saved_regs (frame)[regno],
BINWORD));
- else if (frame->saved_regs[regno] && regno == E_SP_REGNUM)
+ else if (get_frame_saved_regs (frame)[regno] && regno == E_SP_REGNUM)
write_register (regno, frame->frame + 2 * BINWORD);
}
CORE_ADDR pc;
int i;
- if (fip->saved_regs)
+ if (get_frame_saved_regs (fip))
return;
frame_saved_regs_zalloc (fip);
break;
#ifdef I386_REGNO_TO_SYMMETRY
/* Dynix uses different internal numbering. Ick. */
- fip->saved_regs[I386_REGNO_TO_SYMMETRY (op - 0x50)] = addr;
+ get_frame_saved_regs (fip)[I386_REGNO_TO_SYMMETRY (op - 0x50)] = addr;
#else
- fip->saved_regs[op - 0x50] = addr;
+ get_frame_saved_regs (fip)[op - 0x50] = addr;
#endif
addr -= 4;
}
}
- fip->saved_regs[PC_REGNUM] = fip->frame + 4;
- fip->saved_regs[FP_REGNUM] = fip->frame;
+ get_frame_saved_regs (fip)[PC_REGNUM] = fip->frame + 4;
+ get_frame_saved_regs (fip)[FP_REGNUM] = fip->frame;
}
/* Return PC of first real instruction. */
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
CORE_ADDR addr;
- addr = frame->saved_regs[regnum];
+ addr = get_frame_saved_regs (frame)[regnum];
if (addr)
{
read_memory (addr, regbuf, REGISTER_RAW_SIZE (regnum));
else
{
FRAME_INIT_SAVED_REGS (frame);
- if (frame->saved_regs[IA64_VFP_REGNUM])
- return read_memory_integer (frame->saved_regs[IA64_VFP_REGNUM], 8);
+ if (get_frame_saved_regs (frame)[IA64_VFP_REGNUM])
+ return read_memory_integer (get_frame_saved_regs (frame)[IA64_VFP_REGNUM], 8);
else
return frame->frame + frame->extra_info->mem_stack_frame_size;
}
{
FRAME_INIT_SAVED_REGS (frame);
- if (frame->saved_regs[IA64_VRAP_REGNUM])
- return read_memory_integer (frame->saved_regs[IA64_VRAP_REGNUM], 8);
+ if (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM])
+ return read_memory_integer (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM], 8);
else if (frame->next && (get_frame_type (frame->next) == SIGTRAMP_FRAME))
return read_sigcontext_register (frame->next, IA64_BR0_REGNUM);
else /* either frameless, or not far enough along in the prologue... */
memset (instores, 0, sizeof instores);
memset (infpstores, 0, sizeof infpstores);
- if (frame && !frame->saved_regs)
+ if (frame && !get_frame_saved_regs (frame))
{
frame_saved_regs_zalloc (frame);
do_fsr_stuff = 1;
&& ((2 <= fM && fM <= 5) || (16 <= fM && fM <= 31)))
{
if (do_fsr_stuff)
- frame->saved_regs[IA64_FR0_REGNUM + fM] = spill_addr;
+ get_frame_saved_regs (frame)[IA64_FR0_REGNUM + fM] = spill_addr;
if ((instr & 0x1efc0000000) == 0x0eec0000000)
spill_addr += imm;
{
/* Track UNAT register */
if (do_fsr_stuff)
- frame->saved_regs[IA64_UNAT_REGNUM] = spill_addr;
+ get_frame_saved_regs (frame)[IA64_UNAT_REGNUM] = spill_addr;
unat_save_reg = 0;
}
else
{
/* Track PR register */
if (do_fsr_stuff)
- frame->saved_regs[IA64_PR_REGNUM] = spill_addr;
+ get_frame_saved_regs (frame)[IA64_PR_REGNUM] = spill_addr;
pr_save_reg = 0;
}
if ((instr & 0x1efc0000000LL) == 0x0acc0000000LL)
regs. Record the spill address and advance the spill
register if appropriate. */
if (do_fsr_stuff)
- frame->saved_regs[IA64_GR0_REGNUM + rM] = spill_addr;
+ get_frame_saved_regs (frame)[IA64_GR0_REGNUM + rM] = spill_addr;
if ((instr & 0x1efc0000000LL) == 0x0aec0000000LL)
/* st8.spill [rN] = rM, imm9 */
spill_addr += imm9(instr);
addr += 8;
}
if (i < sor)
- frame->saved_regs[IA64_GR32_REGNUM + ((i + (sor - rrb_gr)) % sor)]
+ get_frame_saved_regs (frame)[IA64_GR32_REGNUM + ((i + (sor - rrb_gr)) % sor)]
= addr;
else
- frame->saved_regs[IA64_GR32_REGNUM + i] = addr;
+ get_frame_saved_regs (frame)[IA64_GR32_REGNUM + i] = addr;
if (i+32 == cfm_reg)
- frame->saved_regs[IA64_CFM_REGNUM] = addr;
+ get_frame_saved_regs (frame)[IA64_CFM_REGNUM] = addr;
if (i+32 == ret_reg)
- frame->saved_regs[IA64_VRAP_REGNUM] = addr;
+ get_frame_saved_regs (frame)[IA64_VRAP_REGNUM] = addr;
if (i+32 == fp_reg)
- frame->saved_regs[IA64_VFP_REGNUM] = addr;
+ get_frame_saved_regs (frame)[IA64_VFP_REGNUM] = addr;
}
}
void
ia64_frame_init_saved_regs (struct frame_info *frame)
{
- if (frame->saved_regs)
+ if (get_frame_saved_regs (frame))
return;
if ((get_frame_type (frame) == SIGTRAMP_FRAME) && SIGCONTEXT_REGISTER_ADDRESS)
frame_saved_regs_zalloc (frame);
- frame->saved_regs[IA64_VRAP_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_VRAP_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_IP_REGNUM);
- frame->saved_regs[IA64_CFM_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_CFM_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CFM_REGNUM);
- frame->saved_regs[IA64_PSR_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_PSR_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PSR_REGNUM);
#if 0
- frame->saved_regs[IA64_BSP_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_BSP_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_BSP_REGNUM);
#endif
- frame->saved_regs[IA64_RNAT_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_RNAT_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_RNAT_REGNUM);
- frame->saved_regs[IA64_CCV_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_CCV_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CCV_REGNUM);
- frame->saved_regs[IA64_UNAT_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_UNAT_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_UNAT_REGNUM);
- frame->saved_regs[IA64_FPSR_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_FPSR_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_FPSR_REGNUM);
- frame->saved_regs[IA64_PFS_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_PFS_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PFS_REGNUM);
- frame->saved_regs[IA64_LC_REGNUM] =
+ get_frame_saved_regs (frame)[IA64_LC_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_LC_REGNUM);
for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
if (regno != sp_regnum)
- frame->saved_regs[regno] =
+ get_frame_saved_regs (frame)[regno] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
- frame->saved_regs[regno] =
+ get_frame_saved_regs (frame)[regno] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
for (regno = IA64_FR2_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
- frame->saved_regs[regno] =
+ get_frame_saved_regs (frame)[regno] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
}
else
if (!is_dummy_frame)
{
FRAME_INIT_SAVED_REGS (frame);
- gr_addr = frame->saved_regs[ regnum - IA64_NAT0_REGNUM
- + IA64_GR0_REGNUM];
+ gr_addr = get_frame_saved_regs (frame)[ regnum - IA64_NAT0_REGNUM
+ + IA64_GR0_REGNUM];
}
if (gr_addr)
{
if (!is_dummy_frame)
{
FRAME_INIT_SAVED_REGS (frame);
- addr = frame->saved_regs[regnum];
+ addr = get_frame_saved_regs (frame)[regnum];
}
if (addr != 0)
FRAME_INIT_SAVED_REGS (frn);
- if (frn->saved_regs[IA64_CFM_REGNUM] != 0)
- cfm = read_memory_integer (frn->saved_regs[IA64_CFM_REGNUM], 8);
+ if (get_frame_saved_regs (frn)[IA64_CFM_REGNUM] != 0)
+ cfm = read_memory_integer (get_frame_saved_regs (frn)[IA64_CFM_REGNUM], 8);
else if (frn->next && (get_frame_type (frn->next) == SIGTRAMP_FRAME))
cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM);
else if (frn->next
for (regno = 0; regno < ia64_num_regs; regno++)
{
- if (frame->saved_regs[regno]
+ if (get_frame_saved_regs (frame)[regno]
&& (!(IA64_GR32_REGNUM <= regno && regno <= IA64_GR127_REGNUM))
&& regno != pc_regnum
&& regno != sp_regnum
&& regno != IA64_BSPSTORE_REGNUM)
{
write_register (regno,
- read_memory_integer (frame->saved_regs[regno],
+ read_memory_integer (get_frame_saved_regs (frame)[regno],
REGISTER_RAW_SIZE (regno)));
}
}
cfm = read_register (IA64_CFM_REGNUM);
- if (frame->saved_regs[IA64_PFS_REGNUM])
+ if (get_frame_saved_regs (frame)[IA64_PFS_REGNUM])
{
- pfs = read_memory_integer (frame->saved_regs[IA64_PFS_REGNUM],
+ pfs = read_memory_integer (get_frame_saved_regs (frame)[IA64_PFS_REGNUM],
REGISTER_RAW_SIZE (IA64_PFS_REGNUM));
}
else
/* Copy regs from where they were saved in the frame. */
for (regnum = 0; regnum < M68HC11_ALL_REGS; regnum++)
- if (frame->saved_regs[regnum])
+ if (get_frame_saved_regs (frame)[regnum])
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum], 2));
+ read_memory_integer (get_frame_saved_regs (frame)[regnum], 2));
write_register (HARD_PC_REGNUM, frame->extra_info->return_pc);
sp = (fp + frame->extra_info->size + 2) & 0x0ffff;
CORE_ADDR pc;
CORE_ADDR addr;
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
else
- memset (fi->saved_regs, 0, sizeof (fi->saved_regs));
+ memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
pc = get_frame_pc (fi);
fi->extra_info->return_kind = m68hc11_get_return_insn (pc);
m68hc11_guess_from_prologue (pc, fi->frame, &pc, &fi->extra_info->size,
- fi->saved_regs);
+ get_frame_saved_regs (fi));
addr = fi->frame + fi->extra_info->size + STACK_CORRECTION;
if (soft_regs[SOFT_FP_REGNUM].name)
- fi->saved_regs[SOFT_FP_REGNUM] = addr - 2;
+ get_frame_saved_regs (fi)[SOFT_FP_REGNUM] = addr - 2;
/* Take into account how the function was called/returns. */
if (fi->extra_info->return_kind == RETURN_RTC)
{
- fi->saved_regs[HARD_PAGE_REGNUM] = addr;
+ get_frame_saved_regs (fi)[HARD_PAGE_REGNUM] = addr;
addr++;
}
else if (fi->extra_info->return_kind == RETURN_RTI)
{
- fi->saved_regs[HARD_CCR_REGNUM] = addr;
- fi->saved_regs[HARD_D_REGNUM] = addr + 1;
- fi->saved_regs[HARD_X_REGNUM] = addr + 3;
- fi->saved_regs[HARD_Y_REGNUM] = addr + 5;
+ get_frame_saved_regs (fi)[HARD_CCR_REGNUM] = addr;
+ get_frame_saved_regs (fi)[HARD_D_REGNUM] = addr + 1;
+ get_frame_saved_regs (fi)[HARD_X_REGNUM] = addr + 3;
+ get_frame_saved_regs (fi)[HARD_Y_REGNUM] = addr + 5;
addr += 7;
}
- fi->saved_regs[HARD_SP_REGNUM] = addr;
- fi->saved_regs[HARD_PC_REGNUM] = fi->saved_regs[HARD_SP_REGNUM];
+ get_frame_saved_regs (fi)[HARD_SP_REGNUM] = addr;
+ get_frame_saved_regs (fi)[HARD_PC_REGNUM] = get_frame_saved_regs (fi)[HARD_SP_REGNUM];
}
static void
}
else
{
- addr = fi->saved_regs[HARD_PC_REGNUM];
+ addr = get_frame_saved_regs (fi)[HARD_PC_REGNUM];
addr = read_memory_unsigned_integer (addr, 2) & 0x0ffff;
/* Take into account the 68HC12 specific call (PC + page). */
&& addr >= 0x08000 && addr < 0x0c000
&& USE_PAGE_REGISTER)
{
- CORE_ADDR page_addr = fi->saved_regs[HARD_PAGE_REGNUM];
+ CORE_ADDR page_addr = get_frame_saved_regs (fi)[HARD_PAGE_REGNUM];
unsigned page = read_memory_unsigned_integer (page_addr, 1);
addr -= 0x08000;
m68k_frame_init_saved_regs (frame);
for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--)
{
- if (frame->saved_regs[regnum])
+ if (get_frame_saved_regs (frame)[regnum])
{
- read_memory (frame->saved_regs[regnum], raw_buffer, 12);
+ read_memory (get_frame_saved_regs (frame)[regnum], raw_buffer, 12);
deprecated_write_register_bytes (REGISTER_BYTE (regnum), raw_buffer,
12);
}
}
for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)
{
- if (frame->saved_regs[regnum])
+ if (get_frame_saved_regs (frame)[regnum])
{
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum], 4));
+ read_memory_integer (get_frame_saved_regs (frame)[regnum], 4));
}
}
- if (frame->saved_regs[PS_REGNUM])
+ if (get_frame_saved_regs (frame)[PS_REGNUM])
{
write_register (PS_REGNUM,
- read_memory_integer (frame->saved_regs[PS_REGNUM], 4));
+ read_memory_integer (get_frame_saved_regs (frame)[PS_REGNUM], 4));
}
write_register (FP_REGNUM, read_memory_integer (fp, 4));
write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
int nextinsn;
- if (frame_info->saved_regs)
+ if (get_frame_saved_regs (frame_info))
return;
frame_saved_regs_zalloc (frame_info);
- memset (frame_info->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (frame_info), 0, SIZEOF_FRAME_SAVED_REGS);
if (get_frame_pc (frame_info) >= possible_call_dummy_start
&& get_frame_pc (frame_info) <= frame_info->frame)
/* Regmask's low bit is for register fp7, the first pushed */
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
- frame_info->saved_regs[regnum] = (next_addr -= 12);
+ get_frame_saved_regs (frame_info)[regnum] = (next_addr -= 12);
pc += 4;
}
/* fmovemx to (fp + displacement) */
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
{
- frame_info->saved_regs[regnum] = addr;
+ get_frame_saved_regs (frame_info)[regnum] = addr;
addr += 12;
}
pc += 6;
for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)
if (regmask & 1)
{
- frame_info->saved_regs[regnum] = next_addr;
+ get_frame_saved_regs (frame_info)[regnum] = next_addr;
next_addr += 4;
}
pc += 4;
for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)
if (regmask & 1)
{
- frame_info->saved_regs[regnum] = addr;
+ get_frame_saved_regs (frame_info)[regnum] = addr;
addr += 4;
}
pc += 6;
/* Regmask's low bit is for register 15, the first pushed */
for (regnum = 16; --regnum >= 0; regmask >>= 1)
if (regmask & 1)
- frame_info->saved_regs[regnum] = (next_addr -= 4);
+ get_frame_saved_regs (frame_info)[regnum] = (next_addr -= 4);
pc += 4;
}
/* movl r,-(sp) */
else if (0x2f00 == (0xfff0 & nextinsn))
{
regnum = 0xf & nextinsn;
- frame_info->saved_regs[regnum] = (next_addr -= 4);
+ get_frame_saved_regs (frame_info)[regnum] = (next_addr -= 4);
pc += 2;
}
/* fmovemx to index of sp */
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
{
- frame_info->saved_regs[regnum] = next_addr;
+ get_frame_saved_regs (frame_info)[regnum] = next_addr;
next_addr += 12;
}
pc += 10;
/* clrw -(sp); movw ccr,-(sp) */
else if (0x4267 == nextinsn && 0x42e7 == regmask)
{
- frame_info->saved_regs[PS_REGNUM] = (next_addr -= 4);
+ get_frame_saved_regs (frame_info)[PS_REGNUM] = (next_addr -= 4);
pc += 4;
}
else
break;
}
lose:;
- frame_info->saved_regs[SP_REGNUM] = (frame_info)->frame + 8;
- frame_info->saved_regs[FP_REGNUM] = (frame_info)->frame;
- frame_info->saved_regs[PC_REGNUM] = (frame_info)->frame + 4;
+ get_frame_saved_regs (frame_info)[SP_REGNUM] = (frame_info)->frame + 8;
+ get_frame_saved_regs (frame_info)[FP_REGNUM] = (frame_info)->frame;
+ get_frame_saved_regs (frame_info)[PC_REGNUM] = (frame_info)->frame + 4;
#ifdef SIG_SP_FP_OFFSET
/* Adjust saved SP_REGNUM for fake _sigtramp frames. */
if ((get_frame_type (frame_info) == SIGTRAMP_FRAME) && frame_info->next)
deprecated_update_frame_base_hack (dummy, frame);
dummy->extra_info->status = 0;
dummy->extra_info->framesize = 0;
- memset (dummy->saved_regs, '\000', SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
mcore_analyze_prologue (dummy, 0, 0);
return dummy;
}
{
if (register_offsets[rn] >= 0)
{
- fi->saved_regs[rn] = fi->frame - register_offsets[rn];
+ get_frame_saved_regs (fi)[rn] = fi->frame - register_offsets[rn];
mcore_insn_debug (("Saved register %s stored at 0x%08x, value=0x%08x\n",
mcore_register_names[rn], fi->saved_regs[rn],
read_memory_integer (fi->saved_regs[rn], 4)));
int fp = dummy->extra_info->fp_regnum;
/* Our caller has a frame pointer. */
- if (fi->saved_regs[fp] != 0)
+ if (get_frame_saved_regs (fi)[fp] != 0)
{
/* The "FP" was saved on the stack. Don't forget to adjust
the "FP" with the framesize to get a real FP. */
- callers_addr = read_memory_integer (fi->saved_regs[fp], REGISTER_SIZE)
+ callers_addr = read_memory_integer (get_frame_saved_regs (fi)[fp], REGISTER_SIZE)
+ dummy->extra_info->framesize;
}
else
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
- else if (fi->saved_regs[regnum] != 0)
- return read_memory_integer (fi->saved_regs[regnum],
+ else if (get_frame_saved_regs (fi)[regnum] != 0)
+ return read_memory_integer (get_frame_saved_regs (fi)[regnum],
REGISTER_SIZE);
}
/* Restore any saved registers. */
for (rn = 0; rn < NUM_REGS; rn++)
{
- if (fi->saved_regs[rn] != 0)
+ if (get_frame_saved_regs (fi)[rn] != 0)
{
ULONGEST value;
- value = read_memory_unsigned_integer (fi->saved_regs[rn],
+ value = read_memory_unsigned_integer (get_frame_saved_regs (fi)[rn],
REGISTER_SIZE);
write_register (rn, value);
}
{
reg_position = fci->frame + SIGFRAME_REGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE;
- fci->saved_regs[ireg] = reg_position;
+ get_frame_saved_regs (fci)[ireg] = reg_position;
}
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
reg_position = fci->frame + SIGFRAME_FPREGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE;
- fci->saved_regs[FP0_REGNUM + ireg] = reg_position;
+ get_frame_saved_regs (fci)[FP0_REGNUM + ireg] = reg_position;
}
- fci->saved_regs[PC_REGNUM] = fci->frame + SIGFRAME_PC_OFF;
+ get_frame_saved_regs (fci)[PC_REGNUM] = fci->frame + SIGFRAME_PC_OFF;
return;
}
for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1)
if (gen_mask & 0x80000000)
{
- fci->saved_regs[ireg] = reg_position;
+ get_frame_saved_regs (fci)[ireg] = reg_position;
reg_position -= MIPS_SAVED_REGSIZE;
}
/* Check if the s0 and s1 registers were pushed on the stack. */
for (reg = 16; reg < sreg_count + 16; reg++)
{
- fci->saved_regs[reg] = reg_position;
+ get_frame_saved_regs (fci)[reg] = reg_position;
reg_position -= MIPS_SAVED_REGSIZE;
}
}
for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1)
if (float_mask & 0x80000000)
{
- fci->saved_regs[FP0_REGNUM + ireg] = reg_position;
+ get_frame_saved_regs (fci)[FP0_REGNUM + ireg] = reg_position;
reg_position -= MIPS_SAVED_REGSIZE;
}
- fci->saved_regs[PC_REGNUM] = fci->saved_regs[RA_REGNUM];
+ get_frame_saved_regs (fci)[PC_REGNUM] = get_frame_saved_regs (fci)[RA_REGNUM];
}
/* Set up the 'saved_regs' array. This is a data structure containing
static void
mips_frame_init_saved_regs (struct frame_info *frame)
{
- if (frame->saved_regs == NULL)
+ if (get_frame_saved_regs (frame) == NULL)
{
mips_find_saved_regs (frame);
}
- frame->saved_regs[SP_REGNUM] = frame->frame;
+ get_frame_saved_regs (frame)[SP_REGNUM] = frame->frame;
}
static CORE_ADDR
if (!PC_IN_SIGTRAMP (get_frame_pc (fci), name))
{
frame_saved_regs_zalloc (fci);
- memcpy (fci->saved_regs, temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
- fci->saved_regs[PC_REGNUM]
- = fci->saved_regs[RA_REGNUM];
+ memcpy (get_frame_saved_regs (fci), temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
+ get_frame_saved_regs (fci)[PC_REGNUM]
+ = get_frame_saved_regs (fci)[RA_REGNUM];
/* Set value of previous frame's stack pointer. Remember that
saved_regs[SP_REGNUM] is special in that it contains the
value of the stack pointer register. The other saved_regs
values are addresses (in the inferior) at which a given
register's value may be found. */
- fci->saved_regs[SP_REGNUM] = fci->frame;
+ get_frame_saved_regs (fci)[SP_REGNUM] = fci->frame;
}
}
}
write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
- if (frame->saved_regs == NULL)
+ if (get_frame_saved_regs (frame) == NULL)
FRAME_INIT_SAVED_REGS (frame);
for (regnum = 0; regnum < NUM_REGS; regnum++)
if (regnum != SP_REGNUM && regnum != PC_REGNUM
- && frame->saved_regs[regnum])
+ && get_frame_saved_regs (frame)[regnum])
{
/* Floating point registers must not be sign extended,
in case MIPS_SAVED_REGSIZE = 4 but sizeof (FP0_REGNUM) == 8. */
if (FP0_REGNUM <= regnum && regnum < FP0_REGNUM + 32)
write_register (regnum,
- read_memory_unsigned_integer (frame->saved_regs[regnum],
+ read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
MIPS_SAVED_REGSIZE));
else
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum],
+ read_memory_integer (get_frame_saved_regs (frame)[regnum],
MIPS_SAVED_REGSIZE));
}
dummy->frame = frame;
dummy->extra_info->status = 0;
dummy->extra_info->stack_size = 0;
- memset (dummy->saved_regs, '\000', SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
mn10300_analyze_prologue (dummy, 0);
return dummy;
}
/* The `other' bit leaves a blank area of four bytes at the
beginning of its block of saved registers, making it 32 bytes
long in total. */
- fi->saved_regs[LAR_REGNUM] = fi->frame + offset + 4;
- fi->saved_regs[LIR_REGNUM] = fi->frame + offset + 8;
- fi->saved_regs[MDR_REGNUM] = fi->frame + offset + 12;
- fi->saved_regs[A0_REGNUM + 1] = fi->frame + offset + 16;
- fi->saved_regs[A0_REGNUM] = fi->frame + offset + 20;
- fi->saved_regs[D0_REGNUM + 1] = fi->frame + offset + 24;
- fi->saved_regs[D0_REGNUM] = fi->frame + offset + 28;
+ get_frame_saved_regs (fi)[LAR_REGNUM] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[LIR_REGNUM] = fi->frame + offset + 8;
+ get_frame_saved_regs (fi)[MDR_REGNUM] = fi->frame + offset + 12;
+ get_frame_saved_regs (fi)[A0_REGNUM + 1] = fi->frame + offset + 16;
+ get_frame_saved_regs (fi)[A0_REGNUM] = fi->frame + offset + 20;
+ get_frame_saved_regs (fi)[D0_REGNUM + 1] = fi->frame + offset + 24;
+ get_frame_saved_regs (fi)[D0_REGNUM] = fi->frame + offset + 28;
offset += 32;
}
if (movm_args & movm_a3_bit)
{
- fi->saved_regs[A3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A3_REGNUM] = fi->frame + offset;
offset += 4;
}
if (movm_args & movm_a2_bit)
{
- fi->saved_regs[A2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A2_REGNUM] = fi->frame + offset;
offset += 4;
}
if (movm_args & movm_d3_bit)
{
- fi->saved_regs[D3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D3_REGNUM] = fi->frame + offset;
offset += 4;
}
if (movm_args & movm_d2_bit)
{
- fi->saved_regs[D2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D2_REGNUM] = fi->frame + offset;
offset += 4;
}
if (AM33_MODE)
{
if (movm_args & movm_exother_bit)
{
- fi->saved_regs[MCVF_REGNUM] = fi->frame + offset;
- fi->saved_regs[MCRL_REGNUM] = fi->frame + offset + 4;
- fi->saved_regs[MCRH_REGNUM] = fi->frame + offset + 8;
- fi->saved_regs[MDRQ_REGNUM] = fi->frame + offset + 12;
- fi->saved_regs[E0_REGNUM + 1] = fi->frame + offset + 16;
- fi->saved_regs[E0_REGNUM + 0] = fi->frame + offset + 20;
+ get_frame_saved_regs (fi)[MCVF_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[MCRL_REGNUM] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[MCRH_REGNUM] = fi->frame + offset + 8;
+ get_frame_saved_regs (fi)[MDRQ_REGNUM] = fi->frame + offset + 12;
+ get_frame_saved_regs (fi)[E0_REGNUM + 1] = fi->frame + offset + 16;
+ get_frame_saved_regs (fi)[E0_REGNUM + 0] = fi->frame + offset + 20;
offset += 24;
}
if (movm_args & movm_exreg1_bit)
{
- fi->saved_regs[E0_REGNUM + 7] = fi->frame + offset;
- fi->saved_regs[E0_REGNUM + 6] = fi->frame + offset + 4;
- fi->saved_regs[E0_REGNUM + 5] = fi->frame + offset + 8;
- fi->saved_regs[E0_REGNUM + 4] = fi->frame + offset + 12;
+ get_frame_saved_regs (fi)[E0_REGNUM + 7] = fi->frame + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 6] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 5] = fi->frame + offset + 8;
+ get_frame_saved_regs (fi)[E0_REGNUM + 4] = fi->frame + offset + 12;
offset += 16;
}
if (movm_args & movm_exreg0_bit)
{
- fi->saved_regs[E0_REGNUM + 3] = fi->frame + offset;
- fi->saved_regs[E0_REGNUM + 2] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 3] = fi->frame + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 2] = fi->frame + offset + 4;
offset += 8;
}
}
/* Reserve four bytes for every register saved. */
for (i = 0; i < NUM_REGS; i++)
- if (fi->saved_regs[i])
+ if (get_frame_saved_regs (fi)[i])
adjust += 4;
/* If we saved LIR, then it's most likely we used a `movm'
instruction with the `other' bit set, in which case the SP is
decremented by an extra four bytes, "to simplify calculation
of the transfer area", according to the processor manual. */
- if (fi->saved_regs[LIR_REGNUM])
+ if (get_frame_saved_regs (fi)[LIR_REGNUM])
adjust += 4;
return adjust;
{
/* Our caller has a frame pointer. So find the frame in $a3 or
in the stack. */
- if (fi->saved_regs[A3_REGNUM])
- return (read_memory_integer (fi->saved_regs[A3_REGNUM], REGISTER_SIZE));
+ if (get_frame_saved_regs (fi)[A3_REGNUM])
+ return (read_memory_integer (get_frame_saved_regs (fi)[A3_REGNUM], REGISTER_SIZE));
else
return read_register (A3_REGNUM);
}
/* Restore any saved registers. */
for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (frame->saved_regs[regnum] != 0)
+ if (get_frame_saved_regs (frame)[regnum] != 0)
{
ULONGEST value;
- value = read_memory_unsigned_integer (frame->saved_regs[regnum],
+ value = read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
REGISTER_RAW_SIZE (regnum));
write_register (regnum, value);
}
int localcount;
CORE_ADDR enter_addr, next_addr;
- if (frame->saved_regs)
+ if (get_frame_saved_regs (frame))
return;
frame_saved_regs_zalloc (frame);
for (regnum = 0; regnum < 8; regnum++)
{
if (regmask & (1 << regnum))
- frame->saved_regs[regnum] = next_addr -= 4;
+ get_frame_saved_regs (frame)[regnum] = next_addr -= 4;
}
- frame->saved_regs[SP_REGNUM] = frame->frame + 4;
- frame->saved_regs[PC_REGNUM] = frame->frame + 4;
- frame->saved_regs[FP_REGNUM] = read_memory_integer (frame->frame, 4);
+ get_frame_saved_regs (frame)[SP_REGNUM] = frame->frame + 4;
+ get_frame_saved_regs (frame)[PC_REGNUM] = frame->frame + 4;
+ get_frame_saved_regs (frame)[FP_REGNUM] = read_memory_integer (frame->frame, 4);
}
else if (enter_addr == 1)
{
CORE_ADDR sp = read_register (SP_REGNUM);
- frame->saved_regs[PC_REGNUM] = sp;
- frame->saved_regs[SP_REGNUM] = sp + 4;
+ get_frame_saved_regs (frame)[PC_REGNUM] = sp;
+ get_frame_saved_regs (frame)[SP_REGNUM] = sp + 4;
}
}
FRAME_INIT_SAVED_REGS (frame);
for (regnum = 0; regnum < 8; regnum++)
- if (frame->saved_regs[regnum])
+ if (get_frame_saved_regs (frame)[regnum])
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum], 4));
+ read_memory_integer (get_frame_saved_regs (frame)[regnum], 4));
write_register (FP_REGNUM, read_memory_integer (fp, 4));
write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
orig_sp = fi->frame;
if (! init_extra_info && fextra_info->initialised)
orig_sp += fextra_info->stack_bought;
- saved_regs = fi->saved_regs;
+ saved_regs = get_frame_saved_regs (fi);
}
if (init_extra_info || !fextra_info->initialised)
{
int quick;
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
{
/* zalloc memsets the saved regs */
frame_saved_regs_zalloc (fi);
{
fi->extra_info->saved_pc_valid = 1;
if (fi->extra_info->good_prologue
- && fi->saved_regs[S390_RETADDR_REGNUM])
+ && get_frame_saved_regs (fi)[S390_RETADDR_REGNUM])
fi->extra_info->saved_pc
= ADDR_BITS_REMOVE (read_memory_integer
- (fi->saved_regs[S390_RETADDR_REGNUM],
+ (get_frame_saved_regs (fi)[S390_RETADDR_REGNUM],
S390_GPR_SIZE));
else
fi->extra_info->saved_pc
}
else
{
- if (thisframe->saved_regs)
+ if (get_frame_saved_regs (thisframe))
{
int regno;
if (prev_fextra_info.frame_pointer_saved_pc
- && thisframe->saved_regs[S390_FRAME_REGNUM])
+ && get_frame_saved_regs (thisframe)[S390_FRAME_REGNUM])
regno = S390_FRAME_REGNUM;
else
regno = S390_SP_REGNUM;
- if (thisframe->saved_regs[regno])
+ if (get_frame_saved_regs (thisframe)[regno])
{
/* The SP's entry of `saved_regs' is special. */
if (regno == S390_SP_REGNUM)
- prev_fp = thisframe->saved_regs[regno];
+ prev_fp = get_frame_saved_regs (thisframe)[regno];
else
prev_fp =
- read_memory_integer (thisframe->saved_regs[regno],
+ read_memory_integer (get_frame_saved_regs (thisframe)[regno],
S390_GPR_SIZE);
}
}
write_register (S390_PC_REGNUM, FRAME_SAVED_PC (frame));
/* Restore any saved registers. */
- if (frame->saved_regs)
+ if (get_frame_saved_regs (frame))
{
for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (frame->saved_regs[regnum] != 0)
+ if (get_frame_saved_regs (frame)[regnum] != 0)
{
ULONGEST value;
- value = read_memory_unsigned_integer (frame->saved_regs[regnum],
+ value = read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
REGISTER_RAW_SIZE (regnum));
write_register (regnum, value);
}
/* Actually cut back the stack. Remember that the SP's element of
saved_regs is the old SP itself, not the address at which it is
saved. */
- write_register (S390_SP_REGNUM, frame->saved_regs[S390_SP_REGNUM]);
+ write_register (S390_SP_REGNUM, get_frame_saved_regs (frame)[S390_SP_REGNUM]);
}
/* Throw away any cached frame information. */
FRAME_INIT_SAVED_REGS (fi);
if (!get_frame_pc (fi))
return 0;
- if (fi->saved_regs[regnum] != 0)
- return read_memory_integer (fi->saved_regs[regnum],
+ if (get_frame_saved_regs (fi)[regnum] != 0)
+ return read_memory_integer (get_frame_saved_regs (fi)[regnum],
REGISTER_RAW_SIZE (regnum));
}
return read_register (regnum);
media_mode = pc_is_isa32 (get_frame_pc (fi));
- if (fi->saved_regs[pr_regnum] != 0)
+ if (get_frame_saved_regs (fi)[pr_regnum] != 0)
{
int gdb_reg_num = translate_insn_rn (pr_regnum, media_mode);
int size = ((gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
? 4
: REGISTER_RAW_SIZE (gdb_reg_num));
- return read_memory_integer (fi->saved_regs[pr_regnum], size);
+ return read_memory_integer (get_frame_saved_regs (fi)[pr_regnum], size);
}
}
return read_register (pr_regnum);
int r3_val = 0;
char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
else
- memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
if (dummy_regs)
{
if (rn == FP_REGNUM)
have_fp = 1;
- fi->saved_regs[rn] = fi->frame - where[rn] + depth - 4;
+ get_frame_saved_regs (fi)[rn] = fi->frame - where[rn] + depth - 4;
}
else
{
- fi->saved_regs[rn] = 0;
+ get_frame_saved_regs (fi)[rn] = 0;
}
}
if (have_fp)
{
- fi->saved_regs[SP_REGNUM] = read_memory_integer (fi->saved_regs[FP_REGNUM], 4);
+ get_frame_saved_regs (fi)[SP_REGNUM] = read_memory_integer (get_frame_saved_regs (fi)[FP_REGNUM], 4);
}
else
{
- fi->saved_regs[SP_REGNUM] = fi->frame - 4;
+ get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame - 4;
}
fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
else
- memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
if (dummy_regs)
{
/* Watch out! saved_regs is only for the real registers, and
doesn't include space for the pseudo registers. */
- fi->saved_regs[register_number]= fi->frame - where[rn] + depth;
+ get_frame_saved_regs (fi)[register_number]= fi->frame - where[rn] + depth;
}
else
- fi->saved_regs[register_number] = 0;
+ get_frame_saved_regs (fi)[register_number] = 0;
}
if (have_fp)
size = 4;
else
size = REGISTER_RAW_SIZE (fp_regnum);
- fi->saved_regs[sp_regnum] = read_memory_integer (fi->saved_regs[fp_regnum], size);
+ get_frame_saved_regs (fi)[sp_regnum] = read_memory_integer (get_frame_saved_regs (fi)[fp_regnum], size);
}
else
- fi->saved_regs[sp_regnum] = fi->frame;
+ get_frame_saved_regs (fi)[sp_regnum] = fi->frame;
fi->extra_info->f_offset = depth - where[fp_regnum];
}
char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- if (fi->saved_regs == NULL)
+ if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
else
- memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
+ memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
if (dummy_regs)
{
if (rn == FP_REGNUM)
have_fp = 1;
- fi->saved_regs[rn] = fi->frame - where[rn] + depth - 4;
+ get_frame_saved_regs (fi)[rn] = fi->frame - where[rn] + depth - 4;
}
else
{
- fi->saved_regs[rn] = 0;
+ get_frame_saved_regs (fi)[rn] = 0;
}
}
if (have_fp)
{
- fi->saved_regs[SP_REGNUM] =
- read_memory_integer (fi->saved_regs[FP_REGNUM], 4);
+ get_frame_saved_regs (fi)[SP_REGNUM] =
+ read_memory_integer (get_frame_saved_regs (fi)[FP_REGNUM], 4);
}
else
{
- fi->saved_regs[SP_REGNUM] = fi->frame - 4;
+ get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame - 4;
}
fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
}
FRAME_INIT_SAVED_REGS (frame);
- if (frame->saved_regs != NULL
- && frame->saved_regs[regnum] != 0)
+ if (get_frame_saved_regs (frame) != NULL
+ && get_frame_saved_regs (frame)[regnum] != 0)
{
if (lval) /* found it saved on the stack */
*lval = lval_memory;
{
if (raw_buffer) /* SP register treated specially */
store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- frame->saved_regs[regnum]);
+ get_frame_saved_regs (frame)[regnum]);
}
else
{ /* any other register */
if (addrp)
- *addrp = frame->saved_regs[regnum];
+ *addrp = get_frame_saved_regs (frame)[regnum];
if (raw_buffer)
{
int size;
else
size = REGISTER_RAW_SIZE (live_regnum);
if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
- read_memory (frame->saved_regs[regnum], raw_buffer, size);
+ read_memory (get_frame_saved_regs (frame)[regnum], raw_buffer, size);
else
- read_memory (frame->saved_regs[regnum],
+ read_memory (get_frame_saved_regs (frame)[regnum],
raw_buffer
+ REGISTER_RAW_SIZE (live_regnum)
- size,
/* Copy regs from where they were saved in the frame */
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
- if (frame->saved_regs[regnum])
+ if (get_frame_saved_regs (frame)[regnum])
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum], 4));
+ read_memory_integer (get_frame_saved_regs (frame)[regnum], 4));
write_register (PC_REGNUM, frame->extra_info->return_pc);
write_register (SP_REGNUM, fp + 4);
/* Copy regs from where they were saved in the frame */
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
- if (frame->saved_regs[regnum])
+ if (get_frame_saved_regs (frame)[regnum])
{
int size;
if (tdep->sh_abi == SH_ABI_32
size = REGISTER_RAW_SIZE (translate_insn_rn (regnum,
media_mode));
write_register (regnum,
- read_memory_integer (frame->saved_regs[regnum],
+ read_memory_integer (get_frame_saved_regs (frame)[regnum],
size));
}
for (; fi; fi = fi->next)
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
- else if (fi->saved_regs[regnum] != 0)
- return read_memory_unsigned_integer (fi->saved_regs[regnum],
+ else if (get_frame_saved_regs (fi)[regnum] != 0)
+ return read_memory_unsigned_integer (get_frame_saved_regs (fi)[regnum],
v850_register_raw_size (regnum));
return read_register (regnum);
write_register (E_PC_REGNUM, FRAME_SAVED_PC (frame));
for (regnum = 0; regnum < E_NUM_REGS; regnum++)
- if (frame->saved_regs[regnum] != 0)
+ if (get_frame_saved_regs (frame)[regnum] != 0)
write_register (regnum,
- read_memory_unsigned_integer (frame->saved_regs[regnum],
+ read_memory_unsigned_integer (get_frame_saved_regs (frame)[regnum],
v850_register_raw_size (regnum)));
write_register (E_SP_REGNUM, get_frame_base (frame));
struct pifsr pifsrs[E_NUM_REGS + 1], *pifsr;
CORE_ADDR func_addr, func_end;
- if (!fi->saved_regs)
+ if (!get_frame_saved_regs (fi))
{
frame_saved_regs_zalloc (fi);
for (pifsr = pifsrs; pifsr->framereg; pifsr++)
{
- fi->saved_regs[pifsr->reg] = pifsr->offset + fi->frame;
+ get_frame_saved_regs (fi)[pifsr->reg] = pifsr->offset + fi->frame;
if (pifsr->framereg == E_SP_REGNUM)
- fi->saved_regs[pifsr->reg] += pi.frameoffset;
+ get_frame_saved_regs (fi)[pifsr->reg] += pi.frameoffset;
}
}
/* Else we're out of luck (can't debug completely stripped code).
int regnum, regmask;
CORE_ADDR next_addr;
- if (frame->saved_regs)
+ if (get_frame_saved_regs (frame))
return;
frame_saved_regs_zalloc (frame);
for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
{
if (regmask & (1 << regnum))
- frame->saved_regs[regnum] = next_addr += 4;
+ get_frame_saved_regs (frame)[regnum] = next_addr += 4;
}
- frame->saved_regs[SP_REGNUM] = next_addr + 4;
+ get_frame_saved_regs (frame)[SP_REGNUM] = next_addr + 4;
if (regmask & (1 << FP_REGNUM))
- frame->saved_regs[SP_REGNUM] +=
+ get_frame_saved_regs (frame)[SP_REGNUM] +=
4 + (4 * read_memory_integer (next_addr + 4, 4));
- frame->saved_regs[PC_REGNUM] = frame->frame + 16;
- frame->saved_regs[FP_REGNUM] = frame->frame + 12;
- frame->saved_regs[VAX_AP_REGNUM] = frame->frame + 8;
- frame->saved_regs[PS_REGNUM] = frame->frame + 4;
+ get_frame_saved_regs (frame)[PC_REGNUM] = frame->frame + 16;
+ get_frame_saved_regs (frame)[FP_REGNUM] = frame->frame + 12;
+ get_frame_saved_regs (frame)[VAX_AP_REGNUM] = frame->frame + 8;
+ get_frame_saved_regs (frame)[PS_REGNUM] = frame->frame + 4;
}
/* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp. */
{
/* Restore the saved regs. */
for (i = 0; i < NUM_REGS; i++)
- if (fi->saved_regs[i])
+ if (get_frame_saved_regs (fi)[i])
{
if (i == SP_REGNUM)
- write_register (i, fi->saved_regs[i]);
+ write_register (i, get_frame_saved_regs (fi)[i]);
else if (i == E_PC_REGNUM)
- write_register (i, read_memory_integer (fi->saved_regs[i],
+ write_register (i, read_memory_integer (get_frame_saved_regs (fi)[i],
xstormy16_pc_size));
else
- write_register (i, read_memory_integer (fi->saved_regs[i],
+ write_register (i, read_memory_integer (get_frame_saved_regs (fi)[i],
xstormy16_reg_size));
}
/* Restore the PC */
if (fi)
{
regnum = inst & 0x000f;
- fi->saved_regs[regnum] = fi->extra_info->framesize;
+ get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize;
fi->extra_info->framesize += xstormy16_reg_size;
}
}
if (offset & 0x0800)
offset -= 0x1000;
- fi->saved_regs[regnum] = fi->extra_info->framesize + offset;
+ get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize + offset;
}
next_addr += xstormy16_inst_size;
}
previous value would have been pushed). */
if (fi->extra_info->frameless_p)
{
- fi->saved_regs[E_SP_REGNUM] = sp - fi->extra_info->framesize;
+ get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - fi->extra_info->framesize;
fi->frame = sp;
}
else
{
- fi->saved_regs[E_SP_REGNUM] = fp - fi->extra_info->framesize;
+ get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - fi->extra_info->framesize;
fi->frame = fp;
}
sp, fp and framesize. We know the beginning of the frame
so we can translate the register offsets to real addresses. */
for (regnum = 0; regnum < E_SP_REGNUM; ++regnum)
- if (fi->saved_regs[regnum])
- fi->saved_regs[regnum] += fi->saved_regs[E_SP_REGNUM];
+ if (get_frame_saved_regs (fi)[regnum])
+ get_frame_saved_regs (fi)[regnum] += get_frame_saved_regs (fi)[E_SP_REGNUM];
/* Save address of PC on stack. */
- fi->saved_regs[E_PC_REGNUM] = fi->saved_regs[E_SP_REGNUM];
+ get_frame_saved_regs (fi)[E_PC_REGNUM] = get_frame_saved_regs (fi)[E_SP_REGNUM];
}
return next_addr;
{
CORE_ADDR func_addr, func_end;
- if (!fi->saved_regs)
+ if (!get_frame_saved_regs (fi))
{
frame_saved_regs_zalloc (fi);
}
else
{
- saved_pc = read_memory_unsigned_integer (fi->saved_regs[E_PC_REGNUM],
+ saved_pc = read_memory_unsigned_integer (get_frame_saved_regs (fi)[E_PC_REGNUM],
xstormy16_pc_size);
}