* alpha-tdep.c: Use get_frame_base.
* 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, mn10200-tdep.c: Ditto.
* mn10300-tdep.c, ns32k-tdep.c, s390-tdep.c, sh-tdep.c: Ditto.
* sparc-tdep.c, v850-tdep.c, vax-tdep.c: Ditto.
* x86-64-linux-tdep.c, xstormy16-tdep.c: Ditto.
* config/h8500/tm-h8500.h, config/mn10200/tm-mn10200.h: Ditto.
* config/sparc/tm-sparc.h: Ditto.
+2003-01-07 Andrew Cagney <cagney@redhat.com>
+
+ * alpha-tdep.c: Use get_frame_base.
+ * 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, mn10200-tdep.c: Ditto.
+ * mn10300-tdep.c, ns32k-tdep.c, s390-tdep.c, sh-tdep.c: Ditto.
+ * sparc-tdep.c, v850-tdep.c, vax-tdep.c: Ditto.
+ * x86-64-linux-tdep.c, xstormy16-tdep.c: Ditto.
+ * config/h8500/tm-h8500.h, config/mn10200/tm-mn10200.h: Ditto.
+ * config/sparc/tm-sparc.h: Ditto.
+
2003-01-07 Andrew Cagney <cagney@redhat.com>
* frame.c (deprecated_get_frame_context): New function.
/* Fill in the offsets for the registers which gen_mask says
were saved. */
- reg_position = frame->frame + PROC_REG_OFFSET (proc_desc);
+ reg_position = get_frame_base (frame) + PROC_REG_OFFSET (proc_desc);
mask = PROC_REG_MASK (proc_desc);
returnreg = PROC_PC_REG (proc_desc);
/* Fill in the offsets for the registers which float_mask says
were saved. */
- reg_position = frame->frame + PROC_FREG_OFFSET (proc_desc);
+ reg_position = get_frame_base (frame) + PROC_FREG_OFFSET (proc_desc);
mask = PROC_FREG_MASK (proc_desc);
for (ireg = 0; ireg <= 31; ++ireg)
{
if (get_frame_saved_regs (fi) == NULL)
alpha_find_saved_regs (fi);
- get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi);
}
static CORE_ADDR
/* We have to get the saved sp from the sigcontext
if it is a signal handler frame. */
if (regno == SP_REGNUM && !(get_frame_type (fi) == SIGTRAMP_FRAME))
- return fi->frame;
+ return get_frame_base (fi);
else
{
if (get_frame_saved_regs (fi) == NULL)
: frame->extra_info->pc_reg;
if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
- return read_memory_integer (frame->frame - 8, 8);
+ return read_memory_integer (get_frame_base (frame) - 8, 8);
return read_next_frame_reg (frame, pcreg);
}
static CORE_ADDR
alpha_frame_locals_address (struct frame_info *fi)
{
- return (fi->frame - fi->extra_info->localoff);
+ return (get_frame_base (fi) - fi->extra_info->localoff);
}
static CORE_ADDR
alpha_frame_args_address (struct frame_info *fi)
{
- return (fi->frame - (ALPHA_NUM_ARG_REGS * 8));
+ return (get_frame_base (fi) - (ALPHA_NUM_ARG_REGS * 8));
}
/* ALPHA stack frames are almost impenetrable. When execution stops,
{
register int regnum;
struct frame_info *frame = get_current_frame ();
- CORE_ADDR new_sp = frame->frame;
+ CORE_ADDR new_sp = get_frame_base (frame);
alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
static CORE_ADDR
arm_frame_args_address (struct frame_info *fi)
{
- return fi->frame;
+ return get_frame_base (fi);
}
/* The address of the local variables in the frame. */
static CORE_ADDR
arm_frame_locals_address (struct frame_info *fi)
{
- return fi->frame;
+ return get_frame_base (fi);
}
/* The number of arguments being passed in the frame. */
{
/* Get address of the stmfd in the prologue of the callee;
the saved PC is the address of the stmfd + 8. */
- if (!safe_read_memory_integer (fi->frame, 4, &return_value))
+ if (!safe_read_memory_integer (get_frame_base (fi), 4, &return_value))
return;
else
{
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
{
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), regnum);
}
else if (get_frame_saved_regs (fi)[regnum] != 0)
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
/* A generic call dummy's frame is the same as caller's. */
- return fi->frame;
+ return get_frame_base (fi);
if (get_frame_pc (fi) < LOWEST_PC)
return 0;
if (framereg == ARM_FP_REGNUM || framereg == THUMB_FP_REGNUM)
return arm_find_callers_reg (fi, framereg);
else
- return fi->frame + fi->extra_info->framesize;
+ return get_frame_base (fi) + fi->extra_info->framesize;
}
/* This function actually figures out the frame address for a given pc
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi->next), 0, 0))
/* For generic dummy frames, pull the value direct from the frame.
Having an unwind function to do this would be nice. */
- sp = deprecated_read_register_dummy (get_frame_pc (fi->next), fi->next->frame,
+ sp = deprecated_read_register_dummy (get_frame_pc (fi->next),
+ get_frame_base (fi->next),
ARM_SP_REGNUM);
else
- sp = (fi->next->frame - fi->next->extra_info->frameoffset
+ sp = (get_frame_base (fi->next) - fi->next->extra_info->frameoffset
+ fi->next->extra_info->framesize);
/* Determine whether or not we're in a sigtramp frame.
else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi->next), 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, fi->next->frame);
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi->next));
else if (fi->extra_info->framereg == ARM_FP_REGNUM
|| fi->extra_info->framereg == THUMB_FP_REGNUM)
{
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] += (fi->frame + fi->extra_info->framesize
+ get_frame_saved_regs (fi)[reg] += (get_frame_base (fi)
+ + fi->extra_info->framesize
- fi->extra_info->frameoffset);
}
}
{
/* If a dummy frame, pull the PC out of the frame's register buffer. */
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, ARM_PC_REGNUM);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), ARM_PC_REGNUM);
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame - fi->extra_info->frameoffset,
- fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ (get_frame_base (fi)
+ - fi->extra_info->frameoffset),
+ get_frame_base (fi)))
{
return read_memory_integer (get_frame_saved_regs (fi)[ARM_PC_REGNUM],
REGISTER_RAW_SIZE (ARM_PC_REGNUM));
{
int regnum;
struct frame_info *frame = get_current_frame ();
- CORE_ADDR old_SP = (frame->frame - frame->extra_info->frameoffset
+ CORE_ADDR old_SP = (get_frame_base (frame) - frame->extra_info->frameoffset
+ frame->extra_info->framesize);
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
generic_pop_dummy_frame ();
flush_cached_frames ();
avr_scan_prologue (fi);
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (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), fi->frame,
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi),
AVR_PC_REGNUM));
}
else if (!fi->next) /* this is the innermost frame? */
{
struct frame_info *next_fi = fi->next;
if (fi->extra_info->framereg == AVR_SP_REGNUM)
- deprecated_update_frame_base_hack (fi, next_fi->frame + 2 /* ret addr */ + next_fi->extra_info->framesize);
+ deprecated_update_frame_base_hack (fi, get_frame_base (next_fi) + 2 /* ret addr */ + next_fi->extra_info->framesize);
/* FIXME: I don't analyse va_args functions */
else
{
CORE_ADDR addr;
int i;
- addr = fi->frame + fi->extra_info->framesize + 1;
+ addr = get_frame_base (fi) + fi->extra_info->framesize + 1;
/* Return address in stack in different endianness */
CORE_ADDR saddr;
struct frame_info *frame = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
generic_pop_dummy_frame ();
}
read_memory_unsigned_integer (saddr, 1));
}
else if (get_frame_saved_regs (frame)[regnum] && regnum == AVR_SP_REGNUM)
- write_register (regnum, frame->frame + 2);
+ write_register (regnum, get_frame_base (frame) + 2);
}
/* Don't forget the update the PC too! */
static CORE_ADDR
avr_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame),
AVR_PC_REGNUM);
else
return frame->extra_info->return_pc;
static CORE_ADDR
avr_frame_address (struct frame_info *fi)
{
- return avr_make_saddr (fi->frame);
+ return avr_make_saddr (get_frame_base (fi));
}
/* Given a GDB frame, determine the address of the calling function's
static CORE_ADDR
avr_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
/* initialize the return_pc now */
frame->extra_info->return_pc
- = deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
+ = deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame),
AVR_PC_REGNUM);
- return frame->frame;
+ return get_frame_base (frame);
}
return (frame->extra_info->is_main ? 0
- : frame->frame + frame->extra_info->framesize + 2 /* ret addr */ );
+ : get_frame_base (frame) + frame->extra_info->framesize + 2 /* ret addr */ );
}
/* Store the address of the place in which to copy the structure the
#define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
extern CORE_ADDR frame_saved_pc (struct frame_info *frame);
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
+#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
#define FRAME_ARGS_SKIP 0
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
+#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
#define FRAME_NUM_ARGS(fi) (-1)
extern void mn10200_pop_frame (struct frame_info *);
extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *);
/* If the argument is on the stack, it will be here. */
-#define FRAME_ARGS_ADDRESS(FI) ((FI)->frame)
+#define FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI))
-#define FRAME_LOCALS_ADDRESS(FI) ((FI)->frame)
+#define FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI))
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
#define FRAME_SAVED_L0 0
#define FRAME_SAVED_I0 (8 * REGISTER_RAW_SIZE (L0_REGNUM))
-#define FRAME_STRUCT_ARGS_ADDRESS(FI) ((FI)->frame)
+#define FRAME_STRUCT_ARGS_ADDRESS(FI) (get_frame_base (FI))
/* Things needed for making the inferior call functions. */
/*
CORE_ADDR ip;
struct symtab_and_line sal;
int best_limit;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi),
+ get_frame_base (fi));
/* Examine the entire prologue. */
register int frameless_p = 0;
fi->extra_info->return_pc = 0;
fi->extra_info->leaf_function = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ get_frame_base (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), fi->frame,
- SP_REGNUM));
+ 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), fi->frame, PC_REGNUM);
+ 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;
CORE_ADDR
cris_frame_chain (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ get_frame_base (fi),
+ get_frame_base (fi)))
{
- return fi->frame;
+ return get_frame_base (fi);
}
else if (!inside_entry_file (get_frame_pc (fi)))
{
register int regno;
register int stack_offset = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
+ get_frame_base (fi),
+ get_frame_base (fi)))
{
/* This happens when we hit a breakpoint set at the entry point,
when returning from a dummy frame. */
static CORE_ADDR
d10v_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
return d10v_make_iaddr (deprecated_read_register_dummy (get_frame_pc (frame),
- frame->frame,
+ get_frame_base (frame),
PC_REGNUM));
else
return ((frame)->extra_info->return_pc);
CORE_ADDR addr;
/* A generic call dummy's frame is the same as caller's. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
- return fi->frame;
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return get_frame_base (fi);
d10v_frame_init_saved_regs (fi);
unsigned short op1, op2;
int i;
- fp = fi->frame;
+ fp = get_frame_base (fi);
memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
next_addr = 0;
/* The call dummy doesn't save any registers on the stack, so we can
return now. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
return;
}
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, get_frame_saved_regs (fi), fi);
+ h8300_examine_prologue (func_addr, limit, get_frame_base (fi),
+ get_frame_saved_regs (fi), fi);
}
/* Else we're out of luck (can't debug completely stripped code).
FIXME. */
static CORE_ADDR
h8300_frame_chain (struct frame_info *thisframe)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe), thisframe->frame, thisframe->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe),
+ get_frame_base (thisframe),
+ get_frame_base (thisframe)))
{ /* initialize the from_pc now */
thisframe->extra_info->from_pc =
- deprecated_read_register_dummy (get_frame_pc (thisframe), thisframe->frame,
+ deprecated_read_register_dummy (get_frame_pc (thisframe),
+ get_frame_base (thisframe),
E_PC_REGNUM);
- return thisframe->frame;
+ return get_frame_base (thisframe);
}
return get_frame_saved_regs (thisframe)[E_SP_REGNUM];
}
static CORE_ADDR
h8300_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame),
E_PC_REGNUM);
else
return frame->extra_info->from_pc;
static CORE_ADDR
h8300_frame_locals_address (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->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->locals_pointer;
}
static CORE_ADDR
h8300_frame_args_address (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->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;
}
unsigned regno;
struct frame_info *frame = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
generic_pop_dummy_frame ();
}
read_memory_integer (get_frame_saved_regs (frame)[regno],
BINWORD));
else if (get_frame_saved_regs (frame)[regno] && regno == E_SP_REGNUM)
- write_register (regno, frame->frame + 2 * BINWORD);
+ write_register (regno, get_frame_base (frame) + 2 * BINWORD);
}
/* Don't forget to update the PC too! */
i386_frame_chain (struct frame_info *frame)
{
if (pc_in_dummy_frame (get_frame_pc (frame)))
- return frame->frame;
+ return get_frame_base (frame);
if (get_frame_type (frame) == SIGTRAMP_FRAME
|| i386_frameless_signal_p (frame))
- return frame->frame;
+ return get_frame_base (frame);
if (! inside_entry_file (get_frame_pc (frame)))
- return read_memory_unsigned_integer (frame->frame, 4);
+ return read_memory_unsigned_integer (get_frame_base (frame), 4);
return 0;
}
return read_memory_unsigned_integer (sp, 4);
}
- return read_memory_unsigned_integer (frame->frame + 4, 4);
+ return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4);
}
/* Immediately after a function call, return the saved pc. */
if (locals >= 0)
{
- addr = fip->frame - 4 - locals;
+ addr = get_frame_base (fip) - 4 - locals;
for (i = 0; i < 8; i++)
{
op = codestream_get ();
}
}
- get_frame_saved_regs (fip)[PC_REGNUM] = fip->frame + 4;
- get_frame_saved_regs (fip)[FP_REGNUM] = fip->frame;
+ get_frame_saved_regs (fip)[PC_REGNUM] = get_frame_base (fip) + 4;
+ get_frame_saved_regs (fip)[FP_REGNUM] = get_frame_base (fip);
}
/* Return PC of first real instruction. */
gdb_assert (sigcontext_offset != -1);
if (frame->next)
- return frame->next->frame + sigcontext_offset;
+ return get_frame_base (frame->next) + sigcontext_offset;
return read_register (SP_REGNUM) + sigcontext_offset;
}
\f
internal_error (__FILE__, __LINE__,
"read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
- regaddr = SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regnum);
+ regaddr = SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regnum);
if (regaddr)
return read_memory_integer (regaddr, REGISTER_RAW_SIZE (regnum));
else
{
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return read_sigcontext_register (frame, sp_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame;
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return get_frame_base (frame);
else
{
FRAME_INIT_SAVED_REGS (frame);
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;
+ return (get_frame_base (frame)
+ + frame->extra_info->mem_stack_frame_size);
}
}
{
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return read_sigcontext_register (frame, pc_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return deprecated_read_register_dummy (get_frame_pc (frame), frame->frame, pc_regnum);
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return deprecated_read_register_dummy (get_frame_pc (frame),
+ get_frame_base (frame), pc_regnum);
else
{
FRAME_INIT_SAVED_REGS (frame);
/* Hmm... whether or not this will work will depend on
where the pc is. If it's still early in the prologue
this'll be wrong. FIXME */
- spill_addr = (frame ? frame->frame : 0)
+ spill_addr = (frame ? get_frame_base (frame) : 0)
+ (rM == 12 ? 0 : mem_stack_frame_size)
+ imm;
spill_reg = rN;
frame_saved_regs_zalloc (frame);
get_frame_saved_regs (frame)[IA64_VRAP_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_IP_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_IP_REGNUM);
get_frame_saved_regs (frame)[IA64_CFM_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CFM_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_CFM_REGNUM);
get_frame_saved_regs (frame)[IA64_PSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PSR_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_PSR_REGNUM);
#if 0
get_frame_saved_regs (frame)[IA64_BSP_REGNUM] =
SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_BSP_REGNUM);
#endif
get_frame_saved_regs (frame)[IA64_RNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_RNAT_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_RNAT_REGNUM);
get_frame_saved_regs (frame)[IA64_CCV_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_CCV_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_CCV_REGNUM);
get_frame_saved_regs (frame)[IA64_UNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_UNAT_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_UNAT_REGNUM);
get_frame_saved_regs (frame)[IA64_FPSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_FPSR_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_FPSR_REGNUM);
get_frame_saved_regs (frame)[IA64_PFS_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_PFS_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_PFS_REGNUM);
get_frame_saved_regs (frame)[IA64_LC_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_LC_REGNUM);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_LC_REGNUM);
for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
if (regno != sp_regnum)
get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
for (regno = IA64_FR2_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regno);
+ SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
}
else
{
if (lval != NULL)
*lval = not_lval;
- is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame);
+ is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame));
if (regnum == SP_REGNUM && frame->next)
{
/* Handle SP values for all frames but the topmost. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame);
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ get_frame_base (frame));
}
else if (regnum == IA64_BSP_REGNUM)
{
for the frame pointer, it'll be found by ia64_find_saved_register()
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 = frame->frame + frame->extra_info->mem_stack_frame_size;
+ CORE_ADDR vfp = (get_frame_base (frame)
+ + frame->extra_info->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)
{
CORE_ADDR bsp, cfm;
int next_frame_is_call_dummy = ((frame->next != NULL)
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame->next), frame->next->frame,
- frame->next->frame));
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame->next),
+ get_frame_base (frame->next),
+ get_frame_base (frame->next)));
frame_extra_info_zalloc (frame, sizeof (struct frame_extra_info));
else if (next_frame_is_call_dummy)
{
bsp = deprecated_read_register_dummy (get_frame_pc (frame->next),
- frame->next->frame,
+ get_frame_base (frame->next),
IA64_BSP_REGNUM);
cfm = deprecated_read_register_dummy (get_frame_pc (frame->next),
- frame->next->frame,
+ get_frame_base (frame->next),
IA64_CFM_REGNUM);
}
else
else if (frn->next && (get_frame_type (frn->next) == SIGTRAMP_FRAME))
cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM);
else if (frn->next
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frn->next), frn->next->frame,
- frn->next->frame))
- cfm = deprecated_read_register_dummy (get_frame_pc (frn->next), frn->next->frame,
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frn->next),
+ get_frame_base (frn->next),
+ get_frame_base (frn->next)))
+ cfm = deprecated_read_register_dummy (get_frame_pc (frn->next),
+ get_frame_base (frn->next),
IA64_PFS_REGNUM);
else
cfm = read_register (IA64_PFS_REGNUM);
{
CORE_ADDR addr;
- addr = frame->frame + frame->extra_info->size + STACK_CORRECTION + 2;
+ addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION + 2;
if (frame->extra_info->return_kind == RETURN_RTC)
addr += 1;
else if (frame->extra_info->return_kind == RETURN_RTI)
static CORE_ADDR
m68hc11_frame_locals_address (struct frame_info *frame)
{
- return frame->frame;
+ return get_frame_base (frame);
}
/* Discard from the stack the innermost frame, restoring all saved
register CORE_ADDR fp, sp;
register int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
{
CORE_ADDR addr;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame; /* dummy frame same as caller's frame */
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ 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))
return (CORE_ADDR) 0;
- if (frame->frame == 0)
+ if (get_frame_base (frame) == 0)
{
return (CORE_ADDR) 0;
}
- addr = frame->frame + frame->extra_info->size + STACK_CORRECTION - 2;
+ addr = get_frame_base (frame) + frame->extra_info->size + STACK_CORRECTION - 2;
addr = read_memory_unsigned_integer (addr, 2) & 0x0FFFF;
return addr;
}
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,
+ m68hc11_guess_from_prologue (pc, get_frame_base (fi), &pc, &fi->extra_info->size,
get_frame_saved_regs (fi));
- addr = fi->frame + fi->extra_info->size + STACK_CORRECTION;
+ addr = get_frame_base (fi) + fi->extra_info->size + STACK_CORRECTION;
if (soft_regs[SOFT_FP_REGNUM].name)
get_frame_saved_regs (fi)[SOFT_FP_REGNUM] = addr - 2;
m68k_frame_chain (struct frame_info *thisframe)
{
if (get_frame_type (thisframe) == SIGTRAMP_FRAME)
- return thisframe->frame;
+ return get_frame_base (thisframe);
else if (!inside_entry_file (get_frame_pc (thisframe)))
- return read_memory_unsigned_integer (thisframe->frame, 4);
+ return read_memory_unsigned_integer (get_frame_base (thisframe), 4);
else
return 0;
}
if (get_frame_type (frame) == SIGTRAMP_FRAME)
{
if (frame->next)
- return read_memory_unsigned_integer (frame->next->frame
+ return read_memory_unsigned_integer (get_frame_base (frame->next)
+ SIG_PC_FP_OFFSET, 4);
else
return read_memory_unsigned_integer (read_register (SP_REGNUM)
+ SIG_PC_FP_OFFSET - 8, 4);
}
else
- return read_memory_unsigned_integer (frame->frame + 4, 4);
+ return read_memory_unsigned_integer (get_frame_base (frame) + 4, 4);
}
/* we assume here that the only frameless functions are the system calls
or other functions who do not put anything on the stack. */
if (get_frame_type (frame_info) == SIGTRAMP_FRAME)
- return frame_info->frame + 12;
+ return get_frame_base (frame_info) + 12;
else if (frameless_look_for_prologue (frame_info))
{
/* Check for an interrupted system call */
if (frame_info->next && (get_frame_type (frame_info->next) == SIGTRAMP_FRAME))
- return frame_info->next->frame + 16;
+ return get_frame_base (frame_info->next) + 16;
else
- return frame_info->frame + 4;
+ return get_frame_base (frame_info) + 4;
}
else
- return frame_info->frame;
+ return get_frame_base (frame_info);
}
CORE_ADDR
/* First possible address for a pc in a call dummy for this frame. */
CORE_ADDR possible_call_dummy_start =
- frame_info->frame - 28 - FP_REGNUM * 4 - 4 - 8 * 12;
+ get_frame_base (frame_info) - 28 - FP_REGNUM * 4 - 4 - 8 * 12;
int nextinsn;
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)
+ && get_frame_pc (frame_info) <= get_frame_base (frame_info))
{
/* It is a call dummy. We could just stop now, since we know
to parse the "prologue" which is part of the call dummy.
This is needlessly complex and confusing. FIXME. */
- next_addr = frame_info->frame;
+ next_addr = get_frame_base (frame_info);
pc = possible_call_dummy_start;
}
else
{
/* pea %fp
move.l %sp, %fp */
- next_addr = frame_info->frame;
+ next_addr = get_frame_base (frame_info);
pc += 4;
}
else if (P_LINKL_FP == nextinsn)
/* Find the address above the saved
regs using the amount of storage from the link instruction. */
{
- next_addr = frame_info->frame + read_memory_integer (pc + 2, 4);
+ next_addr = get_frame_base (frame_info) + read_memory_integer (pc + 2, 4);
pc += 6;
}
else if (P_LINKW_FP == nextinsn)
/* Find the address above the saved
regs using the amount of storage from the link instruction. */
{
- next_addr = frame_info->frame + read_memory_integer (pc + 2, 2);
+ next_addr = get_frame_base (frame_info) + read_memory_integer (pc + 2, 2);
pc += 4;
}
else
{
register CORE_ADDR addr;
- addr = frame_info->frame + read_memory_integer (pc + 4, 2);
+ addr = get_frame_base (frame_info) + read_memory_integer (pc + 4, 2);
/* Regmask's low bit is for register fp7, the first pushed */
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
{
register CORE_ADDR addr;
- addr = frame_info->frame + read_memory_integer (pc + 4, 2);
+ addr = get_frame_base (frame_info) + read_memory_integer (pc + 4, 2);
/* Regmask's low bit is for register 0, the first written */
for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)
if (regmask & 1)
break;
}
lose:;
- 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;
+ get_frame_saved_regs (frame_info)[SP_REGNUM] = get_frame_base (frame_info) + 8;
+ get_frame_saved_regs (frame_info)[FP_REGNUM] = get_frame_base (frame_info);
+ get_frame_saved_regs (frame_info)[PC_REGNUM] = get_frame_base (frame_info) + 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)
{
if (register_offsets[rn] >= 0)
{
- get_frame_saved_regs (fi)[rn] = fi->frame - register_offsets[rn];
+ get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - 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)));
If our caller does not have a frame pointer, then his frame base
is <our base> + -<caller's frame size>. */
- dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), fi->frame);
+ dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
if (dummy->extra_info->status & MY_FRAME_IN_FP)
{
else
{
/* Our caller does not have a frame pointer. */
- callers_addr = fi->frame + dummy->extra_info->framesize;
+ callers_addr = get_frame_base (fi) + dummy->extra_info->framesize;
}
return callers_addr;
CORE_ADDR
mcore_frame_args_address (struct frame_info * fi)
{
- return fi->frame - fi->extra_info->framesize;
+ return get_frame_base (fi) - fi->extra_info->framesize;
}
CORE_ADDR
mcore_frame_locals_address (struct frame_info * fi)
{
- return fi->frame - fi->extra_info->framesize;
+ return get_frame_base (fi) - fi->extra_info->framesize;
}
/* Return the frame pointer in use at address PC. */
{
for (; fi != NULL; 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);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), regnum);
else if (get_frame_saved_regs (fi)[regnum] != 0)
return read_memory_integer (get_frame_saved_regs (fi)[regnum],
REGISTER_SIZE);
mcore_frame_saved_pc (struct frame_info * fi)
{
- 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, PC_REGNUM);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), PC_REGNUM);
else
return mcore_find_callers_reg (fi, PR_REGNUM);
}
int rn;
struct frame_info *fi = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
generic_pop_dummy_frame ();
else
{
fi->extra_info->status = 0;
fi->extra_info->framesize = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (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), fi->frame, SP_REGNUM));
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
}
else
mcore_analyze_prologue (fi, 0, 0);
{
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
- reg_position = fci->frame + SIGFRAME_REGSAVE_OFF
+ reg_position = get_frame_base (fci) + SIGFRAME_REGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE;
get_frame_saved_regs (fci)[ireg] = reg_position;
}
for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
{
- reg_position = fci->frame + SIGFRAME_FPREGSAVE_OFF
+ reg_position = get_frame_base (fci) + SIGFRAME_FPREGSAVE_OFF
+ ireg * SIGFRAME_REG_SIZE;
get_frame_saved_regs (fci)[FP0_REGNUM + ireg] = reg_position;
}
- get_frame_saved_regs (fci)[PC_REGNUM] = fci->frame + SIGFRAME_PC_OFF;
+ get_frame_saved_regs (fci)[PC_REGNUM] = get_frame_base (fci) + SIGFRAME_PC_OFF;
return;
}
/* Fill in the offsets for the registers which gen_mask says
were saved. */
- reg_position = fci->frame + PROC_REG_OFFSET (proc_desc);
+ reg_position = get_frame_base (fci) + PROC_REG_OFFSET (proc_desc);
for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1)
if (gen_mask & 0x80000000)
{
int sreg_count = (inst >> 6) & 3;
/* Check if the ra register was pushed on the stack. */
- reg_position = fci->frame + PROC_REG_OFFSET (proc_desc);
+ reg_position = get_frame_base (fci) + PROC_REG_OFFSET (proc_desc);
if (inst & 0x20)
reg_position -= MIPS_SAVED_REGSIZE;
/* Fill in the offsets for the registers which float_mask says
were saved. */
- reg_position = fci->frame + PROC_FREG_OFFSET (proc_desc);
+ reg_position = get_frame_base (fci) + PROC_FREG_OFFSET (proc_desc);
/* Apparently, the freg_offset gives the offset to the first 64 bit
saved.
{
mips_find_saved_regs (frame);
}
- get_frame_saved_regs (frame)[SP_REGNUM] = frame->frame;
+ get_frame_saved_regs (frame)[SP_REGNUM] = get_frame_base (frame);
}
static CORE_ADDR
saved_pc = tmp;
}
else if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
- saved_pc = read_memory_integer (frame->frame - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE);
+ saved_pc = read_memory_integer (get_frame_base (frame) - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE);
else
saved_pc = read_next_frame_reg (frame, pcreg);
/* A dummy frame, uses SP not FP. Get the old SP value. If all
is well, frame->frame the bottom of the current frame will
contain that value. */
- return frame->frame;
+ return get_frame_base (frame);
}
/* Look up the procedure descriptor for this PC. */
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. */
- get_frame_saved_regs (fci)[SP_REGNUM] = fci->frame;
+ get_frame_saved_regs (fci)[SP_REGNUM] = get_frame_base (fci);
}
}
{
if (fi)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
}
return addr;
}
{
if (fi)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
}
return addr;
}
{
if (fi && fi->next == NULL)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
}
return addr;
}
/* Now that we know the size of the outgoing arguments, fix
fi->frame again if this is the innermost frame. */
if (fi && fi->next == NULL)
- deprecated_update_frame_base_hack (fi, fi->frame - outgoing_args_size);
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi) - outgoing_args_size);
/* Note the register save information and update the stack
size for this frame too. */
if (fi)
{
- fi->fsr.regs[2] = fi->frame + fi->stack_size + 4;
- fi->fsr.regs[3] = fi->frame + fi->stack_size + 8;
- fi->fsr.regs[5] = fi->frame + fi->stack_size + 12;
- fi->fsr.regs[6] = fi->frame + fi->stack_size + 16;
+ fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
+ fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
+ fi->fsr.regs[5] = get_frame_base (fi) + fi->stack_size + 12;
+ fi->fsr.regs[6] = get_frame_base (fi) + fi->stack_size + 16;
fi->stack_size += outgoing_args_size;
}
/* There can be no more prologue insns, so return now. */
status = target_read_memory (addr + 2, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[2] = (fi->frame + stack_size
+ fi->fsr.regs[2] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
}
addr += 3;
status = target_read_memory (addr + 2, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[3] = (fi->frame + stack_size
+ fi->fsr.regs[3] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
}
addr += 3;
status = target_read_memory (addr + 1, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[5] = (fi->frame + stack_size
+ fi->fsr.regs[5] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
}
addr += 2;
status = target_read_memory (addr + 1, buf, 1);
if (status != 0)
return addr;
- fi->fsr.regs[6] = (fi->frame + stack_size
+ fi->fsr.regs[6] = (get_frame_base (fi) + stack_size
+ extract_signed_integer (buf, 1));
fi->status &= ~CALLER_A2_IN_A0;
}
So we set up a dummy frame and call mn10200_analyze_prologue to
find stuff for us. */
deprecated_update_frame_pc_hack (dummy_frame, FRAME_SAVED_PC (fi));
- deprecated_update_frame_base_hack (dummy_frame, fi->frame);
+ deprecated_update_frame_base_hack (dummy_frame, get_frame_base (fi));
memset (dummy_frame->fsr.regs, '\000', sizeof dummy_frame->fsr.regs);
dummy_frame->status = 0;
dummy_frame->stack_size = 0;
{
/* Our caller does not have a frame pointer. So his frame starts
at the base of our frame (fi->frame) + <his size> + 4 (saved pc). */
- ret = fi->frame + -dummy_frame->stack_size + 4;
+ ret = get_frame_base (fi) + -dummy_frame->stack_size + 4;
}
do_cleanups (old_chain);
return ret;
{
int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
mn10200_frame_saved_pc (struct frame_info *fi)
{
/* The saved PC will always be at the base of the current frame. */
- return (read_memory_integer (fi->frame, REGISTER_SIZE) & 0xffffff);
+ return (read_memory_integer (get_frame_base (fi), REGISTER_SIZE) & 0xffffff);
}
/* Function: init_extra_frame_info
/* 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. */
- 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;
+ get_frame_saved_regs (fi)[LAR_REGNUM] = get_frame_base (fi) + offset + 4;
+ get_frame_saved_regs (fi)[LIR_REGNUM] = get_frame_base (fi) + offset + 8;
+ get_frame_saved_regs (fi)[MDR_REGNUM] = get_frame_base (fi) + offset + 12;
+ get_frame_saved_regs (fi)[A0_REGNUM + 1] = get_frame_base (fi) + offset + 16;
+ get_frame_saved_regs (fi)[A0_REGNUM] = get_frame_base (fi) + offset + 20;
+ get_frame_saved_regs (fi)[D0_REGNUM + 1] = get_frame_base (fi) + offset + 24;
+ get_frame_saved_regs (fi)[D0_REGNUM] = get_frame_base (fi) + offset + 28;
offset += 32;
}
if (movm_args & movm_a3_bit)
{
- get_frame_saved_regs (fi)[A3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A3_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (movm_args & movm_a2_bit)
{
- get_frame_saved_regs (fi)[A2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[A2_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (movm_args & movm_d3_bit)
{
- get_frame_saved_regs (fi)[D3_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D3_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (movm_args & movm_d2_bit)
{
- get_frame_saved_regs (fi)[D2_REGNUM] = fi->frame + offset;
+ get_frame_saved_regs (fi)[D2_REGNUM] = get_frame_base (fi) + offset;
offset += 4;
}
if (AM33_MODE)
{
if (movm_args & movm_exother_bit)
{
- 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;
+ get_frame_saved_regs (fi)[MCVF_REGNUM] = get_frame_base (fi) + offset;
+ get_frame_saved_regs (fi)[MCRL_REGNUM] = get_frame_base (fi) + offset + 4;
+ get_frame_saved_regs (fi)[MCRH_REGNUM] = get_frame_base (fi) + offset + 8;
+ get_frame_saved_regs (fi)[MDRQ_REGNUM] = get_frame_base (fi) + offset + 12;
+ get_frame_saved_regs (fi)[E0_REGNUM + 1] = get_frame_base (fi) + offset + 16;
+ get_frame_saved_regs (fi)[E0_REGNUM + 0] = get_frame_base (fi) + offset + 20;
offset += 24;
}
if (movm_args & movm_exreg1_bit)
{
- 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;
+ get_frame_saved_regs (fi)[E0_REGNUM + 7] = get_frame_base (fi) + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 6] = get_frame_base (fi) + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 5] = get_frame_base (fi) + offset + 8;
+ get_frame_saved_regs (fi)[E0_REGNUM + 4] = get_frame_base (fi) + offset + 12;
offset += 16;
}
if (movm_args & movm_exreg0_bit)
{
- get_frame_saved_regs (fi)[E0_REGNUM + 3] = fi->frame + offset;
- get_frame_saved_regs (fi)[E0_REGNUM + 2] = fi->frame + offset + 4;
+ get_frame_saved_regs (fi)[E0_REGNUM + 3] = get_frame_base (fi) + offset;
+ get_frame_saved_regs (fi)[E0_REGNUM + 2] = get_frame_base (fi) + offset + 4;
offset += 8;
}
}
/* The easiest way to get that info is to analyze our caller's frame.
So we set up a dummy frame and call mn10300_analyze_prologue to
find stuff for us. */
- dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), fi->frame);
+ dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
if (dummy->extra_info->status & MY_FRAME_IN_FP)
{
/* 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 fi->frame + adjust + -dummy->extra_info->stack_size;
+ return get_frame_base (fi) + adjust + -dummy->extra_info->stack_size;
}
}
{
int adjust = saved_regs_size (fi);
- return (read_memory_integer (fi->frame + adjust, REGISTER_SIZE));
+ return (read_memory_integer (get_frame_base (fi) + adjust, REGISTER_SIZE));
}
/* Function: mn10300_init_extra_frame_info
if (inside_entry_file (get_frame_pc (frame)))
return 0;
- return (read_memory_integer (frame->frame, 4));
+ return (read_memory_integer (get_frame_base (frame), 4));
}
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return (ns32k_sigtramp_saved_pc (frame)); /* XXXJRT */
- return (read_memory_integer (frame->frame + 4, 4));
+ return (read_memory_integer (get_frame_base (frame) + 4, 4));
}
static CORE_ADDR
ns32k_frame_args_address (struct frame_info *frame)
{
if (ns32k_get_enter_addr (get_frame_pc (frame)) > 1)
- return (frame->frame);
+ return (get_frame_base (frame));
return (read_register (SP_REGNUM) - 4);
}
static CORE_ADDR
ns32k_frame_locals_address (struct frame_info *frame)
{
- return (frame->frame);
+ return (get_frame_base (frame));
}
/* Code to initialize the addresses of the saved registers of frame described
{
regmask = read_memory_integer (enter_addr + 1, 1) & 0xff;
localcount = ns32k_localcount (enter_addr);
- next_addr = frame->frame + localcount;
+ next_addr = get_frame_base (frame) + localcount;
for (regnum = 0; regnum < 8; regnum++)
{
get_frame_saved_regs (frame)[regnum] = next_addr -= 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);
+ get_frame_saved_regs (frame)[SP_REGNUM] = get_frame_base (frame) + 4;
+ get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 4;
+ get_frame_saved_regs (frame)[FP_REGNUM] = read_memory_integer (get_frame_base (frame), 4);
}
else if (enter_addr == 1)
{
CORE_ADDR fp;
int regnum;
- fp = frame->frame;
+ fp = get_frame_base (frame);
FRAME_INIT_SAVED_REGS (frame);
for (regnum = 0; regnum < 8; regnum++)
save_link_regidx = subtract_sp_regidx = 0;
if (fextra_info)
{
- if (fi && fi->frame)
+ if (fi && get_frame_base (fi))
{
- orig_sp = fi->frame;
+ orig_sp = get_frame_base (fi);
if (! init_extra_info && fextra_info->initialised)
orig_sp += fextra_info->stack_bought;
saved_regs = get_frame_saved_regs (fi);
if (sighandler_fi)
{
if (s390_frameless_function_invocation (sighandler_fi))
- orig_sp = sighandler_fi->frame;
+ orig_sp = get_frame_base (sighandler_fi);
else
orig_sp = ADDR_BITS_REMOVE ((CORE_ADDR)
- read_memory_integer (sighandler_fi->
- frame,
+ read_memory_integer (get_frame_base (sighandler_fi),
S390_GPR_SIZE));
if (orig_sp && sigcaller_pc)
{
{
/* Apparently gdb already knows gdb_args_offset itself */
- return fi->frame;
+ return get_frame_base (fi);
}
if (fi->extra_info && fi->extra_info->saved_pc_valid)
return fi->extra_info->saved_pc;
- if (deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame))
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, S390_PC_REGNUM);
+ if (deprecated_generic_find_dummy_frame (get_frame_pc (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), S390_PC_REGNUM);
s390_frame_init_saved_regs (fi);
if (fi->extra_info)
{
CORE_ADDR prev_fp = 0;
- if (deprecated_generic_find_dummy_frame (get_frame_pc (thisframe), thisframe->frame))
- return deprecated_read_register_dummy (get_frame_pc (thisframe), thisframe->frame,
+ if (deprecated_generic_find_dummy_frame (get_frame_pc (thisframe),
+ get_frame_base (thisframe)))
+ return deprecated_read_register_dummy (get_frame_pc (thisframe),
+ get_frame_base (thisframe),
S390_SP_REGNUM);
else
{
static CORE_ADDR
sh_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame; /* dummy frame same as caller's frame */
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ 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);
else
static CORE_ADDR
sh64_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
- return frame->frame; /* dummy frame same as caller's frame */
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ 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)))
{
int media_mode = pc_is_isa32 (get_frame_pc (frame));
sh_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
/* When the caller requests PR from the dummy frame, we return PC because
that's where the previous routine appears to have done a call from. */
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
int media_mode = 0;
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
/* When the caller requests PR from the dummy frame, we return PC because
that's where the previous routine appears to have done a call from. */
- return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, pr_regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), pr_regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi),
+ get_frame_base (fi));
if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
if (rn == FP_REGNUM)
have_fp = 1;
- get_frame_saved_regs (fi)[rn] = fi->frame - where[rn] + depth - 4;
+ get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - where[rn] + depth - 4;
}
else
{
}
else
{
- get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame - 4;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
int insn_size;
int gdb_register_number;
int register_number;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi));
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (get_frame_saved_regs (fi) == NULL)
/* Watch out! saved_regs is only for the real registers, and
doesn't include space for the pseudo registers. */
- get_frame_saved_regs (fi)[register_number]= fi->frame - where[rn] + depth;
+ get_frame_saved_regs (fi)[register_number]= get_frame_base (fi) - where[rn] + depth;
}
else
get_frame_saved_regs (fi)[sp_regnum] = read_memory_integer (get_frame_saved_regs (fi)[fp_regnum], size);
}
else
- get_frame_saved_regs (fi)[sp_regnum] = fi->frame;
+ get_frame_saved_regs (fi)[sp_regnum] = get_frame_base (fi);
fi->extra_info->f_offset = depth - where[fp_regnum];
}
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi));
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (get_frame_saved_regs (fi) == NULL)
if (rn == FP_REGNUM)
have_fp = 1;
- get_frame_saved_regs (fi)[rn] = fi->frame - where[rn] + depth - 4;
+ get_frame_saved_regs (fi)[rn] = get_frame_base (fi) - where[rn] + depth - 4;
}
else
{
}
else
{
- get_frame_saved_regs (fi)[SP_REGNUM] = fi->frame - 4;
+ get_frame_saved_regs (fi)[SP_REGNUM] = get_frame_base (fi) - 4;
}
fi->extra_info->f_offset = depth - where[FP_REGNUM] - 4;
if (fi->next)
deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (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), fi->frame,
+ 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),
- fi->frame,
+ get_frame_base (fi),
PC_REGNUM);
fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
fi->extra_info->leaf_function = 0;
if (fi->next)
deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (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), fi->frame,
- SP_REGNUM));
+ 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), fi->frame, PC_REGNUM);
+ 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;
return;
while (frame && ((frame = frame->next) != NULL))
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
{
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
if (raw_buffer)
memcpy (raw_buffer,
- (deprecated_generic_find_dummy_frame (get_frame_pc (frame), frame->frame)
+ (deprecated_generic_find_dummy_frame (get_frame_pc (frame), get_frame_base (frame))
+ REGISTER_BYTE (regnum)),
REGISTER_RAW_SIZE (regnum));
return;
register CORE_ADDR fp;
register int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
int media_mode = pc_is_isa32 (get_frame_pc (frame));
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
fi->extra_info->bottom =
(fi->next ?
- (fi->frame == fi->next->frame ? fi->next->extra_info->bottom :
- fi->next->frame) : read_sp ());
+ (get_frame_base (fi) == get_frame_base (fi->next) ? fi->next->extra_info->bottom :
+ get_frame_base (fi->next)) : read_sp ());
/* If fi->next is NULL, then we already set ->frame by passing read_fp()
to create_new_frame. */
get_saved_register (buf, 0, 0, fi, FP_REGNUM, 0);
deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (FP_REGNUM)));
- if (GDB_TARGET_IS_SPARC64 && (fi->frame & 1))
- deprecated_update_frame_base_hack (fi, fi->frame + 2047);
+ if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
}
}
get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0);
deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (I7_REGNUM)));
- if (GDB_TARGET_IS_SPARC64 && (fi->frame & 1))
- deprecated_update_frame_base_hack (fi, fi->frame + 2047);
+ if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
/* Record where the fp got saved. */
fi->extra_info->fp_addr =
- fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
/* Also try to collect where the pc got saved to. */
fi->extra_info->pc_addr = 0;
&& X_OP3 (insn) == 4
&& X_RS1 (insn) == 14)
fi->extra_info->pc_addr =
- fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
}
}
else
}
}
}
- if (fi->next && fi->frame == 0)
+ if (fi->next && get_frame_base (fi) == 0)
{
/* Kludge to cause init_prev_frame_info to destroy the new frame. */
- deprecated_update_frame_base_hack (fi, fi->next->frame);
+ deprecated_update_frame_base_hack (fi, get_frame_base (fi->next));
deprecated_update_frame_pc_hack (fi, get_frame_pc (fi->next));
}
}
{
if (saved_regs && X_I (insn))
saved_regs[X_RD (insn)] =
- fi->frame + fi->extra_info->sp_offset + X_SIMM13 (insn);
+ get_frame_base (fi) + fi->extra_info->sp_offset + X_SIMM13 (insn);
}
else
break;
The window registers are saved on the stack, just like in a
normal frame. */
if (regnum >= G1_REGNUM && regnum < G1_REGNUM + 7)
- addr = frame1->frame + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
+ addr = get_frame_base (frame1) + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE);
else if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
/* NOTE: cagney/2002-05-04: The call to get_prev_frame()
+ (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_L0);
else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
- addr = frame1->frame + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE
+ addr = get_frame_base (frame1) + (regnum - O0_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 16 * SPARC_INTREG_SIZE);
else if (SPARC_HAS_FPU &&
regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32)
- addr = frame1->frame + (regnum - FP0_REGNUM) * 4
+ addr = get_frame_base (frame1) + (regnum - FP0_REGNUM) * 4
- (FP_REGISTER_BYTES);
else if (GDB_TARGET_IS_SPARC64 && SPARC_HAS_FPU &&
regnum >= FP0_REGNUM + 32 && regnum < FP_MAX_REGNUM)
- addr = frame1->frame + 32 * 4 + (regnum - FP0_REGNUM - 32) * 8
+ addr = get_frame_base (frame1) + 32 * 4 + (regnum - FP0_REGNUM - 32) * 8
- (FP_REGISTER_BYTES);
else if (regnum >= Y_REGNUM && regnum < NUM_REGS)
- addr = frame1->frame + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
+ addr = get_frame_base (frame1) + (regnum - Y_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 24 * SPARC_INTREG_SIZE);
}
else if (frame1->extra_info->flat)
read_memory_integer (fsr[O0_REGNUM + 7],
SPARC_INTREG_SIZE));
- write_sp (frame->frame);
+ write_sp (get_frame_base (frame));
}
else if (fsr[I0_REGNUM])
{
v850_find_callers_reg (struct frame_info *fi, int regnum)
{
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);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), 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));
if (pi.framereg == E_FP_RAW_REGNUM)
return v850_find_callers_reg (fi, pi.framereg);
- return fi->frame - pi.frameoffset;
+ return get_frame_base (fi) - pi.frameoffset;
}
/* Function: skip_prologue
struct frame_info *frame = get_current_frame ();
int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
generic_pop_dummy_frame ();
else
{
CORE_ADDR
v850_frame_saved_pc (struct frame_info *fi)
{
- 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, E_PC_REGNUM);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), E_PC_REGNUM);
else
return v850_find_callers_reg (fi, E_RP_REGNUM);
}
/* The call dummy doesn't save any registers on the stack, so we
can return now. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
return;
/* Find the beginning of this function, so we can analyze its
for (pifsr = pifsrs; pifsr->framereg; pifsr++)
{
- get_frame_saved_regs (fi)[pifsr->reg] = pifsr->offset + fi->frame;
+ get_frame_saved_regs (fi)[pifsr->reg] = pifsr->offset + get_frame_base (fi);
if (pifsr->framereg == E_SP_REGNUM)
get_frame_saved_regs (fi)[pifsr->reg] += pi.frameoffset;
frame_saved_regs_zalloc (frame);
- regmask = read_memory_integer (frame->frame + 4, 4) >> 16;
+ regmask = read_memory_integer (get_frame_base (frame) + 4, 4) >> 16;
- next_addr = frame->frame + 16;
+ next_addr = get_frame_base (frame) + 16;
/* regmask's low bit is for register 0, which is the first one
what would be pushed. */
get_frame_saved_regs (frame)[SP_REGNUM] +=
4 + (4 * read_memory_integer (next_addr + 4, 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_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 16;
+ get_frame_saved_regs (frame)[FP_REGNUM] = get_frame_base (frame) + 12;
+ get_frame_saved_regs (frame)[VAX_AP_REGNUM] = get_frame_base (frame) + 8;
+ get_frame_saved_regs (frame)[PS_REGNUM] = get_frame_base (frame) + 4;
}
/* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp. */
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return (vax_sigtramp_saved_pc (frame)); /* XXXJRT */
- return (read_memory_integer (frame->frame + 16, 4));
+ return (read_memory_integer (get_frame_base (frame) + 16, 4));
}
CORE_ADDR
we don't know the address of the arglist) if we don't know what frame
this frame calls. */
if (frame->next)
- return (read_memory_integer (frame->next->frame + 8, 4));
+ return (read_memory_integer (get_frame_base (frame->next) + 8, 4));
return (0);
}
just say "I don't know". This is sometimes wrong for functions
that aren't on top of the stack, but c'est la vie. */
if (frame->next)
- return (read_memory_integer (frame->next->frame + 8, 4));
+ return (read_memory_integer (get_frame_base (frame->next) + 8, 4));
return (read_register (VAX_AP_REGNUM));
}
static CORE_ADDR
vax_frame_locals_address (struct frame_info *frame)
{
- return (frame->frame);
+ return (get_frame_base (frame));
}
static int
if (inside_entry_file (get_frame_pc (frame)))
return (0);
- return (read_memory_integer (frame->frame + 12, 4));
+ return (read_memory_integer (get_frame_base (frame) + 12, 4));
}
\f
static void
/* If this isn't the top frame, the next frame must be for the
signal handler itself. The sigcontext structure is part of
the user context. */
- return frame->next->frame + LINUX_SIGINFO_SIZE +
+ return get_frame_base (frame->next) + LINUX_SIGINFO_SIZE +
LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
if (fp)
return fp;
else
- addr = fi->frame;
+ addr = get_frame_base (fi);
}
else
- addr = fi->next->frame;
+ addr = get_frame_base (fi->next);
addr += LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
if (fi == NULL)
return; /* paranoia */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
generic_pop_dummy_frame ();
}
if (fi)
{
/* In a call dummy, don't touch the frame. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
return start_addr;
/* Grab the frame-relative values of SP and FP, needed below.
{
CORE_ADDR saved_pc;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
- saved_pc = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
+ saved_pc = deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi),
E_PC_REGNUM);
}
else
static CORE_ADDR
xstormy16_frame_chain (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
{
/* Call dummy's frame is the same as caller's. */
- return fi->frame;
+ return get_frame_base (fi);
}
else
{
/* Return computed offset from this frame's fp. */
- return fi->frame - fi->extra_info->framesize;
+ return get_frame_base (fi) - fi->extra_info->framesize;
}
}
{
return chain < 0x8000 && FRAME_SAVED_PC (thisframe) >= 0x8000 &&
(thisframe->extra_info->frameless_p ||
- thisframe->frame - thisframe->extra_info->framesize == chain);
+ get_frame_base (thisframe) - thisframe->extra_info->framesize == chain);
}
/* Function: xstormy16_saved_pc_after_call