Re: [PATCH/arm] Backtrace through exception frames on arm/cortex-m target

Mark Kettenis
2012-11-13T15:12:06Z

> Date: Tue, 13 Nov 2012 22:44:07 +0800
> From: Yao Qi <yao@codesourcery.com>
>
> On 11/13/2012 10:27 PM, Mark Kettenis wrote:
> >> + unwound_sp = get_frame_register_unsigned (this_frame, ARM_SP_REGNUM);
> > Calling get_frame_register_unsign(this_frame, ...) in the unwinder
> > itself is verboten!.
>
> Really? It is a surprise to me. I see get_frame_register_unsigned is
> called in many other unwinders, for example,
>
> *** alpha-mdebug-tdep.c:
> alpha_mdebug_frame_unwind_cache[217] vfp = get_frame_register_unsigned
> (this_frame, PROC_FRAME_REG (proc_desc));
>
> *** amd64obsd-tdep.c:
> amd64obsd_trapframe_cache[373] sp = get_frame_register_unsigned
> (this_frame, AMD64_RSP_REGNUM);
>
> *** arm-linux-tdep.c:
> arm_linux_sigtramp_cache[258] CORE_ADDR sp =
> get_frame_register_unsigned (this_frame, ARM_SP_REGNUM);
>
> *** avr-tdep.c:
> avr_frame_unwind_cache[987] this_base = get_frame_register_unsigned
> (this_frame, AVR_FP_REGNUM);
>
> Am I missing something?

Ugh, no, you're right. It's unwinding THIS_FRAME in the unwinder that
is verboten. Objection withdrawn.