+2003-01-02 Andrew Cagney <ac131313@redhat.com>
+
+ * arm-tdep.c: Use get_frame_pc and deprecated_update_frame_pc_hack
+ frame accessor methods.
+ * alpha-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
+ * dwarf2cfi.c, h8300-tdep.c, i386-tdep.c, ia64-tdep.c: Ditto.
+ * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c, mips-tdep.c: Ditto.
+ * mn10200-tdep.c, mn10300-tdep.c, ns32k-tdep.c: Ditto.
+ * s390-tdep.c, sh-tdep.c, sparc-tdep.c, v850-tdep.c: Ditto.
+ * vax-tdep.c, x86-64-linux-tdep.c, xstormy16-tdep.c: Ditto.
+ * z8k-tdep.c: Ditto.
+
2003-01-02 Mark Kettenis <kettenis@gnu.org>
* configure.in: Remove UI_OUT configuration code.
static CORE_ADDR
alpha_saved_pc_after_call (struct frame_info *frame)
{
- CORE_ADDR pc = frame->pc;
+ CORE_ADDR pc = get_frame_pc (frame);
CORE_ADDR tmp;
alpha_extra_func_info_t proc_desc;
int pcreg;
{
/* Use proc_desc calculated in frame_chain */
alpha_extra_func_info_t proc_desc =
- frame->next ? cached_proc_desc : find_proc_desc (frame->pc, frame->next);
+ frame->next ? cached_proc_desc : find_proc_desc (get_frame_pc (frame), frame->next);
frame->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
/* This may not be quite right, if proc has a real frame register.
Get the value of the frame relative sp, procedure might have been
interrupted by a signal at it's very start. */
- else if (frame->pc == PROC_LOW_ADDR (proc_desc)
+ else if (get_frame_pc (frame) == PROC_LOW_ADDR (proc_desc)
&& !alpha_proc_desc_is_dyn_sigtramp (proc_desc))
frame->frame = read_next_frame_reg (frame->next, SP_REGNUM);
else
/* FIXME: cagney/2002-11-18: This problem will go away once
frame.c:get_prev_frame() is modified to set the frame's
type before calling functions like this. */
- find_pc_partial_function (frame->pc, &name,
+ find_pc_partial_function (get_frame_pc (frame), &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (!PC_IN_SIGTRAMP (frame->pc, name))
+ if (!PC_IN_SIGTRAMP (get_frame_pc (frame), name))
{
frame->saved_regs = (CORE_ADDR *)
frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
/* we need proc_desc to know how to restore the registers;
if it is NULL, construct (a temporary) one */
if (proc_desc == NULL)
- proc_desc = find_proc_desc (frame->pc, frame->next);
+ proc_desc = find_proc_desc (get_frame_pc (frame), frame->next);
/* Question: should we copy this proc_desc and save it in
frame->proc_desc? If we do, who will free it?
stmdb sp!, {}
sub sp, ip, #4. */
- func_start = (get_pc_function_start ((fi)->pc) + FUNCTION_START_OFFSET);
+ func_start = (get_pc_function_start (get_frame_pc (fi)) + FUNCTION_START_OFFSET);
after_prologue = SKIP_PROLOGUE (func_start);
/* There are some frameless functions whose first two instructions
/* Don't try to scan dummy frames. */
if (fi != NULL
- && DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0))
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
return;
- if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end))
+ if (find_pc_partial_function (get_frame_pc (fi), NULL, &prologue_start, &prologue_end))
{
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
if (sal.line == 0) /* no line info, use current PC */
- prologue_end = fi->pc;
+ prologue_end = get_frame_pc (fi);
else if (sal.end < prologue_end) /* next line begins after fn end */
prologue_end = sal.end; /* (probably means no prologue) */
}
16 pushes, an add, and "mv fp,sp". */
prologue_end = prologue_start + 40;
- prologue_end = min (prologue_end, fi->pc);
+ prologue_end = min (prologue_end, get_frame_pc (fi));
/* Initialize the saved register map. When register H is copied to
register L, we will put H in saved_reg[L]. */
{
int i;
- if (fi->pc == prologue_cache.pc)
+ 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;
{
int i;
- prologue_cache.pc = fi->pc;
+ 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;
fi->extra_info->frameoffset = 0;
/* Check for Thumb prologue. */
- if (arm_pc_is_thumb (fi->pc))
+ if (arm_pc_is_thumb (get_frame_pc (fi)))
{
thumb_scan_prologue (fi);
save_prologue_cache (fi);
/* Find the function prologue. If we can't find the function in
the symbol table, peek in the stack frame to find the PC. */
- if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end))
+ if (find_pc_partial_function (get_frame_pc (fi), NULL, &prologue_start, &prologue_end))
{
/* One way to find the end of the prologue (which works well
for unoptimized code) is to do the following:
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
if (sal.line == 0)
- prologue_end = fi->pc;
+ prologue_end = get_frame_pc (fi);
else if (sal.end < prologue_end)
prologue_end = sal.end;
function could be called directly. */
for (; fi; fi = fi->next)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
{
- return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
}
else if (fi->saved_regs[regnum] != 0)
{
CORE_ADDR caller_pc;
int framereg = fi->extra_info->framereg;
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 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;
- if (fi->pc < LOWEST_PC)
+ if (get_frame_pc (fi) < LOWEST_PC)
return 0;
/* If the caller is the startup code, we're at the end of the chain. */
frame register number. */
/* XXX Fixme, we should try to do this without creating a temporary
caller_fi. */
- if (arm_pc_is_thumb (caller_pc) != arm_pc_is_thumb (fi->pc))
+ if (arm_pc_is_thumb (caller_pc) != arm_pc_is_thumb (get_frame_pc (fi)))
{
struct frame_info caller_fi;
struct cleanup *old_chain;
make_cleanup (xfree, caller_fi.saved_regs);
/* Now, scan the prologue and obtain the frame register. */
- caller_fi.pc = caller_pc;
+ deprecated_update_frame_pc_hack (&caller_fi, caller_pc);
arm_scan_prologue (&caller_fi);
framereg = caller_fi.extra_info->framereg;
fi->extra_info->framereg = 0;
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
memset (fi->saved_regs, '\000', sizeof fi->saved_regs);
the sigtramp and call dummy cases. */
if (!fi->next)
sp = read_sp();
- else if (DEPRECATED_PC_IN_CALL_DUMMY (fi->next->pc, 0, 0))
+ 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 (fi->next->pc, fi->next->frame,
+ sp = deprecated_read_register_dummy (get_frame_pc (fi->next), fi->next->frame,
ARM_SP_REGNUM);
else
sp = (fi->next->frame - fi->next->extra_info->frameoffset
before calling functions like this. */
if (SIGCONTEXT_REGISTER_ADDRESS_P ()
- && ((get_frame_type (fi) == SIGTRAMP_FRAME) || PC_IN_SIGTRAMP (fi->pc, (char *)0)))
+ && ((get_frame_type (fi) == SIGTRAMP_FRAME) || PC_IN_SIGTRAMP (get_frame_pc (fi), (char *)0)))
{
for (reg = 0; reg < NUM_REGS; reg++)
- fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg);
+ fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, get_frame_pc (fi), reg);
/* FIXME: What about thumb mode? */
fi->extra_info->framereg = ARM_SP_REGNUM;
if (!fi->next)
/* This is the innermost frame? */
fi->frame = read_register (fi->extra_info->framereg);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (fi->next->pc, 0, 0))
+ 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. */
fi->frame = fi->next->frame;
arm_frame_saved_pc (struct frame_info *fi)
{
/* If a dummy frame, pull the PC out of the frame's register buffer. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0))
- return deprecated_read_register_dummy (fi->pc, fi->frame, ARM_PC_REGNUM);
+ 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);
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame - fi->extra_info->frameoffset,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame - fi->extra_info->frameoffset,
fi->frame))
{
return read_memory_integer (fi->saved_regs[ARM_PC_REGNUM],
CORE_ADDR old_SP = (frame->frame - frame->extra_info->frameoffset
+ frame->extra_info->framesize);
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
{
generic_pop_dummy_frame ();
flush_cached_frames ();
fi->extra_info->framereg = AVR_SP_REGNUM;
if (find_pc_partial_function
- (fi->pc, &name, &prologue_start, &prologue_end))
+ (get_frame_pc (fi), &name, &prologue_start, &prologue_end))
{
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
if (sal.line == 0) /* no line info, use current PC */
- prologue_end = fi->pc;
+ prologue_end = get_frame_pc (fi);
else if (sal.end < prologue_end) /* next line begins after fn end */
prologue_end = sal.end; /* (probably means no prologue) */
}
/* 19 pushes, an add, and "mv fp,sp" */
prologue_end = prologue_start + AVR_MAX_PROLOGUE_SIZE;
- prologue_end = min (prologue_end, fi->pc);
+ prologue_end = min (prologue_end, get_frame_pc (fi));
/* Search the prologue looking for instructions that set up the
frame pointer, adjust the stack pointer, and save registers. */
int reg;
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
fi->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
avr_scan_prologue (fi);
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ fi->frame = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
AVR_PC_REGNUM);
}
else if (!fi->next) /* this is the innermost frame? */
/* 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 ((fi->pc) && (fi->extra_info->is_main == 0)) /* We are not in CALL_DUMMY */
+ if ((get_frame_pc (fi)) && (fi->extra_info->is_main == 0)) /* We are not in CALL_DUMMY */
{
CORE_ADDR addr;
int i;
CORE_ADDR saddr;
struct frame_info *frame = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
{
generic_pop_dummy_frame ();
}
static CORE_ADDR
avr_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return deprecated_read_register_dummy (frame->pc, frame->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,
AVR_PC_REGNUM);
else
return frame->extra_info->return_pc;
static CORE_ADDR
avr_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
{
/* initialize the return_pc now */
frame->extra_info->return_pc
- = deprecated_read_register_dummy (frame->pc, frame->frame,
+ = deprecated_read_register_dummy (get_frame_pc (frame), frame->frame,
AVR_PC_REGNUM);
return frame->frame;
}
CORE_ADDR ip;
struct symtab_and_line sal;
int best_limit;
- char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
/* Examine the entire prologue. */
register int frameless_p = 0;
}
else
{
- ip = get_pc_function_start (fi->pc);
+ ip = get_pc_function_start (get_frame_pc (fi));
sal = find_pc_line (ip, 0);
/* If there is no symbol information then sal.end == 0, and we end up
if (fi->next)
{
/* Called from get_prev_frame. */
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
}
fi->extra_info = (struct frame_extra_info *)
fi->extra_info->return_pc = 0;
fi->extra_info->leaf_function = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ fi->frame = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
SP_REGNUM);
fi->extra_info->return_pc =
- deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, 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 (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
return fi->frame;
}
- else if (!inside_entry_file (fi->pc))
+ else if (!inside_entry_file (get_frame_pc (fi)))
{
return read_memory_unsigned_integer (get_frame_base (fi), 4);
}
register int regno;
register int stack_offset = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
/* This happens when we hit a breakpoint set at the entry point,
when returning from a dummy frame. */
{
if (chain != 0 && frame != NULL)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
return 1; /* Path back from a call dummy must be valid. */
- return ((frame)->pc > IMEM_START
- && !inside_main_func (frame->pc));
+ return (get_frame_pc (frame) > IMEM_START
+ && !inside_main_func (get_frame_pc (frame)));
}
else return 0;
}
static CORE_ADDR
d10v_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return d10v_make_iaddr (deprecated_read_register_dummy (frame->pc,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
+ return d10v_make_iaddr (deprecated_read_register_dummy (get_frame_pc (frame),
frame->frame,
PC_REGNUM));
else
CORE_ADDR addr;
/* A generic call dummy's frame is the same as caller's. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
return fi->frame;
d10v_frame_init_saved_regs (fi);
memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
next_addr = 0;
- pc = get_pc_function_start (fi->pc);
+ pc = get_pc_function_start (get_frame_pc (fi));
uses_frame = 0;
while (1)
fi->extra_info->size = 0;
fi->extra_info->return_pc = 0;
- /* If fi->pc is zero, but this is not the outermost frame,
+ /* 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
DEPRECATED_PC_IN_CALL_DUMMY will work. */
- if (fi->pc == 0 && fi->level != 0 && fi->next != NULL)
- fi->pc = d10v_frame_saved_pc (fi->next);
+ if (get_frame_pc (fi) == 0 && fi->level != 0 && fi->next != NULL)
+ deprecated_update_frame_pc_hack (fi, d10v_frame_saved_pc (fi->next));
/* The call dummy doesn't save any registers on the stack, so we can
return now. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
return;
}
}
else
{
- UNWIND_CONTEXT (fi)->ra = fi->pc + 1;
+ UNWIND_CONTEXT (fi)->ra = get_frame_pc (fi) + 1;
frame_state_for (UNWIND_CONTEXT (fi), fs);
update_context (UNWIND_CONTEXT (fi), fs, 0);
}
/* Find the beginning of this function, so we can analyze its
prologue. */
- if (find_pc_partial_function (fi->pc, NULL, &func_addr, &func_end))
+ if (find_pc_partial_function (get_frame_pc (fi), NULL, &func_addr, &func_end))
{
struct symtab_and_line sal = find_pc_line (func_addr, 0);
- CORE_ADDR limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc;
+ CORE_ADDR limit = (sal.end && sal.end < get_frame_pc (fi)) ? sal.end : get_frame_pc (fi);
/* This will fill in fields in fi. */
h8300_examine_prologue (func_addr, limit, fi->frame, fi->saved_regs, fi);
}
static CORE_ADDR
h8300_frame_chain (struct frame_info *thisframe)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe), thisframe->frame, thisframe->frame))
{ /* initialize the from_pc now */
thisframe->extra_info->from_pc =
- deprecated_read_register_dummy (thisframe->pc, thisframe->frame,
+ deprecated_read_register_dummy (get_frame_pc (thisframe), thisframe->frame,
E_PC_REGNUM);
return thisframe->frame;
}
static CORE_ADDR
h8300_frame_saved_pc (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return deprecated_read_register_dummy (frame->pc, frame->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,
E_PC_REGNUM);
else
return frame->extra_info->from_pc;
fi->extra_info->args_pointer = 0; /* Unknown */
fi->extra_info->locals_pointer = 0; /* Unknown */
- if (!fi->pc)
+ if (!get_frame_pc (fi))
{
if (fi->next)
- fi->pc = h8300_frame_saved_pc (fi->next);
+ deprecated_update_frame_pc_hack (fi, h8300_frame_saved_pc (fi->next));
}
h8300_frame_init_saved_regs (fi);
}
static CORE_ADDR
h8300_frame_locals_address (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
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 (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
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 (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
{
generic_pop_dummy_frame ();
}
{
return (frame->next && get_frame_type (frame->next) == SIGTRAMP_FRAME
&& (frameless_look_for_prologue (frame)
- || frame->pc == get_pc_function_start (frame->pc)));
+ || get_frame_pc (frame) == get_pc_function_start (get_frame_pc (frame))));
}
/* Return the chain-pointer for FRAME. In the case of the i386, the
static CORE_ADDR
i386_frame_chain (struct frame_info *frame)
{
- if (pc_in_dummy_frame (frame->pc))
+ if (pc_in_dummy_frame (get_frame_pc (frame)))
return frame->frame;
if (get_frame_type (frame) == SIGTRAMP_FRAME
|| i386_frameless_signal_p (frame))
return frame->frame;
- if (! inside_entry_file (frame->pc))
+ if (! inside_entry_file (get_frame_pc (frame)))
return read_memory_unsigned_integer (frame->frame, 4);
return 0;
static CORE_ADDR
i386_frame_saved_pc (struct frame_info *frame)
{
- if (pc_in_dummy_frame (frame->pc))
+ if (pc_in_dummy_frame (get_frame_pc (frame)))
{
ULONGEST pc;
frame_saved_regs_zalloc (fip);
- pc = get_pc_function_start (fip->pc);
+ pc = get_pc_function_start (get_frame_pc (fip));
if (pc != 0)
locals = i386_get_frame_setup (pc);
int sigcontext_offset = -1;
char *name = NULL;
- find_pc_partial_function (frame->pc, &name, NULL, NULL);
+ find_pc_partial_function (get_frame_pc (frame), &name, NULL, NULL);
if (name)
{
if (strcmp (name, "_sigreturn") == 0)
{
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return read_sigcontext_register (frame, sp_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
return frame->frame;
else
{
{
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
return read_sigcontext_register (frame, pc_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return deprecated_read_register_dummy (frame->pc, frame->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
{
FRAME_INIT_SAVED_REGS (frame);
{
CORE_ADDR func_start;
- func_start = get_pc_function_start (frame->pc);
- examine_prologue (func_start, frame->pc, frame);
+ func_start = get_pc_function_start (get_frame_pc (frame));
+ examine_prologue (func_start, get_frame_pc (frame), frame);
}
}
if (lval != NULL)
*lval = not_lval;
- is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame);
+ is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame);
if (regnum == SP_REGNUM && frame->next)
{
{
CORE_ADDR bsp, cfm;
int next_frame_is_call_dummy = ((frame->next != NULL)
- && DEPRECATED_PC_IN_CALL_DUMMY (frame->next->pc, frame->next->frame,
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame->next), frame->next->frame,
frame->next->frame));
frame->extra_info = (struct frame_extra_info *)
}
else if (next_frame_is_call_dummy)
{
- bsp = deprecated_read_register_dummy (frame->next->pc,
+ bsp = deprecated_read_register_dummy (get_frame_pc (frame->next),
frame->next->frame,
IA64_BSP_REGNUM);
- cfm = deprecated_read_register_dummy (frame->next->pc,
+ cfm = deprecated_read_register_dummy (get_frame_pc (frame->next),
frame->next->frame,
IA64_CFM_REGNUM);
}
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 (frn->next->pc, frn->next->frame,
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frn->next), frn->next->frame,
frn->next->frame))
- cfm = deprecated_read_register_dummy (frn->next->pc, frn->next->frame,
+ cfm = deprecated_read_register_dummy (get_frame_pc (frn->next), frn->next->frame,
IA64_PFS_REGNUM);
else
cfm = read_register (IA64_PFS_REGNUM);
register CORE_ADDR fp, sp;
register int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
{
{
CORE_ADDR addr;
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->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 (frame->extra_info->return_pc == 0
else
memset (fi->saved_regs, 0, sizeof (fi->saved_regs));
- pc = fi->pc;
+ pc = get_frame_pc (fi);
fi->extra_info->return_kind = m68hc11_get_return_insn (pc);
m68hc11_guess_from_prologue (pc, fi->frame, &pc, &fi->extra_info->size,
fi->saved_regs);
frame_obstack_alloc (sizeof (struct frame_extra_info));
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
m68hc11_frame_init_saved_regs (fi);
if (fromleaf)
{
- fi->extra_info->return_kind = m68hc11_get_return_insn (fi->pc);
+ fi->extra_info->return_kind = m68hc11_get_return_insn (get_frame_pc (fi));
fi->extra_info->return_pc = m68hc11_saved_pc_after_call (fi);
}
else
{
if (get_frame_type (thisframe) == SIGTRAMP_FRAME)
return thisframe->frame;
- else if (!inside_entry_file (thisframe->pc))
+ else if (!inside_entry_file (get_frame_pc (thisframe)))
return read_memory_unsigned_integer (thisframe->frame, 4);
else
return 0;
memset (frame_info->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
- if (frame_info->pc >= possible_call_dummy_start
- && frame_info->pc <= frame_info->frame)
+ if (get_frame_pc (frame_info) >= possible_call_dummy_start
+ && get_frame_pc (frame_info) <= frame_info->frame)
{
/* It is a call dummy. We could just stop now, since we know
}
else
{
- pc = get_pc_function_start (frame_info->pc);
+ pc = get_pc_function_start (get_frame_pc (frame_info));
nextinsn = read_memory_unsigned_integer (pc, 2);
if (P_PEA_FP == nextinsn
dummy->next = NULL;
dummy->prev = NULL;
- dummy->pc = pc;
+ deprecated_update_frame_pc_hack (dummy, pc);
dummy->frame = frame;
dummy->extra_info->status = 0;
dummy->extra_info->framesize = 0;
/* If provided, use the PC in the frame to look up the
start of this function. */
- pc = (fi == NULL ? pc : fi->pc);
+ pc = (fi == NULL ? pc : get_frame_pc (fi));
/* Find the start of this function. */
status = find_pc_partial_function (pc, &name, &func_addr, &func_end);
mcore_insn_debug (("MCORE: got jmp r15"));
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
/* Check for first insn of prologue */
- if (fi != NULL && fi->pc == func_addr)
+ if (fi != NULL && get_frame_pc (fi) == func_addr)
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
/* Figure out where to stop scanning */
- stop = (fi ? fi->pc : func_end);
+ stop = (fi ? get_frame_pc (fi) : func_end);
/* Don't walk off the end of the function */
stop = (stop > func_end ? func_end : stop);
{
for (; fi != NULL; fi = fi->next)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
else if (fi->saved_regs[regnum] != 0)
return read_memory_integer (fi->saved_regs[regnum],
REGISTER_SIZE);
mcore_frame_saved_pc (struct frame_info * fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ 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);
else
return mcore_find_callers_reg (fi, PR_REGNUM);
}
int rn;
struct frame_info *fi = get_current_frame ();
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
generic_pop_dummy_frame ();
else
{
mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
if (fi && fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
frame_saved_regs_zalloc (fi);
fi->extra_info->status = 0;
fi->extra_info->framesize = 0;
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
+ fi->frame = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, SP_REGNUM);
}
else
mcore_analyze_prologue (fi, 0, 0);
/* Don't bother unless we are inside a function prologue. Outside the
prologue, we know where everything is. */
- && in_prologue (fci->pc, PROC_LOW_ADDR (proc_desc))
+ && in_prologue (get_frame_pc (fci), PROC_LOW_ADDR (proc_desc))
/* Not sure exactly what kernel_trap means, but if it means
the kernel saves the registers without a prologue doing it,
/* Scan through this function's instructions preceding the current
PC, and look for those that save registers. */
- while (addr < fci->pc)
+ while (addr < get_frame_pc (fci))
{
inst = mips_fetch_instruction (addr);
if (pc_is_mips16 (addr))
int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM
: (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM);
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), 0, 0))
{
LONGEST tmp;
frame_unwind_signed_register (frame, PC_REGNUM, &tmp);
&& !(get_frame_type (frame) == SIGTRAMP_FRAME)
/* For a generic dummy frame, let get_frame_pointer() unwind a
register value saved as part of the dummy frame call. */
- && !(DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0)))
+ && !(DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), 0, 0)))
return 0;
else
return get_frame_pointer (frame, proc_desc);
/* Use proc_desc calculated in frame_chain */
mips_extra_func_info_t proc_desc =
- fci->next ? cached_proc_desc : find_proc_desc (fci->pc, fci->next, 1);
+ fci->next ? cached_proc_desc : find_proc_desc (get_frame_pc (fci), fci->next, 1);
fci->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
/* This may not be quite right, if proc has a real frame register.
Get the value of the frame relative sp, procedure might have been
interrupted by a signal at it's very start. */
- if (fci->pc == PROC_LOW_ADDR (proc_desc)
+ if (get_frame_pc (fci) == PROC_LOW_ADDR (proc_desc)
&& !PROC_DESC_IS_DUMMY (proc_desc))
fci->frame = read_next_frame_reg (fci->next, SP_REGNUM);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (fci->pc, 0, 0))
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fci), 0, 0))
/* Do not ``fix'' fci->frame. It will have the value of the
generic dummy frame's top-of-stack (since the draft
fci->frame is obtained by returning the unwound stack
/* FIXME: cagney/2002-11-18: This problem will go away once
frame.c:get_prev_frame() is modified to set the frame's
type before calling functions like this. */
- find_pc_partial_function (fci->pc, &name,
+ find_pc_partial_function (get_frame_pc (fci), &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (!PC_IN_SIGTRAMP (fci->pc, name))
+ if (!PC_IN_SIGTRAMP (get_frame_pc (fci), name))
{
frame_saved_regs_zalloc (fci);
memcpy (fci->saved_regs, temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
CORE_ADDR new_sp = get_frame_base (frame);
mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), 0, 0))
{
generic_pop_dummy_frame ();
flush_cached_frames ();
/* Use the PC in the frame if it's provided to look up the
start of this function. */
- pc = (fi ? fi->pc : pc);
+ pc = (fi ? get_frame_pc (fi) : pc);
/* Find the start of this function. */
status = find_pc_partial_function (pc, &name, &func_addr, &func_end);
been deallocated.
fi->frame is bogus, we need to fix it. */
- if (fi && fi->pc + 1 == func_end)
+ if (fi && get_frame_pc (fi) + 1 == func_end)
{
- status = target_read_memory (fi->pc, buf, 1);
+ status = target_read_memory (get_frame_pc (fi), buf, 1);
if (status != 0)
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
if (buf[0] == 0xfe)
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
}
/* Similarly if we're stopped on the first insn of a prologue as our
frame hasn't been allocated yet. */
- if (fi && fi->pc == func_addr)
+ if (fi && get_frame_pc (fi) == func_addr)
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
/* Figure out where to stop scanning. */
- stop = fi ? fi->pc : func_end;
+ stop = fi ? get_frame_pc (fi) : func_end;
/* Don't walk off the end of the function. */
stop = stop > func_end ? func_end : stop;
So we set up a dummy frame and call mn10200_analyze_prologue to
find stuff for us. */
- dummy_frame.pc = FRAME_SAVED_PC (fi);
+ deprecated_update_frame_pc_hack (&dummy_frame, FRAME_SAVED_PC (fi));
dummy_frame.frame = fi->frame;
memset (dummy_frame.fsr.regs, '\000', sizeof dummy_frame.fsr.regs);
dummy_frame.status = 0;
{
int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
{
registers. Most of the work is done in mn10200_analyze_prologue().
Note that when we are called for the last frame (currently active frame),
- that fi->pc and fi->frame will already be setup. However, fi->frame will
+ that get_frame_pc (fi) and fi->frame will already be setup. However, fi->frame will
be valid only if this routine uses FP. For previous frames, fi-frame will
always be correct. mn10200_analyze_prologue will fix fi->frame if
it's not valid.
mn10200_init_extra_frame_info (struct frame_info *fi)
{
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs);
fi->status = 0;
}
dummy->next = NULL;
dummy->prev = NULL;
- dummy->pc = pc;
+ deprecated_update_frame_pc_hack (dummy, pc);
dummy->frame = frame;
dummy->extra_info->status = 0;
dummy->extra_info->stack_size = 0;
/* Use the PC in the frame if it's provided to look up the
start of this function. */
- pc = (fi ? fi->pc : pc);
+ pc = (fi ? get_frame_pc (fi) : pc);
/* Find the start of this function. */
status = find_pc_partial_function (pc, &name, &func_addr, &func_end);
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
/* Similarly if we're stopped on the first insn of a prologue as our
frame hasn't been allocated yet. */
- if (fi && fi->pc == func_addr)
+ if (fi && get_frame_pc (fi) == func_addr)
{
if (fi->next == NULL)
fi->frame = read_sp ();
- return fi->pc;
+ return get_frame_pc (fi);
}
/* Figure out where to stop scanning. */
- stop = fi ? fi->pc : func_end;
+ stop = fi ? get_frame_pc (fi) : func_end;
/* Don't walk off the end of the function. */
stop = stop > func_end ? func_end : stop;
registers. Most of the work is done in mn10300_analyze_prologue().
Note that when we are called for the last frame (currently active frame),
- that fi->pc and fi->frame will already be setup. However, fi->frame will
+ that get_frame_pc (fi) and fi->frame will already be setup. However, fi->frame will
be valid only if this routine uses FP. For previous frames, fi-frame will
always be correct. mn10300_analyze_prologue will fix fi->frame if
it's not valid.
mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
frame_saved_regs_zalloc (fi);
fi->extra_info = (struct frame_extra_info *)
int width;
numargs = -1;
- enter_addr = ns32k_get_enter_addr ((fi)->pc);
+ enter_addr = ns32k_get_enter_addr (get_frame_pc (fi));
if (enter_addr > 0)
{
pc = ((enter_addr == 1)
FP value, and that address is saved at the previous FP value as a
4-byte word. */
- if (inside_entry_file (frame->pc))
+ if (inside_entry_file (get_frame_pc (frame)))
return 0;
return (read_memory_integer (frame->frame, 4));
static CORE_ADDR
ns32k_frame_args_address (struct frame_info *frame)
{
- if (ns32k_get_enter_addr (frame->pc) > 1)
+ if (ns32k_get_enter_addr (get_frame_pc (frame)) > 1)
return (frame->frame);
return (read_register (SP_REGNUM) - 4);
frame_saved_regs_zalloc (frame);
- enter_addr = ns32k_get_enter_addr (frame->pc);
+ enter_addr = ns32k_get_enter_addr (get_frame_pc (frame));
if (enter_addr > 1)
{
regmask = read_memory_integer (enter_addr + 1, 1) & 0xff;
if (fi->extra_info && fi->extra_info->initialised)
function_start = fi->extra_info->function_start;
- else if (fi->pc)
- function_start = get_pc_function_start (fi->pc);
+ else if (get_frame_pc (fi))
+ function_start = get_pc_function_start (get_frame_pc (fi));
return function_start;
}
else
{
fextra_info_ptr = &fextra_info;
- s390_get_frame_info (s390_sniff_pc_function_start (fi->pc, fi),
+ s390_get_frame_info (s390_sniff_pc_function_start (get_frame_pc (fi), fi),
fextra_info_ptr, fi, 1);
}
frameless = ((fextra_info_ptr->stack_bought == 0));
s390_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
fi->extra_info = frame_obstack_alloc (sizeof (struct frame_extra_info));
- if (fi->pc)
- s390_get_frame_info (s390_sniff_pc_function_start (fi->pc, fi),
+ if (get_frame_pc (fi))
+ s390_get_frame_info (s390_sniff_pc_function_start (get_frame_pc (fi), fi),
fi->extra_info, fi, 1);
else
s390_memset_extra_info (fi->extra_info);
{
/* zalloc memsets the saved regs */
frame_saved_regs_zalloc (fi);
- if (fi->pc)
+ 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 (fi->pc, fi),
+ s390_sniff_pc_function_start (get_frame_pc (fi), fi),
fi->extra_info, fi, !quick);
}
}
if (fi->extra_info && fi->extra_info->saved_pc_valid)
return fi->extra_info->saved_pc;
- if (deprecated_generic_find_dummy_frame (fi->pc, fi->frame))
- return deprecated_read_register_dummy (fi->pc, fi->frame, S390_PC_REGNUM);
+ 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);
s390_frame_init_saved_regs (fi);
if (fi->extra_info)
{
CORE_ADDR prev_fp = 0;
- if (deprecated_generic_find_dummy_frame (thisframe->pc, thisframe->frame))
- return deprecated_read_register_dummy (thisframe->pc, thisframe->frame,
+ if (deprecated_generic_find_dummy_frame (get_frame_pc (thisframe), thisframe->frame))
+ return deprecated_read_register_dummy (get_frame_pc (thisframe), thisframe->frame,
S390_SP_REGNUM);
else
{
struct frame_extra_info prev_fextra_info;
memset (&prev_fextra_info, 0, sizeof (prev_fextra_info));
- if (thisframe->pc)
+ if (get_frame_pc (thisframe))
{
CORE_ADDR saved_pc, sig_pc;
static CORE_ADDR
sh_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->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 (frame->pc && !inside_entry_file (frame->pc))
+ 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
return 0;
static CORE_ADDR
sh64_frame_chain (struct frame_info *frame)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->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 (frame->pc && !inside_entry_file (frame->pc))
+ if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
{
- int media_mode = pc_is_isa32 (frame->pc);
+ int media_mode = pc_is_isa32 (get_frame_pc (frame));
int size;
if (gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
size = 4;
sh_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
/* 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 (fi->pc, fi->frame, regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
- if (!fi->pc)
+ if (!get_frame_pc (fi))
return 0;
if (fi->saved_regs[regnum] != 0)
return read_memory_integer (fi->saved_regs[regnum],
int media_mode = 0;
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
/* 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 (fi->pc, fi->frame, pr_regnum);
+ return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, pr_regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
- if (!fi->pc)
+ if (!get_frame_pc (fi))
return 0;
- media_mode = pc_is_isa32 (fi->pc);
+ media_mode = pc_is_isa32 (get_frame_pc (fi));
if (fi->saved_regs[pr_regnum] != 0)
{
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
if (fi->saved_regs == NULL)
frame_saved_regs_zalloc (fi);
that does not appear to be part of the prologue. But give up
after 20 of them, since we're getting silly then. */
- pc = get_pc_function_start (fi->pc);
+ pc = get_pc_function_start (get_frame_pc (fi));
if (!pc)
{
- fi->pc = 0;
+ deprecated_update_frame_pc_hack (fi, 0);
return;
}
int insn_size;
int gdb_register_number;
int register_number;
- char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (fi->saved_regs == NULL)
that does not appear to be part of the prologue. But give up
after 20 of them, since we're getting silly then. */
- pc = get_pc_function_start (fi->pc);
+ pc = get_pc_function_start (get_frame_pc (fi));
if (!pc)
{
- fi->pc = 0;
+ deprecated_update_frame_pc_hack (fi, 0);
return;
}
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (fi->saved_regs == NULL)
that does not appear to be part of the prologue. But give up
after 20 of them, since we're getting silly then. */
- pc = get_pc_function_start (fi->pc);
+ pc = get_pc_function_start (get_frame_pc (fi));
if (!pc)
{
- fi->pc = 0;
+ deprecated_update_frame_pc_hack (fi, 0);
return;
}
frame_obstack_alloc (sizeof (struct frame_extra_info));
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ fi->frame = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
SP_REGNUM);
- fi->extra_info->return_pc = deprecated_read_register_dummy (fi->pc,
+ fi->extra_info->return_pc = deprecated_read_register_dummy (get_frame_pc (fi),
fi->frame,
PC_REGNUM);
fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
static void
sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
- int media_mode = pc_is_isa32 (fi->pc);
+ int media_mode = pc_is_isa32 (get_frame_pc (fi));
fi->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
- if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ if (fi->next)
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ fi->frame = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
SP_REGNUM);
fi->extra_info->return_pc =
- deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, PC_REGNUM);
fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
fi->extra_info->leaf_function = 0;
return;
but we are in compact mode, it will become the corresponding
compact pseudo register. If there is no corresponding compact
pseudo-register what do we do?*/
- media_mode = pc_is_isa32 (frame->pc);
+ media_mode = pc_is_isa32 (get_frame_pc (frame));
live_regnum = translate_insn_rn (regnum, media_mode);
/* Note: since the current frame's registers could only have been
while (frame && ((frame = frame->next) != NULL))
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
{
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
if (raw_buffer)
memcpy (raw_buffer,
- (deprecated_generic_find_dummy_frame (frame->pc, frame->frame)
+ (deprecated_generic_find_dummy_frame (get_frame_pc (frame), frame->frame)
+ REGISTER_BYTE (regnum)),
REGISTER_RAW_SIZE (regnum));
return;
register CORE_ADDR fp;
register int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
{
register int regnum;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- int media_mode = pc_is_isa32 (frame->pc);
+ int media_mode = pc_is_isa32 (get_frame_pc (frame));
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
{
static void
sh64_show_regs (void)
{
- if (pc_is_isa32 (deprecated_selected_frame->pc))
+ if (pc_is_isa32 (get_frame_pc (deprecated_selected_frame)))
sh64_show_media_regs ();
else
sh64_show_compact_regs ();
void
sh64_do_registers_info (int regnum, int fpregs)
{
- if (pc_is_isa32 (deprecated_selected_frame->pc))
+ if (pc_is_isa32 (get_frame_pc (deprecated_selected_frame)))
sh_do_registers_info (regnum, fpregs);
else
sh_compact_do_registers_info (regnum, fpregs);
frame. For such functions, the frame pointer is actually in %i7. */
fi->extra_info->flat = 0;
fi->extra_info->in_prologue = 0;
- if (find_pc_partial_function (fi->pc, &name, &prologue_start, &prologue_end))
+ 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
negative number if a flat frame) to the sp. FIXME: Does not
sal = find_pc_line (prologue_start, 0);
if (sal.line == 0) /* no line info, use PC */
- prologue_end = fi->pc;
+ prologue_end = get_frame_pc (fi);
else if (sal.end < prologue_end)
prologue_end = sal.end;
- if (fi->pc < prologue_end)
+ if (get_frame_pc (fi) < prologue_end)
{
- for (addr = prologue_start; addr < fi->pc; addr += 4)
+ for (addr = prologue_start; addr < get_frame_pc (fi); addr += 4)
{
insn = read_memory_integer (addr, 4);
if (X_OP (insn) == 2 && X_OP3 (insn) == 0x3c)
break; /* SAVE seen, stop searching */
}
- if (addr >= fi->pc)
+ if (addr >= get_frame_pc (fi))
{
fi->extra_info->in_prologue = 1;
fi->frame = read_register (SP_REGNUM);
{
/* Kludge to cause init_prev_frame_info to destroy the new frame. */
fi->frame = fi->next->frame;
- fi->pc = fi->next->pc;
+ deprecated_update_frame_pc_hack (fi, get_frame_pc (fi->next));
}
}
/* Solaris2 ucbsigvechandler passes a pointer to a sigcontext
as the third parameter. The offset to the saved pc is 12. */
- find_pc_partial_function (frame->pc, &name,
+ find_pc_partial_function (get_frame_pc (frame), &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
if (name && STREQ (name, "ucbsigvechandler"))
saved_pc_offset = 12;
"create_new_frame returned invalid frame");
frame->extra_info->bottom = argv[1];
- frame->pc = FRAME_SAVED_PC (frame);
+ deprecated_update_frame_pc_hack (frame, FRAME_SAVED_PC (frame));
return frame;
}
if (raw_buffer != NULL)
{
/* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->pc);
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), get_frame_pc (frame));
}
if (addrp != NULL)
*addrp = 0;
{
/* FIXME MVS: wrong test for dummy frame at entry. */
- if (frame1->pc >= (frame1->extra_info->bottom ?
+ if (get_frame_pc (frame1) >= (frame1->extra_info->bottom ?
frame1->extra_info->bottom : read_sp ())
- && frame1->pc <= get_frame_base (frame1))
+ && get_frame_pc (frame1) <= get_frame_base (frame1))
{
/* Dummy frame. All but the window regs are in there somewhere.
The window registers are saved on the stack, just like in a
regs = alloca (NUM_REGS * sizeof (CORE_ADDR));
memset (regs, 0, NUM_REGS * sizeof (CORE_ADDR));
- find_pc_partial_function (frame1->pc, NULL, &func_start, NULL);
+ find_pc_partial_function (get_frame_pc (frame1), NULL, &func_start, NULL);
examine_prologue (func_start, 0, frame1, regs);
addr = regs[regnum];
}
memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR));
- if (fi->pc >= (fi->extra_info->bottom ?
+ if (get_frame_pc (fi) >= (fi->extra_info->bottom ?
fi->extra_info->bottom : read_sp ())
- && fi->pc <= get_frame_base (fi))
+ && get_frame_pc (fi) <= get_frame_base (fi))
{
/* Dummy frame. All but the window regs are in there somewhere. */
for (regnum = G1_REGNUM; regnum < G1_REGNUM + 7; regnum++)
else if (fi->extra_info->flat)
{
CORE_ADDR func_start;
- find_pc_partial_function (fi->pc, NULL, &func_start, NULL);
+ 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. */
v850_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = fi->next)
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
+ return deprecated_read_register_dummy (get_frame_pc (fi), fi->frame, regnum);
else if (fi->saved_regs[regnum] != 0)
return read_memory_unsigned_integer (fi->saved_regs[regnum],
v850_register_raw_size (regnum));
struct frame_info *frame = get_current_frame ();
int regnum;
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
{
CORE_ADDR
v850_frame_saved_pc (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return deprecated_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM);
+ 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);
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 (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
return;
/* Find the beginning of this function, so we can analyze its
prologue. */
- if (find_pc_partial_function (fi->pc, NULL, &func_addr, &func_end))
+ if (find_pc_partial_function (get_frame_pc (fi), NULL, &func_addr, &func_end))
{
pi.pifsrs = pifsrs;
- v850_scan_prologue (fi->pc, &pi);
+ v850_scan_prologue (get_frame_pc (fi), &pi);
if (!fi->next && pi.framereg == E_SP_REGNUM)
fi->frame = read_register (pi.framereg) - pi.frameoffset;
registers. Most of the work is done in scan_prologue().
Note that when we are called for the last frame (currently active frame),
- that fi->pc and fi->frame will already be setup. However, fi->frame will
+ that get_frame_pc (fi) and fi->frame will already be setup. However, fi->frame will
be valid only if this routine uses FP. For previous frames, fi-frame will
always be correct (since that is derived from v850_frame_chain ()).
struct prologue_info pi;
if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
v850_frame_init_saved_regs (fi);
}
{
/* In the case of the VAX, the frame's nominal address is the FP value,
and 12 bytes later comes the saved previous FP value as a 4-byte word. */
- if (inside_entry_file (frame->pc))
+ if (inside_entry_file (get_frame_pc (frame)))
return (0);
return (read_memory_integer (frame->frame + 12, 4));
CORE_ADDR pc;
ULONGEST rsp;
- pc = x86_64_linux_sigtramp_start (frame->pc);
+ pc = x86_64_linux_sigtramp_start (get_frame_pc (frame));
if (pc)
{
if (frame->next)
if (fi == NULL)
return; /* paranoia */
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
generic_pop_dummy_frame ();
}
if (fi)
{
/* In a call dummy, don't touch the frame. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
return start_addr;
/* Grab the frame-relative values of SP and FP, needed below.
/* Find the beginning of this function, so we can analyze its
prologue. */
- if (find_pc_partial_function (fi->pc, NULL, &func_addr, &func_end))
- xstormy16_scan_prologue (func_addr, fi->pc, fi, NULL);
+ if (find_pc_partial_function (get_frame_pc (fi), NULL, &func_addr, &func_end))
+ xstormy16_scan_prologue (func_addr, get_frame_pc (fi), fi, NULL);
/* Else we're out of luck (can't debug completely stripped code).
FIXME. */
}
{
CORE_ADDR saved_pc;
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
- saved_pc = deprecated_read_register_dummy (fi->pc, fi->frame,
+ saved_pc = deprecated_read_register_dummy (get_frame_pc (fi), fi->frame,
E_PC_REGNUM);
}
else
or we may be in the prologue, before the FP has been set up.
Unfortunately, we can't make this determination without first
calling scan_prologue, and we can't do that unles we know the
- fi->pc. */
+ get_frame_pc (fi). */
- if (!fi->pc)
+ if (!get_frame_pc (fi))
{
/* Sometimes we are called from get_prev_frame without
the PC being set up first. Long history, don't ask.
frame, so we should be able to get the saved pc from
the next frame. */
if (fi->next)
- fi->pc = xstormy16_frame_saved_pc (fi->next);
+ deprecated_update_frame_pc_hack (fi, xstormy16_frame_saved_pc (fi->next));
}
/* Take care of the saved_regs right here (non-lazy). */
static CORE_ADDR
xstormy16_frame_chain (struct frame_info *fi)
{
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), fi->frame, fi->frame))
{
/* Call dummy's frame is the same as caller's. */
return fi->frame;
CORE_ADDR
z8k_frame_chain (struct frame_info *thisframe)
{
- if (!inside_entry_file (thisframe->pc))
+ if (!inside_entry_file (get_frame_pc (thisframe)))
{
return read_memory_pointer (thisframe->frame);
}
int w;
frame_saved_regs_zalloc (frame_info);
- pc = get_pc_function_start (frame_info->pc);
+ pc = get_pc_function_start (get_frame_pc (frame_info));
/* wander down the instruction stream */
examine_frame (pc, frame_info->saved_regs, frame_info->frame);
memset (fsrp, 0, sizeof *fsrp);
- pc = skip_adjust (get_pc_function_start (fip->pc), &locals);
+ pc = skip_adjust (get_pc_function_start (get_frame_pc (fip)), &locals);
{
adr = get_frame_base (fip) - locals;