This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFD: Unwind_Backtrace for ARM EABI
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: Daniel Jacobowitz <dan at debian dot org>
- Cc: gcc at gcc dot gnu dot org, java at gcc dot gnu dot org, debian-arm at lists dot debian dot org, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Tue, 14 Aug 2007 16:33:52 +0100
- Subject: Re: RFD: Unwind_Backtrace for ARM EABI
- References: <18113.48350.974230.302908@zebedee.pink> <20070814152808.GA18971@caradoc.them.org>
Daniel Jacobowitz writes:
> On Tue, Aug 14, 2007 at 03:31:58PM +0100, Andrew Haley wrote:
> > This is one of the last pieces in the jigsaw for gcj on ARM.
> >
> > Unwind_Backtrace is not defined in the ARM exception handling spec at
> > http://www.arm.com/pdfs/ehabi.pdf, but it can be implemented by
> > performing Phase 1 of a forced unwind, calling the trace function as
> > we go. This works for gcj, which uses backtraces quite heavily, and
> > as far as I can see it'd work everywhere else too.
>
> That's clever, I think it will work. The only problem I see is that
> libstdc++'s personality routine will call terminate if it gets
> lost.
I think we can live with that.
> > + /* Set demand-save flags. */
> > + saved_vrs.demand_save_flags = ~(_uw) 0;
>
> You probably need a call to restore_non_core_regs at the end, or
> you'll corrupt the caller's VFP / WMMXT state.
OK.
> > + /* Call the pr to decide what to do. */
> > + code = ((personality_routine) UCB_PR_ADDR (ucbp))
> > + (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND,
> > + ucbp, (void *) &saved_vrs);
> > + }
> > + while (code != _URC_END_OF_STACK);
>
> This will keep going if the personality routine returns _URC_FAILURE.
I'll fix that.
> Do you need anything besides _URC_CONTINUE_UNWIND? The personality
> routine in libsupc++ for ARM will return _URC_HANDLER_FOUND even
> during forced unwinding but that seems like a bug now that you've
> given a meaning to _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND.
I don't think that it matters much. I think it should just loop until
_URC_FAILURE or _URC_END_OF_STACK.
Andrew.