* d10v-frame.c: Use D10V_RET1_REGNUM.
(saved_regs_unwinder): Don't use get_frame_saved_regs.
* frame.c (get_prev_frame): Always initialize frame.frame.
(get_frame_base): Return frame.frame.
+2003-01-19 Andrew Cagney <ac131313@redhat.com>
+
+ * d10v-frame.c: Use D10V_RET1_REGNUM.
+ (saved_regs_unwinder): Don't use get_frame_saved_regs.
+ * frame.c (get_prev_frame): Always initialize frame.frame.
+ (get_frame_base): Return frame.frame.
+
+2003-01-13 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (FRAME_INIT_SAVED_REGS): Change to function with
+ predicate.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * stack.c (frame_info): Only initialize the saved registers when
+ FRAME_INIT_SAVED_REGS_P.
+ * frame.c (frame_saved_regs_register_unwind): Assert
+ FRAME_INIT_SAVED_REGS_P.
+ (deprecated_generic_get_saved_register): Ditto.
+
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* d10v-tdep.c: Include "d10v-tdep.h". Update to use D10V_
if (bufferp != NULL)
{
/* Read the value in from memory. */
- read_memory (get_frame_saved_regs (frame)[regnum], bufferp,
+ read_memory (saved_regs[regnum], bufferp,
REGISTER_RAW_SIZE (regnum));
}
}
{
bfd_byte tmp[2];
tmp[1] = *(bfd_byte *)valbuf;
- regcache_cooked_write (regcache, RET1_REGNUM, tmp);
+ regcache_cooked_write (regcache, D10V_RET1_REGNUM, tmp);
}
else
{
out any dangling byte at the end of the buffer. */
for (reg = 0; (reg * 2) + 1 < TYPE_LENGTH (type); reg++)
{
- regcache_cooked_write (regcache, RET1_REGNUM + reg,
+ regcache_cooked_write (regcache, D10V_RET1_REGNUM + reg,
(bfd_byte *) valbuf + reg * 2);
}
/* Write out any dangling byte at the end of the buffer. */
d10v_extract_struct_value_address (struct regcache *regcache)
{
ULONGEST addr;
- regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &addr);
- return (addr | DMEM_START);
+ regcache_cooked_read_unsigned (regcache, D10V_ARG1_REGNUM, &addr);
+ return (addr | D10V_DMEM_START);
}
static CORE_ADDR
if (TYPE_LENGTH (type) == 1)
{
ULONGEST c;
- regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &c);
+ regcache_cooked_read_unsigned (regcache, D10V_RET1_REGNUM, &c);
store_unsigned_integer (valbuf, 1, c);
}
else
remaining bytes in remaining registers. Interestingly, when
such values are passed in, the last byte is in the most
significant byte of that same register - wierd. */
- int reg = RET1_REGNUM;
+ int reg = D10V_RET1_REGNUM;
int off = 0;
if (TYPE_LENGTH (type) & 1)
{
- regcache_cooked_read_part (regcache, RET1_REGNUM, 1, 1,
+ regcache_cooked_read_part (regcache, D10V_RET1_REGNUM, 1, 1,
(bfd_byte *)valbuf + off);
off++;
reg++;
/* Transfer the remaining registers. */
for (; off < TYPE_LENGTH (type); reg++, off += 2)
{
- regcache_cooked_read (regcache, RET1_REGNUM + reg,
+ regcache_cooked_read (regcache, D10V_RET1_REGNUM + reg,
(bfd_byte *) valbuf + off);
}
}
prev_frame->unwind = frame_unwind_find_by_pc (current_gdbarch,
prev_frame->pc);
- /* Now figure out how to initialize this new frame. Perhaphs one
- day, this will too, be selected by set_unwind_by_pc(). */
- if (prev_frame->type != DUMMY_FRAME)
- {
- /* A dummy frame doesn't need to unwind the frame ID because the
- frame ID comes from the previous frame. The other frames do
- though. True? */
-#if 0
- /* Oops, the frame doesn't chain. Treat this as the last frame. */
- prev_frame->id = frame_id_unwind (next_frame);
- if (!frame_id_p (prev_frame->id))
- return NULL;
-#else
- /* FIXME: cagney/2002-12-18: Instead of this hack, should just
- save the frame ID directly. */
- struct frame_id id = frame_id_unwind (next_frame);
- if (!frame_id_p (id))
- return NULL;
- prev_frame->frame = id.base;
-#endif
- }
+ /* FIXME: cagney/2003-01-13: A dummy frame doesn't need to unwind
+ the frame ID because the frame ID comes from the previous frame.
+ The other frames do though. True? */
+ {
+ /* FIXME: cagney/2002-12-18: Instead of this hack, should just
+ save the frame ID directly. */
+ struct frame_id id = frame_id_unwind (next_frame);
+ if (!frame_id_p (id))
+ return NULL;
+ prev_frame->frame = id.base;
+ }
/* Link it in. */
next_frame->prev = prev_frame;
CORE_ADDR
get_frame_base (struct frame_info *fi)
{
+#if 1
+ /* FIXME: cagney/2003-01-13: Should be using the frame base obtained
+ by unwinding the previous frame. */
+ return fi->frame;
+#else
struct frame_id id = frame_id_unwind (fi->next);
return id.base;
+#endif
}
/* Level of the selected frame: 0 for innermost, 1 for its caller, ...