On Mon, Oct 6, 2014 at 3:45 PM, Yvan Roux <[email protected]> wrote:
> Hi,
>
> > I'd try to use ia64 and x86_64 as reference code on this topic.
> > src/ia64/Gresume.c has some relevant comments on preserved vs scratch.
> >
> > My understanding of the aarch64 code is:
> >
> > (c->sigcontext_format == AARCH64_SCF_NONE) {
> > // normal path
> > } else {
> > // exception handling path
> > // eh_valid_mask is being looked at
> > }
> >
> > What I'm not understanding is: how does the exception handling path
> > end up with AARCH64_SCF_NONE?
>
> what I did here is to use the same pattern as on the arm and sh port, to
> handle cases without signals (when AARCH64_SCF_NONE is true) and with
> signals, but I've handle exception argument passing only when signal are
> involved which is an error. What I don't understand in the ia64 code
> (which
> have almost the same structure) is: why in the non-signal path exception
> arguments registers are always restored and not guarded by the test on
> eh_valid_mask ?
>
> Regarding the proposed patch, I think that it should handle registers
> x0,x1,x2 and x3 and not only x0 and x1.
>
> Yvan
>
We don't need restore EH registers in the non-signal path if eh_valid_mask
is not set (i. e. register values are undefined). But checking
eh_valid_mask is slower than restoring register, so we just always restore
EH registers.
And yes, it seems we need to restore x0, x1, x2, x3, not only x0 and x1.
Let me know if there's more questions or if it's more or less acceptable
_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel