1 ------------------------------------------------------------------------------
3 -- GNAT LIBRARY COMPONENTS --
5 -- G N A T . M O S T _ R E C E N T _ E X C E P T I O N --
9 -- Copyright (C) 2000-2010, AdaCore --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 with Ada.Exceptions.Is_Null_Occurrence;
33 with System.Soft_Links;
35 package body GNAT.Most_Recent_Exception is
41 function Occurrence return Ada.Exceptions.Exception_Occurrence is
42 EOA : constant Ada.Exceptions.Exception_Occurrence_Access :=
43 GNAT.Most_Recent_Exception.Occurrence_Access;
45 use type Ada.Exceptions.Exception_Occurrence_Access;
48 return Result : Ada.Exceptions.Exception_Occurrence do
50 Ada.Exceptions.Save_Occurrence
52 Source => Ada.Exceptions.Null_Occurrence);
54 Ada.Exceptions.Save_Occurrence
61 -----------------------
62 -- Occurrence_Access --
63 -----------------------
65 function Occurrence_Access
66 return Ada.Exceptions.Exception_Occurrence_Access
70 EOA : constant Exception_Occurrence_Access :=
71 System.Soft_Links.Get_Current_Excep.all;
77 elsif Is_Null_Occurrence (EOA.all) then
83 end Occurrence_Access;
85 end GNAT.Most_Recent_Exception;