1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- A D A . E X C E P T I O N S --
9 -- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
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 2, 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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- This version is used for all Ada 2005 builds. It differs from a-except.ads
35 -- only with respect to the addition of Wide_[Wide]Exception_Name functions.
37 -- The reason for this splitting off of a separate version is that bootstrap
38 -- compilers often will be used that do not support Ada 2005 features, and
39 -- Ada.Exceptions is part of the compiler sources.
41 -- The base version of this unit Ada.Exceptions omits the Wide version of
42 -- Exception_Name and is used to build the compiler and other basic tools.
44 pragma Style_Checks
(All_Checks
);
45 -- No subprogram ordering check, due to logical grouping
48 -- We must turn polling off for this unit, because otherwise we get
49 -- elaboration circularities with System.Exception_Tables.
51 with System
; use System
;
52 with System
.Exceptions
; use System
.Exceptions
;
53 with System
.Standard_Library
; use System
.Standard_Library
;
54 with System
.Soft_Links
; use System
.Soft_Links
;
55 with System
.WCh_Con
; use System
.WCh_Con
;
56 with System
.WCh_StW
; use System
.WCh_StW
;
58 package body Ada
.Exceptions
is
60 pragma Suppress
(All_Checks
);
61 -- We definitely do not want exceptions occurring within this unit, or
62 -- we are in big trouble. If an exceptional situation does occur, better
63 -- that it not be raised, since raising it can cause confusing chaos.
65 -----------------------
66 -- Local Subprograms --
67 -----------------------
69 -- Note: the exported subprograms in this package body are called directly
70 -- from C clients using the given external name, even though they are not
71 -- technically visible in the Ada sense.
73 function Code_Address_For_AAA
return System
.Address
;
74 function Code_Address_For_ZZZ
return System
.Address
;
75 -- Return start and end of procedures in this package
77 -- These procedures are used to provide exclusion bounds in
78 -- calls to Call_Chain at exception raise points from this unit. The
79 -- purpose is to arrange for the exception tracebacks not to include
80 -- frames from routines involved in the raise process, as these are
81 -- meaningless from the user's standpoint.
83 -- For these bounds to be meaningful, we need to ensure that the object
84 -- code for the routines involved in processing a raise is located after
85 -- the object code Code_Address_For_AAA and before the object code
86 -- Code_Address_For_ZZZ. This will indeed be the case as long as the
87 -- following rules are respected:
89 -- 1) The bodies of the subprograms involved in processing a raise
90 -- are located after the body of Code_Address_For_AAA and before the
91 -- body of Code_Address_For_ZZZ.
93 -- 2) No pragma Inline applies to any of these subprograms, as this
94 -- could delay the corresponding assembly output until the end of
97 procedure Call_Chain
(Excep
: EOA
);
98 -- Store up to Max_Tracebacks in Excep, corresponding to the current
101 procedure To_Stderr
(S
: String);
102 pragma Export
(Ada
, To_Stderr
, "__gnat_to_stderr");
103 -- Little routine to output string to stderr that is also used
104 -- in the tasking run time.
106 procedure To_Stderr
(C
: Character);
107 pragma Inline
(To_Stderr
);
108 pragma Export
(Ada
, To_Stderr
, "__gnat_to_stderr_char");
109 -- Little routine to output a character to stderr, used by some of
110 -- the separate units below.
112 package Exception_Data
is
114 ---------------------------------
115 -- Exception messages routines --
116 ---------------------------------
118 procedure Set_Exception_C_Msg
120 Msg1
: System
.Address
;
122 Msg2
: System
.Address
:= System
.Null_Address
);
123 -- This routine is called to setup the exception referenced by the
124 -- Current_Excep field in the TSD to contain the indicated Id value
125 -- and message. Msg1 is a null terminated string which is generated
126 -- as the exception message. If line is non-zero, then a colon and
127 -- the decimal representation of this integer is appended to the
128 -- message. When Msg2 is non-null, a space and this additional null
129 -- terminated string is added to the message.
131 procedure Set_Exception_Msg
134 -- This routine is called to setup the exception referenced by the
135 -- Current_Excep field in the TSD to contain the indicated Id value
136 -- and message. Message is a string which is generated as the
137 -- exception message.
139 --------------------------------------
140 -- Exception information subprogram --
141 --------------------------------------
143 function Exception_Information
(X
: Exception_Occurrence
) return String;
144 -- The format of the exception information is as follows:
146 -- Exception_Name: <exception name> (as in Exception_Name)
147 -- Message: <message> (only if Exception_Message is empty)
148 -- PID=nnnn (only if != 0)
149 -- Call stack traceback locations: (only if at least one location)
150 -- <0xyyyyyyyy 0xyyyyyyyy ...> (is recorded)
152 -- The lines are separated by a ASCII.LF character.
153 -- The nnnn is the partition Id given as decimal digits.
154 -- The 0x... line represents traceback program counter locations, in
155 -- execution order with the first one being the exception location. It
158 -- The Exception_Name and Message lines are omitted in the abort
159 -- signal case, since this is not really an exception.
161 -- !! If the format of the generated string is changed, please note
162 -- !! that an equivalent modification to the routine String_To_EO must
163 -- !! be made to preserve proper functioning of the stream attributes.
165 ---------------------------------------
166 -- Exception backtracing subprograms --
167 ---------------------------------------
169 -- What is automatically output when exception tracing is on is the
170 -- usual exception information with the call chain backtrace possibly
171 -- tailored by a backtrace decorator. Modifying Exception_Information
172 -- itself is not a good idea because the decorated output is completely
173 -- out of control and would break all our code related to the streaming
174 -- of exceptions. We then provide an alternative function to compute
175 -- the possibly tailored output, which is equivalent if no decorator is
178 function Tailored_Exception_Information
179 (X
: Exception_Occurrence
) return String;
180 -- Exception information to be output in the case of automatic tracing
181 -- requested through GNAT.Exception_Traces.
183 -- This is the same as Exception_Information if no backtrace decorator
184 -- is currently in place. Otherwise, this is Exception_Information with
185 -- the call chain raw addresses replaced by the result of a call to the
186 -- current decorator provided with the call chain addresses.
189 (Ada
, Tailored_Exception_Information
,
190 "__gnat_tailored_exception_information");
191 -- This is currently used by System.Tasking.Stages
195 package Exception_Traces
is
198 -- Imports Tailored_Exception_Information
200 ----------------------------------------------
201 -- Run-Time Exception Notification Routines --
202 ----------------------------------------------
204 -- These subprograms provide a common run-time interface to trigger the
205 -- actions required when an exception is about to be propagated (e.g.
206 -- user specified actions or output of exception information). They are
207 -- exported to be usable by the Ada exception handling personality
208 -- routine when the GCC 3 mechanism is used.
210 procedure Notify_Handled_Exception
;
212 (C
, Notify_Handled_Exception
, "__gnat_notify_handled_exception");
213 -- This routine is called for a handled occurrence is about to be
216 procedure Notify_Unhandled_Exception
;
218 (C
, Notify_Unhandled_Exception
, "__gnat_notify_unhandled_exception");
219 -- This routine is called when an unhandled occurrence is about to be
222 procedure Unhandled_Exception_Terminate
;
223 pragma No_Return
(Unhandled_Exception_Terminate
);
224 -- This procedure is called to terminate execution following an
225 -- unhandled exception. The exception information, including
226 -- traceback if available is output, and execution is then
227 -- terminated. Note that at the point where this routine is
228 -- called, the stack has typically been destroyed.
230 end Exception_Traces
;
232 package Exception_Propagation
is
234 use Exception_Traces
;
235 -- Imports Notify_Unhandled_Exception and
236 -- Unhandled_Exception_Terminate
238 ------------------------------------
239 -- Exception propagation routines --
240 ------------------------------------
242 procedure Setup_Exception
245 Reraised
: Boolean := False);
246 -- Perform the necessary operations to prepare the propagation of Excep
247 -- in a task where Current is the current occurrence. Excep is assumed
248 -- to be a valid (non null) pointer.
250 -- This should be called before any (re-)setting of the current
251 -- occurrence. Any such (re-)setting shall take care *not* to clobber
252 -- the Private_Data component.
254 -- Having Current provided as an argument (instead of retrieving it via
255 -- Get_Current_Excep internally) is required to allow one task to setup
256 -- an exception for another task, which is used by Transfer_Occurrence.
258 procedure Propagate_Exception
260 From_Signal_Handler
: Boolean);
261 pragma No_Return
(Propagate_Exception
);
262 -- This procedure propagates the exception represented by the occurrence
263 -- referenced by Current_Excep in the TSD for the current task.
265 end Exception_Propagation
;
267 package Stream_Attributes
is
269 --------------------------------
270 -- Stream attributes routines --
271 --------------------------------
273 function EId_To_String
(X
: Exception_Id
) return String;
274 function String_To_EId
(S
: String) return Exception_Id
;
275 -- Functions for implementing Exception_Id stream attributes
277 function EO_To_String
(X
: Exception_Occurrence
) return String;
278 function String_To_EO
(S
: String) return Exception_Occurrence
;
279 -- Functions for implementing Exception_Occurrence stream
282 end Stream_Attributes
;
284 procedure Raise_Current_Excep
(E
: Exception_Id
);
285 pragma No_Return
(Raise_Current_Excep
);
286 pragma Export
(C
, Raise_Current_Excep
, "__gnat_raise_nodefer_with_msg");
287 -- This is a simple wrapper to Exception_Propagation.Propagate_Exception
288 -- setting the From_Signal_Handler argument to False.
290 -- This external name for Raise_Current_Excep is historical, and probably
291 -- should be changed but for now we keep it, because gdb and gigi know
294 procedure Raise_Exception_No_Defer
295 (E
: Exception_Id
; Message
: String := "");
297 (Ada
, Raise_Exception_No_Defer
,
298 "ada__exceptions__raise_exception_no_defer");
299 pragma No_Return
(Raise_Exception_No_Defer
);
300 -- Similar to Raise_Exception, but with no abort deferral
302 procedure Raise_With_Msg
(E
: Exception_Id
);
303 pragma No_Return
(Raise_With_Msg
);
304 pragma Export
(C
, Raise_With_Msg
, "__gnat_raise_with_msg");
305 -- Raises an exception with given exception id value. A message
306 -- is associated with the raise, and has already been stored in the
307 -- exception occurrence referenced by the Current_Excep in the TSD.
308 -- Abort is deferred before the raise call.
310 procedure Raise_With_Location_And_Msg
314 M
: System
.Address
:= System
.Null_Address
);
315 pragma No_Return
(Raise_With_Location_And_Msg
);
316 -- Raise an exception with given exception id value. A filename and line
317 -- number is associated with the raise and is stored in the exception
318 -- occurrence and in addition a string message M is appended to
319 -- this (if M is not null).
321 procedure Raise_Constraint_Error
322 (File
: System
.Address
;
324 pragma No_Return
(Raise_Constraint_Error
);
326 (C
, Raise_Constraint_Error
, "__gnat_raise_constraint_error");
327 -- Raise constraint error with file:line information
329 procedure Raise_Constraint_Error_Msg
330 (File
: System
.Address
;
332 Msg
: System
.Address
);
333 pragma No_Return
(Raise_Constraint_Error_Msg
);
335 (C
, Raise_Constraint_Error_Msg
, "__gnat_raise_constraint_error_msg");
336 -- Raise constraint error with file:line + msg information
338 procedure Raise_Program_Error
339 (File
: System
.Address
;
341 pragma No_Return
(Raise_Program_Error
);
343 (C
, Raise_Program_Error
, "__gnat_raise_program_error");
344 -- Raise program error with file:line information
346 procedure Raise_Program_Error_Msg
347 (File
: System
.Address
;
349 Msg
: System
.Address
);
350 pragma No_Return
(Raise_Program_Error_Msg
);
352 (C
, Raise_Program_Error_Msg
, "__gnat_raise_program_error_msg");
353 -- Raise program error with file:line + msg information
355 procedure Raise_Storage_Error
356 (File
: System
.Address
;
358 pragma No_Return
(Raise_Storage_Error
);
360 (C
, Raise_Storage_Error
, "__gnat_raise_storage_error");
361 -- Raise storage error with file:line information
363 procedure Raise_Storage_Error_Msg
364 (File
: System
.Address
;
366 Msg
: System
.Address
);
367 pragma No_Return
(Raise_Storage_Error_Msg
);
369 (C
, Raise_Storage_Error_Msg
, "__gnat_raise_storage_error_msg");
370 -- Raise storage error with file:line + reason msg information
372 -- The exception raising process and the automatic tracing mechanism rely
373 -- on some careful use of flags attached to the exception occurrence. The
374 -- graph below illustrates the relations between the Raise_ subprograms
375 -- and identifies the points where basic flags such as Exception_Raised
378 -- (i) signs indicate the flags initialization points. R stands for Raise,
379 -- W for With, and E for Exception.
381 -- R_No_Msg R_E R_Pe R_Ce R_Se
383 -- +--+ +--+ +---+ | +---+
385 -- R_E_No_Defer(i) R_W_Msg(i) R_W_Loc
387 -- +------------+ | +-----------+ +--+
389 -- | | | Set_E_C_Msg(i)
391 -- Raise_Current_Excep
394 pragma No_Return
(Reraise
);
395 pragma Export
(C
, Reraise
, "__gnat_reraise");
396 -- Reraises the exception referenced by the Current_Excep field of
397 -- the TSD (all fields of this exception occurrence are set). Abort
398 -- is deferred before the reraise operation.
400 -- Save_Occurrence variations: As the management of the private data
401 -- attached to occurrences is delicate, wether or not pointers to such
402 -- data has to be copied in various situations is better made explicit.
403 -- The following procedures provide an internal interface to help making
406 procedure Save_Occurrence_No_Private
407 (Target
: out Exception_Occurrence
;
408 Source
: Exception_Occurrence
);
409 -- Copy all the components of Source to Target, except the
410 -- Private_Data pointer.
412 procedure Transfer_Occurrence
413 (Target
: Exception_Occurrence_Access
;
414 Source
: Exception_Occurrence
);
415 pragma Export
(C
, Transfer_Occurrence
, "__gnat_transfer_occurrence");
416 -- Called from System.Tasking.RendezVous.Exceptional_Complete_RendezVous
417 -- to setup Target from Source as an exception to be propagated in the
418 -- caller task. Target is expected to be a pointer to the fixed TSD
419 -- occurrence for this task.
421 -----------------------------
422 -- Run-Time Check Routines --
423 -----------------------------
425 -- These routines are called from the runtime to raise a specific
426 -- exception with a reason message attached. The parameters are
427 -- the file name and line number in each case. The names are keyed
428 -- to the codes defined in Types.ads and a-types.h (for example,
429 -- the name Rcheck_05 refers to the Reason whose Pos code is 5).
431 procedure Rcheck_00
(File
: System
.Address
; Line
: Integer);
432 procedure Rcheck_01
(File
: System
.Address
; Line
: Integer);
433 procedure Rcheck_02
(File
: System
.Address
; Line
: Integer);
434 procedure Rcheck_03
(File
: System
.Address
; Line
: Integer);
435 procedure Rcheck_04
(File
: System
.Address
; Line
: Integer);
436 procedure Rcheck_05
(File
: System
.Address
; Line
: Integer);
437 procedure Rcheck_06
(File
: System
.Address
; Line
: Integer);
438 procedure Rcheck_07
(File
: System
.Address
; Line
: Integer);
439 procedure Rcheck_08
(File
: System
.Address
; Line
: Integer);
440 procedure Rcheck_09
(File
: System
.Address
; Line
: Integer);
441 procedure Rcheck_10
(File
: System
.Address
; Line
: Integer);
442 procedure Rcheck_11
(File
: System
.Address
; Line
: Integer);
443 procedure Rcheck_12
(File
: System
.Address
; Line
: Integer);
444 procedure Rcheck_13
(File
: System
.Address
; Line
: Integer);
445 procedure Rcheck_14
(File
: System
.Address
; Line
: Integer);
446 procedure Rcheck_15
(File
: System
.Address
; Line
: Integer);
447 procedure Rcheck_16
(File
: System
.Address
; Line
: Integer);
448 procedure Rcheck_17
(File
: System
.Address
; Line
: Integer);
449 procedure Rcheck_18
(File
: System
.Address
; Line
: Integer);
450 procedure Rcheck_19
(File
: System
.Address
; Line
: Integer);
451 procedure Rcheck_20
(File
: System
.Address
; Line
: Integer);
452 procedure Rcheck_21
(File
: System
.Address
; Line
: Integer);
453 procedure Rcheck_22
(File
: System
.Address
; Line
: Integer);
454 procedure Rcheck_23
(File
: System
.Address
; Line
: Integer);
455 procedure Rcheck_24
(File
: System
.Address
; Line
: Integer);
456 procedure Rcheck_25
(File
: System
.Address
; Line
: Integer);
457 procedure Rcheck_26
(File
: System
.Address
; Line
: Integer);
458 procedure Rcheck_27
(File
: System
.Address
; Line
: Integer);
459 procedure Rcheck_28
(File
: System
.Address
; Line
: Integer);
460 procedure Rcheck_29
(File
: System
.Address
; Line
: Integer);
461 procedure Rcheck_30
(File
: System
.Address
; Line
: Integer);
462 procedure Rcheck_31
(File
: System
.Address
; Line
: Integer);
463 procedure Rcheck_32
(File
: System
.Address
; Line
: Integer);
465 pragma Export
(C
, Rcheck_00
, "__gnat_rcheck_00");
466 pragma Export
(C
, Rcheck_01
, "__gnat_rcheck_01");
467 pragma Export
(C
, Rcheck_02
, "__gnat_rcheck_02");
468 pragma Export
(C
, Rcheck_03
, "__gnat_rcheck_03");
469 pragma Export
(C
, Rcheck_04
, "__gnat_rcheck_04");
470 pragma Export
(C
, Rcheck_05
, "__gnat_rcheck_05");
471 pragma Export
(C
, Rcheck_06
, "__gnat_rcheck_06");
472 pragma Export
(C
, Rcheck_07
, "__gnat_rcheck_07");
473 pragma Export
(C
, Rcheck_08
, "__gnat_rcheck_08");
474 pragma Export
(C
, Rcheck_09
, "__gnat_rcheck_09");
475 pragma Export
(C
, Rcheck_10
, "__gnat_rcheck_10");
476 pragma Export
(C
, Rcheck_11
, "__gnat_rcheck_11");
477 pragma Export
(C
, Rcheck_12
, "__gnat_rcheck_12");
478 pragma Export
(C
, Rcheck_13
, "__gnat_rcheck_13");
479 pragma Export
(C
, Rcheck_14
, "__gnat_rcheck_14");
480 pragma Export
(C
, Rcheck_15
, "__gnat_rcheck_15");
481 pragma Export
(C
, Rcheck_16
, "__gnat_rcheck_16");
482 pragma Export
(C
, Rcheck_17
, "__gnat_rcheck_17");
483 pragma Export
(C
, Rcheck_18
, "__gnat_rcheck_18");
484 pragma Export
(C
, Rcheck_19
, "__gnat_rcheck_19");
485 pragma Export
(C
, Rcheck_20
, "__gnat_rcheck_20");
486 pragma Export
(C
, Rcheck_21
, "__gnat_rcheck_21");
487 pragma Export
(C
, Rcheck_22
, "__gnat_rcheck_22");
488 pragma Export
(C
, Rcheck_23
, "__gnat_rcheck_23");
489 pragma Export
(C
, Rcheck_24
, "__gnat_rcheck_24");
490 pragma Export
(C
, Rcheck_25
, "__gnat_rcheck_25");
491 pragma Export
(C
, Rcheck_26
, "__gnat_rcheck_26");
492 pragma Export
(C
, Rcheck_27
, "__gnat_rcheck_27");
493 pragma Export
(C
, Rcheck_28
, "__gnat_rcheck_28");
494 pragma Export
(C
, Rcheck_29
, "__gnat_rcheck_29");
495 pragma Export
(C
, Rcheck_30
, "__gnat_rcheck_30");
496 pragma Export
(C
, Rcheck_31
, "__gnat_rcheck_31");
497 pragma Export
(C
, Rcheck_32
, "__gnat_rcheck_32");
499 -- None of these procedures ever returns (they raise an exception!). By
500 -- using pragma No_Return, we ensure that any junk code after the call,
501 -- such as normal return epilog stuff, can be eliminated).
503 pragma No_Return
(Rcheck_00
);
504 pragma No_Return
(Rcheck_01
);
505 pragma No_Return
(Rcheck_02
);
506 pragma No_Return
(Rcheck_03
);
507 pragma No_Return
(Rcheck_04
);
508 pragma No_Return
(Rcheck_05
);
509 pragma No_Return
(Rcheck_06
);
510 pragma No_Return
(Rcheck_07
);
511 pragma No_Return
(Rcheck_08
);
512 pragma No_Return
(Rcheck_09
);
513 pragma No_Return
(Rcheck_10
);
514 pragma No_Return
(Rcheck_11
);
515 pragma No_Return
(Rcheck_12
);
516 pragma No_Return
(Rcheck_13
);
517 pragma No_Return
(Rcheck_14
);
518 pragma No_Return
(Rcheck_15
);
519 pragma No_Return
(Rcheck_16
);
520 pragma No_Return
(Rcheck_17
);
521 pragma No_Return
(Rcheck_18
);
522 pragma No_Return
(Rcheck_19
);
523 pragma No_Return
(Rcheck_20
);
524 pragma No_Return
(Rcheck_21
);
525 pragma No_Return
(Rcheck_22
);
526 pragma No_Return
(Rcheck_23
);
527 pragma No_Return
(Rcheck_24
);
528 pragma No_Return
(Rcheck_25
);
529 pragma No_Return
(Rcheck_26
);
530 pragma No_Return
(Rcheck_27
);
531 pragma No_Return
(Rcheck_28
);
532 pragma No_Return
(Rcheck_29
);
533 pragma No_Return
(Rcheck_30
);
534 pragma No_Return
(Rcheck_32
);
536 ---------------------------------------------
537 -- Reason Strings for Run-Time Check Calls --
538 ---------------------------------------------
540 -- These strings are null-terminated and are used by Rcheck_nn. The
541 -- strings correspond to the definitions for Types.RT_Exception_Code.
545 Rmsg_00
: constant String := "access check failed" & NUL
;
546 Rmsg_01
: constant String := "access parameter is null" & NUL
;
547 Rmsg_02
: constant String := "discriminant check failed" & NUL
;
548 Rmsg_03
: constant String := "divide by zero" & NUL
;
549 Rmsg_04
: constant String := "explicit raise" & NUL
;
550 Rmsg_05
: constant String := "index check failed" & NUL
;
551 Rmsg_06
: constant String := "invalid data" & NUL
;
552 Rmsg_07
: constant String := "length check failed" & NUL
;
553 Rmsg_08
: constant String := "null Exception_Id" & NUL
;
554 Rmsg_09
: constant String := "null-exclusion check failed" & NUL
;
555 Rmsg_10
: constant String := "overflow check failed" & NUL
;
556 Rmsg_11
: constant String := "partition check failed" & NUL
;
557 Rmsg_12
: constant String := "range check failed" & NUL
;
558 Rmsg_13
: constant String := "tag check failed" & NUL
;
559 Rmsg_14
: constant String := "access before elaboration" & NUL
;
560 Rmsg_15
: constant String := "accessibility check failed" & NUL
;
561 Rmsg_16
: constant String := "all guards closed" & NUL
;
562 Rmsg_17
: constant String := "Current_Task referenced in entry" &
564 Rmsg_18
: constant String := "duplicated entry address" & NUL
;
565 Rmsg_19
: constant String := "explicit raise" & NUL
;
566 Rmsg_20
: constant String := "finalize/adjust raised exception" & NUL
;
567 Rmsg_21
: constant String := "implicit return with No_Return" & NUL
;
568 Rmsg_22
: constant String := "misaligned address value" & NUL
;
569 Rmsg_23
: constant String := "missing return" & NUL
;
570 Rmsg_24
: constant String := "overlaid controlled object" & NUL
;
571 Rmsg_25
: constant String := "potentially blocking operation" & NUL
;
572 Rmsg_26
: constant String := "stubbed subprogram called" & NUL
;
573 Rmsg_27
: constant String := "unchecked union restriction" & NUL
;
574 Rmsg_28
: constant String := "actual/returned class-wide value "
575 & "not transportable" & NUL
;
576 Rmsg_29
: constant String := "empty storage pool" & NUL
;
577 Rmsg_30
: constant String := "explicit raise" & NUL
;
578 Rmsg_31
: constant String := "infinite recursion" & NUL
;
579 Rmsg_32
: constant String := "object too large" & NUL
;
581 -----------------------
582 -- Polling Interface --
583 -----------------------
585 type Unsigned
is mod 2 ** 32;
587 Counter
: Unsigned
:= 0;
588 pragma Warnings
(Off
, Counter
);
589 -- This counter is provided for convenience. It can be used in Poll to
590 -- perform periodic but not systematic operations.
592 procedure Poll
is separate;
593 -- The actual polling routine is separate, so that it can easily
594 -- be replaced with a target dependent version.
596 --------------------------
597 -- Code_Address_For_AAA --
598 --------------------------
600 -- This function gives us the start of the PC range for addresses
601 -- within the exception unit itself. We hope that gigi/gcc keep all the
602 -- procedures in their original order!
604 function Code_Address_For_AAA
return System
.Address
is
606 -- We are using a label instead of merely using
607 -- Code_Address_For_AAA'Address because on some platforms the latter
608 -- does not yield the address we want, but the address of a stub or of
609 -- a descriptor instead. This is the case at least on Alpha-VMS and
613 return Start_Of_AAA
'Address;
614 end Code_Address_For_AAA
;
620 procedure Call_Chain
(Excep
: EOA
) is separate;
621 -- The actual Call_Chain routine is separate, so that it can easily
622 -- be dummied out when no exception traceback information is needed.
624 ------------------------------
625 -- Current_Target_Exception --
626 ------------------------------
628 function Current_Target_Exception
return Exception_Occurrence
is
630 return Null_Occurrence
;
631 end Current_Target_Exception
;
637 function EId_To_String
(X
: Exception_Id
) return String
638 renames Stream_Attributes
.EId_To_String
;
644 -- We use the null string to represent the null occurrence, otherwise
645 -- we output the Exception_Information string for the occurrence.
647 function EO_To_String
(X
: Exception_Occurrence
) return String
648 renames Stream_Attributes
.EO_To_String
;
650 ------------------------
651 -- Exception_Identity --
652 ------------------------
654 function Exception_Identity
655 (X
: Exception_Occurrence
) return Exception_Id
658 -- Note that the following test used to be here for the original
659 -- Ada 95 semantics, but these were modified by AI-241 to require
660 -- returning Null_Id instead of raising Constraint_Error.
662 -- if X.Id = Null_Id then
663 -- raise Constraint_Error;
667 end Exception_Identity
;
669 ---------------------------
670 -- Exception_Information --
671 ---------------------------
673 function Exception_Information
(X
: Exception_Occurrence
) return String is
675 if X
.Id
= Null_Id
then
676 raise Constraint_Error
;
679 return Exception_Data
.Exception_Information
(X
);
680 end Exception_Information
;
682 -----------------------
683 -- Exception_Message --
684 -----------------------
686 function Exception_Message
(X
: Exception_Occurrence
) return String is
688 if X
.Id
= Null_Id
then
689 raise Constraint_Error
;
692 return X
.Msg
(1 .. X
.Msg_Length
);
693 end Exception_Message
;
699 function Exception_Name
(Id
: Exception_Id
) return String is
702 raise Constraint_Error
;
705 return To_Ptr
(Id
.Full_Name
) (1 .. Id
.Name_Length
- 1);
708 function Exception_Name
(X
: Exception_Occurrence
) return String is
710 return Exception_Name
(X
.Id
);
713 ---------------------------
714 -- Exception_Name_Simple --
715 ---------------------------
717 function Exception_Name_Simple
(X
: Exception_Occurrence
) return String is
718 Name
: constant String := Exception_Name
(X
);
724 exit when Name
(P
- 1) = '.';
728 -- Return result making sure lower bound is 1
731 subtype Rname
is String (1 .. Name
'Length - P
+ 1);
733 return Rname
(Name
(P
.. Name
'Length));
735 end Exception_Name_Simple
;
741 package body Exception_Data
is separate;
742 -- This package can be easily dummied out if we do not want the
743 -- basic support for exception messages (such as in Ada 83).
745 ---------------------------
746 -- Exception_Propagation --
747 ---------------------------
749 package body Exception_Propagation
is separate;
750 -- Depending on the actual exception mechanism used (front-end or
751 -- back-end based), the implementation will differ, which is why this
752 -- package is separated.
754 ----------------------
755 -- Exception_Traces --
756 ----------------------
758 package body Exception_Traces
is separate;
759 -- Depending on the underlying support for IO the implementation
760 -- will differ. Moreover we would like to dummy out this package
761 -- in case we do not want any exception tracing support. This is
762 -- why this package is separated.
764 -----------------------
765 -- Stream Attributes --
766 -----------------------
768 package body Stream_Attributes
is separate;
769 -- This package can be easily dummied out if we do not want the
770 -- support for streaming Exception_Ids and Exception_Occurrences.
772 ----------------------------
773 -- Raise_Constraint_Error --
774 ----------------------------
776 procedure Raise_Constraint_Error
777 (File
: System
.Address
;
781 Raise_With_Location_And_Msg
782 (Constraint_Error_Def
'Access, File
, Line
);
783 end Raise_Constraint_Error
;
785 --------------------------------
786 -- Raise_Constraint_Error_Msg --
787 --------------------------------
789 procedure Raise_Constraint_Error_Msg
790 (File
: System
.Address
;
792 Msg
: System
.Address
)
795 Raise_With_Location_And_Msg
796 (Constraint_Error_Def
'Access, File
, Line
, Msg
);
797 end Raise_Constraint_Error_Msg
;
799 -------------------------
800 -- Raise_Current_Excep --
801 -------------------------
803 procedure Raise_Current_Excep
(E
: Exception_Id
) is
805 pragma Inspection_Point
(E
);
806 -- This is so the debugger can reliably inspect the parameter when
807 -- inserting a breakpoint at the start of this procedure.
809 -- To provide support for breakpoints on unhandled exceptions, the
810 -- debugger will also need to be able to inspect the value of E from
811 -- inner frames so we need to make sure that its value is also spilled
812 -- on stack. We take the address and dereference using volatile local
813 -- objects for this purpose.
815 -- The pragma Warnings (Off) are needed because the compiler knows that
816 -- these locals are not referenced and that this use of pragma Volatile
819 type EID_Access
is access Exception_Id
;
821 Access_To_E
: EID_Access
:= E
'Unrestricted_Access;
822 pragma Volatile
(Access_To_E
);
823 pragma Warnings
(Off
, Access_To_E
);
825 Id
: Exception_Id
:= Access_To_E
.all;
826 pragma Volatile
(Id
);
827 pragma Warnings
(Off
, Id
);
830 Debug_Raise_Exception
(E
=> SSL
.Exception_Data_Ptr
(E
));
831 Exception_Propagation
.Propagate_Exception
832 (E
=> E
, From_Signal_Handler
=> False);
833 end Raise_Current_Excep
;
835 ---------------------
836 -- Raise_Exception --
837 ---------------------
839 procedure Raise_Exception
841 Message
: String := "")
845 Exception_Data
.Set_Exception_Msg
(E
, Message
);
847 Raise_Current_Excep
(E
);
850 -- Note: if E is null, then we simply return, which is correct Ada 95
851 -- semantics. If we are operating in Ada 2005 mode, then the expander
852 -- generates a raise Constraint_Error immediately following the call
853 -- to provide the required Ada 2005 semantics (see AI-329). We do it
854 -- this way to avoid having run time dependencies on the Ada version.
859 ----------------------------
860 -- Raise_Exception_Always --
861 ----------------------------
863 procedure Raise_Exception_Always
865 Message
: String := "")
868 Exception_Data
.Set_Exception_Msg
(E
, Message
);
870 Raise_Current_Excep
(E
);
871 end Raise_Exception_Always
;
873 -------------------------------------
874 -- Raise_From_Controlled_Operation --
875 -------------------------------------
877 procedure Raise_From_Controlled_Operation
878 (X
: Ada
.Exceptions
.Exception_Occurrence
)
880 Prefix
: constant String := "adjust/finalize raised ";
881 Orig_Msg
: constant String := Exception_Message
(X
);
882 New_Msg
: constant String := Prefix
& Exception_Name
(X
);
885 if Orig_Msg
'Length >= Prefix
'Length
887 Orig_Msg
(Orig_Msg
'First .. Orig_Msg
'First + Prefix
'Length - 1) =
890 -- Message already has proper prefix, just re-reraise PROGRAM_ERROR
892 Raise_Exception_No_Defer
893 (E
=> Program_Error
'Identity,
894 Message
=> Orig_Msg
);
896 elsif Orig_Msg
= "" then
898 -- No message present: just provide our own
900 Raise_Exception_No_Defer
901 (E
=> Program_Error
'Identity,
905 -- Message present, add informational prefix
907 Raise_Exception_No_Defer
908 (E
=> Program_Error
'Identity,
909 Message
=> New_Msg
& ": " & Orig_Msg
);
911 end Raise_From_Controlled_Operation
;
913 -------------------------------
914 -- Raise_From_Signal_Handler --
915 -------------------------------
917 procedure Raise_From_Signal_Handler
922 Exception_Data
.Set_Exception_C_Msg
(E
, M
);
924 Exception_Propagation
.Propagate_Exception
925 (E
=> E
, From_Signal_Handler
=> True);
926 end Raise_From_Signal_Handler
;
928 -------------------------
929 -- Raise_Program_Error --
930 -------------------------
932 procedure Raise_Program_Error
933 (File
: System
.Address
;
937 Raise_With_Location_And_Msg
938 (Program_Error_Def
'Access, File
, Line
);
939 end Raise_Program_Error
;
941 -----------------------------
942 -- Raise_Program_Error_Msg --
943 -----------------------------
945 procedure Raise_Program_Error_Msg
946 (File
: System
.Address
;
948 Msg
: System
.Address
)
951 Raise_With_Location_And_Msg
952 (Program_Error_Def
'Access, File
, Line
, Msg
);
953 end Raise_Program_Error_Msg
;
955 -------------------------
956 -- Raise_Storage_Error --
957 -------------------------
959 procedure Raise_Storage_Error
960 (File
: System
.Address
;
964 Raise_With_Location_And_Msg
965 (Storage_Error_Def
'Access, File
, Line
);
966 end Raise_Storage_Error
;
968 -----------------------------
969 -- Raise_Storage_Error_Msg --
970 -----------------------------
972 procedure Raise_Storage_Error_Msg
973 (File
: System
.Address
;
975 Msg
: System
.Address
)
978 Raise_With_Location_And_Msg
979 (Storage_Error_Def
'Access, File
, Line
, Msg
);
980 end Raise_Storage_Error_Msg
;
982 ---------------------------------
983 -- Raise_With_Location_And_Msg --
984 ---------------------------------
986 procedure Raise_With_Location_And_Msg
990 M
: System
.Address
:= System
.Null_Address
)
993 Exception_Data
.Set_Exception_C_Msg
(E
, F
, L
, M
);
995 Raise_Current_Excep
(E
);
996 end Raise_With_Location_And_Msg
;
1000 --------------------
1002 procedure Raise_With_Msg
(E
: Exception_Id
) is
1003 Excep
: constant EOA
:= Get_Current_Excep
.all;
1006 Exception_Propagation
.Setup_Exception
(Excep
, Excep
);
1008 Excep
.Exception_Raised
:= False;
1010 Excep
.Num_Tracebacks
:= 0;
1011 Excep
.Cleanup_Flag
:= False;
1012 Excep
.Pid
:= Local_Partition_ID
;
1014 Raise_Current_Excep
(E
);
1017 --------------------------------------
1018 -- Calls to Run-Time Check Routines --
1019 --------------------------------------
1021 procedure Rcheck_00
(File
: System
.Address
; Line
: Integer) is
1023 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_00
'Address);
1026 procedure Rcheck_01
(File
: System
.Address
; Line
: Integer) is
1028 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_01
'Address);
1031 procedure Rcheck_02
(File
: System
.Address
; Line
: Integer) is
1033 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_02
'Address);
1036 procedure Rcheck_03
(File
: System
.Address
; Line
: Integer) is
1038 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_03
'Address);
1041 procedure Rcheck_04
(File
: System
.Address
; Line
: Integer) is
1043 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_04
'Address);
1046 procedure Rcheck_05
(File
: System
.Address
; Line
: Integer) is
1048 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_05
'Address);
1051 procedure Rcheck_06
(File
: System
.Address
; Line
: Integer) is
1053 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_06
'Address);
1056 procedure Rcheck_07
(File
: System
.Address
; Line
: Integer) is
1058 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_07
'Address);
1061 procedure Rcheck_08
(File
: System
.Address
; Line
: Integer) is
1063 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_08
'Address);
1066 procedure Rcheck_09
(File
: System
.Address
; Line
: Integer) is
1068 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_09
'Address);
1071 procedure Rcheck_10
(File
: System
.Address
; Line
: Integer) is
1073 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_10
'Address);
1076 procedure Rcheck_11
(File
: System
.Address
; Line
: Integer) is
1078 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_11
'Address);
1081 procedure Rcheck_12
(File
: System
.Address
; Line
: Integer) is
1083 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_12
'Address);
1086 procedure Rcheck_13
(File
: System
.Address
; Line
: Integer) is
1088 Raise_Constraint_Error_Msg
(File
, Line
, Rmsg_13
'Address);
1091 procedure Rcheck_14
(File
: System
.Address
; Line
: Integer) is
1093 Raise_Program_Error_Msg
(File
, Line
, Rmsg_14
'Address);
1096 procedure Rcheck_15
(File
: System
.Address
; Line
: Integer) is
1098 Raise_Program_Error_Msg
(File
, Line
, Rmsg_15
'Address);
1101 procedure Rcheck_16
(File
: System
.Address
; Line
: Integer) is
1103 Raise_Program_Error_Msg
(File
, Line
, Rmsg_16
'Address);
1106 procedure Rcheck_17
(File
: System
.Address
; Line
: Integer) is
1108 Raise_Program_Error_Msg
(File
, Line
, Rmsg_17
'Address);
1111 procedure Rcheck_18
(File
: System
.Address
; Line
: Integer) is
1113 Raise_Program_Error_Msg
(File
, Line
, Rmsg_18
'Address);
1116 procedure Rcheck_19
(File
: System
.Address
; Line
: Integer) is
1118 Raise_Program_Error_Msg
(File
, Line
, Rmsg_19
'Address);
1121 procedure Rcheck_20
(File
: System
.Address
; Line
: Integer) is
1123 Raise_Program_Error_Msg
(File
, Line
, Rmsg_20
'Address);
1126 procedure Rcheck_21
(File
: System
.Address
; Line
: Integer) is
1128 Raise_Program_Error_Msg
(File
, Line
, Rmsg_21
'Address);
1131 procedure Rcheck_22
(File
: System
.Address
; Line
: Integer) is
1133 Raise_Program_Error_Msg
(File
, Line
, Rmsg_22
'Address);
1136 procedure Rcheck_23
(File
: System
.Address
; Line
: Integer) is
1138 Raise_Program_Error_Msg
(File
, Line
, Rmsg_23
'Address);
1141 procedure Rcheck_24
(File
: System
.Address
; Line
: Integer) is
1143 Raise_Program_Error_Msg
(File
, Line
, Rmsg_24
'Address);
1146 procedure Rcheck_25
(File
: System
.Address
; Line
: Integer) is
1148 Raise_Program_Error_Msg
(File
, Line
, Rmsg_25
'Address);
1151 procedure Rcheck_26
(File
: System
.Address
; Line
: Integer) is
1153 Raise_Program_Error_Msg
(File
, Line
, Rmsg_26
'Address);
1156 procedure Rcheck_27
(File
: System
.Address
; Line
: Integer) is
1158 Raise_Program_Error_Msg
(File
, Line
, Rmsg_27
'Address);
1161 procedure Rcheck_28
(File
: System
.Address
; Line
: Integer) is
1163 Raise_Program_Error_Msg
(File
, Line
, Rmsg_28
'Address);
1166 procedure Rcheck_29
(File
: System
.Address
; Line
: Integer) is
1168 Raise_Storage_Error_Msg
(File
, Line
, Rmsg_29
'Address);
1171 procedure Rcheck_30
(File
: System
.Address
; Line
: Integer) is
1173 Raise_Storage_Error_Msg
(File
, Line
, Rmsg_30
'Address);
1176 procedure Rcheck_31
(File
: System
.Address
; Line
: Integer) is
1178 Raise_Storage_Error_Msg
(File
, Line
, Rmsg_31
'Address);
1181 procedure Rcheck_32
(File
: System
.Address
; Line
: Integer) is
1183 Raise_Storage_Error_Msg
(File
, Line
, Rmsg_32
'Address);
1190 procedure Reraise
is
1191 Excep
: constant EOA
:= Get_Current_Excep
.all;
1195 Exception_Propagation
.Setup_Exception
(Excep
, Excep
, Reraised
=> True);
1196 Raise_Current_Excep
(Excep
.Id
);
1199 ------------------------
1200 -- Reraise_Occurrence --
1201 ------------------------
1203 procedure Reraise_Occurrence
(X
: Exception_Occurrence
) is
1205 if X
.Id
/= null then
1207 Exception_Propagation
.Setup_Exception
1208 (X
'Unrestricted_Access, Get_Current_Excep
.all, Reraised
=> True);
1209 Save_Occurrence_No_Private
(Get_Current_Excep
.all.all, X
);
1210 Raise_Current_Excep
(X
.Id
);
1212 end Reraise_Occurrence
;
1214 -------------------------------
1215 -- Reraise_Occurrence_Always --
1216 -------------------------------
1218 procedure Reraise_Occurrence_Always
(X
: Exception_Occurrence
) is
1221 Exception_Propagation
.Setup_Exception
1222 (X
'Unrestricted_Access, Get_Current_Excep
.all, Reraised
=> True);
1223 Save_Occurrence_No_Private
(Get_Current_Excep
.all.all, X
);
1224 Raise_Current_Excep
(X
.Id
);
1225 end Reraise_Occurrence_Always
;
1227 ---------------------------------
1228 -- Reraise_Occurrence_No_Defer --
1229 ---------------------------------
1231 procedure Reraise_Occurrence_No_Defer
(X
: Exception_Occurrence
) is
1233 Exception_Propagation
.Setup_Exception
1234 (X
'Unrestricted_Access, Get_Current_Excep
.all, Reraised
=> True);
1235 Save_Occurrence_No_Private
(Get_Current_Excep
.all.all, X
);
1236 Raise_Current_Excep
(X
.Id
);
1237 end Reraise_Occurrence_No_Defer
;
1239 ---------------------
1240 -- Save_Occurrence --
1241 ---------------------
1243 procedure Save_Occurrence
1244 (Target
: out Exception_Occurrence
;
1245 Source
: Exception_Occurrence
)
1248 Save_Occurrence_No_Private
(Target
, Source
);
1249 end Save_Occurrence
;
1251 function Save_Occurrence
(Source
: Exception_Occurrence
) return EOA
is
1252 Target
: constant EOA
:= new Exception_Occurrence
;
1254 Save_Occurrence
(Target
.all, Source
);
1256 end Save_Occurrence
;
1258 --------------------------------
1259 -- Save_Occurrence_No_Private --
1260 --------------------------------
1262 procedure Save_Occurrence_No_Private
1263 (Target
: out Exception_Occurrence
;
1264 Source
: Exception_Occurrence
)
1267 Target
.Id
:= Source
.Id
;
1268 Target
.Msg_Length
:= Source
.Msg_Length
;
1269 Target
.Num_Tracebacks
:= Source
.Num_Tracebacks
;
1270 Target
.Pid
:= Source
.Pid
;
1271 Target
.Cleanup_Flag
:= Source
.Cleanup_Flag
;
1273 Target
.Msg
(1 .. Target
.Msg_Length
) :=
1274 Source
.Msg
(1 .. Target
.Msg_Length
);
1276 Target
.Tracebacks
(1 .. Target
.Num_Tracebacks
) :=
1277 Source
.Tracebacks
(1 .. Target
.Num_Tracebacks
);
1278 end Save_Occurrence_No_Private
;
1280 -------------------------
1281 -- Transfer_Occurrence --
1282 -------------------------
1284 procedure Transfer_Occurrence
1285 (Target
: Exception_Occurrence_Access
;
1286 Source
: Exception_Occurrence
)
1289 -- Setup Target as an exception to be propagated in the calling task
1290 -- (rendezvous-wise), taking care not to clobber the associated private
1291 -- data. Target is expected to be a pointer to the calling task's
1292 -- fixed TSD occurrence, which is very different from Get_Current_Excep
1293 -- here because this subprogram is called from the called task.
1295 Exception_Propagation
.Setup_Exception
(Target
, Target
);
1296 Save_Occurrence_No_Private
(Target
.all, Source
);
1297 end Transfer_Occurrence
;
1303 function String_To_EId
(S
: String) return Exception_Id
1304 renames Stream_Attributes
.String_To_EId
;
1310 function String_To_EO
(S
: String) return Exception_Occurrence
1311 renames Stream_Attributes
.String_To_EO
;
1313 ------------------------------
1314 -- Raise_Exception_No_Defer --
1315 ------------------------------
1317 procedure Raise_Exception_No_Defer
1319 Message
: String := "")
1322 Exception_Data
.Set_Exception_Msg
(E
, Message
);
1324 -- Do not call Abort_Defer.all, as specified by the spec
1326 Raise_Current_Excep
(E
);
1327 end Raise_Exception_No_Defer
;
1333 procedure To_Stderr
(C
: Character) is
1335 type int
is new Integer;
1337 procedure put_char_stderr
(C
: int
);
1338 pragma Import
(C
, put_char_stderr
, "put_char_stderr");
1341 put_char_stderr
(Character'Pos (C
));
1344 procedure To_Stderr
(S
: String) is
1346 for J
in S
'Range loop
1347 if S
(J
) /= ASCII
.CR
then
1353 -------------------------
1354 -- Wide_Exception_Name --
1355 -------------------------
1357 WC_Encoding
: Character;
1358 pragma Import
(C
, WC_Encoding
, "__gl_wc_encoding");
1359 -- Encoding method for source, as exported by binder
1361 function Wide_Exception_Name
1362 (Id
: Exception_Id
) return Wide_String
1364 S
: constant String := Exception_Name
(Id
);
1365 W
: Wide_String (1 .. S
'Length);
1368 String_To_Wide_String
1369 (S
, W
, L
, Get_WC_Encoding_Method
(WC_Encoding
));
1371 end Wide_Exception_Name
;
1373 function Wide_Exception_Name
1374 (X
: Exception_Occurrence
) return Wide_String
1376 S
: constant String := Exception_Name
(X
);
1377 W
: Wide_String (1 .. S
'Length);
1380 String_To_Wide_String
1381 (S
, W
, L
, Get_WC_Encoding_Method
(WC_Encoding
));
1383 end Wide_Exception_Name
;
1385 ----------------------------
1386 -- Wide_Wide_Exception_Name --
1387 -----------------------------
1389 function Wide_Wide_Exception_Name
1390 (Id
: Exception_Id
) return Wide_Wide_String
1392 S
: constant String := Exception_Name
(Id
);
1393 W
: Wide_Wide_String
(1 .. S
'Length);
1396 String_To_Wide_Wide_String
1397 (S
, W
, L
, Get_WC_Encoding_Method
(WC_Encoding
));
1399 end Wide_Wide_Exception_Name
;
1401 function Wide_Wide_Exception_Name
1402 (X
: Exception_Occurrence
) return Wide_Wide_String
1404 S
: constant String := Exception_Name
(X
);
1405 W
: Wide_Wide_String
(1 .. S
'Length);
1408 String_To_Wide_Wide_String
1409 (S
, W
, L
, Get_WC_Encoding_Method
(WC_Encoding
));
1411 end Wide_Wide_Exception_Name
;
1413 --------------------------
1414 -- Code_Address_For_ZZZ --
1415 --------------------------
1417 -- This function gives us the end of the PC range for addresses
1418 -- within the exception unit itself. We hope that gigi/gcc keeps all the
1419 -- procedures in their original order!
1421 function Code_Address_For_ZZZ
return System
.Address
is
1424 return Start_Of_ZZZ
'Address;
1425 end Code_Address_For_ZZZ
;