]>
Commit | Line | Data |
---|---|---|
ee6ba406 | 1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNAT COMPILER COMPONENTS -- | |
4 | -- -- | |
5 | -- C O M P E R R -- | |
6 | -- -- | |
7 | -- S p e c -- | |
8 | -- -- | |
9dfe12ae | 9 | -- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- |
ee6ba406 | 10 | -- -- |
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, 59 Temple Place - Suite 330, Boston, -- | |
20 | -- MA 02111-1307, USA. -- | |
21 | -- -- | |
22 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
e78e8c8e | 23 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
ee6ba406 | 24 | -- -- |
25 | ------------------------------------------------------------------------------ | |
26 | ||
27 | -- This package contains the routine called when a fatal internal compiler | |
28 | -- error is detected. Calls to this routines cause termination of the | |
29 | -- current compilation with appropriate error output. | |
30 | ||
31 | package Comperr is | |
32 | ||
33 | procedure Compiler_Abort | |
34 | (X : String; | |
35 | Code : Integer := 0); | |
36 | -- Signals an internal compiler error. Never returns control. Depending | |
37 | -- on processing may end up raising Unrecoverable_Error, or exiting | |
38 | -- directly. The message output is a "bug box" containing the | |
39 | -- string passed as an argument. The node in Current_Error_Node is used | |
40 | -- to provide the location where the error should be signalled. The | |
41 | -- message includes the node id, and the code parameter if it is positive. | |
42 | -- Note that this is only used at the outer level (to handle constraint | |
43 | -- errors or assert errors etc.) In the normal logic of the compiler we | |
44 | -- always use pragma Assert to check for errors, and if necessary an | |
45 | -- explicit abort is achieved by pragma Assert (False). Code is positive | |
46 | -- for a gigi abort (giving the gigi abort code), zero for a front | |
47 | -- end exception (with possible message stored in TSD.Current_Excep, | |
48 | -- and negative (an unused value) for a GCC abort. | |
49 | ||
50 | ------------------------------ | |
51 | -- Use of gnat_bug.box File -- | |
52 | ------------------------------ | |
53 | ||
54 | -- When comperr generates the "bug box". The first two lines contain | |
55 | -- information on the version number, type of abort, and source location. | |
56 | ||
9dfe12ae | 57 | -- Normally the remaining text is one of three possible forms |
58 | -- depending on Gnatvsn.Gnat_Version_Type (FSF, Public, GNATPRO). | |
59 | -- See body of this package for the exact text used. | |
ee6ba406 | 60 | |
9dfe12ae | 61 | -- In addition, an alternative mechanism exists for easily substituting |
ee6ba406 | 62 | -- different text for this message. Compiler_Abort checks for the |
63 | -- existence of the file "gnat_bug.box" in the current source path. | |
64 | -- Most typically this file, if present, will be in the directory | |
65 | -- containing the run-time sources. | |
66 | ||
67 | -- If this file is present, then it is a plain ASCII file, whose | |
9dfe12ae | 68 | -- contents replace the remaining text. The lines in this file should be |
69 | -- 72 characters or less to avoid misformatting the right boundary of the | |
70 | -- box. Note that the file does not contain the vertical bar characters or | |
71 | -- any leading spaces in lines. | |
ee6ba406 | 72 | |
73 | end Comperr; |