* gcc.c-torture/execute/20020307-1.c: New test.
[official-gcc.git] / gcc / ada / debug_a.ads
blobcc62a03b6d28d5b7d8ddd52f91a3b09d468cdb7c
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- D E B U G _ A --
6 -- --
7 -- S p e c --
8 -- --
9 -- $Revision: 1.8 $ --
10 -- --
11 -- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
12 -- --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
23 -- --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 -- --
27 ------------------------------------------------------------------------------
29 -- This package contains data and subprograms to support the A debug switch
30 -- that is used to generate output showing what node is being analyzed,
31 -- resolved, evaluated, or expanded.
33 with Types; use Types;
35 package Debug_A is
37 -- Note: the following subprograms are used in a stack like manner, with
38 -- an exit call matching each entry call. This means that they can keep
39 -- track of the current node being worked on, with the entry call setting
40 -- a new value, by pushing the Node_Id value on a stack, and the exit call
41 -- popping this value off. Comperr.Current_Error_Node is set by both the
42 -- entry and exit routines to point to the current node so that an abort
43 -- message indicates the node involved as accurately as possible.
45 procedure Debug_A_Entry (S : String; N : Node_Id);
46 pragma Inline (Debug_A_Entry);
47 -- Generates a message prefixed by a sequence of bars showing the nesting
48 -- depth (depth increases by 1 for a Debug_A_Entry call and is decreased
49 -- by the corresponding Debug_A_Exit call). Then the string is output
50 -- (analyzing, expanding etc), followed by the node number and its kind.
51 -- This output is generated only if the debug A flag is set. If the debug
52 -- A flag is not set, then no output is generated. This call also sets the
53 -- Node_Id value in Comperr.Current_Error_Node in case a bomb occurs. This
54 -- is done unconditionally, whether or not the debug A flag is set.
56 procedure Debug_A_Exit (S : String; N : Node_Id; Comment : String);
57 pragma Inline (Debug_A_Exit);
58 -- Generates the corresponding termination message. The message is preceded
59 -- by a sequence of bars, followed by the string S, the node number, and
60 -- a trailing comment (e.g. " (already evaluated)"). This output is
61 -- generated only if the debug A flag is set. If the debug A flag is not
62 -- set, then no output is generated. This call also resets the value in
63 -- Comperr.Current_Error_Node to what it was before the corresponding call
64 -- to Debug_A_Entry.
66 end Debug_A;