static CORE_ADDR branch_dest (int opcode, int instr, CORE_ADDR pc,
CORE_ADDR safety);
-static CORE_ADDR skip_prologue (CORE_ADDR, struct rs6000_framedata *);
+static CORE_ADDR skip_prologue (CORE_ADDR, CORE_ADDR,
+ struct rs6000_framedata *);
static void frame_get_saved_regs (struct frame_info * fi,
struct rs6000_framedata * fdatap);
static CORE_ADDR frame_initial_stack_address (struct frame_info *);
rs6000_skip_prologue (CORE_ADDR pc)
{
struct rs6000_framedata frame;
- pc = skip_prologue (pc, &frame);
+ pc = skip_prologue (pc, 0, &frame);
return pc;
}
#define GET_SRC_REG(x) (((x) >> 21) & 0x1f)
static CORE_ADDR
-skip_prologue (CORE_ADDR pc, struct rs6000_framedata *fdata)
+skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
{
CORE_ADDR orig_pc = pc;
CORE_ADDR last_prologue_pc;
fdata->nosavedpc = 1;
pc -= 4;
- for (;;)
+ while (lim_pc == 0 || pc < lim_pc - 4)
{
pc += 4;
saved %pc value in the previous frame. */
addr = get_pc_function_start (frame->pc);
- (void) skip_prologue (addr, &fdata);
+ (void) skip_prologue (addr, frame->pc, &fdata);
wordsize = TDEP->wordsize;
if (fdata.frameless)
return 0;
}
- (void) skip_prologue (func_start, &fdata);
+ (void) skip_prologue (func_start, fi->pc, &fdata);
return fdata.frameless;
}
if (!func_start)
return 0;
- (void) skip_prologue (func_start, &fdata);
+ (void) skip_prologue (func_start, fi->pc, &fdata);
if (fdata.lr_offset == 0 && fi->next != NULL)
{
if (fdatap == NULL)
{
fdatap = &work_fdata;
- (void) skip_prologue (get_pc_function_start (fi->pc), fdatap);
+ (void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, fdatap);
}
frame_saved_regs_zalloc (fi);
/* find out if this function is using an alloca register.. */
- (void) skip_prologue (get_pc_function_start (fi->pc), &fdata);
+ (void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, &fdata);
/* if saved registers of this frame are not known yet, read and cache them. */