Package: Ada.Exceptions

Dependencies

pragma Polling (Off);
--  We must turn polling off for this unit, because otherwise we get
--  elaboration circularities with ourself.

with System;
with System.Standard_Library;

Description

GNAT RUN-TIME COMPONENTS

A D A . E X C E P T I O N S

S p e c

$Revision: 1.47 $

Copyright (C) 1992-2000 Free Software Foundation, Inc.

This specification is derived from the Ada Reference Manual for use with GNAT. The copyright notice above, and the license provisions that follow apply solely to the contents of the part following the private keyword.

GNAT is free software; you can redistribute it and/or modify it under terms of the GNU General Public License as published by the Free Soft- ware Foundation; either version 2, or (at your option) any later ver- sion. GNAT is distributed in the hope that it will be useful, but WITH- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License distributed with GNAT; see file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

As a special exception, if other files instantiate generics from this unit, or you link this unit with other files to produce an executable, this unit does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.

GNAT was originally developed by the GNAT team at New York University. It is now maintained by Ada Core Technologies Inc (http://www.gnat.com).


Header

package Ada.Exceptions is
 

Known child units

Ada.Exceptions.Is_Null_Occurrence(function)
Ada.Exceptions.Traceback(package)

Type Summary

Exception_Id
Primitive Operations:  Exception_Identity, Exception_Name, Raise_Exception
Exception_Occurrence (limited type)
Primitive Operations:  Exception_Identity, Exception_Information, Exception_Message, Exception_Name, Reraise_Occurrence, Save_Occurrence, Save_Occurrence
Exception_Occurrence_Access

Constants and Named Numbers

Null_Id : constant Exception_Id;
Null_Occurrence : constant Exception_Occurrence;

Other Items:

type Exception_Id is private;

type Exception_Occurrence is limited private;

type Exception_Occurrence_Access is access all Exception_Occurrence;

function Exception_Name (X : Exception_Occurrence) return String;
Same as Exception_Name (Exception_Identity (X))

function Exception_Name (Id : Exception_Id) return String;

procedure Raise_Exception (E : in Exception_Id; Message : in String := "");
pragma Export (Ada, Raise_Exception, "__gnat_raise_exception");
The Export allows this routine to be accessed from Pure units. Note: it would be really nice to give a pragma No_Return for this procedure, but it would be wrong, since Raise_Exception does return if given the null exception. However we do special case the name in the test in the compiler for issuing a warning for a missing return after this call. Program_Error seems reasonable enough in such a case.

function Exception_Message (X : Exception_Occurrence) return String;

procedure Reraise_Occurrence (X : Exception_Occurrence);

function Exception_Identity (X : Exception_Occurrence) return Exception_Id;

function Exception_Information (X : Exception_Occurrence) return String;
The format of the exception information is as follows:

exception name (as in Exception_Name) message (or a null line if no message) PID=nnnn 0xyyyyyyyy 0xyyyyyyyy ...

The lines are separated by an ASCII.CR/ASCII.LF sequence. The nnnn is the partition Id given as decimal digits. The 0x... line represents traceback program counter locations, in order with the first one being the exception location.


procedure Save_Occurrence
  (Target :    out Exception_Occurrence;
   Source : in     Exception_Occurrence);

function Save_Occurrence
  (Source : in Exception_Occurrence)
   return Exception_Occurrence_Access;

private

   --  Implementation-defined ...
end Ada.Exceptions;