+2002-09-17 Andrew Cagney <cagney@redhat.com>
+
+ * blockframe.c (deprecated_read_register_dummy): Rename
+ generic_read_register_dummy.
+ * frame.c (frame_unwind_signed_register): New function.
+ (frame_unwind_unsigned_register): New function.
+ * frame.h (frame_unwind_signed_register): Declare.
+ (frame_unwind_unsigned_register): Declare.
+ (deprecated_read_register_dummy): Rename
+ generic_read_register_dummy.
+
+ * h8300-tdep.c (h8300_frame_chain): Update.
+ (h8300_frame_saved_pc): Update.
+ * xstormy16-tdep.c (xstormy16_frame_saved_pc): Update.
+ * rs6000-tdep.c (rs6000_frame_saved_pc): Update.
+ * s390-tdep.c (s390_frame_saved_pc_nofix): Update.
+ (s390_frame_chain): Update.
+ * v850-tdep.c (v850_find_callers_reg): Update.
+ (v850_frame_saved_pc): Update.
+ * m32r-tdep.c (m32r_init_extra_frame_info): Update.
+ (m32r_find_callers_reg): Update.
+ (m32r_frame_saved_pc): Update.
+ * sh-tdep.c (sh_find_callers_reg): Update.
+ (sh64_get_saved_pr): Update.
+ (sh_init_extra_frame_info): Update.
+ (sh_init_extra_frame_info): Update.
+ (sh64_init_extra_frame_info): Update.
+ (sh64_init_extra_frame_info): Update.
+ * mcore-tdep.c (mcore_find_callers_reg): Update.
+ (mcore_frame_saved_pc): Update.
+ (mcore_init_extra_frame_info): Update.
+ * i386-tdep.c (i386_frame_saved_pc): Update.
+ * ia64-tdep.c (ia64_frame_saved_pc): Update.
+ (ia64_init_extra_frame_info): Update.
+ (ia64_init_extra_frame_info): Update.
+ * d10v-tdep.c (d10v_frame_saved_pc): Update.
+ * cris-tdep.c (cris_init_extra_frame_info): Update.
+ * avr-tdep.c (avr_frame_chain): Update.
+ (avr_init_extra_frame_info): Update.
+ (avr_frame_saved_pc): Update.
+ * arm-tdep.c (arm_find_callers_reg): Update.
+ (arm_init_extra_frame_info): Update.
+ (arm_frame_saved_pc): Update.
+
2002-09-17 Tom Tromey <tromey@redhat.com>
* c-lang.c (c_emit_char): Don't treat \0 specially unless quoter
if (USE_GENERIC_DUMMY_FRAMES
&& PC_IN_CALL_DUMMY (fi->pc, 0, 0))
{
- return generic_read_register_dummy (fi->pc, fi->frame, regnum);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
}
else if (fi->saved_regs[regnum] != 0)
{
&& PC_IN_CALL_DUMMY (fi->next->pc, 0, 0))
/* For generic dummy frames, pull the value direct from the frame.
Having an unwind function to do this would be nice. */
- sp = generic_read_register_dummy (fi->next->pc, fi->next->frame,
- ARM_SP_REGNUM);
+ sp = deprecated_read_register_dummy (fi->next->pc, fi->next->frame,
+ ARM_SP_REGNUM);
else
sp = (fi->next->frame - fi->next->extra_info->frameoffset
+ fi->next->extra_info->framesize);
/* If a dummy frame, pull the PC out of the frame's register buffer. */
if (USE_GENERIC_DUMMY_FRAMES
&& PC_IN_CALL_DUMMY (fi->pc, 0, 0))
- return generic_read_register_dummy (fi->pc, fi->frame, ARM_PC_REGNUM);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, ARM_PC_REGNUM);
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame - fi->extra_info->frameoffset,
fi->frame))
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = generic_read_register_dummy (fi->pc, fi->frame, fi->frame);
+ /* FIXME: cagney/2002-09-13: This is wrong. The third parameter
+ to deprecated_read_register_dummy() is REGNUM and not a frame
+ address. */
+ fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ fi->frame);
}
else if (!fi->next) /* this is the innermost frame? */
fi->frame = read_register (fi->extra_info->framereg);
avr_frame_saved_pc (struct frame_info *frame)
{
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return generic_read_register_dummy (frame->pc, frame->frame,
- AVR_PC_REGNUM);
+ return deprecated_read_register_dummy (frame->pc, frame->frame,
+ AVR_PC_REGNUM);
else
return frame->extra_info->return_pc;
}
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
{
/* initialize the return_pc now */
- frame->extra_info->return_pc = generic_read_register_dummy (frame->pc,
- frame->
- frame,
- AVR_PC_REGNUM);
+ frame->extra_info->return_pc
+ = deprecated_read_register_dummy (frame->pc, frame->frame,
+ AVR_PC_REGNUM);
return frame->frame;
}
return (frame->extra_info->is_main ? 0
Find a saved register from before GDB calls a function in the inferior */
CORE_ADDR
-generic_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
+deprecated_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
{
struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp);
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
+ fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ SP_REGNUM);
fi->extra_info->return_pc =
- generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
/* FIXME: Is this necessarily true? */
fi->extra_info->leaf_function = 0;
d10v_frame_saved_pc (struct frame_info *frame)
{
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return d10v_make_iaddr (generic_read_register_dummy (frame->pc,
- frame->frame,
- PC_REGNUM));
+ return d10v_make_iaddr (deprecated_read_register_dummy (frame->pc,
+ frame->frame,
+ PC_REGNUM));
else
return ((frame)->extra_info->return_pc);
}
optimizedp, lvalp, addrp, realnump, bufferp);
}
+void
+frame_unwind_signed_register (struct frame_info *frame, int regnum,
+ LONGEST *val)
+{
+ int optimized;
+ CORE_ADDR addr;
+ int realnum;
+ enum lval_type lval;
+ void *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ frame_register_unwind (frame, regnum, &optimized, &lval, &addr,
+ &realnum, buf);
+ (*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
+}
+
+void
+frame_unwind_unsigned_register (struct frame_info *frame, int regnum,
+ ULONGEST *val)
+{
+ int optimized;
+ CORE_ADDR addr;
+ int realnum;
+ enum lval_type lval;
+ void *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ frame_register_unwind (frame, regnum, &optimized, &lval, &addr,
+ &realnum, buf);
+ (*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
+}
void
generic_unwind_get_saved_register (char *raw_buffer,
extern CORE_ADDR sigtramp_saved_pc (struct frame_info *);
-extern CORE_ADDR generic_read_register_dummy (CORE_ADDR pc,
- CORE_ADDR fp, int);
+/* NOTE: cagney/2002-09-13: There is no need for this function.
+ Instead either of frame_unwind_signed_register() or
+ frame_unwind_unsigned_register() can be used. */
+extern CORE_ADDR deprecated_read_register_dummy (CORE_ADDR pc,
+ CORE_ADDR fp, int);
extern void generic_push_dummy_frame (void);
extern void generic_pop_current_frame (void (*)(struct frame_info *));
extern void generic_pop_dummy_frame (void);
CORE_ADDR *addrp, int *realnump,
void *valuep);
+/* Unwind FRAME so that the value of register REGNUM, in the previous
+ frame is returned. Simplified versions of frame_register_unwind. */
+/* NOTE: cagney/2002-09-13: Return void as one day these functions may
+ be changed to return an indication that the read succeeded. */
+extern void frame_unwind_signed_register (struct frame_info *frame,
+ int regnum, LONGEST *val);
+extern void frame_unwind_unsigned_register (struct frame_info *frame,
+ int regnum, ULONGEST *val);
+
extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
extern void get_saved_register (char *raw_buffer, int *optimized,
{
if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame))
{ /* initialize the from_pc now */
- thisframe->extra_info->from_pc = generic_read_register_dummy (
- thisframe->pc,
- thisframe->frame,
- E_PC_REGNUM);
+ thisframe->extra_info->from_pc =
+ deprecated_read_register_dummy (thisframe->pc, thisframe->frame,
+ E_PC_REGNUM);
return thisframe->frame;
}
return thisframe->saved_regs[E_SP_REGNUM];
h8300_frame_saved_pc (struct frame_info *frame)
{
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return generic_read_register_dummy (frame->pc, frame->frame, E_PC_REGNUM);
+ return deprecated_read_register_dummy (frame->pc, frame->frame,
+ E_PC_REGNUM);
else
return frame->extra_info->from_pc;
}
i386_frame_saved_pc (struct frame_info *frame)
{
if (PC_IN_CALL_DUMMY (frame->pc, 0, 0))
- return generic_read_register_dummy (frame->pc, frame->frame,
- PC_REGNUM);
+ return deprecated_read_register_dummy (frame->pc, frame->frame,
+ PC_REGNUM);
if (frame->signal_handler_caller)
return i386_sigtramp_saved_pc (frame);
if (frame->signal_handler_caller)
return read_sigcontext_register (frame, pc_regnum);
else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- return generic_read_register_dummy (frame->pc, frame->frame, pc_regnum);
+ return deprecated_read_register_dummy (frame->pc, frame->frame, pc_regnum);
else
{
FRAME_INIT_SAVED_REGS (frame);
}
else if (next_frame_is_call_dummy)
{
- bsp = generic_read_register_dummy (frame->next->pc, frame->next->frame,
- IA64_BSP_REGNUM);
- cfm = generic_read_register_dummy (frame->next->pc, frame->next->frame,
- IA64_CFM_REGNUM);
+ bsp = deprecated_read_register_dummy (frame->next->pc,
+ frame->next->frame,
+ IA64_BSP_REGNUM);
+ cfm = deprecated_read_register_dummy (frame->next->pc,
+ frame->next->frame,
+ IA64_CFM_REGNUM);
}
else
{
else if (frn->next
&& PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame,
frn->next->frame))
- cfm = generic_read_register_dummy (frn->next->pc, frn->next->frame,
- IA64_PFS_REGNUM);
+ cfm = deprecated_read_register_dummy (frn->next->pc, frn->next->frame,
+ IA64_PFS_REGNUM);
else
cfm = read_register (IA64_PFS_REGNUM);
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
+ fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ SP_REGNUM);
fi->framesize = 0;
return;
}
{
for (; fi; fi = fi->next)
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, regnum);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
else if (fi->fsr.regs[regnum] != 0)
return read_memory_integer (fi->fsr.regs[regnum],
REGISTER_RAW_SIZE (regnum));
m32r_frame_saved_pc (struct frame_info *fi)
{
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
else
return m32r_find_callers_reg (fi, RP_REGNUM);
}
for (; fi != NULL; fi = fi->next)
{
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, regnum);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
else if (fi->saved_regs[regnum] != 0)
return read_memory_integer (fi->saved_regs[regnum],
REGISTER_SIZE);
{
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
else
return mcore_find_callers_reg (fi, PR_REGNUM);
}
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
+ fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
}
else
mcore_analyze_prologue (fi, 0, 0);
return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize);
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
func_start = get_pc_function_start (fi->pc);
return fi->extra_info->saved_pc;
if (deprecated_generic_find_dummy_frame (fi->pc, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, S390_PC_REGNUM);
+ return deprecated_read_register_dummy (fi->pc, 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 generic_read_register_dummy (thisframe->pc, thisframe->frame,
- S390_SP_REGNUM);
+ return deprecated_read_register_dummy (thisframe->pc, thisframe->frame,
+ S390_SP_REGNUM);
else
{
int sigreturn = 0;
if (PC_IN_CALL_DUMMY (fi->pc, 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 generic_read_register_dummy (fi->pc, fi->frame, regnum);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
if (PC_IN_CALL_DUMMY (fi->pc, 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 generic_read_register_dummy (fi->pc, fi->frame, pr_regnum);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, pr_regnum);
else
{
FRAME_INIT_SAVED_REGS (fi);
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = generic_read_register_dummy (fi->pc, fi->frame,
- SP_REGNUM);
- fi->extra_info->return_pc = generic_read_register_dummy (fi->pc,
- fi->frame,
- PC_REGNUM);
+ fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ SP_REGNUM);
+ fi->extra_info->return_pc = deprecated_read_register_dummy (fi->pc,
+ fi->frame,
+ PC_REGNUM);
fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
fi->extra_info->leaf_function = 0;
return;
{
/* We need to setup fi->frame here because run_stack_dummy gets it wrong
by assuming it's always FP. */
- fi->frame = generic_read_register_dummy (fi->pc, fi->frame,
- SP_REGNUM);
+ fi->frame = deprecated_read_register_dummy (fi->pc, fi->frame,
+ SP_REGNUM);
fi->extra_info->return_pc =
- generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
+ deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
fi->extra_info->f_offset = -(CALL_DUMMY_LENGTH + 4);
fi->extra_info->leaf_function = 0;
return;
{
for (; fi; fi = fi->next)
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, regnum);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, regnum);
else if (fi->saved_regs[regnum] != 0)
return read_memory_unsigned_integer (fi->saved_regs[regnum],
v850_register_raw_size (regnum));
v850_frame_saved_pc (struct frame_info *fi)
{
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM);
+ return deprecated_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM);
else
return v850_find_callers_reg (fi, E_RP_REGNUM);
}
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
{
- saved_pc = generic_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM);
+ saved_pc = deprecated_read_register_dummy (fi->pc, fi->frame,
+ E_PC_REGNUM);
}
else
{