This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: MIPS support for libjava.


David Daney writes:

 > Here is a patch against 3.3.1 that adds SIGSEGV handling of
 > NullPointerExceptions for a MIPS host.  It also contains a custom
 > backtrace function as the version we have in our libc is broken.

Greetings.

Do we have copyright assignment papers from you?


I think you can just call your version backtrace() -- link precedence
will sort out the ordering, so you don't need any heavy configury
changes.


>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.

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.

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.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]