* alpha-tdep.c: Use get_frame_extra_info.
* arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
* h8300-tdep.c, ia64-tdep.c, m68hc11-tdep.c, mcore-tdep.c: Ditto.
* mips-tdep.c, mn10300-tdep.c, s390-tdep.c, sh-tdep.c: Ditto.
* sparc-tdep.c, xstormy16-tdep.c: Ditto.
2003-01-08 Andrew Cagney <cagney@redhat.com>
+ * alpha-tdep.c: Use get_frame_extra_info.
+ * arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
+ * h8300-tdep.c, ia64-tdep.c, m68hc11-tdep.c, mcore-tdep.c: Ditto.
+ * mips-tdep.c, mn10300-tdep.c, s390-tdep.c, sh-tdep.c: Ditto.
+ * sparc-tdep.c, xstormy16-tdep.c: Ditto.
+
* alpha-tdep.c: Use get_next_frame.
* arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
* dwarf2cfi.c, h8300-tdep.c, i386-tdep.c, ia64-tdep.c: Ditto.
return;
}
- proc_desc = frame->extra_info->proc_desc;
+ proc_desc = get_frame_extra_info (frame)->proc_desc;
if (proc_desc == NULL)
/* I'm not sure how/whether this can happen. Normally when we can't
find a proc_desc, we "synthesize" one using heuristic_proc_desc
static CORE_ADDR
alpha_frame_saved_pc (struct frame_info *frame)
{
- alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
+ alpha_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc;
/* We have to get the saved pc from the sigcontext
if it is a signal handler frame. */
- int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM
- : frame->extra_info->pc_reg;
+ int pcreg = ((get_frame_type (frame) == SIGTRAMP_FRAME)
+ ? PC_REGNUM
+ : get_frame_extra_info (frame)->pc_reg);
if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
return read_memory_integer (get_frame_base (frame) - 8, 8);
alpha_print_extra_frame_info (struct frame_info *fi)
{
if (fi
- && fi->extra_info
- && fi->extra_info->proc_desc
- && fi->extra_info->proc_desc->pdr.framereg < NUM_REGS)
+ && get_frame_extra_info (fi)
+ && get_frame_extra_info (fi)->proc_desc
+ && get_frame_extra_info (fi)->proc_desc->pdr.framereg < NUM_REGS)
printf_filtered (" frame pointer is at %s+%s\n",
- REGISTER_NAME (fi->extra_info->proc_desc->pdr.framereg),
- paddr_d (fi->extra_info->proc_desc->pdr.frameoffset));
+ REGISTER_NAME (get_frame_extra_info (fi)->proc_desc->pdr.framereg),
+ paddr_d (get_frame_extra_info (fi)->proc_desc->pdr.frameoffset));
}
static void
/* 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;
+ get_frame_extra_info (frame)->localoff = 0;
+ get_frame_extra_info (frame)->pc_reg = ALPHA_RA_REGNUM;
+ get_frame_extra_info (frame)->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc;
if (proc_desc)
{
/* Get the locals offset and the saved pc register from the
procedure descriptor, they are valid even if we are in the
middle of the prologue. */
- frame->extra_info->localoff = PROC_LOCALOFF (proc_desc);
- frame->extra_info->pc_reg = PROC_PC_REG (proc_desc);
+ get_frame_extra_info (frame)->localoff = PROC_LOCALOFF (proc_desc);
+ get_frame_extra_info (frame)->pc_reg = PROC_PC_REG (proc_desc);
/* Fixup frame-pointer - only needed for top frame */
static CORE_ADDR
alpha_frame_locals_address (struct frame_info *fi)
{
- return (get_frame_base (fi) - fi->extra_info->localoff);
+ return (get_frame_base (fi) - get_frame_extra_info (fi)->localoff);
}
static CORE_ADDR
struct frame_info *frame = get_current_frame ();
CORE_ADDR new_sp = get_frame_base (frame);
- alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
+ alpha_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc;
/* we need proc_desc to know how to restore the registers;
if it is NULL, construct (a temporary) one */
frame pointer, adjust the stack pointer, and save registers.
Do this until all basic prolog instructions are found. */
- fi->extra_info->framesize = 0;
+ get_frame_extra_info (fi)->framesize = 0;
for (current_pc = prologue_start;
(current_pc < prologue_end) && ((findmask & 7) != 7);
current_pc += 2)
for (regno = ARM_LR_REGNUM; regno >= 0; regno--)
if (mask & (1 << regno))
{
- fi->extra_info->framesize += 4;
+ get_frame_extra_info (fi)->framesize += 4;
get_frame_saved_regs (fi)[saved_reg[regno]] =
- -(fi->extra_info->framesize);
+ -(get_frame_extra_info (fi)->framesize);
/* Reset saved register map. */
saved_reg[regno] = regno;
}
offset = (insn & 0x7f) << 2; /* get scaled offset */
if (insn & 0x80) /* is it signed? (==subtracting) */
{
- fi->extra_info->frameoffset += offset;
+ get_frame_extra_info (fi)->frameoffset += offset;
offset = -offset;
}
- fi->extra_info->framesize -= offset;
+ get_frame_extra_info (fi)->framesize -= offset;
}
else if ((insn & 0xff00) == 0xaf00) /* add r7, sp, #imm */
{
findmask |= 2; /* setting of r7 found */
- fi->extra_info->framereg = THUMB_FP_REGNUM;
+ get_frame_extra_info (fi)->framereg = THUMB_FP_REGNUM;
/* get scaled offset */
- fi->extra_info->frameoffset = (insn & 0xff) << 2;
+ get_frame_extra_info (fi)->frameoffset = (insn & 0xff) << 2;
}
else if (insn == 0x466f) /* mov r7, sp */
{
findmask |= 2; /* setting of r7 found */
- fi->extra_info->framereg = THUMB_FP_REGNUM;
- fi->extra_info->frameoffset = 0;
+ get_frame_extra_info (fi)->framereg = THUMB_FP_REGNUM;
+ get_frame_extra_info (fi)->frameoffset = 0;
saved_reg[THUMB_FP_REGNUM] = ARM_SP_REGNUM;
}
else if ((insn & 0xffc0) == 0x4640) /* mov r0-r7, r8-r15 */
if (get_frame_pc (fi) == get_frame_pc (prologue_cache))
{
- fi->extra_info->framereg = prologue_cache->extra_info->framereg;
- fi->extra_info->framesize = prologue_cache->extra_info->framesize;
- fi->extra_info->frameoffset = prologue_cache->extra_info->frameoffset;
+ get_frame_extra_info (fi)->framereg = get_frame_extra_info (prologue_cache)->framereg;
+ get_frame_extra_info (fi)->framesize = get_frame_extra_info (prologue_cache)->framesize;
+ get_frame_extra_info (fi)->frameoffset = get_frame_extra_info (prologue_cache)->frameoffset;
for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
get_frame_saved_regs (fi)[i] = get_frame_saved_regs (prologue_cache)[i];
return 1;
int i;
deprecated_update_frame_pc_hack (prologue_cache, get_frame_pc (fi));
- prologue_cache->extra_info->framereg = fi->extra_info->framereg;
- prologue_cache->extra_info->framesize = fi->extra_info->framesize;
- prologue_cache->extra_info->frameoffset = fi->extra_info->frameoffset;
+ get_frame_extra_info (prologue_cache)->framereg = get_frame_extra_info (fi)->framereg;
+ get_frame_extra_info (prologue_cache)->framesize = get_frame_extra_info (fi)->framesize;
+ get_frame_extra_info (prologue_cache)->frameoffset = get_frame_extra_info (fi)->frameoffset;
for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
get_frame_saved_regs (prologue_cache)[i] = get_frame_saved_regs (fi)[i];
return;
/* Assume there is no frame until proven otherwise. */
- fi->extra_info->framereg = ARM_SP_REGNUM;
- fi->extra_info->framesize = 0;
- fi->extra_info->frameoffset = 0;
+ get_frame_extra_info (fi)->framereg = ARM_SP_REGNUM;
+ get_frame_extra_info (fi)->framesize = 0;
+ get_frame_extra_info (fi)->frameoffset = 0;
/* Check for Thumb prologue. */
if (arm_pc_is_thumb (get_frame_pc (fi)))
unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32 - rot));
fp_offset = -imm;
- fi->extra_info->framereg = ARM_FP_REGNUM;
+ get_frame_extra_info (fi)->framereg = ARM_FP_REGNUM;
}
else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */
{
/* The frame size is just the negative of the offset (from the
original SP) of the last thing thing we pushed on the stack.
The frame offset is [new FP] - [new SP]. */
- fi->extra_info->framesize = -sp_offset;
- if (fi->extra_info->framereg == ARM_FP_REGNUM)
- fi->extra_info->frameoffset = fp_offset - sp_offset;
+ get_frame_extra_info (fi)->framesize = -sp_offset;
+ if (get_frame_extra_info (fi)->framereg == ARM_FP_REGNUM)
+ get_frame_extra_info (fi)->frameoffset = fp_offset - sp_offset;
else
- fi->extra_info->frameoffset = 0;
+ get_frame_extra_info (fi)->frameoffset = 0;
save_prologue_cache (fi);
}
arm_frame_chain (struct frame_info *fi)
{
CORE_ADDR caller_pc;
- int framereg = fi->extra_info->framereg;
+ int framereg = get_frame_extra_info (fi)->framereg;
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
/* A generic call dummy's frame is the same as caller's. */
/* Now, scan the prologue and obtain the frame register. */
deprecated_update_frame_pc_hack (caller_fi, caller_pc);
arm_scan_prologue (caller_fi);
- framereg = caller_fi->extra_info->framereg;
+ framereg = get_frame_extra_info (caller_fi)->framereg;
/* Deallocate the storage associated with the temporary frame
created above. */
if (framereg == ARM_FP_REGNUM || framereg == THUMB_FP_REGNUM)
return arm_find_callers_reg (fi, framereg);
else
- return get_frame_base (fi) + fi->extra_info->framesize;
+ return get_frame_base (fi) + get_frame_extra_info (fi)->framesize;
}
/* This function actually figures out the frame address for a given pc
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- fi->extra_info->framesize = 0;
- fi->extra_info->frameoffset = 0;
- fi->extra_info->framereg = 0;
+ get_frame_extra_info (fi)->framesize = 0;
+ get_frame_extra_info (fi)->frameoffset = 0;
+ get_frame_extra_info (fi)->framereg = 0;
if (get_next_frame (fi))
deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
get_frame_base (get_next_frame (fi)),
ARM_SP_REGNUM);
else
- sp = (get_frame_base (get_next_frame (fi)) - get_next_frame (fi)->extra_info->frameoffset
- + get_next_frame (fi)->extra_info->framesize);
+ sp = (get_frame_base (get_next_frame (fi))
+ - get_frame_extra_info (get_next_frame (fi))->frameoffset
+ + get_frame_extra_info (get_next_frame (fi))->framesize);
/* Determine whether or not we're in a sigtramp frame.
Unfortunately, it isn't sufficient to test (get_frame_type (fi)
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;
- deprecated_update_frame_base_hack (fi, 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;
+ get_frame_extra_info (fi)->framereg = ARM_SP_REGNUM;
+ deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (fi)[get_frame_extra_info (fi)->framereg], REGISTER_RAW_SIZE (get_frame_extra_info (fi)->framereg)));
+ get_frame_extra_info (fi)->framesize = 0;
+ get_frame_extra_info (fi)->frameoffset = 0;
}
else
if (!get_next_frame (fi))
/* This is the innermost frame? */
- deprecated_update_frame_base_hack (fi, read_register (fi->extra_info->framereg));
+ deprecated_update_frame_base_hack (fi, read_register (get_frame_extra_info (fi)->framereg));
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0))
/* Next inner most frame is a dummy, just grab its frame.
Dummy frames always have the same FP as their caller. */
deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi)));
- else if (fi->extra_info->framereg == ARM_FP_REGNUM
- || fi->extra_info->framereg == THUMB_FP_REGNUM)
+ else if (get_frame_extra_info (fi)->framereg == ARM_FP_REGNUM
+ || get_frame_extra_info (fi)->framereg == THUMB_FP_REGNUM)
{
/* not the innermost frame */
/* If we have an FP, the callee saved it. */
- if (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg] != 0)
- deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[fi->extra_info->framereg], 4));
+ if (get_frame_saved_regs (get_next_frame (fi))[get_frame_extra_info (fi)->framereg] != 0)
+ deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[get_frame_extra_info (fi)->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... */
determined by arm_scan_prologue. */
for (reg = 0; reg < NUM_REGS; reg++)
if (get_frame_saved_regs (fi)[reg] != 0)
- get_frame_saved_regs (fi)[reg] += (get_frame_base (fi)
- + fi->extra_info->framesize
- - fi->extra_info->frameoffset);
+ get_frame_saved_regs (fi)[reg]
+ += (get_frame_base (fi)
+ + get_frame_extra_info (fi)->framesize
+ - get_frame_extra_info (fi)->frameoffset);
}
}
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
(get_frame_base (fi)
- - fi->extra_info->frameoffset),
+ - get_frame_extra_info (fi)->frameoffset),
get_frame_base (fi)))
{
return read_memory_integer (get_frame_saved_regs (fi)[ARM_PC_REGNUM],
{
int regnum;
struct frame_info *frame = get_current_frame ();
- CORE_ADDR old_SP = (get_frame_base (frame) - frame->extra_info->frameoffset
- + frame->extra_info->framesize);
+ CORE_ADDR old_SP = (get_frame_base (frame)
+ - get_frame_extra_info (frame)->frameoffset
+ + get_frame_extra_info (frame)->framesize);
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
get_frame_base (frame),
unsigned char prologue[AVR_MAX_PROLOGUE_SIZE];
int vpc = 0;
- fi->extra_info->framereg = AVR_SP_REGNUM;
+ get_frame_extra_info (fi)->framereg = AVR_SP_REGNUM;
if (find_pc_partial_function
(get_frame_pc (fi), &name, &prologue_start, &prologue_end))
/* Search the prologue looking for instructions that set up the
frame pointer, adjust the stack pointer, and save registers. */
- fi->extra_info->framesize = 0;
+ get_frame_extra_info (fi)->framesize = 0;
prologue_len = prologue_end - prologue_start;
read_memory (prologue_start, prologue, prologue_len);
0xcd, 0xbf /* out __SP_L__,r28 */
};
- fi->extra_info->framereg = AVR_FP_REGNUM;
+ get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM;
insn = EXTRACT_INSN (&prologue[vpc]);
/* ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>) */
if ((insn & 0xf0f0) == 0xe0c0)
{
deprecated_update_frame_base_hack (fi, locals);
- fi->extra_info->is_main = 1;
+ get_frame_extra_info (fi)->is_main = 1;
return;
}
}
from <= AVR_LAST_PUSHED_REGNUM; ++from)
get_frame_saved_regs (fi)[from] = ++i;
}
- fi->extra_info->locals_size = loc_size;
- fi->extra_info->framesize = loc_size + num_pushes;
- fi->extra_info->framereg = AVR_FP_REGNUM;
+ get_frame_extra_info (fi)->locals_size = loc_size;
+ get_frame_extra_info (fi)->framesize = loc_size + num_pushes;
+ get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM;
return;
}
vpc += sizeof (img);
get_frame_saved_regs (fi)[0] = 2;
get_frame_saved_regs (fi)[1] = 1;
- fi->extra_info->framesize += 3;
+ get_frame_extra_info (fi)->framesize += 3;
}
else if (memcmp (img + 1, prologue, sizeof (img) - 1) == 0)
{
vpc += sizeof (img) - 1;
get_frame_saved_regs (fi)[0] = 2;
get_frame_saved_regs (fi)[1] = 1;
- fi->extra_info->framesize += 3;
+ get_frame_extra_info (fi)->framesize += 3;
}
}
{
/* Bits 4-9 contain a mask for registers R0-R32. */
regno = (insn & 0x1f0) >> 4;
- ++fi->extra_info->framesize;
- get_frame_saved_regs (fi)[regno] = fi->extra_info->framesize;
+ ++get_frame_extra_info (fi)->framesize;
+ get_frame_saved_regs (fi)[regno] = get_frame_extra_info (fi)->framesize;
scan_stage = 1;
}
else
if (memcmp (prologue + vpc, img, sizeof (img)) == 0)
{
vpc += 4;
- fi->extra_info->framereg = AVR_FP_REGNUM;
+ get_frame_extra_info (fi)->framereg = AVR_FP_REGNUM;
scan_stage = 2;
}
}
}
else
return;
- fi->extra_info->locals_size = locals_size;
- fi->extra_info->framesize += locals_size;
+ get_frame_extra_info (fi)->locals_size = locals_size;
+ get_frame_extra_info (fi)->framesize += locals_size;
}
}
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
frame_saved_regs_zalloc (fi);
- fi->extra_info->return_pc = 0;
- fi->extra_info->args_pointer = 0;
- fi->extra_info->locals_size = 0;
- fi->extra_info->framereg = 0;
- fi->extra_info->framesize = 0;
- fi->extra_info->is_main = 0;
+ get_frame_extra_info (fi)->return_pc = 0;
+ get_frame_extra_info (fi)->args_pointer = 0;
+ get_frame_extra_info (fi)->locals_size = 0;
+ get_frame_extra_info (fi)->framereg = 0;
+ get_frame_extra_info (fi)->framesize = 0;
+ get_frame_extra_info (fi)->is_main = 0;
avr_scan_prologue (fi);
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi),
AVR_PC_REGNUM));
}
- else if (!get_next_frame (fi)) /* this is the innermost frame? */
- deprecated_update_frame_base_hack (fi, read_register (fi->extra_info->framereg));
- else if (fi->extra_info->is_main != 1) /* not the innermost frame, not `main' */
+ else if (!get_next_frame (fi))
+ /* this is the innermost frame? */
+ deprecated_update_frame_base_hack (fi, read_register (get_frame_extra_info (fi)->framereg));
+ else if (get_frame_extra_info (fi)->is_main != 1)
+ /* not the innermost frame, not `main' */
/* If we have an next frame, the callee saved it. */
{
struct frame_info *next_fi = get_next_frame (fi);
- if (fi->extra_info->framereg == AVR_SP_REGNUM)
- deprecated_update_frame_base_hack (fi, get_frame_base (next_fi) + 2 /* ret addr */ + next_fi->extra_info->framesize);
+ if (get_frame_extra_info (fi)->framereg == AVR_SP_REGNUM)
+ deprecated_update_frame_base_hack (fi, (get_frame_base (next_fi)
+ + 2 /* ret addr */
+ + get_frame_extra_info (next_fi)->framesize));
/* FIXME: I don't analyse va_args functions */
else
{
/* TRoth: Do we want to do this if we are in main? I don't think we should
since return_pc makes no sense when we are in main. */
- if ((get_frame_pc (fi)) && (fi->extra_info->is_main == 0)) /* We are not in CALL_DUMMY */
+ if ((get_frame_pc (fi)) && (get_frame_extra_info (fi)->is_main == 0))
+ /* We are not in CALL_DUMMY */
{
CORE_ADDR addr;
int i;
- addr = get_frame_base (fi) + fi->extra_info->framesize + 1;
+ addr = get_frame_base (fi) + get_frame_extra_info (fi)->framesize + 1;
/* Return address in stack in different endianness */
- fi->extra_info->return_pc =
+ get_frame_extra_info (fi)->return_pc =
read_memory_unsigned_integer (avr_make_saddr (addr), 1) << 8;
- fi->extra_info->return_pc |=
+ get_frame_extra_info (fi)->return_pc |=
read_memory_unsigned_integer (avr_make_saddr (addr + 1), 1);
/* This return address in words,
must be converted to the bytes address */
- fi->extra_info->return_pc *= 2;
+ get_frame_extra_info (fi)->return_pc *= 2;
/* Resolve a pushed registers addresses */
for (i = 0; i < NUM_REGS; i++)
}
/* Don't forget the update the PC too! */
- write_pc (frame->extra_info->return_pc);
+ write_pc (get_frame_extra_info (frame)->return_pc);
}
flush_cached_frames ();
}
get_frame_base (frame),
AVR_PC_REGNUM);
else
- return frame->extra_info->return_pc;
+ return get_frame_extra_info (frame)->return_pc;
}
static CORE_ADDR
get_frame_base (frame)))
{
/* initialize the return_pc now */
- frame->extra_info->return_pc
+ get_frame_extra_info (frame)->return_pc
= deprecated_read_register_dummy (get_frame_pc (frame),
get_frame_base (frame),
AVR_PC_REGNUM);
return get_frame_base (frame);
}
- return (frame->extra_info->is_main ? 0
- : get_frame_base (frame) + frame->extra_info->framesize + 2 /* ret addr */ );
+ return (get_frame_extra_info (frame)->is_main ? 0
+ : get_frame_base (frame) + get_frame_extra_info (frame)->framesize + 2 /* ret addr */ );
}
/* Store the address of the place in which to copy the structure the
short source_register;
/* This frame is with respect to a leaf until a push srp is found. */
- fi->extra_info->leaf_function = 1;
+ get_frame_extra_info (fi)->leaf_function = 1;
/* This frame is without the FP until a push fp is found. */
have_fp = 0;
{
return ip;
}
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
}
else if (regno == FP_REGNUM)
{
get_frame_saved_regs (fi)[regno] = get_frame_base (fi) - val;
val -= 4;
}
- if (fi->extra_info->leaf_function)
+ if (get_frame_extra_info (fi)->leaf_function)
{
/* Set the register SP to contain the stack pointer of
the caller. */
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- fi->extra_info->return_pc = 0;
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->return_pc = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
get_frame_base (fi),
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
- fi->extra_info->return_pc =
+ get_frame_extra_info (fi)->return_pc =
deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), PC_REGNUM);
/* FIXME: Is this necessarily true? */
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
}
else
{
if (get_frame_saved_regs (fi)[SRP_REGNUM] != 0)
{
/* SRP was saved on the stack; non-leaf function. */
- fi->extra_info->return_pc =
+ get_frame_extra_info (fi)->return_pc =
read_memory_integer (get_frame_saved_regs (fi)[SRP_REGNUM],
REGISTER_RAW_SIZE (SRP_REGNUM));
}
else
{
/* SRP is still in a register; leaf function. */
- fi->extra_info->return_pc = read_register (SRP_REGNUM);
+ get_frame_extra_info (fi)->return_pc = read_register (SRP_REGNUM);
/* FIXME: Should leaf_function be set to 1 here? */
- fi->extra_info->leaf_function = 1;
+ get_frame_extra_info (fi)->leaf_function = 1;
}
}
}
CORE_ADDR
cris_frame_saved_pc (struct frame_info *fi)
{
- return fi->extra_info->return_pc;
+ return get_frame_extra_info (fi)->return_pc;
}
/* Setup the function arguments for calling a function in the inferior. */
}
/* Restore the PC. */
- write_register (PC_REGNUM, fi->extra_info->return_pc);
+ write_register (PC_REGNUM, get_frame_extra_info (fi)->return_pc);
}
flush_cached_frames ();
}
get_frame_base (frame),
PC_REGNUM));
else
- return ((frame)->extra_info->return_pc);
+ return (get_frame_extra_info (frame)->return_pc);
}
/* Immediately after a function call, return the saved pc. We can't
}
write_register (PC_REGNUM, read_register (LR_REGNUM));
- write_register (SP_REGNUM, fp + fi->extra_info->size);
+ write_register (SP_REGNUM, fp + get_frame_extra_info (fi)->size);
target_store_registers (-1);
flush_cached_frames ();
}
d10v_frame_init_saved_regs (fi);
- if (fi->extra_info->return_pc == IMEM_START
- || inside_entry_file (fi->extra_info->return_pc))
+ if (get_frame_extra_info (fi)->return_pc == IMEM_START
+ || inside_entry_file (get_frame_extra_info (fi)->return_pc))
{
/* This is meant to halt the backtrace at "_start".
Make sure we don't halt it at a generic dummy frame. */
- if (!DEPRECATED_PC_IN_CALL_DUMMY (fi->extra_info->return_pc, 0, 0))
+ if (!DEPRECATED_PC_IN_CALL_DUMMY (get_frame_extra_info (fi)->return_pc, 0, 0))
return (CORE_ADDR) 0;
}
pc += 4;
}
- fi->extra_info->size = -next_addr;
+ get_frame_extra_info (fi)->size = -next_addr;
if (!(fp & 0xffff))
fp = d10v_read_sp ();
CORE_ADDR return_pc
= 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);
+ get_frame_extra_info (fi)->return_pc = d10v_make_iaddr (return_pc);
}
else
{
- fi->extra_info->return_pc = d10v_make_iaddr (read_register (LR_REGNUM));
+ get_frame_extra_info (fi)->return_pc = d10v_make_iaddr (read_register (LR_REGNUM));
}
/* The SP is not normally (ever?) saved, but check anyway */
/* otherwise, it isn't being used, so we use the SP instead */
if (uses_frame)
get_frame_saved_regs (fi)[SP_REGNUM]
- = d10v_read_fp () + fi->extra_info->size;
+ = d10v_read_fp () + get_frame_extra_info (fi)->size;
else
{
- get_frame_saved_regs (fi)[SP_REGNUM] = fp + fi->extra_info->size;
- fi->extra_info->frameless = 1;
+ get_frame_saved_regs (fi)[SP_REGNUM] = fp + get_frame_extra_info (fi)->size;
+ get_frame_extra_info (fi)->frameless = 1;
get_frame_saved_regs (fi)[FP_REGNUM] = 0;
}
}
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
frame_saved_regs_zalloc (fi);
- fi->extra_info->frameless = 0;
- fi->extra_info->size = 0;
- fi->extra_info->return_pc = 0;
+ get_frame_extra_info (fi)->frameless = 0;
+ get_frame_extra_info (fi)->size = 0;
+ get_frame_extra_info (fi)->return_pc = 0;
/* If get_frame_pc (fi) is zero, but this is not the outermost frame,
then let's snatch the return_pc from the callee, so that
}
/* The args are always reffed based from the stack pointer */
- fi->extra_info->args_pointer = after_prolog_fp;
+ get_frame_extra_info (fi)->args_pointer = after_prolog_fp;
/* Locals are always reffed based from the fp */
- fi->extra_info->locals_pointer = after_prolog_fp;
+ get_frame_extra_info (fi)->locals_pointer = after_prolog_fp;
/* The PC is at a known place */
- fi->extra_info->from_pc =
+ get_frame_extra_info (fi)->from_pc =
read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD);
/* Rememeber any others too */
get_frame_base (thisframe),
get_frame_base (thisframe)))
{ /* initialize the from_pc now */
- thisframe->extra_info->from_pc =
+ get_frame_extra_info (thisframe)->from_pc =
deprecated_read_register_dummy (get_frame_pc (thisframe),
get_frame_base (thisframe),
E_PC_REGNUM);
get_frame_base (frame),
E_PC_REGNUM);
else
- return frame->extra_info->from_pc;
+ return get_frame_extra_info (frame)->from_pc;
}
static void
h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
- if (!fi->extra_info)
+ if (!get_frame_extra_info (fi))
{
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- fi->extra_info->from_pc = 0;
- fi->extra_info->args_pointer = 0; /* Unknown */
- fi->extra_info->locals_pointer = 0; /* Unknown */
+ get_frame_extra_info (fi)->from_pc = 0;
+ get_frame_extra_info (fi)->args_pointer = 0; /* Unknown */
+ get_frame_extra_info (fi)->locals_pointer = 0; /* Unknown */
if (!get_frame_pc (fi))
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
return (CORE_ADDR) 0; /* Not sure what else to do... */
- return fi->extra_info->locals_pointer;
+ return get_frame_extra_info (fi)->locals_pointer;
}
/* Return the address of the argument block for the frame
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
return (CORE_ADDR) 0; /* Not sure what else to do... */
- return fi->extra_info->args_pointer;
+ return get_frame_extra_info (fi)->args_pointer;
}
/* Round N up or down to the nearest multiple of UNIT.
}
/* Don't forget to update the PC too! */
- write_register (E_PC_REGNUM, frame->extra_info->from_pc);
+ write_register (E_PC_REGNUM, get_frame_extra_info (frame)->from_pc);
}
flush_cached_frames ();
}
return read_memory_integer (get_frame_saved_regs (frame)[IA64_VFP_REGNUM], 8);
else
return (get_frame_base (frame)
- + frame->extra_info->mem_stack_frame_size);
+ + get_frame_extra_info (frame)->mem_stack_frame_size);
}
}
if (frame
&& !do_fsr_stuff
- && frame->extra_info->after_prologue != 0
- && frame->extra_info->after_prologue <= lim_pc)
- return frame->extra_info->after_prologue;
+ && get_frame_extra_info (frame)->after_prologue != 0
+ && get_frame_extra_info (frame)->after_prologue <= lim_pc)
+ return get_frame_extra_info (frame)->after_prologue;
lim_pc = refine_prologue_limit (pc, lim_pc, &trust_limit);
/* Extract the size of the rotating portion of the stack
frame and the register rename base from the current
frame marker. */
- sor = ((frame->extra_info->cfm >> 14) & 0xf) * 8;
- rrb_gr = (frame->extra_info->cfm >> 18) & 0x7f;
+ sor = ((get_frame_extra_info (frame)->cfm >> 14) & 0xf) * 8;
+ rrb_gr = (get_frame_extra_info (frame)->cfm >> 18) & 0x7f;
- for (i = 0, addr = frame->extra_info->bsp;
- i < frame->extra_info->sof;
+ for (i = 0, addr = get_frame_extra_info (frame)->bsp;
+ i < get_frame_extra_info (frame)->sof;
i++, addr += 8)
{
if (IS_NaT_COLLECTION_ADDR (addr))
}
}
- if (frame && frame->extra_info) {
- frame->extra_info->after_prologue = last_prologue_pc;
- frame->extra_info->mem_stack_frame_size = mem_stack_frame_size;
- frame->extra_info->fp_reg = fp_reg;
- }
+ if (frame && get_frame_extra_info (frame))
+ {
+ get_frame_extra_info (frame)->after_prologue = last_prologue_pc;
+ get_frame_extra_info (frame)->mem_stack_frame_size = mem_stack_frame_size;
+ get_frame_extra_info (frame)->fp_reg = fp_reg;
+ }
return last_prologue_pc;
}
else if (regnum == IA64_BSP_REGNUM)
{
store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- frame->extra_info->bsp);
+ get_frame_extra_info (frame)->bsp);
}
else if (regnum == IA64_VFP_REGNUM)
{
above. If the function lacks one of these frame pointers, we can
still provide a value since we know the size of the frame */
CORE_ADDR vfp = (get_frame_base (frame)
- + frame->extra_info->mem_stack_frame_size);
+ + get_frame_extra_info (frame)->mem_stack_frame_size);
store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp);
}
else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
{
/* Fetch predicate register rename base from current frame
marker for this frame. */
- int rrb_pr = (frame->extra_info->cfm >> 32) & 0x3f;
+ int rrb_pr = (get_frame_extra_info (frame)->cfm >> 32) & 0x3f;
/* Adjust the register number to account for register rotation. */
regnum = IA64_PR16_REGNUM
{
/* Fetch floating point register rename base from current
frame marker for this frame. */
- int rrb_fr = (frame->extra_info->cfm >> 25) & 0x7f;
+ int rrb_fr = (get_frame_extra_info (frame)->cfm >> 25) & 0x7f;
/* Adjust the floating point register number to account for
register rotation. */
ia64_frameless_function_invocation (struct frame_info *frame)
{
FRAME_INIT_SAVED_REGS (frame);
- return (frame->extra_info->mem_stack_frame_size == 0);
+ return (get_frame_extra_info (frame)->mem_stack_frame_size == 0);
}
CORE_ADDR
else
cfm = read_register (IA64_PFS_REGNUM);
- bsp = frn->extra_info->bsp;
+ bsp = get_frame_extra_info (frn)->bsp;
}
- frame->extra_info->cfm = cfm;
- frame->extra_info->sof = cfm & 0x7f;
- frame->extra_info->sol = (cfm >> 7) & 0x7f;
+ get_frame_extra_info (frame)->cfm = cfm;
+ get_frame_extra_info (frame)->sof = cfm & 0x7f;
+ get_frame_extra_info (frame)->sol = (cfm >> 7) & 0x7f;
if (get_next_frame (frame) == 0
|| (get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME)
|| next_frame_is_call_dummy)
- frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof);
+ get_frame_extra_info (frame)->bsp =
+ rse_address_add (bsp, -get_frame_extra_info (frame)->sof);
else
- frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sol);
+ get_frame_extra_info (frame)->bsp =
+ rse_address_add (bsp, -get_frame_extra_info (frame)->sol);
- frame->extra_info->after_prologue = 0;
- frame->extra_info->mem_stack_frame_size = -1; /* Not yet determined */
- frame->extra_info->fp_reg = 0;
+ get_frame_extra_info (frame)->after_prologue = 0;
+ get_frame_extra_info (frame)->mem_stack_frame_size = -1; /* Not yet determined */
+ get_frame_extra_info (frame)->fp_reg = 0;
}
static int
wants bsp to be set at the end of all used registers. It's
likely that this code will need to be revised to accomodate
other operating systems. */
- bsp = rse_address_add (frame->extra_info->bsp,
+ bsp = rse_address_add (get_frame_extra_info (frame)->bsp,
(pfs & 0x7f) - ((pfs >> 7) & 0x7f));
write_register (IA64_BSP_REGNUM, bsp);
static CORE_ADDR
m68hc11_frame_saved_pc (struct frame_info *frame)
{
- return frame->extra_info->return_pc;
+ return get_frame_extra_info (frame)->return_pc;
}
static CORE_ADDR
{
CORE_ADDR addr;
- addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION + 2;
- if (frame->extra_info->return_kind == RETURN_RTC)
+ addr = get_frame_base (frame) + get_frame_extra_info (frame)->size + STACK_CORRECTION + 2;
+ if (get_frame_extra_info (frame)->return_kind == RETURN_RTC)
addr += 1;
- else if (frame->extra_info->return_kind == RETURN_RTI)
+ else if (get_frame_extra_info (frame)->return_kind == RETURN_RTI)
addr += 7;
return addr;
write_register (regnum,
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;
+ write_register (HARD_PC_REGNUM, get_frame_extra_info (frame)->return_pc);
+ sp = (fp + get_frame_extra_info (frame)->size + 2) & 0x0ffff;
write_register (HARD_SP_REGNUM, sp);
}
flush_cached_frames ();
get_frame_base (frame)))
return get_frame_base (frame); /* dummy frame same as caller's frame */
- if (frame->extra_info->return_pc == 0
- || inside_entry_file (frame->extra_info->return_pc))
+ if (get_frame_extra_info (frame)->return_pc == 0
+ || inside_entry_file (get_frame_extra_info (frame)->return_pc))
return (CORE_ADDR) 0;
if (get_frame_base (frame) == 0)
return (CORE_ADDR) 0;
}
- addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION - 2;
+ addr = get_frame_base (frame) + get_frame_extra_info (frame)->size + STACK_CORRECTION - 2;
addr = read_memory_unsigned_integer (addr, 2) & 0x0FFFF;
return addr;
}
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, get_frame_base (fi), &pc, &fi->extra_info->size,
+ get_frame_extra_info (fi)->return_kind = m68hc11_get_return_insn (pc);
+ m68hc11_guess_from_prologue (pc, get_frame_base (fi), &pc,
+ &get_frame_extra_info (fi)->size,
get_frame_saved_regs (fi));
- addr = get_frame_base (fi) + fi->extra_info->size + STACK_CORRECTION;
+ addr = get_frame_base (fi) + get_frame_extra_info (fi)->size + STACK_CORRECTION;
if (soft_regs[SOFT_FP_REGNUM].name)
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)
+ if (get_frame_extra_info (fi)->return_kind == RETURN_RTC)
{
get_frame_saved_regs (fi)[HARD_PAGE_REGNUM] = addr;
addr++;
}
- else if (fi->extra_info->return_kind == RETURN_RTI)
+ else if (get_frame_extra_info (fi)->return_kind == RETURN_RTI)
{
get_frame_saved_regs (fi)[HARD_CCR_REGNUM] = addr;
get_frame_saved_regs (fi)[HARD_D_REGNUM] = addr + 1;
if (fromleaf)
{
- fi->extra_info->return_kind = m68hc11_get_return_insn (get_frame_pc (fi));
- fi->extra_info->return_pc = m68hc11_saved_pc_after_call (fi);
+ get_frame_extra_info (fi)->return_kind = m68hc11_get_return_insn (get_frame_pc (fi));
+ get_frame_extra_info (fi)->return_pc = m68hc11_saved_pc_after_call (fi);
}
else
{
addr = read_memory_unsigned_integer (addr, 2) & 0x0ffff;
/* Take into account the 68HC12 specific call (PC + page). */
- if (fi->extra_info->return_kind == RETURN_RTC
+ if (get_frame_extra_info (fi)->return_kind == RETURN_RTC
&& addr >= 0x08000 && addr < 0x0c000
&& USE_PAGE_REGISTER)
{
addr += ((page & 0x0ff) << 14);
addr += 0x1000000;
}
- fi->extra_info->return_pc = addr;
+ get_frame_extra_info (fi)->return_pc = addr;
}
}
deprecated_set_frame_prev_hack (dummy, NULL);
deprecated_update_frame_pc_hack (dummy, pc);
deprecated_update_frame_base_hack (dummy, frame);
- dummy->extra_info->status = 0;
- dummy->extra_info->framesize = 0;
+ get_frame_extra_info (dummy)->status = 0;
+ get_frame_extra_info (dummy)->framesize = 0;
memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
mcore_analyze_prologue (dummy, 0, 0);
return dummy;
if (func_addr == entry_point_address ())
{
if (fi != NULL)
- fi->extra_info->status |= NO_MORE_FRAMES;
+ get_frame_extra_info (fi)->status |= NO_MORE_FRAMES;
return pc;
}
/* Save everything we have learned about this frame into FI. */
if (fi != NULL)
{
- fi->extra_info->framesize = framesize;
- fi->extra_info->fp_regnum = fp_regnum;
- fi->extra_info->status = flags;
+ get_frame_extra_info (fi)->framesize = framesize;
+ get_frame_extra_info (fi)->fp_regnum = fp_regnum;
+ get_frame_extra_info (fi)->status = flags;
/* Fix the frame pointer. When gcc uses r8 as a frame pointer,
it is really an arg ptr. We adjust fi->frame to be a "real"
frame pointer. */
if (get_next_frame (fi) == NULL)
{
- if (fi->extra_info->status & MY_FRAME_IN_SP)
+ if (get_frame_extra_info (fi)->status & MY_FRAME_IN_SP)
deprecated_update_frame_base_hack (fi, read_sp () + framesize);
else
deprecated_update_frame_base_hack (fi, read_register (fp_regnum) + framesize);
CORE_ADDR callers_addr;
/* Analyze the prologue of this function. */
- if (fi->extra_info->status == 0)
+ if (get_frame_extra_info (fi)->status == 0)
mcore_analyze_prologue (fi, 0, 0);
/* If mcore_analyze_prologue set NO_MORE_FRAMES, quit now. */
- if (fi->extra_info->status & NO_MORE_FRAMES)
+ if (get_frame_extra_info (fi)->status & NO_MORE_FRAMES)
return 0;
/* Now that we've analyzed our prologue, we can start to ask
is <our base> + -<caller's frame size>. */
dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
- if (dummy->extra_info->status & MY_FRAME_IN_FP)
+ if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_FP)
{
- int fp = dummy->extra_info->fp_regnum;
+ int fp = get_frame_extra_info (dummy)->fp_regnum;
/* Our caller has a frame pointer. */
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 (get_frame_saved_regs (fi)[fp], REGISTER_SIZE)
- + dummy->extra_info->framesize;
+ + get_frame_extra_info (dummy)->framesize;
}
else
{
/* It's still in the register. Don't forget to adjust
the "FP" with the framesize to get a real FP. */
- callers_addr = read_register (fp) + dummy->extra_info->framesize;
+ callers_addr = read_register (fp) + get_frame_extra_info (dummy)->framesize;
}
}
else
{
/* Our caller does not have a frame pointer. */
- callers_addr = get_frame_base (fi) + dummy->extra_info->framesize;
+ callers_addr = get_frame_base (fi) + get_frame_extra_info (dummy)->framesize;
}
return callers_addr;
CORE_ADDR
mcore_frame_args_address (struct frame_info * fi)
{
- return get_frame_base (fi) - fi->extra_info->framesize;
+ return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
}
CORE_ADDR
mcore_frame_locals_address (struct frame_info * fi)
{
- return get_frame_base (fi) - fi->extra_info->framesize;
+ return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
}
/* Return the frame pointer in use at address PC. */
mcore_virtual_frame_pointer (CORE_ADDR pc, int *reg, LONGEST *offset)
{
struct frame_info *dummy = analyze_dummy_frame (pc, 0);
- if (dummy->extra_info->status & MY_FRAME_IN_SP)
+ if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_SP)
{
*reg = SP_REGNUM;
*offset = 0;
}
else
{
- *reg = dummy->extra_info->fp_regnum;
+ *reg = get_frame_extra_info (dummy)->fp_regnum;
*offset = 0;
}
}
frame_saved_regs_zalloc (fi);
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- fi->extra_info->status = 0;
- fi->extra_info->framesize = 0;
+ get_frame_extra_info (fi)->status = 0;
+ get_frame_extra_info (fi)->framesize = 0;
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
mips_print_extra_frame_info (struct frame_info *fi)
{
if (fi
- && fi->extra_info
- && fi->extra_info->proc_desc
- && fi->extra_info->proc_desc->pdr.framereg < NUM_REGS)
+ && get_frame_extra_info (fi)
+ && get_frame_extra_info (fi)->proc_desc
+ && get_frame_extra_info (fi)->proc_desc->pdr.framereg < NUM_REGS)
printf_filtered (" frame pointer is at %s+%s\n",
- REGISTER_NAME (fi->extra_info->proc_desc->pdr.framereg),
- paddr_d (fi->extra_info->proc_desc->pdr.frameoffset));
+ REGISTER_NAME (get_frame_extra_info (fi)->proc_desc->pdr.framereg),
+ paddr_d (get_frame_extra_info (fi)->proc_desc->pdr.frameoffset));
}
/* Number of bytes of storage in the actual machine representation for
return;
}
- proc_desc = fci->extra_info->proc_desc;
+ proc_desc = get_frame_extra_info (fci)->proc_desc;
if (proc_desc == NULL)
/* I'm not sure how/whether this can happen. Normally when we can't
find a proc_desc, we "synthesize" one using heuristic_proc_desc
mips_frame_saved_pc (struct frame_info *frame)
{
CORE_ADDR saved_pc;
- mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
+ mips_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc;
/* We have to get the saved pc from the sigcontext
if it is a signal handler frame. */
int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM
frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info));
fci->saved_regs = NULL;
- fci->extra_info->proc_desc =
+ get_frame_extra_info (fci)->proc_desc =
proc_desc == &temp_proc_desc ? 0 : proc_desc;
if (proc_desc)
{
/* hack: if argument regs are saved, guess these contain args */
/* assume we can't tell how many args for now */
- fci->extra_info->num_args = -1;
+ get_frame_extra_info (fci)->num_args = -1;
for (regnum = MIPS_LAST_ARG_REGNUM; regnum >= A0_REGNUM; regnum--)
{
if (PROC_REG_MASK (proc_desc) & (1 << regnum))
{
- fci->extra_info->num_args = regnum - A0_REGNUM + 1;
+ get_frame_extra_info (fci)->num_args = regnum - A0_REGNUM + 1;
break;
}
}
register int regnum;
struct frame_info *frame = get_current_frame ();
CORE_ADDR new_sp = get_frame_base (frame);
- mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
+ mips_extra_func_info_t proc_desc = get_frame_extra_info (frame)->proc_desc;
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), 0, 0))
{
deprecated_set_frame_prev_hack (dummy, NULL);
deprecated_update_frame_pc_hack (dummy, pc);
deprecated_update_frame_base_hack (dummy, frame);
- dummy->extra_info->status = 0;
- dummy->extra_info->stack_size = 0;
+ get_frame_extra_info (dummy)->status = 0;
+ get_frame_extra_info (dummy)->stack_size = 0;
memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
mn10300_analyze_prologue (dummy, 0);
return dummy;
{
if (fi && get_next_frame (fi) == NULL)
{
- if (fi->extra_info->status & MY_FRAME_IN_SP)
+ if (get_frame_extra_info (fi)->status & MY_FRAME_IN_SP)
deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
- else if (fi->extra_info->status & MY_FRAME_IN_FP)
+ else if (get_frame_extra_info (fi)->status & MY_FRAME_IN_FP)
deprecated_update_frame_base_hack (fi, read_register (A3_REGNUM));
}
}
if (strcmp (name, "start") == 0)
{
if (fi != NULL)
- fi->extra_info->status = NO_MORE_FRAMES;
+ get_frame_extra_info (fi)->status = NO_MORE_FRAMES;
return pc;
}
/* At the start of a function our frame is in the stack pointer. */
if (fi)
- fi->extra_info->status = MY_FRAME_IN_SP;
+ get_frame_extra_info (fi)->status = MY_FRAME_IN_SP;
/* Get the next two bytes into buf, we need two because rets is a two
byte insn and the first isn't enough to uniquely identify it. */
if (buf[0] == 0xf2 && (buf[1] & 0xf3) == 0xf0)
{
if (fi)
- fi->extra_info->status = NO_MORE_FRAMES;
+ get_frame_extra_info (fi)->status = NO_MORE_FRAMES;
return addr;
}
/* The frame pointer is now valid. */
if (fi)
{
- fi->extra_info->status |= MY_FRAME_IN_FP;
- fi->extra_info->status &= ~MY_FRAME_IN_SP;
+ get_frame_extra_info (fi)->status |= MY_FRAME_IN_FP;
+ get_frame_extra_info (fi)->status &= ~MY_FRAME_IN_SP;
}
/* Quit now if we're beyond the stop point. */
/* Note the size of the stack in the frame info structure. */
stack_size = extract_signed_integer (buf, imm_size);
if (fi)
- fi->extra_info->stack_size = stack_size;
+ get_frame_extra_info (fi)->stack_size = stack_size;
/* We just consumed 2 + imm_size bytes. */
addr += 2 + imm_size;
struct frame_info *dummy;
/* Walk through the prologue to determine the stack size,
location of saved registers, end of the prologue, etc. */
- if (fi->extra_info->status == 0)
+ if (get_frame_extra_info (fi)->status == 0)
mn10300_analyze_prologue (fi, (CORE_ADDR) 0);
/* Quit now if mn10300_analyze_prologue set NO_MORE_FRAMES. */
- if (fi->extra_info->status & NO_MORE_FRAMES)
+ if (get_frame_extra_info (fi)->status & NO_MORE_FRAMES)
return 0;
/* Now that we've analyzed our prologue, determine the frame
find stuff for us. */
dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
- if (dummy->extra_info->status & MY_FRAME_IN_FP)
+ if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_FP)
{
/* Our caller has a frame pointer. So find the frame in $a3 or
in the stack. */
/* Our caller does not have a frame pointer. So his frame starts
at the base of our frame (fi->frame) + register save space
+ <his size>. */
- return get_frame_base (fi) + adjust + -dummy->extra_info->stack_size;
+ return get_frame_base (fi) + adjust + -get_frame_extra_info (dummy)->stack_size;
}
}
frame_saved_regs_zalloc (fi);
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- fi->extra_info->status = 0;
- fi->extra_info->stack_size = 0;
+ get_frame_extra_info (fi)->status = 0;
+ get_frame_extra_info (fi)->stack_size = 0;
mn10300_analyze_prologue (fi, 0);
}
/* Set up a dummy frame_info, Analyze the prolog and fill in the
extra info. */
/* Results will tell us which type of frame it uses. */
- if (dummy->extra_info->status & MY_FRAME_IN_SP)
+ if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_SP)
{
*reg = SP_REGNUM;
- *offset = -(dummy->extra_info->stack_size);
+ *offset = -(get_frame_extra_info (dummy)->stack_size);
}
else
{
{
good_prologue = 1;
if (saved_regs && fextra_info && get_next_frame (fi)
- && get_next_frame (fi)->extra_info
- && get_next_frame (fi)->extra_info->sigcontext)
+ && get_frame_extra_info (get_next_frame (fi))
+ && get_frame_extra_info (get_next_frame (fi))->sigcontext)
{
/* We are backtracing from a signal handler */
- save_reg_addr = get_next_frame (fi)->extra_info->sigcontext +
+ save_reg_addr = get_frame_extra_info (get_next_frame (fi))->sigcontext +
REGISTER_BYTE (S390_GP0_REGNUM);
for (regidx = 0; regidx < S390_NUM_GPRS; regidx++)
{
saved_regs[S390_GP0_REGNUM + regidx] = save_reg_addr;
save_reg_addr += S390_GPR_SIZE;
}
- save_reg_addr = get_next_frame (fi)->extra_info->sigcontext +
+ save_reg_addr = get_frame_extra_info (get_next_frame (fi))->sigcontext +
(GDB_TARGET_IS_ESAME ? S390X_SIGREGS_FP0_OFFSET :
S390_SIGREGS_FP0_OFFSET);
for (regidx = 0; regidx < S390_NUM_FPRS; regidx++)
{
CORE_ADDR function_start = 0;
- if (fi->extra_info && fi->extra_info->initialised)
- function_start = fi->extra_info->function_start;
+ if (get_frame_extra_info (fi) && get_frame_extra_info (fi)->initialised)
+ function_start = get_frame_extra_info (fi)->function_start;
else if (get_frame_pc (fi))
function_start = get_pc_function_start (get_frame_pc (fi));
return function_start;
if (get_next_frame (fi) == NULL) /* no may be frameless */
{
- if (fi->extra_info)
- fextra_info_ptr = fi->extra_info;
+ if (get_frame_extra_info (fi))
+ fextra_info_ptr = get_frame_extra_info (fi);
else
{
fextra_info_ptr = &fextra_info;
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
if (get_frame_pc (fi))
s390_get_frame_info (s390_sniff_pc_function_start (get_frame_pc (fi), fi),
- fi->extra_info, fi, 1);
+ get_frame_extra_info (fi), fi, 1);
else
- s390_memset_extra_info (fi->extra_info);
+ s390_memset_extra_info (get_frame_extra_info (fi));
}
/* If saved registers of frame FI are not known yet, read and cache them.
frame_saved_regs_zalloc (fi);
if (get_frame_pc (fi))
{
- quick = (fi->extra_info && fi->extra_info->initialised
- && fi->extra_info->good_prologue);
- s390_get_frame_info (quick ? fi->extra_info->function_start :
- s390_sniff_pc_function_start (get_frame_pc (fi), fi),
- fi->extra_info, fi, !quick);
+ quick = (get_frame_extra_info (fi)
+ && get_frame_extra_info (fi)->initialised
+ && get_frame_extra_info (fi)->good_prologue);
+ s390_get_frame_info (quick
+ ? get_frame_extra_info (fi)->function_start
+ : s390_sniff_pc_function_start (get_frame_pc (fi), fi),
+ get_frame_extra_info (fi), fi, !quick);
}
}
}
static CORE_ADDR
s390_frame_saved_pc_nofix (struct frame_info *fi)
{
- if (fi->extra_info && fi->extra_info->saved_pc_valid)
- return fi->extra_info->saved_pc;
+ if (get_frame_extra_info (fi) && get_frame_extra_info (fi)->saved_pc_valid)
+ return get_frame_extra_info (fi)->saved_pc;
if (deprecated_generic_find_dummy_frame (get_frame_pc (fi),
get_frame_base (fi)))
get_frame_base (fi), S390_PC_REGNUM);
s390_frame_init_saved_regs (fi);
- if (fi->extra_info)
+ if (get_frame_extra_info (fi))
{
- fi->extra_info->saved_pc_valid = 1;
- if (fi->extra_info->good_prologue
+ get_frame_extra_info (fi)->saved_pc_valid = 1;
+ if (get_frame_extra_info (fi)->good_prologue
&& get_frame_saved_regs (fi)[S390_RETADDR_REGNUM])
- fi->extra_info->saved_pc
+ get_frame_extra_info (fi)->saved_pc
= ADDR_BITS_REMOVE (read_memory_integer
(get_frame_saved_regs (fi)[S390_RETADDR_REGNUM],
S390_GPR_SIZE));
else
- fi->extra_info->saved_pc
+ get_frame_extra_info (fi)->saved_pc
= ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM));
- return fi->extra_info->saved_pc;
+ return get_frame_extra_info (fi)->saved_pc;
}
return 0;
}
{
CORE_ADDR saved_pc = 0, sig_pc;
- if (fi->extra_info && fi->extra_info->sig_fixed_saved_pc_valid)
- return fi->extra_info->sig_fixed_saved_pc;
+ if (get_frame_extra_info (fi)
+ && get_frame_extra_info (fi)->sig_fixed_saved_pc_valid)
+ return get_frame_extra_info (fi)->sig_fixed_saved_pc;
saved_pc = s390_frame_saved_pc_nofix (fi);
- if (fi->extra_info)
+ if (get_frame_extra_info (fi))
{
- fi->extra_info->sig_fixed_saved_pc_valid = 1;
+ get_frame_extra_info (fi)->sig_fixed_saved_pc_valid = 1;
if (saved_pc)
{
if (s390_is_sigreturn (saved_pc, fi, NULL, &sig_pc))
saved_pc = sig_pc;
}
- fi->extra_info->sig_fixed_saved_pc = saved_pc;
+ get_frame_extra_info (fi)->sig_fixed_saved_pc = saved_pc;
}
return saved_pc;
}
frame_pointer_saved_pc
? 11 : 15)),
S390_GPR_SIZE);
- thisframe->extra_info->sigcontext = sregs;
+ get_frame_extra_info (thisframe)->sigcontext = sregs;
}
else
{
get_frame_base (frame)))
return get_frame_base (frame); /* dummy frame same as caller's frame */
if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
- return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, 4);
+ return read_memory_integer (get_frame_base (frame)
+ + get_frame_extra_info (frame)->f_offset, 4);
else
return 0;
}
size = 4;
else
size = REGISTER_RAW_SIZE (translate_insn_rn (FP_REGNUM, media_mode));
- return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, size);
+ return read_memory_integer (get_frame_base (frame)
+ + get_frame_extra_info (frame)->f_offset,
+ size);
}
else
return 0;
return;
}
- fi->extra_info->leaf_function = 1;
- fi->extra_info->f_offset = 0;
+ get_frame_extra_info (fi)->leaf_function = 1;
+ get_frame_extra_info (fi)->f_offset = 0;
for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++)
where[rn] = -1;
{
where[gdbarch_tdep (current_gdbarch)->PR_REGNUM] = depth;
/* If we're storing the pr then this isn't a leaf */
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
depth += 4;
}
else if (IS_MOV_R3 (insn))
get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
- fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
+ get_frame_extra_info (fi)->f_offset = depth - where[FP_REGNUM] - 4;
/* Work out the return pc - either from the saved pr or the pr
value */
}
return;
}
- fi->extra_info->leaf_function = 1;
- fi->extra_info->f_offset = 0;
+ get_frame_extra_info (fi)->leaf_function = 1;
+ get_frame_extra_info (fi)->f_offset = 0;
for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++)
where[rn] = -1;
int reg_nr = tdep->PR_C_REGNUM;
where[reg_nr] = depth - ((((next_insn & 0xf) ^ 0x8) - 0x8) << 2);
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
pc += insn_size;
}
}
int reg_nr = tdep->PR_C_REGNUM;
where[reg_nr] = depth - (r0_val - 4);
r0_val -= 4;
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
}
else if (IS_MOV_R14_R0 (insn))
{
{
where[tdep->PR_REGNUM] =
depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3);
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
}
else if (IS_STL_R18_R15 (insn))
{
where[tdep->PR_REGNUM] =
depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2);
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
}
else if (IS_STQ_R14_R15 (insn))
else
get_frame_saved_regs (fi)[sp_regnum] = get_frame_base (fi);
- fi->extra_info->f_offset = depth - where[fp_regnum];
+ get_frame_extra_info (fi)->f_offset = depth - where[fp_regnum];
}
static void
return;
}
- fi->extra_info->leaf_function = 1;
- fi->extra_info->f_offset = 0;
+ get_frame_extra_info (fi)->leaf_function = 1;
+ get_frame_extra_info (fi)->f_offset = 0;
for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++)
where[rn] = -1;
{
where[tdep->PR_REGNUM] = depth;
/* If we're storing the pr then this isn't a leaf */
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->leaf_function = 0;
depth += 4;
}
else if (IS_MOV_R3 (insn))
get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
- fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
+ get_frame_extra_info (fi)->f_offset = depth - where[FP_REGNUM] - 4;
/* Work out the return pc - either from the saved pr or the pr
value */
}
by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi),
SP_REGNUM));
- fi->extra_info->return_pc = deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_extra_info (fi)->return_pc = deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi),
PC_REGNUM);
- fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4);
+ get_frame_extra_info (fi)->leaf_function = 0;
return;
}
else
{
FRAME_INIT_SAVED_REGS (fi);
- fi->extra_info->return_pc =
+ get_frame_extra_info (fi)->return_pc =
sh_find_callers_reg (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM);
}
}
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
- fi->extra_info->return_pc =
+ get_frame_extra_info (fi)->return_pc =
deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), PC_REGNUM);
- fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
- fi->extra_info->leaf_function = 0;
+ get_frame_extra_info (fi)->f_offset = -(CALL_DUMMY_LENGTH + 4);
+ get_frame_extra_info (fi)->leaf_function = 0;
return;
}
else
{
FRAME_INIT_SAVED_REGS (fi);
- fi->extra_info->return_pc =
+ get_frame_extra_info (fi)->return_pc =
sh64_get_saved_pr (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM);
}
}
static CORE_ADDR
sh_frame_saved_pc (struct frame_info *frame)
{
- return ((frame)->extra_info->return_pc);
+ return (get_frame_extra_info (frame)->return_pc);
}
/* Discard from the stack the innermost frame,
write_register (regnum,
read_memory_integer (get_frame_saved_regs (frame)[regnum], 4));
- write_register (PC_REGNUM, frame->extra_info->return_pc);
+ write_register (PC_REGNUM, get_frame_extra_info (frame)->return_pc);
write_register (SP_REGNUM, fp + 4);
}
flush_cached_frames ();
size));
}
- write_register (PC_REGNUM, frame->extra_info->return_pc);
+ write_register (PC_REGNUM, get_frame_extra_info (frame)->return_pc);
write_register (SP_REGNUM, fp + 8);
}
flush_cached_frames ();
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
frame_saved_regs_zalloc (fi);
- fi->extra_info->bottom =
+ get_frame_extra_info (fi)->bottom =
(get_next_frame (fi)
? (get_frame_base (fi) == get_frame_base (get_next_frame (fi))
- ? get_next_frame (fi)->extra_info->bottom
+ ? get_frame_extra_info (get_next_frame (fi))->bottom
: get_frame_base (get_next_frame (fi)))
: read_sp ());
/* A frameless function interrupted by a signal did not change
the frame pointer, fix up frame pointer accordingly. */
deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi)));
- fi->extra_info->bottom = get_next_frame (fi)->extra_info->bottom;
+ get_frame_extra_info (fi)->bottom =
+ get_frame_extra_info (get_next_frame (fi))->bottom;
}
else
{
/* Decide whether this is a function with a ``flat register window''
frame. For such functions, the frame pointer is actually in %i7. */
- fi->extra_info->flat = 0;
- fi->extra_info->in_prologue = 0;
+ get_frame_extra_info (fi)->flat = 0;
+ get_frame_extra_info (fi)->in_prologue = 0;
if (find_pc_partial_function (get_frame_pc (fi), &name, &prologue_start, &prologue_end))
{
/* See if the function starts with an add (which will be of a
buf = alloca (MAX_REGISTER_RAW_SIZE);
/* We definitely have a flat frame now. */
- fi->extra_info->flat = 1;
+ get_frame_extra_info (fi)->flat = 1;
- fi->extra_info->sp_offset = offset;
+ get_frame_extra_info (fi)->sp_offset = offset;
/* Overwrite the frame's address with the value in %i7. */
get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0);
deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
/* Record where the fp got saved. */
- fi->extra_info->fp_addr =
- get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_extra_info (fi)->fp_addr =
+ get_frame_base (fi) + get_frame_extra_info (fi)->sp_offset + X_SIMM13 (insn);
/* Also try to collect where the pc got saved to. */
- fi->extra_info->pc_addr = 0;
+ get_frame_extra_info (fi)->pc_addr = 0;
insn = fetch_instruction (prologue_start + 12);
if (X_OP (insn) == 3
&& X_RD (insn) == 15
&& X_OP3 (insn) == 4
&& X_RS1 (insn) == 14)
- fi->extra_info->pc_addr =
- get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_extra_info (fi)->pc_addr =
+ get_frame_base (fi) + get_frame_extra_info (fi)->sp_offset + X_SIMM13 (insn);
}
}
else
}
if (addr >= get_frame_pc (fi))
{
- fi->extra_info->in_prologue = 1;
+ get_frame_extra_info (fi)->in_prologue = 1;
deprecated_update_frame_base_hack (fi, read_register (SP_REGNUM));
}
}
scbuf, sizeof (scbuf));
return extract_address (scbuf, sizeof (scbuf));
}
- else if (frame->extra_info->in_prologue ||
+ else if (get_frame_extra_info (frame)->in_prologue ||
(get_next_frame (frame) != NULL &&
((get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME) ||
deprecated_frame_in_dummy (get_next_frame (frame))) &&
frame, O7_REGNUM, (enum lval_type *) NULL);
return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE));
}
- if (frame->extra_info->flat)
- addr = frame->extra_info->pc_addr;
+ if (get_frame_extra_info (frame)->flat)
+ addr = get_frame_extra_info (frame)->pc_addr;
else
- addr = frame->extra_info->bottom + FRAME_SAVED_I0 +
+ addr = get_frame_extra_info (frame)->bottom + FRAME_SAVED_I0 +
SPARC_INTREG_SIZE * (I7_REGNUM - I0_REGNUM);
if (addr == 0)
internal_error (__FILE__, __LINE__,
"create_new_frame returned invalid frame");
- frame->extra_info->bottom = argv[1];
+ get_frame_extra_info (frame)->bottom = argv[1];
deprecated_update_frame_pc_hack (frame, FRAME_SAVED_PC (frame));
return frame;
}
{
if (saved_regs && X_I (insn))
saved_regs[X_RD (insn)] =
- get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_base (fi) + get_frame_extra_info (fi)->sp_offset + X_SIMM13 (insn);
}
else
break;
{
/* FIXME MVS: wrong test for dummy frame at entry. */
- if (get_frame_pc (frame1) >= (frame1->extra_info->bottom ?
- frame1->extra_info->bottom : read_sp ())
+ if (get_frame_pc (frame1) >= (get_frame_extra_info (frame1)->bottom
+ ? get_frame_extra_info (frame1)->bottom
+ : read_sp ())
&& get_frame_pc (frame1) <= get_frame_base (frame1))
{
/* Dummy frame. All but the window regs are in there somewhere.
This is because frame1 is initialized to frame->next
(frame1->prev == frame) and is then advanced towards
the innermost (next) frame. */
- addr = (get_prev_frame (frame1)->extra_info->bottom
+ addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom
+ (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_I0);
else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
This is because frame1 is initialized to frame->next
(frame1->prev == frame) and is then advanced towards
the innermost (next) frame. */
- addr = (get_prev_frame (frame1)->extra_info->bottom
+ addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom
+ (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_L0);
else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
addr = get_frame_base (frame1) + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 24 * SPARC_INTREG_SIZE);
}
- else if (frame1->extra_info->flat)
+ else if (get_frame_extra_info (frame1)->flat)
{
if (regnum == RP_REGNUM)
- addr = frame1->extra_info->pc_addr;
+ addr = get_frame_extra_info (frame1)->pc_addr;
else if (regnum == I7_REGNUM)
- addr = frame1->extra_info->fp_addr;
+ addr = get_frame_extra_info (frame1)->fp_addr;
else
{
CORE_ADDR func_start;
{
/* Normal frame. Local and In registers are saved on stack. */
if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
- addr = (get_prev_frame (frame1)->extra_info->bottom
+ addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom
+ (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_I0);
else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
- addr = (get_prev_frame (frame1)->extra_info->bottom
+ addr = (get_frame_extra_info (get_prev_frame (frame1))->bottom
+ (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_L0);
else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR));
- if (get_frame_pc (fi) >= (fi->extra_info->bottom ?
- fi->extra_info->bottom : read_sp ())
+ if (get_frame_pc (fi) >= (get_frame_extra_info (fi)->bottom
+ ? get_frame_extra_info (fi)->bottom
+ : read_sp ())
&& get_frame_pc (fi) <= get_frame_base (fi))
{
/* Dummy frame. All but the window regs are in there somewhere. */
frame_addr + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
- DUMMY_STACK_REG_BUF_SIZE;
- frame_addr = fi->extra_info->bottom ?
- fi->extra_info->bottom : read_sp ();
+ frame_addr = (get_frame_extra_info (fi)->bottom
+ ? get_frame_extra_info (fi)->bottom
+ : read_sp ());
}
- else if (fi->extra_info->flat)
+ else if (get_frame_extra_info (fi)->flat)
{
CORE_ADDR func_start;
find_pc_partial_function (get_frame_pc (fi), NULL, &func_start, NULL);
examine_prologue (func_start, 0, fi, saved_regs_addr);
/* Flat register window frame. */
- saved_regs_addr[RP_REGNUM] = fi->extra_info->pc_addr;
- saved_regs_addr[I7_REGNUM] = fi->extra_info->fp_addr;
+ saved_regs_addr[RP_REGNUM] = get_frame_extra_info (fi)->pc_addr;
+ saved_regs_addr[I7_REGNUM] = get_frame_extra_info (fi)->fp_addr;
}
else
{
/* Normal frame. Just Local and In registers */
- frame_addr = fi->extra_info->bottom ?
- fi->extra_info->bottom : read_sp ();
+ frame_addr = (get_frame_extra_info (fi)->bottom
+ ? get_frame_extra_info (fi)->bottom
+ : read_sp ());
for (regnum = L0_REGNUM; regnum < L0_REGNUM + 8; regnum++)
saved_regs_addr[regnum] =
(frame_addr + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
}
if (get_next_frame (fi))
{
- if (fi->extra_info->flat)
+ if (get_frame_extra_info (fi)->flat)
{
- saved_regs_addr[O7_REGNUM] = fi->extra_info->pc_addr;
+ saved_regs_addr[O7_REGNUM] = get_frame_extra_info (fi)->pc_addr;
}
else
{
/* Pull off either the next frame pointer or the stack pointer */
CORE_ADDR next_next_frame_addr =
- (get_next_frame (fi)->extra_info->bottom ?
- get_next_frame (fi)->extra_info->bottom : read_sp ());
+ (get_frame_extra_info (get_next_frame (fi))->bottom
+ ? get_frame_extra_info (get_next_frame (fi))->bottom
+ : read_sp ());
for (regnum = O0_REGNUM; regnum < O0_REGNUM + 8; regnum++)
saved_regs_addr[regnum] =
(next_next_frame_addr
7 * SPARC_INTREG_SIZE);
}
- if (frame->extra_info->flat)
+ if (get_frame_extra_info (frame)->flat)
{
/* Each register might or might not have been saved, need to test
individually. */
read_memory_integer (fsr[NPC_REGNUM],
REGISTER_RAW_SIZE (NPC_REGNUM)));
}
- else if (frame->extra_info->flat)
+ else if (get_frame_extra_info (frame)->flat)
{
- if (frame->extra_info->pc_addr)
+ if (get_frame_extra_info (frame)->pc_addr)
pc = PC_ADJUST ((CORE_ADDR)
- read_memory_integer (frame->extra_info->pc_addr,
+ read_memory_integer (get_frame_extra_info (frame)->pc_addr,
REGISTER_RAW_SIZE (PC_REGNUM)));
else
{
extern void
sparc_print_extra_frame_info (struct frame_info *fi)
{
- if (fi && fi->extra_info && fi->extra_info->flat)
+ if (fi && get_frame_extra_info (fi) && get_frame_extra_info (fi)->flat)
printf_filtered (" flat, pc saved at 0x%s, fp saved at 0x%s\n",
- paddr_nz (fi->extra_info->pc_addr),
- paddr_nz (fi->extra_info->fp_addr));
+ paddr_nz (get_frame_extra_info (fi)->pc_addr),
+ paddr_nz (get_frame_extra_info (fi)->fp_addr));
}
/* MULTI_ARCH support */
fp = xstormy16_frame_saved_register (fi, E_FP_REGNUM);
/* Initialize framesize with size of PC put on stack by CALLF inst. */
- fi->extra_info->framesize = xstormy16_pc_size;
+ get_frame_extra_info (fi)->framesize = xstormy16_pc_size;
}
for (next_addr = start_addr;
next_addr < end_addr; next_addr += xstormy16_inst_size)
if (fi)
{
regnum = inst & 0x000f;
- get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize;
- fi->extra_info->framesize += xstormy16_reg_size;
+ get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize;
+ get_frame_extra_info (fi)->framesize += xstormy16_reg_size;
}
}
else if (inst == 0x301f || inst == 0x303f) /* inc r15, #0x1/#0x3 */
{
if (fi) /* Record the frame size. */
- fi->extra_info->framesize += ((inst & 0x0030) >> 4) + 1;
+ get_frame_extra_info (fi)->framesize += ((inst & 0x0030) >> 4) + 1;
}
/* optional stack allocation for args and local vars > 4 && < 16 byte */
else if ((inst & 0xff0f) == 0x510f) /* 51Hf add r15, #0xH */
{
if (fi) /* Record the frame size. */
- fi->extra_info->framesize += (inst & 0x00f0) >> 4;
+ get_frame_extra_info (fi)->framesize += (inst & 0x00f0) >> 4;
}
/* optional stack allocation for args and local vars >= 16 byte */
else if (inst == 0x314f && inst2 >= 0x0010) /* 314f HHHH add r15, #0xH */
{
if (fi) /* Record the frame size. */
- fi->extra_info->framesize += inst2;
+ get_frame_extra_info (fi)->framesize += inst2;
next_addr += xstormy16_inst_size;
}
else if (inst == 0x46fd) /* mov r13, r15 */
{
if (fi) /* Record that the frame pointer is in use. */
- fi->extra_info->frameless_p = 0;
+ get_frame_extra_info (fi)->frameless_p = 0;
if (frameless)
*frameless = 0;
}
if (offset & 0x0800)
offset -= 0x1000;
- get_frame_saved_regs (fi)[regnum] = fi->extra_info->framesize + offset;
+ get_frame_saved_regs (fi)[regnum] = get_frame_extra_info (fi)->framesize + offset;
}
next_addr += xstormy16_inst_size;
}
by convention what we put here is simply the previous
_value_ of the SP (as opposed to an address where the
previous value would have been pushed). */
- if (fi->extra_info->frameless_p)
+ if (get_frame_extra_info (fi)->frameless_p)
{
- get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - fi->extra_info->framesize;
+ get_frame_saved_regs (fi)[E_SP_REGNUM] = sp - get_frame_extra_info (fi)->framesize;
deprecated_update_frame_base_hack (fi, sp);
}
else
{
- get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - fi->extra_info->framesize;
+ get_frame_saved_regs (fi)[E_SP_REGNUM] = fp - get_frame_extra_info (fi)->framesize;
deprecated_update_frame_base_hack (fi, fp);
}
static void
xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
- if (!fi->extra_info)
+ if (!get_frame_extra_info (fi))
{
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- fi->extra_info->framesize = 0;
- fi->extra_info->frameless_p = 1; /* Default frameless, detect framed */
+ get_frame_extra_info (fi)->framesize = 0;
+ get_frame_extra_info (fi)->frameless_p = 1; /* Default frameless, detect framed */
/* By default, the fi->frame is set to the value of the FP reg by gdb.
This may not always be right; we may be in a frameless function,
else
{
/* Return computed offset from this frame's fp. */
- return get_frame_base (fi) - fi->extra_info->framesize;
+ return get_frame_base (fi) - get_frame_extra_info (fi)->framesize;
}
}
xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{
return chain < 0x8000 && FRAME_SAVED_PC (thisframe) >= 0x8000 &&
- (thisframe->extra_info->frameless_p ||
- get_frame_base (thisframe) - thisframe->extra_info->framesize == chain);
+ (get_frame_extra_info (thisframe)->frameless_p ||
+ get_frame_base (thisframe) - get_frame_extra_info (thisframe)->framesize == chain);
}
/* Function: xstormy16_saved_pc_after_call