* alpha-tdep.c: Use get_next_frame.
* arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
* dwarf2cfi.c, h8300-tdep.c, i386-tdep.c, ia64-tdep.c: Ditto.
* m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c: Ditto.
* mips-tdep.c, mn10200-tdep.c, mn10300-tdep.c: Ditto.
* ns32k-tdep.c, s390-tdep.c, sh-tdep.c, sparc-tdep.c: Ditto.
* v850-tdep.c, vax-tdep.c, x86-64-linux-tdep.c: Ditto.
* xstormy16-tdep.c: Ditto.
+2003-01-08 Andrew Cagney <cagney@redhat.com>
+
+ * alpha-tdep.c: Use get_next_frame.
+ * arm-tdep.c, avr-tdep.c, cris-tdep.c, d10v-tdep.c: Ditto.
+ * dwarf2cfi.c, h8300-tdep.c, i386-tdep.c, ia64-tdep.c: Ditto.
+ * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c: Ditto.
+ * mips-tdep.c, mn10200-tdep.c, mn10300-tdep.c: Ditto.
+ * ns32k-tdep.c, s390-tdep.c, sh-tdep.c, sparc-tdep.c: Ditto.
+ * v850-tdep.c, vax-tdep.c, x86-64-linux-tdep.c: Ditto.
+ * xstormy16-tdep.c: Ditto.
+
2003-01-07 Andrew Cagney <cagney@redhat.com>
* alpha-tdep.c: Use get_frame_base.
alpha_init_frame_pc_first (int fromleaf, struct frame_info *prev)
{
return (fromleaf ? SAVED_PC_AFTER_CALL (get_next_frame (prev))
- : get_next_frame (prev) ? FRAME_SAVED_PC (prev->next)
+ : get_next_frame (prev) ? FRAME_SAVED_PC (get_next_frame (prev))
: read_pc ());
}
static CORE_ADDR
read_next_frame_reg (struct frame_info *fi, int regno)
{
- for (; fi; fi = fi->next)
+ for (; fi; fi = get_next_frame (fi))
{
/* We have to get the saved sp from the sigcontext
if it is a signal handler frame. */
if (tmp != 0)
pc = tmp;
- proc_desc = find_proc_desc (pc, frame->next);
+ proc_desc = find_proc_desc (pc, get_next_frame (frame));
pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM;
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
/* Use proc_desc calculated in frame_chain */
alpha_extra_func_info_t proc_desc =
- frame->next ? cached_proc_desc : find_proc_desc (get_frame_pc (frame), frame->next);
+ get_next_frame (frame)
+ ? cached_proc_desc
+ : find_proc_desc (get_frame_pc (frame), get_next_frame (frame));
frame_extra_info_zalloc (frame, sizeof (struct frame_extra_info));
interrupted by a signal at it's very start. */
else if (get_frame_pc (frame) == PROC_LOW_ADDR (proc_desc)
&& !alpha_proc_desc_is_dyn_sigtramp (proc_desc))
- deprecated_update_frame_base_hack (frame, read_next_frame_reg (frame->next, SP_REGNUM));
+ deprecated_update_frame_base_hack (frame, read_next_frame_reg (get_next_frame (frame), SP_REGNUM));
else
- deprecated_update_frame_base_hack (frame, read_next_frame_reg (frame->next, PROC_FRAME_REG (proc_desc))
+ deprecated_update_frame_base_hack (frame, read_next_frame_reg (get_next_frame (frame), PROC_FRAME_REG (proc_desc))
+ PROC_FRAME_OFFSET (proc_desc));
if (proc_desc == &temp_proc_desc)
/* 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 (get_frame_pc (frame), frame->next);
+ proc_desc = find_proc_desc (get_frame_pc (frame), get_next_frame (frame));
/* Question: should we copy this proc_desc and save it in
frame->proc_desc? If we do, who will free it?
/* NOTE: cagney/2002-05-03: This function really shouldn't be
needed. Instead the (still being written) register unwind
function could be called directly. */
- for (; fi; fi = fi->next)
+ for (; fi; fi = get_next_frame (fi))
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
{
fi->extra_info->frameoffset = 0;
fi->extra_info->framereg = 0;
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
memset (get_frame_saved_regs (fi), '\000', sizeof get_frame_saved_regs (fi));
/* Compute stack pointer for this frame. We use this value for both
the sigtramp and call dummy cases. */
- if (!fi->next)
+ if (!get_next_frame (fi))
sp = read_sp();
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi->next), 0, 0))
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 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),
- get_frame_base (fi->next),
+ sp = deprecated_read_register_dummy (get_frame_pc (get_next_frame (fi)),
+ get_frame_base (get_next_frame (fi)),
ARM_SP_REGNUM);
else
- sp = (get_frame_base (fi->next) - fi->next->extra_info->frameoffset
- + fi->next->extra_info->framesize);
+ sp = (get_frame_base (get_next_frame (fi)) - get_next_frame (fi)->extra_info->frameoffset
+ + get_next_frame (fi)->extra_info->framesize);
/* Determine whether or not we're in a sigtramp frame.
Unfortunately, it isn't sufficient to test (get_frame_type (fi)
{
arm_scan_prologue (fi);
- if (!fi->next)
+ if (!get_next_frame (fi))
/* This is the innermost frame? */
deprecated_update_frame_base_hack (fi, read_register (fi->extra_info->framereg));
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi->next), 0, 0))
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0))
/* Next inner most frame is a dummy, just grab its frame.
Dummy frames always have the same FP as their caller. */
- deprecated_update_frame_base_hack (fi, get_frame_base (fi->next));
+ deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi)));
else if (fi->extra_info->framereg == ARM_FP_REGNUM
|| fi->extra_info->framereg == THUMB_FP_REGNUM)
{
{
int reg;
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
frame_saved_regs_zalloc (fi);
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? */
+ else if (!get_next_frame (fi)) /* this is the innermost frame? */
deprecated_update_frame_base_hack (fi, read_register (fi->extra_info->framereg));
else if (fi->extra_info->is_main != 1) /* not the innermost frame, not `main' */
/* If we have an next frame, the callee saved it. */
{
- struct frame_info *next_fi = fi->next;
+ struct frame_info *next_fi = get_next_frame (fi);
if (fi->extra_info->framereg == AVR_SP_REGNUM)
deprecated_update_frame_base_hack (fi, get_frame_base (next_fi) + 2 /* ret addr */ + next_fi->extra_info->framesize);
/* FIXME: I don't analyse va_args functions */
unsigned int fp_low, fp_high;
/* Scan all frames */
- for (; next_fi; next_fi = next_fi->next)
+ for (; next_fi; next_fi = get_next_frame (next_fi))
{
/* look for saved AVR_FP_REGNUM */
if (get_frame_saved_regs (next_fi)[AVR_FP_REGNUM] && !fp)
void
cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
- if (fi->next)
+ if (get_next_frame (fi))
{
/* Called from get_prev_frame. */
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
}
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
/* 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 (get_frame_pc (fi) == 0 && fi->level != 0 && fi->next != NULL)
- deprecated_update_frame_pc_hack (fi, d10v_frame_saved_pc (fi->next));
+ if (get_frame_pc (fi) == 0 && fi->level != 0 && get_next_frame (fi) != NULL)
+ deprecated_update_frame_pc_hack (fi, d10v_frame_saved_pc (get_next_frame (fi)));
/* The call dummy doesn't save any registers on the stack, so we can
return now. */
memset (UNWIND_CONTEXT (fi)->reg, 0,
sizeof (struct context_reg) * NUM_REGS);
- if (fi->next)
+ if (get_next_frame (fi))
{
- context_cpy (UNWIND_CONTEXT (fi), UNWIND_CONTEXT (fi->next));
+ context_cpy (UNWIND_CONTEXT (fi), UNWIND_CONTEXT (get_next_frame (fi)));
frame_state_for (UNWIND_CONTEXT (fi), fs);
update_context (UNWIND_CONTEXT (fi), fs, 1);
}
if (addrp) /* default assumption: not found in memory */
*addrp = 0;
- if (!frame->next)
+ if (!get_next_frame (frame))
{
deprecated_read_register_gen (regnum, raw_buffer);
if (lval != NULL)
}
else
{
- frame = frame->next;
+ frame = get_next_frame (frame);
switch (UNWIND_CONTEXT (frame)->reg[regnum].how)
{
case REG_CTX_UNSAVED:
if (!get_frame_pc (fi))
{
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, h8300_frame_saved_pc (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, h8300_frame_saved_pc (get_next_frame (fi)));
}
h8300_frame_init_saved_regs (fi);
}
int
i386_frameless_signal_p (struct frame_info *frame)
{
- return (frame->next && get_frame_type (frame->next) == SIGTRAMP_FRAME
+ return (get_next_frame (frame)
+ && get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME
&& (frameless_look_for_prologue (frame)
|| get_frame_pc (frame) == get_pc_function_start (get_frame_pc (frame))));
}
if (i386_frameless_signal_p (frame))
{
- CORE_ADDR sp = i386_sigtramp_saved_sp (frame->next);
+ CORE_ADDR sp = i386_sigtramp_saved_sp (get_next_frame (frame));
return read_memory_unsigned_integer (sp, 4);
}
gdb_assert (sigcontext_offset != -1);
- if (frame->next)
- return get_frame_base (frame->next) + sigcontext_offset;
+ if (get_next_frame (frame))
+ return get_frame_base (get_next_frame (frame)) + sigcontext_offset;
return read_register (SP_REGNUM) + sigcontext_offset;
}
\f
if (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM])
return read_memory_integer (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM], 8);
- else if (frame->next && (get_frame_type (frame->next) == SIGTRAMP_FRAME))
- return read_sigcontext_register (frame->next, IA64_BR0_REGNUM);
+ else if (get_next_frame (frame)
+ && (get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME))
+ return read_sigcontext_register (get_next_frame (frame), IA64_BR0_REGNUM);
else /* either frameless, or not far enough along in the prologue... */
return ia64_saved_pc_after_call (frame);
}
get_frame_base (frame),
get_frame_base (frame));
- if (regnum == SP_REGNUM && frame->next)
+ if (regnum == SP_REGNUM && get_next_frame (frame))
{
/* Handle SP values for all frames but the topmost. */
store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
else if (regnum == IA64_IP_REGNUM)
{
CORE_ADDR pc;
- if (frame->next)
+ if (get_next_frame (frame))
{
/* FIXME: Set *addrp, *lval when possible. */
- pc = ia64_frame_saved_pc (frame->next);
+ pc = ia64_frame_saved_pc (get_next_frame (frame));
}
else
{
ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
{
CORE_ADDR bsp, cfm;
- int next_frame_is_call_dummy = ((frame->next != NULL)
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame->next),
- get_frame_base (frame->next),
- get_frame_base (frame->next)));
+ int next_frame_is_call_dummy = ((get_next_frame (frame) != NULL)
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (frame)),
+ get_frame_base (get_next_frame (frame)),
+ get_frame_base (get_next_frame (frame))));
frame_extra_info_zalloc (frame, sizeof (struct frame_extra_info));
- if (frame->next == 0)
+ if (get_next_frame (frame) == 0)
{
bsp = read_register (IA64_BSP_REGNUM);
cfm = read_register (IA64_CFM_REGNUM);
}
- else if ((get_frame_type (frame->next) == SIGTRAMP_FRAME))
+ else if ((get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME))
{
- bsp = read_sigcontext_register (frame->next, IA64_BSP_REGNUM);
- cfm = read_sigcontext_register (frame->next, IA64_CFM_REGNUM);
+ bsp = read_sigcontext_register (get_next_frame (frame), IA64_BSP_REGNUM);
+ cfm = read_sigcontext_register (get_next_frame (frame), IA64_CFM_REGNUM);
}
else if (next_frame_is_call_dummy)
{
- bsp = deprecated_read_register_dummy (get_frame_pc (frame->next),
- get_frame_base (frame->next),
+ bsp = deprecated_read_register_dummy (get_frame_pc (get_next_frame (frame)),
+ get_frame_base (get_next_frame (frame)),
IA64_BSP_REGNUM);
- cfm = deprecated_read_register_dummy (get_frame_pc (frame->next),
- get_frame_base (frame->next),
+ cfm = deprecated_read_register_dummy (get_frame_pc (get_next_frame (frame)),
+ get_frame_base (get_next_frame (frame)),
IA64_CFM_REGNUM);
}
else
{
- struct frame_info *frn = frame->next;
+ struct frame_info *frn = get_next_frame (frame);
FRAME_INIT_SAVED_REGS (frn);
if (get_frame_saved_regs (frn)[IA64_CFM_REGNUM] != 0)
cfm = read_memory_integer (get_frame_saved_regs (frn)[IA64_CFM_REGNUM], 8);
- else if (frn->next && (get_frame_type (frn->next) == SIGTRAMP_FRAME))
- cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM);
- else if (frn->next
- && 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),
+ else if (get_next_frame (frn) && (get_frame_type (get_next_frame (frn)) == SIGTRAMP_FRAME))
+ cfm = read_sigcontext_register (get_next_frame (frn), IA64_PFS_REGNUM);
+ else if (get_next_frame (frn)
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (frn)),
+ get_frame_base (get_next_frame (frn)),
+ get_frame_base (get_next_frame (frn))))
+ cfm = deprecated_read_register_dummy (get_frame_pc (get_next_frame (frn)),
+ get_frame_base (get_next_frame (frn)),
IA64_PFS_REGNUM);
else
cfm = read_register (IA64_PFS_REGNUM);
frame->extra_info->cfm = cfm;
frame->extra_info->sof = cfm & 0x7f;
frame->extra_info->sol = (cfm >> 7) & 0x7f;
- if (frame->next == 0
- || (get_frame_type (frame->next) == SIGTRAMP_FRAME)
+ if (get_next_frame (frame) == 0
+ || (get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME)
|| next_frame_is_call_dummy)
frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof);
else
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
m68hc11_frame_init_saved_regs (fi);
{
if (get_frame_type (frame) == SIGTRAMP_FRAME)
{
- if (frame->next)
- return read_memory_unsigned_integer (get_frame_base (frame->next)
+ if (get_next_frame (frame))
+ return read_memory_unsigned_integer (get_frame_base (get_next_frame (frame))
+ SIG_PC_FP_OFFSET, 4);
else
return read_memory_unsigned_integer (read_register (SP_REGNUM)
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 get_frame_base (frame_info->next) + 16;
+ if (get_next_frame (frame_info) && (get_frame_type (get_next_frame (frame_info)) == SIGTRAMP_FRAME))
+ return get_frame_base (get_next_frame (frame_info)) + 16;
else
return get_frame_base (frame_info) + 4;
}
if (fi != NULL && IS_RTS (insn))
{
mcore_insn_debug (("MCORE: got jmp r15"));
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
/* Check for first insn of prologue */
if (fi != NULL && get_frame_pc (fi) == func_addr)
{
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
/* Fix the frame pointer. When gcc uses r8 as a frame pointer,
it is really an arg ptr. We adjust fi->frame to be a "real"
frame pointer. */
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
{
if (fi->extra_info->status & MY_FRAME_IN_SP)
deprecated_update_frame_base_hack (fi, read_sp () + framesize);
CORE_ADDR
mcore_find_callers_reg (struct frame_info *fi, int regnum)
{
- for (; fi != NULL; fi = fi->next)
+ for (; fi != NULL; fi = get_next_frame (fi))
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
void
mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
- if (fi && fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (fi && get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
frame_saved_regs_zalloc (fi);
a signal, we assume that all registers have been saved.
This assumes that all register saves in a function happen before
the first function call. */
- (fci->next == NULL || (get_frame_type (fci->next) == SIGTRAMP_FRAME))
+ (get_next_frame (fci) == NULL
+ || (get_frame_type (get_next_frame (fci)) == SIGTRAMP_FRAME))
/* In a dummy frame we know exactly where things are saved. */
&& !PROC_DESC_IS_DUMMY (proc_desc)
{
CORE_ADDR pc, tmp;
- pc = ((fromleaf) ? SAVED_PC_AFTER_CALL (prev->next) :
- prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
+ pc = ((fromleaf)
+ ? SAVED_PC_AFTER_CALL (get_next_frame (prev))
+ : get_next_frame (prev)
+ ? FRAME_SAVED_PC (get_next_frame (prev))
+ : read_pc ());
tmp = SKIP_TRAMPOLINE_CODE (pc);
return tmp ? tmp : pc;
}
/* Use proc_desc calculated in frame_chain */
mips_extra_func_info_t proc_desc =
- fci->next ? cached_proc_desc : find_proc_desc (get_frame_pc (fci), fci->next, 1);
+ get_next_frame (fci)
+ ? cached_proc_desc
+ : find_proc_desc (get_frame_pc (fci), get_next_frame (fci), 1);
frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info));
interrupted by a signal at it's very start. */
if (get_frame_pc (fci) == PROC_LOW_ADDR (proc_desc)
&& !PROC_DESC_IS_DUMMY (proc_desc))
- deprecated_update_frame_base_hack (fci, read_next_frame_reg (fci->next, SP_REGNUM));
+ deprecated_update_frame_base_hack (fci, read_next_frame_reg (get_next_frame (fci), SP_REGNUM));
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
part of the dummy frames data. */
/* Do nothing. */;
else
- deprecated_update_frame_base_hack (fci, get_frame_pointer (fci->next, proc_desc));
+ deprecated_update_frame_base_hack (fci, get_frame_pointer (get_next_frame (fci), proc_desc));
if (proc_desc == &temp_proc_desc)
{
status = target_read_memory (get_frame_pc (fi), buf, 1);
if (status != 0)
{
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
if (buf[0] == 0xfe)
{
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
frame hasn't been allocated yet. */
if (fi && get_frame_pc (fi) == func_addr)
{
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
status = target_read_memory (addr, buf, 2);
if (status != 0)
{
- if (fi && fi->next == NULL && fi->status & MY_FRAME_IN_SP)
+ if (fi && get_next_frame (fi) == NULL && fi->status & MY_FRAME_IN_SP)
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
{
/* We still haven't allocated our local stack. Handle this
as if we stopped on the first or last insn of a function. */
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
status = target_read_memory (addr, buf, 2);
if (status != 0)
{
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
}
else
{
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
status = target_read_memory (addr, buf, 2);
if (status != 0)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
addr += 2;
if (addr >= stop)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
return addr;
}
status = target_read_memory (addr + 2, buf, 2);
if (status != 0)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
addr += 4;
if (addr >= stop)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
return addr;
}
status = target_read_memory (addr + 2, buf, 3);
if (status != 0)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
addr += 5;
if (addr >= stop)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
return addr;
}
status = target_read_memory (addr + 1, buf, 2);
if (status != 0)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
status = find_pc_partial_function (temp, &name, NULL, NULL);
if (status == 0)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
if (addr >= stop)
{
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
{
fi->stack_size -= 16;
deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
status = target_read_memory (addr + 2, buf, 3);
if (status != 0)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
status = find_pc_partial_function (temp, &name, NULL, NULL);
if (status == 0)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
deprecated_update_frame_base_hack (fi, read_sp ());
return addr;
}
if (addr >= stop)
{
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP))
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP))
{
fi->stack_size -= 16;
deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
fi->stack_size -= 16;
/* Update fi->frame if necessary. */
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
/* After the out of line prologue, there may be another
status = target_read_memory (addr + 2, buf, 3);
if (status != 0)
{
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
{
fi->fsr.regs[2] = get_frame_base (fi) + fi->stack_size + 4;
fi->fsr.regs[3] = get_frame_base (fi) + fi->stack_size + 8;
/* 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)
+ if (fi && get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, get_frame_base (fi) - outgoing_args_size);
/* Note the register save information and update the stack
If MY_FRAME_IN_SP is set and we're the innermost frame, then we
need to fix fi->frame so that backtracing, find_frame_saved_regs,
etc work correctly. */
- if (fi && fi->next == NULL && (fi->status & MY_FRAME_IN_SP) != 0)
+ if (fi && get_next_frame (fi) == NULL && (fi->status & MY_FRAME_IN_SP) != 0)
deprecated_update_frame_base_hack (fi, read_sp () - fi->stack_size);
/* And last we have the register saves. These are relatively
void
mn10200_init_extra_frame_info (struct frame_info *fi)
{
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs);
fi->status = 0;
static void
fix_frame_pointer (struct frame_info *fi, int stack_size)
{
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
{
if (fi->extra_info->status & MY_FRAME_IN_SP)
deprecated_update_frame_base_hack (fi, read_sp () - stack_size);
In this case fi->frame is bogus, we need to fix it. */
if (fi && buf[0] == 0xf0 && buf[1] == 0xfc)
{
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
frame hasn't been allocated yet. */
if (fi && get_frame_pc (fi) == func_addr)
{
- if (fi->next == NULL)
+ if (get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
return get_frame_pc (fi);
}
if (addr >= stop)
{
/* Fix fi->frame since it's bogus at this point. */
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
/* Note if/where callee saved registers were saved. */
if (status != 0)
{
/* Fix fi->frame since it's bogus at this point. */
- if (fi && fi->next == NULL)
+ if (fi && get_next_frame (fi) == NULL)
deprecated_update_frame_base_hack (fi, read_sp ());
/* Note if/where callee saved registers were saved. */
static void
mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
frame_saved_regs_zalloc (fi);
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
buf = alloca (ptrbytes);
/* Get sigcontext address, it is the third parameter on the stack. */
- if (frame->next)
+ if (get_next_frame (frame))
sigcontext_addr = read_memory_typed_address
- (FRAME_ARGS_ADDRESS (frame->next) + FRAME_ARGS_SKIP + sigcontext_offs,
+ (FRAME_ARGS_ADDRESS (get_next_frame (frame)) + FRAME_ARGS_SKIP + sigcontext_offs,
builtin_type_void_data_ptr);
else
sigcontext_addr = read_memory_typed_address
if (instr[0] == S390_SYSCALL_OPCODE && test_pc == pc)
{
good_prologue = 1;
- if (saved_regs && fextra_info && fi->next && fi->next->extra_info
- && fi->next->extra_info->sigcontext)
+ if (saved_regs && fextra_info && get_next_frame (fi)
+ && get_next_frame (fi)->extra_info
+ && get_next_frame (fi)->extra_info->sigcontext)
{
/* We are backtracing from a signal handler */
- save_reg_addr = fi->next->extra_info->sigcontext +
+ save_reg_addr = get_next_frame (fi)->extra_info->sigcontext +
REGISTER_BYTE (S390_GP0_REGNUM);
for (regidx = 0; regidx < S390_NUM_GPRS; regidx++)
{
saved_regs[S390_GP0_REGNUM + regidx] = save_reg_addr;
save_reg_addr += S390_GPR_SIZE;
}
- save_reg_addr = fi->next->extra_info->sigcontext +
+ save_reg_addr = get_next_frame (fi)->extra_info->sigcontext +
(GDB_TARGET_IS_ESAME ? S390X_SIGREGS_FP0_OFFSET :
S390_SIGREGS_FP0_OFFSET);
for (regidx = 0; regidx < S390_NUM_FPRS; regidx++)
struct frame_extra_info fextra_info, *fextra_info_ptr;
int frameless = 0;
- if (fi->next == NULL) /* no may be frameless */
+ if (get_next_frame (fi) == NULL) /* no may be frameless */
{
if (fi->extra_info)
fextra_info_ptr = fi->extra_info;
static CORE_ADDR
sh_find_callers_reg (struct frame_info *fi, int regnum)
{
- for (; fi; fi = fi->next)
+ for (; fi; fi = get_next_frame (fi))
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
{
int media_mode = 0;
- for (; fi; fi = fi->next)
+ for (; fi; fi = get_next_frame (fi))
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
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
get_frame_base (fi)))
the current frame itself: otherwise, we would be getting the
previous frame's registers which were saved by the current frame. */
- while (frame && ((frame = frame->next) != NULL))
+ while (frame && ((frame = get_next_frame (frame)) != NULL))
{
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
get_frame_base (frame),
frame_saved_regs_zalloc (fi);
fi->extra_info->bottom =
- (fi->next ?
- (get_frame_base (fi) == get_frame_base (fi->next) ? fi->next->extra_info->bottom :
- get_frame_base (fi->next)) : read_sp ());
+ (get_next_frame (fi)
+ ? (get_frame_base (fi) == get_frame_base (get_next_frame (fi))
+ ? get_next_frame (fi)->extra_info->bottom
+ : get_frame_base (get_next_frame (fi)))
+ : read_sp ());
/* If fi->next is NULL, then we already set ->frame by passing read_fp()
to create_new_frame. */
- if (fi->next)
+ if (get_next_frame (fi))
{
char *buf;
/* Compute ->frame as if not flat. If it is flat, we'll change
it later. */
- if (fi->next->next != NULL
- && ((get_frame_type (fi->next->next) == SIGTRAMP_FRAME)
- || deprecated_frame_in_dummy (fi->next->next))
- && frameless_look_for_prologue (fi->next))
+ if (get_next_frame (get_next_frame (fi)) != NULL
+ && ((get_frame_type (get_next_frame (get_next_frame (fi))) == SIGTRAMP_FRAME)
+ || deprecated_frame_in_dummy (get_next_frame (get_next_frame (fi))))
+ && frameless_look_for_prologue (get_next_frame (fi)))
{
/* A frameless function interrupted by a signal did not change
the frame pointer, fix up frame pointer accordingly. */
- deprecated_update_frame_base_hack (fi, get_frame_base (fi->next));
- fi->extra_info->bottom = fi->next->extra_info->bottom;
+ deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi)));
+ fi->extra_info->bottom = get_next_frame (fi)->extra_info->bottom;
}
else
{
}
}
}
- if (fi->next && get_frame_base (fi) == 0)
+ if (get_next_frame (fi) && get_frame_base (fi) == 0)
{
/* Kludge to cause init_prev_frame_info to destroy the new frame. */
- deprecated_update_frame_base_hack (fi, get_frame_base (fi->next));
- deprecated_update_frame_pc_hack (fi, get_frame_pc (fi->next));
+ deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi)));
+ deprecated_update_frame_pc_hack (fi, get_frame_pc (get_next_frame (fi)));
}
}
return extract_address (scbuf, sizeof (scbuf));
}
else if (frame->extra_info->in_prologue ||
- (frame->next != NULL &&
- ((get_frame_type (frame->next) == SIGTRAMP_FRAME) ||
- deprecated_frame_in_dummy (frame->next)) &&
+ (get_next_frame (frame) != NULL &&
+ ((get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME) ||
+ deprecated_frame_in_dummy (get_next_frame (frame))) &&
frameless_look_for_prologue (frame)))
{
/* A frameless function interrupted by a signal did not save
}
- frame1 = frame->next;
+ frame1 = get_next_frame (frame);
/* Get saved PC from the frame info if not in innermost frame. */
if (regnum == PC_REGNUM && frame1 != NULL)
}
if (addr != 0)
break;
- frame1 = frame1->next;
+ frame1 = get_next_frame (frame1);
}
if (addr != 0)
{
(frame_addr + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_I0);
}
- if (fi->next)
+ if (get_next_frame (fi))
{
if (fi->extra_info->flat)
{
{
/* Pull off either the next frame pointer or the stack pointer */
CORE_ADDR next_next_frame_addr =
- (fi->next->extra_info->bottom ?
- fi->next->extra_info->bottom : read_sp ());
+ (get_next_frame (fi)->extra_info->bottom ?
+ get_next_frame (fi)->extra_info->bottom : read_sp ());
for (regnum = O0_REGNUM; regnum < O0_REGNUM + 8; regnum++)
saved_regs_addr[regnum] =
(next_next_frame_addr
CORE_ADDR
v850_find_callers_reg (struct frame_info *fi, int regnum)
{
- for (; fi; fi = fi->next)
+ for (; fi; fi = get_next_frame (fi))
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),
v850_scan_prologue (get_frame_pc (fi), &pi);
- if (!fi->next && pi.framereg == E_SP_REGNUM)
+ if (!get_next_frame (fi) && pi.framereg == E_SP_REGNUM)
deprecated_update_frame_base_hack (fi, read_register (pi.framereg) - pi.frameoffset);
for (pifsr = pifsrs; pifsr->framereg; pifsr++)
{
struct prologue_info pi;
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
v850_frame_init_saved_regs (fi);
}
buf = alloca (ptrbytes);
/* Get sigcontext address, it is the third parameter on the stack. */
- if (frame->next)
+ if (get_next_frame (frame))
sigcontext_addr = read_memory_typed_address
- (FRAME_ARGS_ADDRESS (frame->next) + FRAME_ARGS_SKIP + sigcontext_offs,
+ (FRAME_ARGS_ADDRESS (get_next_frame (frame))
+ + FRAME_ARGS_SKIP + sigcontext_offs,
builtin_type_void_data_ptr);
else
sigcontext_addr = read_memory_typed_address
(which is one reason that "info frame" exists). So, return 0 (indicating
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 (get_frame_base (frame->next) + 8, 4));
+ if (get_next_frame (frame))
+ return (read_memory_integer (get_frame_base (get_next_frame (frame)) + 8, 4));
return (0);
}
/* In most of GDB, getting the args address is too important to
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 (get_frame_base (frame->next) + 8, 4));
+ if (get_next_frame (frame))
+ return (read_memory_integer (get_frame_base (get_next_frame (frame)) + 8, 4));
return (read_register (VAX_AP_REGNUM));
}
pc = x86_64_linux_sigtramp_start (get_frame_pc (frame));
if (pc)
{
- if (frame->next)
+ if (get_next_frame (frame))
/* 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 get_frame_base (frame->next) + LINUX_SIGINFO_SIZE +
+ return get_frame_base (get_next_frame (frame)) + LINUX_SIGINFO_SIZE +
LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
addr = get_frame_base (fi);
}
else
- addr = get_frame_base (fi->next);
+ addr = get_frame_base (get_next_frame (fi));
addr += LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
{
CORE_ADDR addr;
- if (get_next_frame (fi) && (get_frame_type (fi->next) == SIGTRAMP_FRAME))
+ if (get_next_frame (fi)
+ && (get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME))
{
addr = get_frame_base (get_next_frame (get_next_frame (fi)))
+ LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
Fortunately this will never happen from the outermost
frame, so we should be able to get the saved pc from
the next frame. */
- if (fi->next)
- deprecated_update_frame_pc_hack (fi, xstormy16_frame_saved_pc (fi->next));
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, xstormy16_frame_saved_pc (get_next_frame (fi)));
}
/* Take care of the saved_regs right here (non-lazy). */