This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: MIPS support for libjava.
David Daney writes:
> Andrew Haley wrote:
>
> >Do we have copyright assignment papers from you?
> >
> I finally mailed them in last week. If you don't already have them, you
> should have them soon.
Okay. It can sometimes take a while for the FSF to turn these around.
> >From what I can see, you jump to the magic code that restores some
> >registers form the signal frame and then that code jumps to
> >_Jv_MipselThrowNPE.
> >
> >The unwinder sees that the return address points to the middle of
> >__sig2exdummy and unwinds from there. The return address of
> >__sig2exdummy points just after the faulting insn.
> >
> That was the general idea.
>
> >
> >What I can't quite see is how scratch registers that are destroyed by
> >the signal handler will be restored. As far as I can see there's
> >nothing to restore them. $16..$23 are restored, but not $12..$15 or
> >$31, and the compiler won't expect these to be trashed by a faulting
> >memory access.
> >
> For some reason I thought that -fnon-call-exceptions might take care of
> those.
I don't think that happens on other arches, but I admit that it varies
quite a bit. The thing to do is copy everything that is saved in the
sigcontext into the unwinder context and the unwinder worry about what
to do with it all.
> >The official way to do this is to define MD_FALLBACK_FRAME_STATE_FOR
> >in arch/linux.h. See gcc/config/rs6000/linux.h for an example.
> >
> >
> I knew there must be a better way, but did not want to start hacking in
> the "core" of gcc. Perhaps it is time to revisit that decision.
MD_FALLBACK_FRAME_STATE_FOR is a bit tricky, but there's now quite a
few examples for other Linuxes to refer to. Although the way it works
by recognizing a signal handler frame is rather weird, this is the
best way to do it. I think you'll find the result is less hairy than
your patch.
Thanks,
Andrew.