annotate gcc/ada/libgnat/a-except.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT RUN-TIME COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- A D A . E X C E P T I O N S --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- This specification is derived from the Ada Reference Manual for use with --
kono
parents:
diff changeset
12 -- GNAT. The copyright notice above, and the license provisions that follow --
kono
parents:
diff changeset
13 -- apply solely to the contents of the part following the private keyword. --
kono
parents:
diff changeset
14 -- --
kono
parents:
diff changeset
15 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
16 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
17 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
20 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
23 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
24 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
25 -- --
kono
parents:
diff changeset
26 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
27 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
28 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
29 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
30 -- --
kono
parents:
diff changeset
31 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
32 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
33 -- --
kono
parents:
diff changeset
34 ------------------------------------------------------------------------------
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 -- This version of Ada.Exceptions fully supports Ada 95 and later language
kono
parents:
diff changeset
37 -- versions. It is used in all situations except for the build of the
kono
parents:
diff changeset
38 -- compiler and other basic tools. For these latter builds, we use an
kono
parents:
diff changeset
39 -- Ada 95-only version.
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 -- The reason for this splitting off of a separate version is to support
kono
parents:
diff changeset
42 -- older bootstrap compilers that do not support Ada 2005 features, and
kono
parents:
diff changeset
43 -- Ada.Exceptions is part of the compiler sources.
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 pragma Polling (Off);
kono
parents:
diff changeset
46 -- We must turn polling off for this unit, because otherwise we get
kono
parents:
diff changeset
47 -- elaboration circularities with ourself.
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 with System;
kono
parents:
diff changeset
50 with System.Parameters;
kono
parents:
diff changeset
51 with System.Standard_Library;
kono
parents:
diff changeset
52 with System.Traceback_Entries;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 package Ada.Exceptions is
kono
parents:
diff changeset
55 pragma Preelaborate;
kono
parents:
diff changeset
56 -- In accordance with Ada 2005 AI-362.
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 type Exception_Id is private;
kono
parents:
diff changeset
59 pragma Preelaborable_Initialization (Exception_Id);
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 Null_Id : constant Exception_Id;
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 type Exception_Occurrence is limited private;
kono
parents:
diff changeset
64 pragma Preelaborable_Initialization (Exception_Occurrence);
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 type Exception_Occurrence_Access is access all Exception_Occurrence;
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 Null_Occurrence : constant Exception_Occurrence;
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 function Exception_Name (Id : Exception_Id) return String;
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 function Exception_Name (X : Exception_Occurrence) return String;
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 function Wide_Exception_Name
kono
parents:
diff changeset
75 (Id : Exception_Id) return Wide_String;
kono
parents:
diff changeset
76 pragma Ada_05 (Wide_Exception_Name);
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 function Wide_Exception_Name
kono
parents:
diff changeset
79 (X : Exception_Occurrence) return Wide_String;
kono
parents:
diff changeset
80 pragma Ada_05 (Wide_Exception_Name);
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 function Wide_Wide_Exception_Name
kono
parents:
diff changeset
83 (Id : Exception_Id) return Wide_Wide_String;
kono
parents:
diff changeset
84 pragma Ada_05 (Wide_Wide_Exception_Name);
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 function Wide_Wide_Exception_Name
kono
parents:
diff changeset
87 (X : Exception_Occurrence) return Wide_Wide_String;
kono
parents:
diff changeset
88 pragma Ada_05 (Wide_Wide_Exception_Name);
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 procedure Raise_Exception (E : Exception_Id; Message : String := "");
kono
parents:
diff changeset
91 pragma No_Return (Raise_Exception);
kono
parents:
diff changeset
92 -- Note: In accordance with AI-466, CE is raised if E = Null_Id
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 function Exception_Message (X : Exception_Occurrence) return String;
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 procedure Reraise_Occurrence (X : Exception_Occurrence);
kono
parents:
diff changeset
97 -- Note: it would be really nice to give a pragma No_Return for this
kono
parents:
diff changeset
98 -- procedure, but it would be wrong, since Reraise_Occurrence does return
kono
parents:
diff changeset
99 -- if the argument is the null exception occurrence. See also procedure
kono
parents:
diff changeset
100 -- Reraise_Occurrence_Always in the private part of this package.
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 function Exception_Identity (X : Exception_Occurrence) return Exception_Id;
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 function Exception_Information (X : Exception_Occurrence) return String;
kono
parents:
diff changeset
105 -- The format of the exception information is as follows:
kono
parents:
diff changeset
106 --
kono
parents:
diff changeset
107 -- exception name (as in Exception_Name)
kono
parents:
diff changeset
108 -- message (or a null line if no message)
kono
parents:
diff changeset
109 -- PID=nnnn
kono
parents:
diff changeset
110 -- 0xyyyyyyyy 0xyyyyyyyy ...
kono
parents:
diff changeset
111 --
kono
parents:
diff changeset
112 -- The lines are separated by a ASCII.LF character
kono
parents:
diff changeset
113 --
kono
parents:
diff changeset
114 -- The nnnn is the partition Id given as decimal digits
kono
parents:
diff changeset
115 --
kono
parents:
diff changeset
116 -- The 0x... line represents traceback program counter locations,
kono
parents:
diff changeset
117 -- in order with the first one being the exception location.
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 -- Note on ordering: the compiler uses the Save_Occurrence procedure, but
kono
parents:
diff changeset
120 -- not the function from Rtsfind, so it is important that the procedure
kono
parents:
diff changeset
121 -- come first, since Rtsfind finds the first matching entity.
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 procedure Save_Occurrence
kono
parents:
diff changeset
124 (Target : out Exception_Occurrence;
kono
parents:
diff changeset
125 Source : Exception_Occurrence);
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 function Save_Occurrence
kono
parents:
diff changeset
128 (Source : Exception_Occurrence)
kono
parents:
diff changeset
129 return Exception_Occurrence_Access;
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 -- Ada 2005 (AI-438): The language revision introduces the following
kono
parents:
diff changeset
132 -- subprograms and attribute definitions. We do not provide them
kono
parents:
diff changeset
133 -- explicitly. instead, the corresponding stream attributes are made
kono
parents:
diff changeset
134 -- available through a pragma Stream_Convert in the private part.
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 -- procedure Read_Exception_Occurrence
kono
parents:
diff changeset
137 -- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
kono
parents:
diff changeset
138 -- Item : out Exception_Occurrence);
kono
parents:
diff changeset
139
kono
parents:
diff changeset
140 -- procedure Write_Exception_Occurrence
kono
parents:
diff changeset
141 -- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
kono
parents:
diff changeset
142 -- Item : Exception_Occurrence);
kono
parents:
diff changeset
143
kono
parents:
diff changeset
144 -- for Exception_Occurrence'Read use Read_Exception_Occurrence;
kono
parents:
diff changeset
145 -- for Exception_Occurrence'Write use Write_Exception_Occurrence;
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 private
kono
parents:
diff changeset
148 package SSL renames System.Standard_Library;
kono
parents:
diff changeset
149 package SP renames System.Parameters;
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 subtype EOA is Exception_Occurrence_Access;
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 Exception_Msg_Max_Length : constant := SP.Default_Exception_Msg_Max_Length;
kono
parents:
diff changeset
154
kono
parents:
diff changeset
155 ------------------
kono
parents:
diff changeset
156 -- Exception_Id --
kono
parents:
diff changeset
157 ------------------
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 subtype Code_Loc is System.Address;
kono
parents:
diff changeset
160 -- Code location used in building exception tables and for call addresses
kono
parents:
diff changeset
161 -- when propagating an exception. Values of this type are created by using
kono
parents:
diff changeset
162 -- Label'Address or extracted from machine states using Get_Code_Loc.
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 Null_Loc : constant Code_Loc := System.Null_Address;
kono
parents:
diff changeset
165 -- Null code location, used to flag outer level frame
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 type Exception_Id is new SSL.Exception_Data_Ptr;
kono
parents:
diff changeset
168
kono
parents:
diff changeset
169 function EId_To_String (X : Exception_Id) return String;
kono
parents:
diff changeset
170 function String_To_EId (S : String) return Exception_Id;
kono
parents:
diff changeset
171 pragma Stream_Convert (Exception_Id, String_To_EId, EId_To_String);
kono
parents:
diff changeset
172 -- Functions for implementing Exception_Id stream attributes
kono
parents:
diff changeset
173
kono
parents:
diff changeset
174 Null_Id : constant Exception_Id := null;
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176 -------------------------
kono
parents:
diff changeset
177 -- Private Subprograms --
kono
parents:
diff changeset
178 -------------------------
kono
parents:
diff changeset
179
kono
parents:
diff changeset
180 function Exception_Name_Simple (X : Exception_Occurrence) return String;
kono
parents:
diff changeset
181 -- Like Exception_Name, but returns the simple non-qualified name of the
kono
parents:
diff changeset
182 -- exception. This is used to implement the Exception_Name function in
kono
parents:
diff changeset
183 -- Current_Exceptions (the DEC compatible unit). It is called from the
kono
parents:
diff changeset
184 -- compiler generated code (using Rtsfind, which does not respect the
kono
parents:
diff changeset
185 -- private barrier, so we can place this function in the private part
kono
parents:
diff changeset
186 -- where the compiler can find it, but the spec is unchanged.)
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 procedure Raise_Exception_Always (E : Exception_Id; Message : String := "");
kono
parents:
diff changeset
189 pragma No_Return (Raise_Exception_Always);
kono
parents:
diff changeset
190 pragma Export (Ada, Raise_Exception_Always, "__gnat_raise_exception");
kono
parents:
diff changeset
191 -- This differs from Raise_Exception only in that the caller has determined
kono
parents:
diff changeset
192 -- that for sure the parameter E is not null, and that therefore no check
kono
parents:
diff changeset
193 -- for Null_Id is required. The expander converts Raise_Exception calls to
kono
parents:
diff changeset
194 -- Raise_Exception_Always if it can determine this is the case. The Export
kono
parents:
diff changeset
195 -- allows this routine to be accessed from Pure units.
kono
parents:
diff changeset
196
kono
parents:
diff changeset
197 procedure Raise_From_Signal_Handler
kono
parents:
diff changeset
198 (E : Exception_Id;
kono
parents:
diff changeset
199 M : System.Address);
kono
parents:
diff changeset
200 pragma Export
kono
parents:
diff changeset
201 (Ada, Raise_From_Signal_Handler,
kono
parents:
diff changeset
202 "ada__exceptions__raise_from_signal_handler");
kono
parents:
diff changeset
203 pragma No_Return (Raise_From_Signal_Handler);
kono
parents:
diff changeset
204 -- This routine is used to raise an exception from a signal handler. The
kono
parents:
diff changeset
205 -- signal handler has already stored the machine state (i.e. the state that
kono
parents:
diff changeset
206 -- corresponds to the location at which the signal was raised). E is the
kono
parents:
diff changeset
207 -- Exception_Id specifying what exception is being raised, and M is a
kono
parents:
diff changeset
208 -- pointer to a null-terminated string which is the message to be raised.
kono
parents:
diff changeset
209 -- Note that this routine never returns, so it is permissible to simply
kono
parents:
diff changeset
210 -- jump to this routine, rather than call it. This may be appropriate for
kono
parents:
diff changeset
211 -- systems where the right way to get out of signal handler is to alter the
kono
parents:
diff changeset
212 -- PC value in the machine state or in some other way ask the operating
kono
parents:
diff changeset
213 -- system to return here rather than to the original location.
kono
parents:
diff changeset
214
kono
parents:
diff changeset
215 procedure Raise_From_Controlled_Operation
kono
parents:
diff changeset
216 (X : Ada.Exceptions.Exception_Occurrence);
kono
parents:
diff changeset
217 pragma No_Return (Raise_From_Controlled_Operation);
kono
parents:
diff changeset
218 pragma Export
kono
parents:
diff changeset
219 (Ada, Raise_From_Controlled_Operation,
kono
parents:
diff changeset
220 "__gnat_raise_from_controlled_operation");
kono
parents:
diff changeset
221 -- Raise Program_Error, providing information about X (an exception raised
kono
parents:
diff changeset
222 -- during a controlled operation) in the exception message.
kono
parents:
diff changeset
223
kono
parents:
diff changeset
224 procedure Reraise_Library_Exception_If_Any;
kono
parents:
diff changeset
225 pragma Export
kono
parents:
diff changeset
226 (Ada, Reraise_Library_Exception_If_Any,
kono
parents:
diff changeset
227 "__gnat_reraise_library_exception_if_any");
kono
parents:
diff changeset
228 -- If there was an exception raised during library-level finalization,
kono
parents:
diff changeset
229 -- reraise the exception.
kono
parents:
diff changeset
230
kono
parents:
diff changeset
231 procedure Reraise_Occurrence_Always (X : Exception_Occurrence);
kono
parents:
diff changeset
232 pragma No_Return (Reraise_Occurrence_Always);
kono
parents:
diff changeset
233 -- This differs from Raise_Occurrence only in that the caller guarantees
kono
parents:
diff changeset
234 -- that for sure the parameter X is not the null occurrence, and that
kono
parents:
diff changeset
235 -- therefore this procedure cannot return. The expander uses this routine
kono
parents:
diff changeset
236 -- in the translation of a raise statement with no parameter (reraise).
kono
parents:
diff changeset
237
kono
parents:
diff changeset
238 procedure Reraise_Occurrence_No_Defer (X : Exception_Occurrence);
kono
parents:
diff changeset
239 pragma No_Return (Reraise_Occurrence_No_Defer);
kono
parents:
diff changeset
240 -- Exactly like Reraise_Occurrence, except that abort is not deferred
kono
parents:
diff changeset
241 -- before the call and the parameter X is known not to be the null
kono
parents:
diff changeset
242 -- occurrence. This is used in generated code when it is known that abort
kono
parents:
diff changeset
243 -- is already deferred.
kono
parents:
diff changeset
244
kono
parents:
diff changeset
245 function Triggered_By_Abort return Boolean;
kono
parents:
diff changeset
246 -- Determine whether the current exception (if it exists) is an instance of
kono
parents:
diff changeset
247 -- Standard'Abort_Signal.
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 -----------------------
kono
parents:
diff changeset
250 -- Polling Interface --
kono
parents:
diff changeset
251 -----------------------
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 -- The GNAT compiler has an option to generate polling calls to the Poll
kono
parents:
diff changeset
254 -- routine in this package. Specifying the -gnatP option for a compilation
kono
parents:
diff changeset
255 -- causes a call to Ada.Exceptions.Poll to be generated on every subprogram
kono
parents:
diff changeset
256 -- entry and on every iteration of a loop, thus avoiding the possibility of
kono
parents:
diff changeset
257 -- a case of unbounded time between calls.
kono
parents:
diff changeset
258
kono
parents:
diff changeset
259 -- This polling interface may be used for instrumentation or debugging
kono
parents:
diff changeset
260 -- purposes (e.g. implementing watchpoints in software or in the debugger).
kono
parents:
diff changeset
261
kono
parents:
diff changeset
262 -- In the GNAT technology itself, this interface is used to implement
kono
parents:
diff changeset
263 -- immediate asynchronous transfer of control and immediate abort on
kono
parents:
diff changeset
264 -- targets which do not provide for one thread interrupting another.
kono
parents:
diff changeset
265
kono
parents:
diff changeset
266 -- Note: this used to be in a separate unit called System.Poll, but that
kono
parents:
diff changeset
267 -- caused horrible circular elaboration problems between System.Poll and
kono
parents:
diff changeset
268 -- Ada.Exceptions.
kono
parents:
diff changeset
269
kono
parents:
diff changeset
270 procedure Poll;
kono
parents:
diff changeset
271 -- Check for asynchronous abort. Note that we do not inline the body.
kono
parents:
diff changeset
272 -- This makes the interface more useful for debugging purposes.
kono
parents:
diff changeset
273
kono
parents:
diff changeset
274 --------------------------
kono
parents:
diff changeset
275 -- Exception_Occurrence --
kono
parents:
diff changeset
276 --------------------------
kono
parents:
diff changeset
277
kono
parents:
diff changeset
278 package TBE renames System.Traceback_Entries;
kono
parents:
diff changeset
279
kono
parents:
diff changeset
280 Max_Tracebacks : constant := 50;
kono
parents:
diff changeset
281 -- Maximum number of trace backs stored in exception occurrence
kono
parents:
diff changeset
282
kono
parents:
diff changeset
283 subtype Tracebacks_Array is TBE.Tracebacks_Array (1 .. Max_Tracebacks);
kono
parents:
diff changeset
284 -- Traceback array stored in exception occurrence
kono
parents:
diff changeset
285
kono
parents:
diff changeset
286 type Exception_Occurrence is record
kono
parents:
diff changeset
287 Id : Exception_Id;
kono
parents:
diff changeset
288 -- Exception_Identity for this exception occurrence
kono
parents:
diff changeset
289
kono
parents:
diff changeset
290 Machine_Occurrence : System.Address;
kono
parents:
diff changeset
291 -- The underlying machine occurrence. For GCC, this corresponds to the
kono
parents:
diff changeset
292 -- _Unwind_Exception structure address.
kono
parents:
diff changeset
293
kono
parents:
diff changeset
294 Msg_Length : Natural := 0;
kono
parents:
diff changeset
295 -- Length of message (zero = no message)
kono
parents:
diff changeset
296
kono
parents:
diff changeset
297 Msg : String (1 .. Exception_Msg_Max_Length);
kono
parents:
diff changeset
298 -- Characters of message
kono
parents:
diff changeset
299
kono
parents:
diff changeset
300 Exception_Raised : Boolean := False;
kono
parents:
diff changeset
301 -- Set to true to indicate that this exception occurrence has actually
kono
parents:
diff changeset
302 -- been raised. When an exception occurrence is first created, this is
kono
parents:
diff changeset
303 -- set to False, then when it is processed by Raise_Current_Exception,
kono
parents:
diff changeset
304 -- it is set to True. If Raise_Current_Exception is used to raise an
kono
parents:
diff changeset
305 -- exception for which this flag is already True, then it knows that
kono
parents:
diff changeset
306 -- it is dealing with the reraise case (which is useful to distinguish
kono
parents:
diff changeset
307 -- for exception tracing purposes).
kono
parents:
diff changeset
308
kono
parents:
diff changeset
309 Pid : Natural := 0;
kono
parents:
diff changeset
310 -- Partition_Id for partition raising exception
kono
parents:
diff changeset
311
kono
parents:
diff changeset
312 Num_Tracebacks : Natural range 0 .. Max_Tracebacks := 0;
kono
parents:
diff changeset
313 -- Number of traceback entries stored
kono
parents:
diff changeset
314
kono
parents:
diff changeset
315 Tracebacks : Tracebacks_Array;
kono
parents:
diff changeset
316 -- Stored tracebacks (in Tracebacks (1 .. Num_Tracebacks))
kono
parents:
diff changeset
317 end record;
kono
parents:
diff changeset
318
kono
parents:
diff changeset
319 function "=" (Left, Right : Exception_Occurrence) return Boolean
kono
parents:
diff changeset
320 is abstract;
kono
parents:
diff changeset
321 -- Don't allow comparison on exception occurrences, we should not need
kono
parents:
diff changeset
322 -- this, and it would not work right, because of the Msg and Tracebacks
kono
parents:
diff changeset
323 -- fields which have unused entries not copied by Save_Occurrence.
kono
parents:
diff changeset
324
kono
parents:
diff changeset
325 function Get_Exception_Machine_Occurrence
kono
parents:
diff changeset
326 (X : Exception_Occurrence) return System.Address;
kono
parents:
diff changeset
327 pragma Export (Ada, Get_Exception_Machine_Occurrence,
kono
parents:
diff changeset
328 "__gnat_get_exception_machine_occurrence");
kono
parents:
diff changeset
329 -- Get the machine occurrence corresponding to an exception occurrence.
kono
parents:
diff changeset
330 -- It is Null_Address if there is no machine occurrence (in runtimes that
kono
parents:
diff changeset
331 -- doesn't use GCC mechanism) or if it has been lost (Save_Occurrence
kono
parents:
diff changeset
332 -- doesn't save the machine occurrence).
kono
parents:
diff changeset
333
kono
parents:
diff changeset
334 function EO_To_String (X : Exception_Occurrence) return String;
kono
parents:
diff changeset
335 function String_To_EO (S : String) return Exception_Occurrence;
kono
parents:
diff changeset
336 pragma Stream_Convert (Exception_Occurrence, String_To_EO, EO_To_String);
kono
parents:
diff changeset
337 -- Functions for implementing Exception_Occurrence stream attributes
kono
parents:
diff changeset
338
kono
parents:
diff changeset
339 Null_Occurrence : constant Exception_Occurrence := (
kono
parents:
diff changeset
340 Id => null,
kono
parents:
diff changeset
341 Machine_Occurrence => System.Null_Address,
kono
parents:
diff changeset
342 Msg_Length => 0,
kono
parents:
diff changeset
343 Msg => (others => ' '),
kono
parents:
diff changeset
344 Exception_Raised => False,
kono
parents:
diff changeset
345 Pid => 0,
kono
parents:
diff changeset
346 Num_Tracebacks => 0,
kono
parents:
diff changeset
347 Tracebacks => (others => TBE.Null_TB_Entry));
kono
parents:
diff changeset
348
kono
parents:
diff changeset
349 end Ada.Exceptions;