This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Enable DWARF2 exceptions on PPC
- To: java at gcc dot gnu dot org
- Subject: Enable DWARF2 exceptions on PPC
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- Date: Mon, 21 May 2001 17:31:56 +0100 (BST)
Use the new DWARF2 exceptions on PPC. With this I get 0 failures on
the libgcj testsuite.
Added to the trunk and the branch.
Andrew.
2001-05-18 Andrew Haley <aph@cambridge.redhat.com>
* include/dwarf2-signal.h: New file.
* configure.in (SYSDEP_SOURCES): Add dwarf2-signal.h for PPC.
* configure.host (EXCEPTIONSPEC): Don't use sjlj on PPC.
* configure: Rebuilt.
Index: include/dwarf2-signal.h
===================================================================
RCS file: dwarf2-signal.h
diff -N dwarf2-signal.h
*** /dev/null Tue May 5 13:32:27 1998
--- dwarf2-signal.h Mon May 21 09:23:37 2001
***************
*** 0 ****
--- 1,72 ----
+ // dwarf2-signal.h - Catch runtime signals and turn them into exceptions.
+
+ /* Copyright (C) 2000 Free Software Foundation
+
+ This file is part of libgcj.
+
+ Use this file for every target for which the dwarf2 unwinder in
+ libgcc can unwind through signal handlers and no special actions
+ are needed.
+
+ This software is copyrighted work licensed under the terms of the
+ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+ details. */
+
+ #ifndef JAVA_SIGNAL_H
+ #define JAVA_SIGNAL_H 1
+
+ #include <signal.h>
+ #include <sys/syscall.h>
+
+ #define HANDLE_SEGV 1
+ #undef HANDLE_FPE
+
+ #define SIGNAL_HANDLER(_name) \
+ static void _Jv_##_name (int)
+
+ class java::lang::Throwable;
+
+ // Unwind the stack to the point at which the signal was generated and
+ // then throw an exception. With the dwarf2 unwinder we don't need to
+ // do anything.
+
+ #define MAKE_THROW_FRAME(_exception) \
+ do \
+ { \
+ } \
+ while (0)
+
+
+ #define INIT_SEGV \
+ do \
+ { \
+ nullp = new java::lang::NullPointerException (); \
+ struct sigaction act; \
+ act.sa_handler = _Jv_catch_segv; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = 0; \
+ syscall (SYS_sigaction, SIGSEGV, &act, NULL); \
+ } \
+ while (0)
+
+ #define INIT_FPE \
+ do \
+ { \
+ arithexception = new java::lang::ArithmeticException \
+ (JvNewStringLatin1 ("/ by zero")); \
+ struct sigaction act; \
+ act.sa_handler = _Jv_catch_fpe; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = 0; \
+ syscall (SYS_sigaction, SIGFPE, &act, NULL); \
+ } \
+ while (0)
+
+ /* We use syscall(SYS_sigaction) in INIT_SEGV and INIT_FPE instead of
+ * sigaction() because on some systems the pthreads wrappers for
+ * signal handlers are not compiled with unwind information, so it's
+ * not possible to unwind through them. This is a problem that will
+ * go away once all systems have pthreads libraries that are
+ * compiled with full unwind info. */
+
+ #endif /* JAVA_SIGNAL_H */
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.73.2.7
diff -c -2 -p -r1.73.2.7 configure.in
*** configure.in 2001/05/14 17:45:15 1.73.2.7
--- configure.in 2001/05/21 16:24:46
*************** case "${host}" in
*** 746,749 ****
--- 746,752 ----
# test -d sysdep || mkdir sysdep
# ;;
+ powerpc-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
+ ;;
*)
SIGNAL_HANDLER=include/default-signal.h
Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.host,v
retrieving revision 1.15.2.3
diff -c -2 -p -r1.15.2.3 configure.host
*** configure.host 2001/05/14 17:45:15 1.15.2.3
--- configure.host 2001/05/21 16:24:46
*************** case "${host}" in
*** 68,72 ****
libgcj_flags="${libgcj_flags} -mieee"
libgcj_interpreter=yes
- libgcj_sjlj=yes
;;
powerpc*-*)
--- 68,71 ----