This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] | |
Manually tested under i686-mingw.
Tested under i686-linux, commited on mainline.
The Ada runtime now supports SEH (Structured Exception
Handling). This is currently used on Win32 only and handles
properly multiple sigsegv. Note that on Win32 it is required to
initialize the exception registration record (2 words actually) on
each thread. It is also important to note that the exception
registration record must be allocated on the stack of the thread.
The following code should display 10 times the exception message under
Windows:
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Text_IO; use Ada.Text_IO;
with System; use System;
procedure Tasking is
task T;
task body T is
A : Integer; for A'Address use System.Null_Address;
begin
for K in 1 .. 10 loop
begin
A := 1;
exception
when E : others =>
Put_Line ("Got exception: " & Exception_Message (E));
end;
end loop;
end T;
begin
null;
end Tasking;
--
2005-02-09 Pascal Obry <obry@adacore.com>
Arnaud Charlet <charlet@adacore.com>
* init.c (__gnat_initialize): Add a new parameter eh which contains the
address of the exception registration. The Win32 version of this
routine calls __gnat_install_SEH_handler() to initialize the SEH
(Structured Exception Handling) handler.
(__gnat_error_handler) [Win32]: Removed. Not needed as we use
SEH (Structured Exception Handling) now.
(__gnat_install_handler) [Win32]: Nothing to do now as we use SEH.
(__gnat_initialize for ppc-vxworks): Adjust comments and the
preprocessor condition protecting the call to the extra eh setup
subprogram, which is only available for the ppc target.
(__gnat_clear_exception_count): replaced reference to
variable taskIdCurrent by call to taskIdSelf(), cleaner.
* seh_init.c: New file.
* Make-lang.in: (GNAT_ADA_OBJS): Add seh_init.o.
(GNATBIND_OBJS): Idem.
* misc.c (gnat_parse_file): Update call to __gnat_initialize. This
routine takes a new parameter (a pointer to the exception registration
for the SEH (Structured Exception Handling) support.
* raise.h: (__gnat_install_SEH_handler): New prototype.
Update copyright notice.
* s-tassta.adb (Task_Wrapper): Declare the exception registration
record and initialize it by calling __gnat_install_SEH_handler.
Attachment:
difs.11
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |