-trad_frame_prev_register (struct frame_info *next_frame,
- struct trad_frame_saved_reg this_saved_regs[],
- int regnum, int *optimizedp,
- enum lval_type *lvalp, CORE_ADDR *addrp,
- int *realnump, void *bufferp)
-{
- struct gdbarch *gdbarch = get_frame_arch (next_frame);
- if (this_saved_regs[regnum].realnum >= 0
- && this_saved_regs[regnum].addr != 0)
- {
- /* The register was saved in memory. */
- *optimizedp = 0;
- *lvalp = lval_memory;
- *addrp = this_saved_regs[regnum].addr;
- *realnump = -1;
- if (bufferp != NULL)
- {
- /* Read the value in from memory. */
- get_frame_memory (next_frame, this_saved_regs[regnum].addr, bufferp,
- register_size (gdbarch, regnum));
- }
- }
- else if (this_saved_regs[regnum].realnum >= 0
- && this_saved_regs[regnum].addr == 0)
- {
- /* As the next frame to return the value of the register. */
- frame_register_unwind (next_frame, this_saved_regs[regnum].realnum,
- optimizedp, lvalp, addrp, realnump, bufferp);
- }
+trad_frame_set_reg_value (struct trad_frame_cache *this_trad_cache,
+ int regnum, LONGEST val)
+{
+ /* External interface for users of trad_frame_cache
+ (who cannot access the prev_regs object directly). */
+ trad_frame_set_value (this_trad_cache->prev_regs, regnum, val);
+}
+
+void
+trad_frame_set_reg_realreg (struct trad_frame_cache *this_trad_cache,
+ int regnum, int realreg)
+{
+ this_trad_cache->prev_regs[regnum].realreg = realreg;
+ this_trad_cache->prev_regs[regnum].addr = -1;
+}
+
+void
+trad_frame_set_reg_addr (struct trad_frame_cache *this_trad_cache,
+ int regnum, CORE_ADDR addr)
+{
+ this_trad_cache->prev_regs[regnum].addr = addr;
+}
+
+void
+trad_frame_set_unknown (struct trad_frame_saved_reg this_saved_regs[],
+ int regnum)
+{
+ /* Make the REALREG invalid, indicating that the value is not known. */
+ this_saved_regs[regnum].realreg = REG_UNKNOWN;
+ this_saved_regs[regnum].addr = -1;
+}
+
+struct value *
+trad_frame_get_prev_register (struct frame_info *this_frame,
+ struct trad_frame_saved_reg this_saved_regs[],
+ int regnum)
+{
+ if (trad_frame_addr_p (this_saved_regs, regnum))
+ /* The register was saved in memory. */
+ return frame_unwind_got_memory (this_frame, regnum,
+ this_saved_regs[regnum].addr);
+ else if (trad_frame_realreg_p (this_saved_regs, regnum))
+ return frame_unwind_got_register (this_frame, regnum,
+ this_saved_regs[regnum].realreg);
+ else if (trad_frame_value_p (this_saved_regs, regnum))
+ /* The register's value is available. */
+ return frame_unwind_got_constant (this_frame, regnum,
+ this_saved_regs[regnum].addr);