Re: [rfc] [2/4] SPU overlay support: The SPU target part

Daniel Jacobowitz
2007-05-10T21:55:06Z

On Tue, May 08, 2007 at 02:40:12PM +0200, Ulrich Weigand wrote:
> + /* The previous SP is equal to the CFA. */
> + trad_frame_set_value (info->saved_regs, SPU_SP_REGNUM, info->frame_base);
> +
> + /* The previous PC comes from the link register. In the case
> + of overlay return stubs, we unwind to the real return address. */
> + if (trad_frame_addr_p (info->saved_regs, SPU_LR_REGNUM))
> + target_read_memory (info->saved_regs[SPU_LR_REGNUM].addr, buf, 16);
> + else
> + frame_unwind_register (next_frame, SPU_LR_REGNUM, buf);
> +
> + if (extract_unsigned_integer (buf + 8, 4) != 0)
> + trad_frame_set_value (info->saved_regs, SPU_PC_REGNUM,
> + extract_unsigned_integer (buf + 8, 4));
> + else
> + trad_frame_set_value (info->saved_regs, SPU_PC_REGNUM,
> + extract_unsigned_integer (buf, 4));

(I'm not sure how this ends up detecting an overlay return stub, but
I'll take your word for it.)

This is clever, but kind of sneaky. We show signal return trampolines
and dummy call trampolines, so I'm not sure why it's necessary to
hide overlay return stubs. Do you think this is more useful than
confusing?

--
Daniel Jacobowitz
CodeSourcery