annotate gcc/ada/libgnat/s-exctra.ads @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
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 -- S Y S T E M . E X C E P T I O N _ T R A C E S --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 2000-2019, AdaCore --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
17 -- --
kono
parents:
diff changeset
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
19 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
20 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
23 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
25 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
26 -- --
kono
parents:
diff changeset
27 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
29 -- --
kono
parents:
diff changeset
30 ------------------------------------------------------------------------------
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 -- This package provides an interface allowing to control *automatic* output
kono
parents:
diff changeset
33 -- to standard error upon exception occurrences (as opposed to explicit
kono
parents:
diff changeset
34 -- generation of traceback information using System.Traceback).
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 -- This output includes the basic information associated with the exception
kono
parents:
diff changeset
37 -- (name, message) as well as a backtrace of the call chain at the point
kono
parents:
diff changeset
38 -- where the exception occurred. This backtrace is only output if the call
kono
parents:
diff changeset
39 -- chain information is available, depending if the binder switch dedicated
kono
parents:
diff changeset
40 -- to that purpose has been used or not.
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 -- The default backtrace is in the form of absolute code locations which may
kono
parents:
diff changeset
43 -- be converted to corresponding source locations using the addr2line utility
kono
parents:
diff changeset
44 -- or from within GDB. Please refer to System.Traceback for information about
kono
parents:
diff changeset
45 -- what is necessary to be able to exploit this possibility.
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 -- The backtrace output can also be customized by way of a "decorator" which
kono
parents:
diff changeset
48 -- may return any string output in association with a provided call chain.
kono
parents:
diff changeset
49 -- The decorator replaces the default backtrace mentioned above.
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 -- On systems that use DWARF debugging output, then if the "-g" compiler
kono
parents:
diff changeset
52 -- switch and the "-Es" binder switch are used, the decorator is automatically
kono
parents:
diff changeset
53 -- set to Symbolic_Traceback.
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 with System.Traceback_Entries;
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 package System.Exception_Traces is
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 -- The following defines the exact situations in which raises will
kono
parents:
diff changeset
60 -- cause automatic output of trace information.
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 type Trace_Kind is
kono
parents:
diff changeset
63 (Every_Raise,
kono
parents:
diff changeset
64 -- Denotes the initial raise event for any exception occurrence, either
kono
parents:
diff changeset
65 -- explicit or due to a specific language rule, within the context of a
kono
parents:
diff changeset
66 -- task or not.
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 Unhandled_Raise,
kono
parents:
diff changeset
69 -- Denotes the raise events corresponding to exceptions for which there
kono
parents:
diff changeset
70 -- is no user defined handler. This includes unhandled exceptions in
kono
parents:
diff changeset
71 -- task bodies.
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 Unhandled_Raise_In_Main
kono
parents:
diff changeset
74 -- Same as Unhandled_Raise, except exceptions in task bodies are not
kono
parents:
diff changeset
75 -- included.
kono
parents:
diff changeset
76 );
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 -- The following procedures can be used to activate and deactivate
kono
parents:
diff changeset
79 -- traces identified by the above trace kind values.
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 procedure Trace_On (Kind : Trace_Kind);
kono
parents:
diff changeset
82 -- Activate the traces denoted by Kind
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 procedure Trace_Off;
kono
parents:
diff changeset
85 -- Stop the tracing requested by the last call to Trace_On.
kono
parents:
diff changeset
86 -- Has no effect if no such call has ever occurred.
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 -- The following provide the backtrace decorating facilities
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 type Traceback_Decorator is access
kono
parents:
diff changeset
91 function (Traceback : Traceback_Entries.Tracebacks_Array) return String;
kono
parents:
diff changeset
92 -- A backtrace decorator is a function which returns the string to be
kono
parents:
diff changeset
93 -- output for a call chain provided by way of a tracebacks array.
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 procedure Set_Trace_Decorator (Decorator : Traceback_Decorator);
kono
parents:
diff changeset
96 -- Set the decorator to be used for future automatic outputs. Restore the
kono
parents:
diff changeset
97 -- default behavior if the provided access value is null.
kono
parents:
diff changeset
98 --
kono
parents:
diff changeset
99 -- Note: System.Traceback.Symbolic.Symbolic_Traceback may be used as the
kono
parents:
diff changeset
100 -- Decorator, to get a symbolic traceback. This will cause a significant
kono
parents:
diff changeset
101 -- cpu and memory overhead on some platforms.
kono
parents:
diff changeset
102 --
kono
parents:
diff changeset
103 -- Note: The Decorator is called when constructing the
kono
parents:
diff changeset
104 -- Exception_Information; that needs to be taken into account
kono
parents:
diff changeset
105 -- if the Decorator has any side effects.
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 end System.Exception_Traces;