]>
gcc.gnu.org Git - gcc.git/blob - libjava/include/dwarf2-signal.h
1 // dwarf2-signal.h - Catch runtime signals and turn them into exceptions.
3 /* Copyright (C) 2000, 2001 Free Software Foundation
5 This file is part of libgcj.
7 Use this file for every target for which the dwarf2 unwinder in
8 libgcc can unwind through signal handlers and no special actions
11 This software is copyrighted work licensed under the terms of the
12 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
16 #define JAVA_SIGNAL_H 1
19 #include <sys/syscall.h>
24 #define SIGNAL_HANDLER(_name) \
25 static void _Jv_##_name (int)
27 class java::lang::Throwable
;
29 // Unwind the stack to the point at which the signal was generated and
30 // then throw an exception. With the dwarf2 unwinder we don't need to
33 #define MAKE_THROW_FRAME(_exception) \
43 nullp = new java::lang::NullPointerException (); \
44 struct sigaction act; \
45 act.sa_handler = _Jv_catch_segv; \
46 sigemptyset (&act.sa_mask); \
48 syscall (SYS_sigaction, SIGSEGV, &act, NULL); \
55 arithexception = new java::lang::ArithmeticException \
56 (JvNewStringLatin1 ("/ by zero")); \
57 struct sigaction act; \
58 act.sa_handler = _Jv_catch_fpe; \
59 sigemptyset (&act.sa_mask); \
61 syscall (SYS_sigaction, SIGFPE, &act, NULL); \
65 /* We use syscall(SYS_sigaction) in INIT_SEGV and INIT_FPE instead of
66 * sigaction() because on some systems the pthreads wrappers for
67 * signal handlers are not compiled with unwind information, so it's
68 * not possible to unwind through them. This is a problem that will
69 * go away once all systems have pthreads libraries that are
70 * compiled with full unwind info. */
72 #endif /* JAVA_SIGNAL_H */
This page took 0.038409 seconds and 5 git commands to generate.