aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-04-29 17:24:56 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-04-29 17:24:56 +0200
commitd935a36e27c5a15e05cabdc6b6e9b6d68538a14f (patch)
tree32aad4e68b4052f7ce71c58540a2b80a90d67674 /gcc/ada/init.c
parent56141a6ad7f965b156427f25ab45bd1093b0b565 (diff)
downloadgcc-d935a36e27c5a15e05cabdc6b6e9b6d68538a14f.zip
gcc-d935a36e27c5a15e05cabdc6b6e9b6d68538a14f.tar.gz
gcc-d935a36e27c5a15e05cabdc6b6e9b6d68538a14f.tar.bz2
[multiple changes]
2004-04-29 Ed Schonberg <schonberg@gnat.com> * checks.adb (Enable_Range_Check): If the prefix of an index component is an access to an unconstrained array, perform check unconditionally. 2004-04-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * decl.c (gnat_to_gnu_field): Also call make_packable_type if Component_Clause. 2004-04-29 Olivier Hainque <hainque@act-europe.fr> * init.c (__gnat_install_handler, __gnat_error_handler): Remove alternate stack setting. There was no support for the tasking cases and the changes eventually caused a number of side-effect failures in the non-tasking case too. 2004-04-29 Eric Botcazou <ebotcazou@act-europe.fr> lang-specs.h: Redirect output to /dev/null if -gnatc or -gnatz or -gnats is passed. 2004-04-29 Vincent Celier <celier@gnat.com> * make.adb (Gnatmake): Increase max size of argument array for gnatbind for the potential addition of -F. If there are Stand-Alone Library projects, invoke gnatbind with -F to be sure that elaboration flags will be checked. * switch-c.adb: Correct call to Scan_Pos for -gnateI 2004-04-29 Thomas Quinot <quinot@act-europe.fr> * sem_warn.adb (Check_References): Move '<access-variable> may be null' warning out of under Warn_On_No_Value_Assigned. 2004-04-29 Ed Falis <falis@gnat.com> * gnat_ugn.texi: Fixed texi error 2004-04-29 Robert Dewar <dewar@gnat.com> * sem_ch4.adb (Remove_Abstract_Operations): Unconditionally remove abstract operations if they come from predefined files. * gnat_rm.texi: Fix bad doc for pragma Elaboration_Checks (should be Dynamic, not RM). * s-addope.adb: Correct obvious error in mod function From-SVN: r81289
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r--gcc/ada/init.c65
1 files changed, 1 insertions, 64 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index efc1a25..fd25d0d 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -386,7 +386,6 @@ __gnat_initialize (void)
exclude this case in the above test. */
#include <signal.h>
-#include <setjmp.h>
#include <sys/siginfo.h>
static void __gnat_error_handler (int, siginfo_t *, struct sigcontext *);
@@ -404,7 +403,6 @@ __gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context)
static int recurse = 0;
struct sigcontext *mstate;
const char *msg;
- jmp_buf handler_jmpbuf;
/* If this was an explicit signal from a "kill", just resignal it. */
if (SI_FROMUSER (sip))
@@ -414,43 +412,6 @@ __gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context)
}
/* Otherwise, treat it as something we handle. */
-
- /* We are now going to raise the exception corresponding to the signal we
- caught, which may eventually end up resuming the application code if the
- exception is handled.
-
- When the exception is handled, merely arranging for the *exception*
- handler's context (stack pointer, program counter, other registers, ...)
- to be installed is *not* enough to let the kernel think we've left the
- *signal* handler. This has annoying implications if an alternate stack
- has been setup for this *signal* handler, because the kernel thinks we
- are still running on that alternate stack even after the jump, which
- causes trouble at least as soon as another signal is raised.
-
- We deal with this by forcing a "local" longjmp within the signal handler
- below, forcing the "on alternate stack" indication to be reset (kernel
- wise) on the way. If no alternate stack has been setup, this should be a
- neutral operation. Otherwise, we will be in a delicate situation for a
- short while because we are going to run the exception propagation code
- within the alternate stack area (that is, with the stack pointer inside
- the alternate stack bounds), but with the corresponding flag off from the
- kernel's standpoint. We expect this to be ok as long as the propagation
- code does not trigger a signal itself, which is expected.
-
- ??? A better approach would be to at least delay this operation until the
- last second, that is, until just before we jump to the exception handler,
- if any. */
-
- if (setjmp (handler_jmpbuf) == 0)
- {
-#define JB_ONSIGSTK 0
-
- /* Arrange for the "on alternate stack" flag to be reset. See the
- comments around "jmp_buf offsets" in /usr/include/setjmp.h. */
- handler_jmpbuf [JB_ONSIGSTK] = 0;
- longjmp (handler_jmpbuf, 1);
- }
-
switch (sig)
{
case SIGSEGV:
@@ -510,36 +471,12 @@ __gnat_install_handler (void)
{
struct sigaction act;
- /* stack-checking on this platform is performed by the back-end and conforms
- to what the ABI *mandates* (DEC OSF/1 Calling standard for AXP systems,
- chapter 6: Stack Limits in Multihtreaded Execution Environments). This
- does not include a "stack reserve" region, so nothing guarantees that
- enough room remains on the current stack to propagate an exception when
- a stack-overflow is signaled. We deal with this by requesting the use of
- an alternate stack region for signal handlers.
-
- ??? The actual use of this alternate region depends on the act.sa_flags
- including SA_ONSTACK below. Care should be taken to update s-intman if
- we want this to happen for tasks also. */
-
- static char sig_stack [8*1024];
- /* 8K is a mininum to be able to propagate an exception using the GCC/ZCX
- scheme. */
-
- struct sigaltstack ss;
-
- ss.ss_sp = (void *) sig_stack;
- ss.ss_size = sizeof (sig_stack);
- ss.ss_flags = 0;
-
- sigaltstack (&ss, 0);
-
/* Setup signal handler to map synchronous signals to appropriate
exceptions. Make sure that the handler isn't interrupted by another
signal that might cause a scheduling event! */
act.sa_handler = (void (*) (int)) __gnat_error_handler;
- act.sa_flags = SA_ONSTACK | SA_RESTART | SA_NODEFER | SA_SIGINFO;
+ act.sa_flags = SA_RESTART | SA_NODEFER | SA_SIGINFO;
sigemptyset (&act.sa_mask);
/* Do not install handlers if interrupt state is "System" */