ac3ce41dcc51397333d96fe66024b7e87d882c4e
[gcc.git] / gcc / ada / debug.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                                D E B U G                                 --
6 --                                                                          --
7 --                                 B o d y                                  --
8 --                                                                          --
9 --          Copyright (C) 1992-2025, Free Software Foundation, Inc.         --
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 3,  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 COPYING3.  If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license.          --
20 --                                                                          --
21 -- GNAT was originally developed  by the GNAT team at  New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
23 --                                                                          --
24 ------------------------------------------------------------------------------
25
26 package body Debug is
27
28    ---------------------------------
29    -- Summary of Debug Flag Usage --
30    ---------------------------------
31
32    --  Debug flags for compiler (GNAT1)
33
34    --  da   Generate messages tracking semantic analyzer progress
35    --  db   Show encoding of type names for debug output
36    --  dc   List names of units as they are compiled
37    --  dd   Dynamic allocation of tables messages generated
38    --  de   List the entity table
39    --  df   Full tree/source print (includes withed units)
40    --  dg   Print source from tree (generated code only)
41    --  dh   Generate listing showing loading of name table hash chains
42    --  di   Generate messages for visibility linking/delinking
43    --  dj   Suppress "junk null check" for access parameter values
44    --  dk   Generate "GNAT BUG" message on abort, even if previous errors
45    --  dl   Generate unit load trace messages
46    --  dm   Prevent special frontend inlining in GNATprove mode
47    --  dn   Generate messages for node/list allocation
48    --  do   Print source from tree (original code only)
49    --  dp   Generate messages for parser scope stack push/pops
50    --  dq   No auto-alignment of small records
51    --  dr   Generate parser resynchronization messages
52    --  ds   Print source from tree (including original and generated stuff)
53    --  dt   Print full tree
54    --  du   Uncheck categorization pragmas
55    --  dv   Output trace of overload resolution
56    --  dw   Print trace of semantic scope stack
57    --  dx   Force expansion on, even if no code being generated
58    --  dy   Print tree of package Standard
59    --  dz   Print source of package Standard
60
61    --  dA   All entities included in representation information output
62    --  dB   Output debug encoding of type names and variants
63    --  dC   Output debugging information on check suppression
64    --  dD   Delete elaboration checks in inner level routines
65    --  dE   Apply elaboration checks to predefined units
66    --  dF   Alternative display for messages over multiple lines
67    --  dG   Generate all warnings including those normally suppressed
68    --  dH   Hold (kill) call to gigi
69    --  dI   Inhibit internal name numbering in gnatG listing
70    --  dJ
71    --  dK   Kill all error messages
72    --  dL   Ignore external calls from instances for elaboration
73    --  dM   Assume all variables are modified (no current values)
74    --  dN   No file name information in exception messages
75    --  dO   Output immediate error messages
76    --  dP   Do not check for controlled objects in preelaborable packages
77    --  dQ   Do not generate cleanups for qualified expressions of allocators
78    --  dR   Bypass check for correct version of s-rpc
79    --  dS   Never convert numbers to machine numbers in Sem_Eval
80    --  dT   Convert to machine numbers only for constant declarations
81    --  dU   Enable garbage collection of unreachable entities
82    --  dV   Enable viewing of all symbols in debugger
83    --  dW   Disable warnings on calls for IN OUT parameters
84    --  dX   Display messages on reads of potentially uninitialized scalars
85    --  dY   Enable configurable run-time mode
86    --  dZ   Generate listing showing the contents of the dispatch tables
87
88    --  d.a  Force Target_Strict_Alignment mode to True
89    --  d.b  Dump backend types
90    --  d.c  Generate inline concatenation, do not call procedure
91    --  d.d  Disable atomic synchronization
92    --  d.e  Enable atomic synchronization
93    --  d.f  Inhibit folding of static expressions
94    --  d.g  Enable conversion of raise into goto
95    --  d.h  Minimize the creation of public internal symbols for concatenation
96    --  d.i  Ignore Warnings pragmas
97    --  d.j  Generate listing of frontend inlined calls
98    --  d.k  Kill referenced run-time library unit line numbers
99    --  d.l  Use Ada 95 semantics for limited function returns
100    --  d.m  For -gnatl, print full source only for main unit
101    --  d.n  Print source file names
102    --  d.o  Conservative elaboration order for indirect calls
103    --  d.p  Use original Ada 95 semantics for Bit_Order (disable AI95-0133)
104    --  d.q  Suppress optimizations on imported 'in'
105    --  d.r  Disable reordering of components in record types
106    --  d.s  Strict secondary stack management
107    --  d.t  Disable static allocation of library level dispatch tables
108    --  d.u
109    --  d.v  Enforce SPARK elaboration rules in SPARK code
110    --  d.w  Do not check for infinite loops
111    --  d.x  No exception handlers
112    --  d.y  Disable implicit pragma Elaborate_All on task bodies
113    --  d.z  Restore previous support for frontend handling of Inline_Always
114
115    --  d.A  Enable statistics printing in Atree
116    --  d.B  Generate a "GNAT BUG" message on abort_statement
117    --  d.C  Generate concatenation call, do not generate inline code
118    --  d.D  Disable errors on use of overriding keyword in Ada 95 mode
119    --  d.E  Turn selected errors into warnings
120    --  d.F  Debug mode for GNATprove
121    --  d.G  Ignore calls through generic formal parameters for elaboration
122    --  d.H  Disable the support for 128-bit integer types on 64-bit platforms
123    --  d.I  Do not ignore enum representation clauses in CodePeer mode
124    --  d.J  Relaxed rules for pragma No_Return
125    --  d.K  Do not reject components in extensions overlapping with parent
126    --  d.M  Relaxed RM semantics
127    --  d.N  Use rounding when converting from floating point to fixed point
128    --  d.O  Dump internal SCO tables
129    --  d.P  Previous (non-optimized) handling of length comparisons
130    --  d.Q  Previous (incomplete) style check for binary operators
131    --  d.R  Restrictions in ali files in positional form
132    --  d.S  Force Optimize_Alignment (Space)
133    --  d.T  Force Optimize_Alignment (Time)
134    --  d.U  Ignore indirect calls for static elaboration
135    --  d.V  Do not verify validity of SCIL files (CodePeer mode)
136    --  d.W  Print out debugging information for Walk_Library_Items
137    --  d.X  Old treatment of indexing aspects
138    --  d.Y
139    --  d.Z  Do not enable expansion in configurable run-time mode
140
141    --  d_a  Stop elaboration checks on accept or select statement
142    --  d_b  Use designated type model under No_Dynamic_Accessibility_Checks
143    --  d_c  CUDA compilation : compile for the host
144    --  d_d  CUDA compilation : compile for the device
145    --  d_e  Ignore entry calls and requeue statements for elaboration
146    --  d_f  Issue info messages related to GNATprove usage
147    --  d_g  Disable large static aggregates
148    --  d_h  Disable the use of (perfect) hash functions for enumeration Value
149    --  d_i  Ignore activations and calls to instances for elaboration
150    --  d_j  Read JSON files and populate Repinfo tables (opposite of -gnatRjs)
151    --  d_k  In CodePeer mode disable expansion of assertion checks
152    --  d_l  Disable strict alignment of array types with aliased component
153    --  d_m  Run adareducer on crash
154    --  d_n
155    --  d_o
156    --  d_p  Ignore assertion pragmas for elaboration
157    --  d_q  Do not enforce freezing for equality operator of boolean subtype
158    --  d_r  Disable the use of the return slot in functions
159    --  d_s  Stop elaboration checks on synchronous suspension
160    --  d_t  In LLVM-based CCG, dump LLVM IR after transformations are done
161    --  d_u  In LLVM-based CCG, dump flows
162    --  d_v  Enable additional checks and debug printouts in Atree
163    --  d_w  In LLVM-based CCG, don't send front end data to CCG
164    --  d_x  Disable inline expansion of Image attribute for enumeration types
165    --  d_y
166    --  d_z
167
168    --  d_A  Stop generation of ALI file
169    --  d_B  Warn on build-in-place function calls
170    --  d_C
171    --  d_D  Use improved diagnostics
172    --  d_E  Print diagnostics and switch repository
173    --  d_F  Encode full invocation paths in ALI files
174    --  d_G
175    --  d_H
176    --  d_I  Note generic formal type inference
177    --  d_J
178    --  d_K  (Reserved) Enable reporting a warning on known-problem issues
179    --  d_L  Output trace information on elaboration checking
180    --  d_M  Ignore Source_File_Name and Source_File_Name_Project pragmas
181    --  d_N
182    --  d_O
183    --  d_P  Disable runtime check for null prefix of prefixed subprogram call
184    --  d_Q
185    --  d_R  For LLVM, dump the representation of records
186    --  d_S
187    --  d_T  Output trace information on invocation path recording
188    --  d_U  Disable prepending messages with "error:".
189    --  d_V  Enable verifications on the expanded tree
190    --  d_W
191    --  d_X  Disable assertions to check matching of extra formals
192    --  d_Y
193    --  d_Z
194
195    --  d1   Error msgs have node numbers where possible
196    --  d2   Eliminate error flags in verbose form error messages
197    --  d3   Dump bad node in Comperr on an abort
198    --  d4   Inhibit automatic krunch of predefined library unit files
199    --  d5   Debug output for tree read/write
200    --  d6   Default access unconstrained to thin pointers
201    --  d7   Suppress version/source stamp/compilation time for -gnatv/-gnatl
202    --  d8   Force opposite endianness in packed stuff
203    --  d9
204
205    --  d.1  Enable unnesting of nested procedures
206    --  d.2  Allow statements in declarative part
207    --  d.3  Output debugging information from Exp_Unst
208    --  d.4  Do not delete generated C file in case of errors
209    --  d.5  Do not generate imported subprogram definitions in C code
210    --  d.6
211    --  d.7  Disable unsound heuristics in gnat2scil (for CP as SPARK prover)
212    --  d.8  Disable unconditional inlining of expression functions
213    --  d.9
214
215    --  d_1
216    --  d_2
217    --  d_3
218    --  d_4
219    --  d_5
220    --  d_6
221    --  d_7
222    --  d_8
223    --  d_9
224
225    --  Debug flags for binder (GNATBIND)
226
227    --  da  All links (including internal units) listed if there is a cycle
228    --  db  Output information from Better_Choice
229    --  dc  List units as they are chosen
230    --  dd
231    --  de  Elaboration dependencies including system units
232    --  df
233    --  dg
234    --  dh
235    --  di  Ignore_Errors mode for reading ali files
236    --  dj
237    --  dk
238    --  dl
239    --  dm
240    --  dn  List details of manipulation of Num_Pred values
241    --  do  Use older preference for elaboration order
242    --  dp  Use old preference for elaboration order
243    --  dq
244    --  dr
245    --  ds
246    --  dt
247    --  du  List units as they are acquired
248    --  dv  Verbose debugging printouts
249    --  dw
250    --  dx  Force binder to read xref information from ali files
251    --  dy
252    --  dz
253
254    --  dA
255    --  dB
256    --  dC
257    --  dD
258    --  dE
259    --  dF
260    --  dG
261    --  dH
262    --  dI
263    --  dJ
264    --  dK
265    --  dL
266    --  dM
267    --  dN
268    --  dO
269    --  dP
270    --  dQ
271    --  dR
272    --  dS
273    --  dT
274    --  dU
275    --  dV
276    --  dW
277    --  dX
278    --  dY
279    --  dZ
280
281    --  d.a
282    --  d.b
283    --  d.c
284    --  d.d
285    --  d.e
286    --  d.f
287    --  d.g
288    --  d.h
289    --  d.i
290    --  d.j
291    --  d.k
292    --  d.l
293    --  d.m
294    --  d.n
295    --  d.o
296    --  d.p
297    --  d.q
298    --  d.r
299    --  d.s
300    --  d.t
301    --  d.u
302    --  d.v
303    --  d.w
304    --  d.x
305    --  d.y
306    --  d.z
307
308    --  d.A
309    --  d.B
310    --  d.C
311    --  d.D
312    --  d.E
313    --  d.F
314    --  d.G
315    --  d.H
316    --  d.I
317    --  d.J
318    --  d.K
319    --  d.L
320    --  d.M
321    --  d.N
322    --  d.O
323    --  d.P
324    --  d.Q
325    --  d.R
326    --  d.S
327    --  d.T
328    --  d.U
329    --  d.V
330    --  d.W
331    --  d.X
332    --  d.Y
333    --  d.Z
334
335    --  d.1
336    --  d.2
337    --  d.3
338    --  d.4
339    --  d.5
340    --  d.6
341    --  d.7
342    --  d.8
343    --  d.9
344
345    --  d_a  Ignore the effects of pragma Elaborate_All
346    --  d_b  Ignore the effects of pragma Elaborate_Body
347    --  d_c  CUDA compilation : compile/bind for the host
348    --  d_d  CUDA compilation : compile/bind for the device
349    --  d_e  Ignore the effects of pragma Elaborate
350    --  d_f
351    --  d_g
352    --  d_h
353    --  d_i
354    --  d_j
355    --  d_k
356    --  d_l
357    --  d_m
358    --  d_n
359    --  d_o
360    --  d_p
361    --  d_q
362    --  d_r
363    --  d_s
364    --  d_t  Output cycle-detection trace information
365    --  d_u
366    --  d_v
367    --  d_w
368    --  d_x
369    --  d_y
370    --  d_z
371
372    --  d_A  Output ALI invocation tables
373    --  d_B
374    --  d_C  Diagnose all cycles
375    --  d_D
376    --  d_E
377    --  d_F
378    --  d_G
379    --  d_H
380    --  d_I  Output invocation graph
381    --  d_J
382    --  d_K
383    --  d_L  Output library graph
384    --  d_M
385    --  d_N
386    --  d_O
387    --  d_P  Output cycle paths
388    --  d_Q
389    --  d_R
390    --  d_S  Output elaboration-order status
391    --  d_T  Output elaboration-order trace information
392    --  d_U
393    --  d_V  Validate bindo cycles, graphs, and order
394    --  d_W
395    --  d_X
396    --  d_Y
397    --  d_Z
398
399    --  d_1
400    --  d_2
401    --  d_3
402    --  d_4
403    --  d_5
404    --  d_6
405    --  d_7
406    --  d_8
407    --  d_9
408
409    --  Debug flags used in package Make and its clients (e.g. GNATMAKE)
410
411    --  da
412    --  db
413    --  dc
414    --  dd
415    --  de
416    --  df  Only output file names, not path names, in log
417    --  dg
418    --  dh  Generate listing showing loading of name table hash chains
419    --  di
420    --  dj
421    --  dk
422    --  dl
423    --  dm  Display the number of maximum simultaneous compilations
424    --  dn  Do not delete temp files created by gnatmake
425    --  do
426    --  dp  Prints the contents of the Q used by Make.Compile_Sources
427    --  dq  Prints source files as they are enqueued and dequeued
428    --  dr
429    --  ds
430    --  dt  Display time stamps when there is a mismatch
431    --  du  List units as their ali files are acquired
432    --  dv
433    --  dw  Prints the list of units withed by the unit currently explored
434    --  dx
435    --  dy
436    --  dz
437
438    --------------------------------------------
439    -- Documentation for Compiler Debug Flags --
440    --------------------------------------------
441
442    --  da   Generate messages tracking semantic analyzer progress. A message
443    --       is output showing each node as it gets analyzed, expanded,
444    --       resolved, or evaluated. This option is useful for finding out
445    --       exactly where a bomb during semantic analysis is occurring.
446
447    --  db   In Exp_Dbug, certain type names are encoded to include debugging
448    --       information. This debug switch causes lines to be output showing
449    --       the encodings used.
450
451    --  dc   List names of units as they are compiled. One line of output will
452    --       be generated at the start of compiling each unit (package or
453    --       subprogram).
454
455    --  dd   Dynamic allocation of tables messages generated. Each time a
456    --       table is reallocated, a line is output indicating the expansion.
457
458    --  de   List the entity table
459
460    --  df   Full tree/source print (includes withed units). Normally the tree
461    --       output (dt) or recreated source output (dg,do,ds) includes only
462    --       the main unit. If df is set, then the output in either case
463    --       includes all compiled units (see also dg,do,ds,dt). Note that to
464    --       be effective, this switch must be used in combination with one or
465    --       more of dt, dg, do or ds.
466
467    --  dg   Print the source recreated from the generated tree. In the case
468    --       where the tree has been rewritten this output includes only the
469    --       generated code, not the original code (see also df,do,ds,dz).
470    --       This flag differs from -gnatG in that the output also includes
471    --       non-source generated null statements, and freeze nodes, which
472    --       are normally omitted in -gnatG mode.
473
474    --  dh   Generates a table at the end of a compilation showing how the hash
475    --       table chains built by the Namet package are loaded. This is useful
476    --       in ensuring that the hashing algorithm (in Namet.Hash) is working
477    --       effectively with typical sets of program identifiers.
478
479    --  di   Generate messages for visibility linking/delinking
480
481    --  dj   Suppress "junk null check" for access parameters. This flag permits
482    --       Ada programs to pass null parameters to access parameters, and to
483    --       explicitly check such access values against the null literal.
484    --       Neither of these is valid Ada, but both were allowed in versions of
485    --       GNAT before 3.10, so this switch can ease the transition process.
486
487    --  dk   Immediate kill on abort. Normally on an abort (i.e. a call to
488    --       Comperr.Compiler_Abort), the "GNAT BUG" message is not given if
489    --       there is a previous error. Instead, the message "compilation
490    --       abandoned due to previous error" is given. This debug switch
491    --       bypasses this test and gives the "GNAT BUG" message unconditionally
492    --       (useful for debugging). Use -gnatdO in addition to see the previous
493    --       errors.
494
495    --  dl   Generate unit load trace messages. A line of traceback output is
496    --       generated each time a request is made to the library manager to
497    --       load a new unit.
498
499    --  dm   Prevent special frontend inlining in GNATprove mode. In some cases,
500    --       some subprogram calls are inlined in GNATprove mode in order to
501    --       facilitate formal verification. This debug switch prevents that
502    --       inlining to happen.
503
504    --  dn   Generate messages for node/list allocation. Each time a node or
505    --       list header is allocated, a line of output is generated. Certain
506    --       other basic tree operations also cause a line of output to be
507    --       generated. This option is useful in seeing where the parser is
508    --       blowing up.
509
510    --  do   Print the source recreated from the generated tree. In the case
511    --       where the tree has been rewritten, this output includes only the
512    --       original code, not the generated code (see also df,dg,ds,dz).
513
514    --  dp   Generate messages for parser scope stack push/pops. A line of
515    --       output by the parser each time the parser scope stack is either
516    --       pushed or popped. Useful in debugging situations where the
517    --       parser scope stack ends up incorrectly synchronized
518
519    --  dq   In layout version 1.38, 2002/01/12, a circuit was implemented
520    --       to give decent default alignment to short records that had no
521    --       specific alignment set. This debug option restores the previous
522    --       behavior of giving such records poor alignments, typically 1.
523    --       This may be useful in dealing with transition.
524
525    --  dr   Generate parser resynchronization messages. Normally the parser
526    --       resynchronizes quietly. With this debug option, two messages
527    --       are generated, one when the parser starts a resynchronization
528    --       skip, and another when it resumes parsing. Useful in debugging
529    --       inadequate error recovery situations.
530
531    --  ds   Print the source recreated from the generated tree. In the case
532    --       where the tree has been rewritten this output includes both the
533    --       generated code and the original code with the generated code
534    --       being enlosed in curly brackets (see also df,do,ds,dz)
535
536    --  dt   Print full tree. The generated tree is output (see also df,dy)
537
538    --  du   Uncheck categorization pragmas. This debug switch causes the
539    --       elaboration control pragmas (Pure, Preelaborate, etc.) and the
540    --       categorization pragmas (Shared_Passive, Remote_Types, etc.) to be
541    --       ignored, so that normal checks are not made (this is particularly
542    --       useful for adding temporary debugging code to units that have
543    --       pragmas that are inconsistent with the debugging code added).
544
545    --  dv   Output trace of overload resolution. Outputs messages for
546    --       overload attempts that involve cascaded errors, or where
547    --       an interpretation is incompatible with the context.
548
549    --  dw   Write semantic scope stack messages. Each time a scope is created
550    --       or removed, a message is output (see the Sem_Ch8.Push_Scope and
551    --       Sem_Ch8.Pop_Scope subprograms).
552
553    --  dx   Force expansion on, even if no code being generated. Normally the
554    --       expander is inhibited if no code is generated. This switch forces
555    --       expansion to proceed normally even if the backend is not being
556    --       called. This is particularly useful for debugging purposes when
557    --       using the front-end only version of the compiler (which normally
558    --       would never do any expansion).
559
560    --  dy   Print tree of package Standard. Normally the tree print out does
561    --       not include package Standard, even if the -df switch is set. This
562    --       switch forces output of the internal tree built for Standard.
563
564    --  dz   Print source of package Standard. Normally the source print out
565    --       does not include package Standard, even if the -df switch is set.
566    --       This switch forces output of the source recreated from the internal
567    --       tree built for Standard. Note that this differs from -gnatS in
568    --       that it prints from the actual tree using the normal Sprint
569    --       circuitry for printing trees.
570
571    --  dA   Forces output of representation information, including full
572    --       information for all internal type and object entities, as well
573    --       as all user defined type and object entities including private
574    --       and incomplete types. This debug switch also automatically sets
575    --       the equivalent of -gnatRm.
576
577    --  dB   Output debug encodings for types and variants. See Exp_Dbug for
578    --       exact form of the generated output.
579
580    --  dC   Output trace information showing the decisions made during
581    --       check suppression activity in unit Checks.
582
583    --  dD   Delete new elaboration checks. This flag causes GNAT to return
584    --       to the 3.13a elaboration semantics, and to suppress the fixing
585    --       of two bugs. The first is in the context of inner routines in
586    --       dynamic elaboration mode, when the subprogram we are in was
587    --       called at elaboration time by a unit that was also compiled with
588    --       dynamic elaboration checks. In this case, if A calls B calls C,
589    --       and all are in different units, we need an elaboration check at
590    --       each call. These nested checks were only put in recently (see
591    --       version 1.80 of Sem_Elab) and we provide this debug flag to
592    --       revert to the previous behavior in case of regressions. The
593    --       other behavior reverted by this flag is the treatment of the
594    --       Elaborate_Body pragma in static elaboration mode. This used to
595    --       be treated as not needing elaboration checking, but in fact in
596    --       general Elaborate_All is still required because of nested calls.
597
598    --  dE   Apply compile time elaboration checking for with relations between
599    --       predefined units. Normally no checks are made.
600
601    --  dG   Generate all warnings. Normally Errout suppresses warnings on
602    --       units that are not part of the main extended source, and also
603    --       suppresses warnings on instantiations in the main extended
604    --       source that duplicate warnings already posted on the template.
605    --       This switch stops both kinds of deletion and causes Errout to
606    --       post all warnings sent to it.
607
608    --  dH   Inhibit call to gigi. This is useful for testing front end data
609    --       layout, and may be useful in other debugging situations where
610    --       you do not want gigi to intefere with the testing.
611
612    --  dI   Inhibit internal name numbering in gnatDG listing. Any sequence of
613    --       the form <uppercase-letter><digits><lowercase-letter> appearing in
614    --       a name is replaced by <uppercase-letter>...<lowercase-letter>. This
615    --       is used in the fixed bugs run to minimize system and version
616    --       dependency in filed -gnatD or -gnatG output.
617
618    --  dK   Kill all error messages. This debug flag suppresses the output
619    --       of all error messages. It is used in regression tests where the
620    --       error messages are target dependent and irrelevant.
621
622    --  dL   The compiler ignores calls in instances and invoke subprograms
623    --       which are external to the instance for both the static and dynamic
624    --       elaboration models.
625
626    --  dM   Assume all variables have been modified, and ignore current value
627    --       indications. This debug flag disconnects the tracking of constant
628    --       values (see Exp_Ch2.Expand_Current_Value).
629
630    --  dN   Do not generate file name information in exception messages
631
632    --  dO   Output immediate error messages. This causes error messages to
633    --       be output as soon as they are generated (disconnecting several
634    --       circuits for improvement of messages, deletion of duplicate
635    --       messages etc). Useful to diagnose compiler bombs caused by
636    --       erroneous handling of error situations
637
638    --  dP   Do not check for controlled objects in preelaborable packages.
639    --       RM 10.2.1(9) forbids the use of library level controlled objects
640    --       in preelaborable packages, but this restriction is a huge pain,
641    --       especially in the predefined library units.
642
643    --  dQ   Do not generate cleanups to deallocate the memory in case qualified
644    --       expressions of allocators raise an exception.
645
646    --  dR   Bypass the check for a proper version of s-rpc being present
647    --       to use the -gnatz? switch. This allows debugging of the use
648    --       of stubs generation without needing to have GLADE (or some
649    --       other PCS  installed).
650
651    --  dS   Omit conversion of fpt numbers to exact machine numbers in
652    --       non-static evaluation contexts (see Check_Non_Static_Context).
653    --       This is intended for testing out timing problems with this
654    --       conversion circuit.
655
656    --  dT   Similar to dS, but omits the conversions only in the case where
657    --       the parent is not a constant declaration.
658
659    --  dU   Enable garbage collection of unreachable entities. This enables
660    --       both the reachability analysis and changing the Is_Public and
661    --       Is_Eliminated flags.
662
663    --  dV   Enable viewing of all symbols in debugger. Causes debug information
664    --       to be generated for all symbols, including internal symbols. This
665    --       is enabled by default for -gnatD, but this switch allows this to
666    --       be enabled without generating modified source files. Note that the
667    --       use of -gnatdV ensures in the dwarf/elf case that all symbols that
668    --       are present in the elf tables are also in the dwarf tables (which
669    --       seems to be required by some tools). Another effect of dV is to
670    --       generate full qualified names, including internal names generated
671    --       for blocks and loops.
672
673    --  dW   Disable warnings when a possibly uninitialized scalar value is
674    --       passed to an IN OUT parameter of a procedure. This usage is a
675    --       quite improper bounded error [erroneous in Ada 83] situation,
676    --       and would normally generate a warning. However, to ease the
677    --       task of transitioning incorrect legacy code, we provide this
678    --       undocumented feature for suppressing these warnings.
679
680    --  dY   Enable configurable run-time mode, just as though the System file
681    --       had Configurable_Run_Time_Mode set to True. This is useful in
682    --       testing high integrity mode.
683
684    --  dZ   Generate listing showing the contents of the dispatch tables. Each
685    --       line has an internally generated number used for references between
686    --       tagged types and primitives. For each primitive the output has the
687    --       following fields:
688    --
689    --         - Letter 'P' or letter 's': The former indicates that this
690    --           primitive will be located in a primary dispatch table. The
691    --           latter indicates that it will be located in a secondary
692    --           dispatch table.
693    --
694    --         - Name of the primitive. In case of predefined Ada primitives
695    --           the text "(predefined)" is added before the name, and these
696    --           acronyms are used: SR (Stream_Read), SW (Stream_Write), SI
697    --           (Stream_Input), SO (Stream_Output), DA (Deep_Adjust), DF
698    --           (Deep_Finalize). In addition Oeq identifies the equality
699    --           operator, and "_assign" the assignment.
700    --
701    --         - If the primitive covers interface types, two extra fields
702    --           referencing other primitives are generated: "Alias" references
703    --           the primitive of the tagged type that covers an interface
704    --           primitive, and "AI_Alias" references the covered interface
705    --           primitive.
706    --
707    --         - The expression "at #xx" indicates the slot of the dispatch
708    --           table occupied by such primitive in its corresponding primary
709    --           or secondary dispatch table.
710    --
711    --         - In case of abstract subprograms the text "is abstract" is
712    --           added at the end of the line.
713
714    --  d.a  Force Target_Strict_Alignment to True, even on targets where it
715    --       would normally be false. Can be used for testing strict alignment
716    --       circuitry in the compiler.
717
718    --  d.b  Dump back end types. During Create_Standard, the back end is
719    --       queried for all available types. This option shows them.
720
721    --  d.c  Generate inline concatenation, instead of calling one of the
722    --       System.Concat_n.Str_Concat_n routines in cases where the latter
723    --       routines would normally be called.
724
725    --  d.d  Disable atomic synchronization for all atomic variable references.
726    --       Pragma Enable_Atomic_Synchronization is ignored.
727
728    --  d.e  Enable atomic synchronization for all atomic variable references.
729    --       Pragma Disable_Atomic_Synchronization is ignored, and also the
730    --       compiler switch -gnated is ignored.
731
732    --  d.f  Suppress folding of static expressions. This of course results
733    --       in seriously non-conforming behavior, but is useful sometimes
734    --       when tracking down handling of complex expressions.
735
736    --  d.g  Enables conversion of a raise statement into a goto when the
737    --       relevant handler is statically determinable. For now we only try
738    --       this if this debug flag is set. Later we will enable this more
739    --       generally by default.
740
741    --  d.h  Minimize the creation of public internal symbols for concatenation
742    --       by enforcing a secondary stack-like handling of the final result.
743    --       The target of the concatenation is thus constrained in place and
744    --       initialized with the result instead of acting as its alias.
745
746    --  d.i  Ignore all occurrences of pragma Warnings in the sources. This can
747    --       be used in particular to disable Warnings (Off) to check if any of
748    --       these statements are inappropriate.
749
750    --  d.k  If an error message contains a reference to a location in an
751    --       internal unit, then suppress the line number in this reference.
752
753    --  d.j  Generate listing of frontend inlined calls and inline calls passed
754    --       to the backend. This is useful to locate skipped calls that must be
755    --       inlined by the frontend.
756
757    --  d.l  Use Ada 95 semantics for limited function returns. This may be
758    --       used to work around the incompatibility introduced by AI-318-2.
759    --       It is useful only in Ada 2005 and later.
760
761    --  d.m  When -gnatl is used, the normal output includes full listings of
762    --       all files in the extended main source (body/spec/subunits). If this
763    --       debug switch is used, then the full listing is given only for the
764    --       main source (this corresponds to a previous behavior of -gnatl and
765    --       is used for running the ACATS tests).
766
767    --  d.n  Print source file names as they are loaded. This is useful if the
768    --       compiler has a bug -- these are the files that need to be included
769    --       in a bug report.
770
771    --  d.o  Conservative elaboration order for indirect calls. This causes
772    --       P'Access to be treated as a call in more cases.
773
774    --  d.p  In Ada 95 (or 83) mode, use original Ada 95 behavior for the
775    --       interpretation of component clauses crossing byte boundaries when
776    --       using the non-default bit order (i.e. ignore AI95-0133).
777
778    --  d.q  If an array variable or constant is not modified in Ada code, and
779    --       is passed to an 'in' parameter of a foreign-convention subprogram,
780    --       and that subprogram modifies the array, the Ada compiler normally
781    --       assumes that the array is not modified. This option suppresses such
782    --       optimizations. This option should not be used; the correct solution
783    --       is to declare the parameter 'in out'.
784
785    --  d.r  Do not reorder components in record types.
786
787    --  d.s  The compiler no longer attempts to optimize the calls to secondary
788    --       stack management routines SS_Mark and SS_Release. As a result, each
789    --       transient block tasked with secondary stack management will fulfill
790    --       its role unconditionally.
791
792    --  d.s  The compiler does not generate calls to secondary stack management
793    --       routines SS_Mark and SS_Release for a transient block when there is
794    --       an enclosing scoping construct which already manages the secondary
795    --       stack.
796
797    --  d.t  The compiler has been modified (a fairly extensive modification)
798    --       to generate static dispatch tables for library level tagged types.
799    --       This debug switch disables this modification and reverts to the
800    --       previous dynamic construction of tables. It is there as a possible
801    --       work around if we run into trouble with the new implementation.
802
803    --  d.u
804
805    --  d.v  This flag enforces the elaboration rules defined in the SPARK
806    --       Reference Manual, chapter 7.7, to all SPARK code within a unit. As
807    --       a result, constructs which violate the rules in chapter 7.7 are no
808    --       longer accepted, even if the implementation is able to statically
809    --       ensure that accepting these constructs does not introduce the
810    --       possibility of failing an elaboration check.
811
812    --  d.w  This flag turns off the scanning of loops to detect possible
813    --       infinite loops.
814
815    --  d.x  No exception handlers in generated code. This causes exception
816    --       handlers to be eliminated from the generated code. They are still
817    --       fully compiled and analyzed, they just get eliminated from the
818    --       code generation step.
819
820    --  d.y  Disable implicit pragma Elaborate_All on task bodies. When a task
821    --       body calls a procedure in the same package, and that procedure
822    --       calls a procedure in another package, the static elaboration
823    --       machinery adds an implicit Elaborate_All on the other package. This
824    --       switch disables the addition of the implicit pragma in such cases.
825
826    --  d.z  Restore previous front-end support for Inline_Always. In default
827    --       mode, for targets that use the GCC back end, Inline_Always is
828    --       handled by the back end. Use of this switch restores the previous
829    --       handling of Inline_Always by the front end on such targets. For the
830    --       targets that do not use the GCC back end, this switch is ignored.
831
832    --  d.A  Enable statistics printing in Atree. First set Statistics_Enabled
833    --       in gen_il-gen.adb to True, then rebuild, then run the compiler
834    --       with -gnatd.A. You might want to apply "sort -nr" to parts of the
835    --       output.
836
837    --  d.B  Generate a "GNAT BUG" message when we see an abort_statement, even
838    --       though there is no bug. Useful for testing Comperr.Compiler_Abort:
839    --       write some code containing an abort_statement, and compile it with
840    --       -gnatd.B. There is nothing special about abort_statements; it just
841    --       provides a way to control where the bug box is generated. See the
842    --       "when N_Abort_Statement" in package body Expander.
843
844    --  d.C  Generate call to System.Concat_n.Str_Concat_n routines in cases
845    --       where we would normally generate inline concatenation code.
846
847    --  d.D  For compatibility with some Ada 95 compilers implementing only
848    --       one feature of Ada 2005 (overriding keyword), disable errors on use
849    --       of overriding keyword in Ada 95 mode.
850
851    --  d.E  Turn selected errors into warnings. This debug switch causes a
852    --       specific set of error messages into warnings. Setting this switch
853    --       causes Opt.Error_To_Warning to be set to True. The intention is
854    --       that this be used for messages representing upwards incompatible
855    --       changes to Ada 2012 that cause previously correct programs to be
856    --       treated as illegal now. The following cases are affected:
857    --
858    --          Errors relating to overlapping subprogram parameters for cases
859    --          other than IN OUT parameters to functions.
860    --
861    --          Errors relating to the new rules about not defining equality
862    --          too late so that composition of equality can be assured.
863    --
864    --          Errors relating to overriding indicators on protected subprogram
865    --          bodies (not an Ada 2012 incompatibility, but might cause errors
866    --          for existing programs assuming they were legal because GNAT
867    --          formerly allowed them).
868
869    --  d.F  Sets GNATprove_Mode to True. This allows debugging the frontend in
870    --       the special mode used by GNATprove.
871
872    --  d.G  Previously the compiler ignored calls via generic formal parameters
873    --       when doing the analysis for the static elaboration model. This is
874    --       now fixed, but we provide this debug flag to revert to the previous
875    --       situation of ignoring such calls to aid in transition.
876
877    --  d.H  Disable the support for 128-bit integer types on 64-bit platforms.
878    --       This makes it easier to mimic the behavior of the current compiler
879    --       on 32-bit platforms or of older compilers on 64-bit platforms.
880
881    --  d.I  Do not ignore enum representation clauses in CodePeer mode.
882    --       The default of ignoring representation clauses for enumeration
883    --       types in CodePeer is good for the majority of Ada code, but in some
884    --       cases being able to change this default might be useful to remove
885    --       some false positives.
886
887    --  d.J  Relaxed rules for pragma No_Return. A pragma No_Return is illegal
888    --       if it applies to a body. This switch disables the legality check
889    --       for that. If the procedure does in fact return normally, execution
890    --       is erroneous, and therefore unpredictable.
891
892    --  d.K  Do not reject components in extensions overlapping with the parent
893    --       component. Such components can be specified by means of a component
894    --       clause but they cannot be fully supported by the GCC type system.
895    --       This switch nevertheless allows them for the sake of compatibility.
896
897    --  d.M  Relaxed RM semantics. This flag sets Opt.Relaxed_RM_Semantics
898    --       See Opt.Relaxed_RM_Semantics for more details.
899
900    --  d.N  Use rounding instead of truncation when dynamically converting from
901    --       a floating-point type to an ordinary fixed-point type, for the sake
902    --       of compatibility with earlier versions of the compiler.
903
904    --  d.O  Dump internal SCO tables. Before outputting the SCO information to
905    --       the ALI file, the internal SCO tables (SCO_Table/SCO_Unit_Table)
906    --       are dumped for debugging purposes.
907
908    --  d.P  Previous non-optimized handling of length comparisons. Setting this
909    --       flag inhibits the effect of Optimize_Length_Comparison in Exp_Ch4.
910    --       This is there in case we find a situation where the optimization
911    --       malfunctions, to provide a work around.
912
913    --  d.Q  Previous incomplete style checks for binary operators. Style checks
914    --       for token separation rules were incomplete and have been made
915    --       compliant with the documentation. For example, no warning was
916    --       issued for expressions such as 16-One or "A"&"B". Setting this flag
917    --       inhibits these new checks.
918
919    --  d.R  As documented in lib-writ.ads, restrictions in the ali file can
920    --       have two forms, positional and named. The named notation is the
921    --       current preferred form, but the use of this debug switch will force
922    --       the use of the obsolescent positional form.
923
924    --  d.S  Force Optimize_Alignment (Space) mode as the default
925
926    --  d.T  Force Optimize_Alignment (Time) mode as the default
927
928    --  d.U  Ignore indirect calls for static elaboration. The static
929    --       elaboration model is conservative, especially regarding indirect
930    --       calls. If you say Proc'Access, it will assume you might call
931    --       Proc. This can cause elaboration cycles at bind time. This flag
932    --       reverts to the behavior of earlier compilers, which ignored
933    --       indirect calls.
934
935    --  d.V  Do not verify the validity of SCIL files (CodePeer mode). When
936    --       generating SCIL files for CodePeer, by default we verify that the
937    --       SCIL is well formed before saving it on disk. This switch can be
938    --       used to disable this checking, either to improve speed or to shut
939    --       down a false positive detected during the verification.
940
941    --  d.W  Print out debugging information for Walk_Library_Items, including
942    --       the order in which units are walked. This is primarily for use in
943    --       debugging CodePeer mode.
944
945    --  d.X  A previous version of GNAT allowed indexing aspects to be redefined
946    --       on derived container types, while the default iterator was
947    --       inherited from the parent type. This nonstandard extension is
948    --       preserved temporarily for use by the modeling project under debug
949    --       flag d.X.
950
951    --  d.Z  Normally we always enable expansion in configurable run-time mode
952    --       to make sure we get error messages about unsupported features even
953    --       when compiling in -gnatc mode. But expansion is turned off in this
954    --       case if debug flag -gnatd.Z is used. This is to deal with the case
955    --       where we discover difficulties in this new processing.
956
957    --  d_a  The compiler stops the examination of a task body once it reaches
958    --       an accept or select statement for the static elaboration model. The
959    --       behavior is similar to that of No_Entry_Calls_In_Elaboration_Code,
960    --       but does not penalize actual entry calls in elaboration code.
961
962    --  d_b  When the restriction No_Dynamic_Accessibility_Checks is enabled,
963    --       use the simple "designated type" accessibility model, instead of
964    --       using the implicit level of the anonymous access type declaration.
965
966    --  d_e  The compiler ignores simple entry calls, asynchronous transfer of
967    --       control, conditional entry calls, timed entry calls, and requeue
968    --       statements in both the static and dynamic elaboration models.
969
970    --  d_f  Issue info messages related to GNATprove usage to help users
971    --       understand analysis results. By default these are not issued as
972    --       beginners find them confusing. Set automatically by GNATprove when
973    --       switch --info is used.
974
975    --  d_g  Disable large static aggregates. The maximum size for a static
976    --       aggregate will be fairly modest, which is useful if the compiler
977    --       is using too much memory and time at compile time.
978
979    --  d_h  The compiler does not make use of (perfect) hash functions in the
980    --       implementation of the Value attribute for enumeration types.
981
982    --  d_i  The compiler ignores calls and task activations when they target a
983    --       subprogram or task type defined in an external instance for both
984    --       the static and dynamic elaboration models.
985
986    --  d_j  The compiler reads JSON files that would be generated by the same
987    --       compilation session if -gnatRjs was passed, in order to populate
988    --       the internal tables of the Repinfo unit from them.
989
990    --  d_k  In CodePeer mode assertion expressions are expanded by default
991    --       (regardless of the -gnata compiler switch); when this switch is
992    --       enabled, expansion of assertion expressions is controlled by
993    --       pragma Assertion_Policy.
994
995    --  d_l  The compiler does not enforce the strict alignment of array types
996    --       that are declared with an aliased component.
997
998    --  d_p  The compiler ignores calls to subprograms which verify the run-time
999    --       semantics of invariants and postconditions in both the static and
1000    --       dynamic elaboration models.
1001
1002    --  d_q  The compiler does not enforce the new freezing rule introduced for
1003    --       primitive equality operators in Ada 2012 when the operator returns
1004    --       a subtype of Boolean.
1005
1006    --  d_r  The compiler does not make use of the return slot in the expansion
1007    --       of functions returning a by-reference type. If this use is required
1008    --       for these functions to return on the primary stack, then they are
1009    --       changed to return on the secondary stack instead.
1010
1011    --  d_s  The compiler stops the examination of a task body once it reaches
1012    --       a call to routine Ada.Synchronous_Task_Control.Suspend_Until_True
1013    --       or Ada.Synchronous_Barriers.Wait_For_Release.
1014
1015    --  d_t  In the LLVM-based CCG, do an additional dump of the LLVM IR
1016    --       after the pass that does transformations to the IR into a
1017    --       filename ending with .trans.ll.
1018
1019    --  d_u  In the LLVM-based CCG, dump flows, both when originally created
1020    --       and after transformations.
1021
1022    --  d_v  Enable additional checks and debug printouts in Atree
1023
1024    --  d_w  In LLVM-based CCG, don't send front end data to CCG
1025
1026    --  d_x  The compiler does not expand in line the Image attribute for user-
1027    --       defined enumeration types and the standard boolean type.
1028
1029    --  d_A  Do not generate ALI files by setting Opt.Disable_ALI_File.
1030
1031    --  d_B  Warn on build-in-place function calls. This allows users to
1032    --       inspect their code in case it triggers compiler bugs related
1033    --       to build-in-place calls. See known-problem entries for details.
1034
1035    --  d_F  The compiler encodes the full path from an invocation construct to
1036    --       an external target, offering additional information to GNATBIND for
1037    --       purposes of error diagnostics.
1038
1039    --  d_I  Generic formal type inference: print a "note:" message for each
1040    --       actual type that is inferred, or could be inferred.
1041
1042    --  d_K  (Reserved) Enable reporting a warning on known-problem issues of
1043    --       previous releases. No action performed in the wavefront.
1044
1045    --  d_L  Output trace information on elaboration checking. This debug switch
1046    --       causes output to be generated showing each call or instantiation as
1047    --       it is checked, and the progress of the recursive trace through
1048    --       elaboration calls at compile time.
1049
1050    --  d_P  For prefixed subprogram calls with an access-type prefix, disable
1051    --       the generation of a null-excluding runtime check on the prefix,
1052    --       even when the called subprogram has a first access parameter that
1053    --       does not exclude null (that is the case only for class-wide
1054    --       parameter, as controlling parameters are automatically null-
1055    --       excluding). In such a case, P.Proc is equivalent to the call
1056    --       Proc(P.all'Access); see RM 6.4(9.1/5). This includes a dereference,
1057    --       and thus a null check.
1058
1059    --  d_R  In the LLVM backend, output the internal representation of
1060    --       each record
1061
1062    --  d_T  The compiler outputs trace information to standard output whenever
1063    --       an invocation path is recorded.
1064
1065    --  d_U  Disable prepending 'error:' to error messages. This used to be the
1066    --       default and can be seen as the opposite of -gnatU.
1067
1068    --  d_V  Enable verification of the expanded code before calling the backend
1069    --       and generate error messages on each inconsistency found.
1070
1071    --  d_X  Disable assertions to check matching of extra formals; switch added
1072    --       temporarily to disable these checks until this work is complete if
1073    --       they cause unexpected assertion failures.
1074
1075    --  d1   Error messages have node numbers where possible. Normally error
1076    --       messages have only source locations. This option is useful when
1077    --       debugging errors caused by expanded code, where the source location
1078    --       does not give enough information.
1079
1080    --  d2   Suppress output of the error position flags for verbose form error
1081    --       messages. The messages are still interspersed in the listing, but
1082    --       without any error flags or extra blank lines. Also causes an extra
1083    --       <<< to be output at the right margin. This is intended to be the
1084    --       easiest format for checking conformance of ACATS B tests. This
1085    --       flag also suppresses the additional messages explaining why a
1086    --       non-static expression is non-static (see Sem_Eval.Why_Not_Static).
1087    --       This avoids having to worry about these messages in ACATS testing.
1088    --       Finally, this flag is also used for strict legality check, in
1089    --       particular it will generate an error instead a warning when
1090    --       encountering an unknown pragma.
1091
1092    --  d3   Causes Comperr to dump the contents of the node for which an abort
1093    --       was detected (normally only the Node_Id of the node is output).
1094
1095    --  d4   Inhibits automatic krunching of predefined library unit file names.
1096    --       Normally, as described in the spec of package Krunch, such files
1097    --       are automatically krunched to 8 characters, with special treatment
1098    --       of the prefixes Ada, System, and Interfaces. Setting this debug
1099    --       switch disables this special treatment.
1100
1101    --  d5   Causes the tree read/write circuit to output detailed information
1102    --       tracking the data that is read and written element by element.
1103
1104    --  d6   Normally access-to-unconstrained-array types are represented
1105    --       using fat (double) pointers. Using this debug flag causes them
1106    --       to default to thin. This can be used to test the performance
1107    --       implications of using thin pointers, and also to test that the
1108    --       compiler functions correctly with this choice.
1109
1110    --  d7   Normally a -gnatl or -gnatv listing includes the time stamp of the
1111    --       source file and the time of the compilation. This debug flag can
1112    --       be used to suppress this output, and also suppresses the message
1113    --       with the version of the compiler. This is useful for regression
1114    --       tests which need to have consistent output.
1115
1116    --  d8   This forces the packed stuff to generate code assuming the
1117    --       opposite endianness from the actual correct value. Useful in
1118    --       testing out code generation from the packed routines.
1119
1120    --  d.1  Sets Opt.Unnest_Subprogram_Mode to enable unnesting of subprograms.
1121    --       This special pass does not actually unnest things, but it ensures
1122    --       that a nested procedure does not contain any uplevel references.
1123    --       See spec of Exp_Unst for full details.
1124
1125    --  d.2  Allow statements within declarative parts. This is not usually
1126    --       allowed, but in some debugging contexts (e.g. testing the circuit
1127    --       for unnesting of procedures), it is useful to allow this.
1128
1129    --  d.3  Output debugging information from Exp_Unst, including the name of
1130    --       any unreachable subprograms that get deleted.
1131
1132    --  d.4  By default in case of an error during C generation, the .c or .h
1133    --       file is deleted. This flag keeps the C file.
1134
1135    --  d.5  By default a subprogram imported generates a subprogram profile.
1136    --       This debug flag disables this generation when generating C code,
1137    --       assuming a proper #include will be used instead.
1138
1139    --  d.7  Indicates (to gnat2scil) that CodePeer is being invoked as a
1140    --       prover by the SPARK tools and that therefore gnat2scil should
1141    --       avoid SCIL generation strategies which can introduce soundness
1142    --       issues (e.g., assuming that a low bound of an array parameter
1143    --       of an unconstrained subtype belongs to the index subtype).
1144
1145    --  d.8  By default calls to expression functions are always inlined.
1146    --       This debug flag turns off this behavior, making them subject
1147    --       to the usual inlining heuristics of the code generator.
1148
1149    ------------------------------------------
1150    -- Documentation for Binder Debug Flags --
1151    ------------------------------------------
1152
1153    --  da  Normally if there is an elaboration circularity, then in describing
1154    --      the cycle, links involving internal units are omitted, since they
1155    --      are irrelevant and confusing. This debug flag causes all links to
1156    --      be listed, and is useful when diagnosing circularities introduced
1157    --      by incorrect changes to the run-time library itself.
1158
1159    --  db  Output debug information from Better_Choice in Binde, which uses
1160    --      various heuristics to determine elaboration order in cases where
1161    --      multiple orders are valid.
1162
1163    --  dc  List units as they are chosen. As units are selected for addition to
1164    --      the elaboration order, a line of output is generated showing which
1165    --      unit has been selected.
1166
1167    --  de  Similar to the effect of -e (output complete list of elaboration
1168    --      dependencies) except that internal units are included in the
1169    --      listing.
1170
1171    --  di  Normally GNATBIND calls Read_Ali with Ignore_Errors set to False,
1172    --      since the binder really needs correct version ALI files to do its
1173    --      job. This debug flag causes Ignore_Errors mode to be set for the
1174    --      binder (and is particularly useful for testing ignore errors mode).
1175
1176    --  dn  List details of manipulation of Num_Pred values during execution of
1177    --      the algorithm used to determine a correct order of elaboration. This
1178    --      is useful in diagnosing any problems in its behavior.
1179
1180    --  do  Use older elaboration order preference. The new preference rules
1181    --      prefer specs with no bodies to specs with bodies, and between two
1182    --      specs with bodies, prefers the one whose body is closer to being
1183    --      able to be elaborated. This is a clear improvement, but we provide
1184    --      this debug flag in case of regressions. Note: -do is even older
1185    --      than -dp.
1186
1187    --  dp  Use old elaboration order preference. The new preference rules
1188    --      elaborate all units within a strongly connected component together,
1189    --      with no other units in between. In particular, if a spec/body pair
1190    --      can be elaborated together, it will be. In the new order, the binder
1191    --      behaves as if every pragma Elaborate_All that would be legal is
1192    --      present, even if it does not appear in the source code.
1193
1194    --  du  List unit name and file name for each unit as it is read in
1195
1196    --  dv  Verbose debugging printouts
1197
1198    --  dx  Force the binder to read (and then ignore) the xref information
1199    --      in ali files (used to check that read circuit is working OK).
1200
1201    --  d_a  GNATBIND ignores the effects of pragma Elaborate_All in the case of
1202    --       elaboration order and treats the associated dependency as a regular
1203    --       with edge.
1204
1205    --  d_b  GNATBIND ignores the effects of pragma Elaborate_Body in the case
1206    --       of elaboration order and treats the spec and body as decoupled.
1207
1208    --  d_e  GNATBIND ignores the effects of pragma Elaborate in the case of
1209    --       elaboration order and no longer creates an implicit dependency on
1210    --       the body of the argument.
1211
1212    --  d_t  GNATBIND output trace information of cycle-detection activities to
1213    --       standard output.
1214
1215    --  d_A  GNATBIND output the contents of all ALI invocation-related tables
1216    --       in textual format to standard output.
1217
1218    --  d_C  GNATBIND diagnoses all unique cycles within the bind, rather than
1219    --       just the most important one.
1220
1221    --  d_I  GNATBIND outputs the contents of the invocation graph in textual
1222    --       format to standard output.
1223
1224    --  d_L  GNATBIND outputs the contents of the library graph in textual
1225    --       format to standard output.
1226
1227    --  d_P  GNATBIND outputs the cycle paths to standard output
1228
1229    --  d_S  GNATBIND outputs trace information concerning the status of its
1230    --       various phases to standard output.
1231
1232    --  d_T  GNATBIND outputs trace information of elaboration order detection
1233    --       activities to standard output.
1234
1235    --  d_V  GNATBIND validates the invocation graph, library graph along with
1236    --       its cycles, and the elaboration order.
1237
1238    --------------------------------------------
1239    -- Documentation for gnatmake Debug Flags --
1240    --------------------------------------------
1241
1242    --  df  Only output file names, not path names, in log
1243
1244    --  dh  Generate listing showing loading of name table hash chains,
1245    --      same as for the compiler.
1246
1247    --  dm  Issue a message indicating the maximum number of simultaneous
1248    --      compilations.
1249
1250    --  dn  Do not delete temporary files created by gnatmake at the end
1251    --      of execution, such as temporary config pragma files, mapping
1252    --      files or project path files. This debug switch is equivalent to
1253    --      the standard switch --keep-temp-files. We retain the debug switch
1254    --      for back compatibility with past usage.
1255
1256    --  dp  Prints the Q used by routine Make.Compile_Sources every time
1257    --      we go around the main compile loop of Make.Compile_Sources
1258
1259    --  dq  Prints source files as they are enqueued and dequeued in the Q
1260    --      used by routine Make.Compile_Sources. Useful to figure out the
1261    --      order in which sources are recompiled.
1262
1263    --  dt  When a time stamp mismatch has been found for an ALI file,
1264    --      display the source file name, the time stamp expected and
1265    --      the time stamp found.
1266
1267    --  du  List unit name and file name for each unit as it is read in
1268
1269    --  dw  Prints the list of units withed by the unit currently explored
1270    --      during the main loop of Make.Compile_Sources.
1271
1272    ---------------------------------------------
1273    -- Documentation for gprbuild Debug Flags  --
1274    ---------------------------------------------
1275
1276    --  dm  Display the maximum number of simultaneous compilations.
1277
1278    --  dn  Do not delete temporary files created by gprbuild at the end
1279    --      of execution, such as temporary config pragma files, mapping
1280    --      files or project path files. This debug switch is equivalent to
1281    --      the standard switch --keep-temp-files. We retain the debug switch
1282    --      for back compatibility with past usage.
1283
1284    --  dt  When a time stamp mismatch has been found for an ALI file,
1285    --      display the source file name, the time stamp expected and
1286    --      the time stamp found.
1287
1288    --------------------
1289    -- Set_Debug_Flag --
1290    --------------------
1291
1292    procedure Set_Debug_Flag (C : Character; Val : Boolean := True) is
1293       subtype Dig  is Character range '1' .. '9';
1294       subtype LLet is Character range 'a' .. 'z';
1295       subtype ULet is Character range 'A' .. 'Z';
1296
1297    begin
1298       if C in Dig then
1299          case Dig (C) is
1300             when '1' =>
1301                Debug_Flag_1 := Val;
1302             when '2' =>
1303                Debug_Flag_2 := Val;
1304             when '3' =>
1305                Debug_Flag_3 := Val;
1306             when '4' =>
1307                Debug_Flag_4 := Val;
1308             when '5' =>
1309                Debug_Flag_5 := Val;
1310             when '6' =>
1311                Debug_Flag_6 := Val;
1312             when '7' =>
1313                Debug_Flag_7 := Val;
1314             when '8' =>
1315                Debug_Flag_8 := Val;
1316             when '9' =>
1317                Debug_Flag_9 := Val;
1318          end case;
1319
1320       elsif C in ULet then
1321          case ULet (C) is
1322             when 'A' =>
1323                Debug_Flag_AA := Val;
1324             when 'B' =>
1325                Debug_Flag_BB := Val;
1326             when 'C' =>
1327                Debug_Flag_CC := Val;
1328             when 'D' =>
1329                Debug_Flag_DD := Val;
1330             when 'E' =>
1331                Debug_Flag_EE := Val;
1332             when 'F' =>
1333                Debug_Flag_FF := Val;
1334             when 'G' =>
1335                Debug_Flag_GG := Val;
1336             when 'H' =>
1337                Debug_Flag_HH := Val;
1338             when 'I' =>
1339                Debug_Flag_II := Val;
1340             when 'J' =>
1341                Debug_Flag_JJ := Val;
1342             when 'K' =>
1343                Debug_Flag_KK := Val;
1344             when 'L' =>
1345                Debug_Flag_LL := Val;
1346             when 'M' =>
1347                Debug_Flag_MM := Val;
1348             when 'N' =>
1349                Debug_Flag_NN := Val;
1350             when 'O' =>
1351                Debug_Flag_OO := Val;
1352             when 'P' =>
1353                Debug_Flag_PP := Val;
1354             when 'Q' =>
1355                Debug_Flag_QQ := Val;
1356             when 'R' =>
1357                Debug_Flag_RR := Val;
1358             when 'S' =>
1359                Debug_Flag_SS := Val;
1360             when 'T' =>
1361                Debug_Flag_TT := Val;
1362             when 'U' =>
1363                Debug_Flag_UU := Val;
1364             when 'V' =>
1365                Debug_Flag_VV := Val;
1366             when 'W' =>
1367                Debug_Flag_WW := Val;
1368             when 'X' =>
1369                Debug_Flag_XX := Val;
1370             when 'Y' =>
1371                Debug_Flag_YY := Val;
1372             when 'Z' =>
1373                Debug_Flag_ZZ := Val;
1374          end case;
1375
1376       else
1377          case LLet (C) is
1378             when 'a' =>
1379                Debug_Flag_A := Val;
1380             when 'b' =>
1381                Debug_Flag_B := Val;
1382             when 'c' =>
1383                Debug_Flag_C := Val;
1384             when 'd' =>
1385                Debug_Flag_D := Val;
1386             when 'e' =>
1387                Debug_Flag_E := Val;
1388             when 'f' =>
1389                Debug_Flag_F := Val;
1390             when 'g' =>
1391                Debug_Flag_G := Val;
1392             when 'h' =>
1393                Debug_Flag_H := Val;
1394             when 'i' =>
1395                Debug_Flag_I := Val;
1396             when 'j' =>
1397                Debug_Flag_J := Val;
1398             when 'k' =>
1399                Debug_Flag_K := Val;
1400             when 'l' =>
1401                Debug_Flag_L := Val;
1402             when 'm' =>
1403                Debug_Flag_M := Val;
1404             when 'n' =>
1405                Debug_Flag_N := Val;
1406             when 'o' =>
1407                Debug_Flag_O := Val;
1408             when 'p' =>
1409                Debug_Flag_P := Val;
1410             when 'q' =>
1411                Debug_Flag_Q := Val;
1412             when 'r' =>
1413                Debug_Flag_R := Val;
1414             when 's' =>
1415                Debug_Flag_S := Val;
1416             when 't' =>
1417                Debug_Flag_T := Val;
1418             when 'u' =>
1419                Debug_Flag_U := Val;
1420             when 'v' =>
1421                Debug_Flag_V := Val;
1422             when 'w' =>
1423                Debug_Flag_W := Val;
1424             when 'x' =>
1425                Debug_Flag_X := Val;
1426             when 'y' =>
1427                Debug_Flag_Y := Val;
1428             when 'z' =>
1429                Debug_Flag_Z := Val;
1430          end case;
1431       end if;
1432    end Set_Debug_Flag;
1433
1434    ---------------------------
1435    -- Set_Dotted_Debug_Flag --
1436    ---------------------------
1437
1438    procedure Set_Dotted_Debug_Flag (C : Character; Val : Boolean := True) is
1439       subtype Dig  is Character range '1' .. '9';
1440       subtype LLet is Character range 'a' .. 'z';
1441       subtype ULet is Character range 'A' .. 'Z';
1442
1443    begin
1444       if C in Dig then
1445          case Dig (C) is
1446             when '1' =>
1447                Debug_Flag_Dot_1 := Val;
1448             when '2' =>
1449                Debug_Flag_Dot_2 := Val;
1450             when '3' =>
1451                Debug_Flag_Dot_3 := Val;
1452             when '4' =>
1453                Debug_Flag_Dot_4 := Val;
1454             when '5' =>
1455                Debug_Flag_Dot_5 := Val;
1456             when '6' =>
1457                Debug_Flag_Dot_6 := Val;
1458             when '7' =>
1459                Debug_Flag_Dot_7 := Val;
1460             when '8' =>
1461                Debug_Flag_Dot_8 := Val;
1462             when '9' =>
1463                Debug_Flag_Dot_9 := Val;
1464          end case;
1465
1466       elsif C in ULet then
1467          case ULet (C) is
1468             when 'A' =>
1469                Debug_Flag_Dot_AA := Val;
1470             when 'B' =>
1471                Debug_Flag_Dot_BB := Val;
1472             when 'C' =>
1473                Debug_Flag_Dot_CC := Val;
1474             when 'D' =>
1475                Debug_Flag_Dot_DD := Val;
1476             when 'E' =>
1477                Debug_Flag_Dot_EE := Val;
1478             when 'F' =>
1479                Debug_Flag_Dot_FF := Val;
1480             when 'G' =>
1481                Debug_Flag_Dot_GG := Val;
1482             when 'H' =>
1483                Debug_Flag_Dot_HH := Val;
1484             when 'I' =>
1485                Debug_Flag_Dot_II := Val;
1486             when 'J' =>
1487                Debug_Flag_Dot_JJ := Val;
1488             when 'K' =>
1489                Debug_Flag_Dot_KK := Val;
1490             when 'L' =>
1491                Debug_Flag_Dot_LL := Val;
1492             when 'M' =>
1493                Debug_Flag_Dot_MM := Val;
1494             when 'N' =>
1495                Debug_Flag_Dot_NN := Val;
1496             when 'O' =>
1497                Debug_Flag_Dot_OO := Val;
1498             when 'P' =>
1499                Debug_Flag_Dot_PP := Val;
1500             when 'Q' =>
1501                Debug_Flag_Dot_QQ := Val;
1502             when 'R' =>
1503                Debug_Flag_Dot_RR := Val;
1504             when 'S' =>
1505                Debug_Flag_Dot_SS := Val;
1506             when 'T' =>
1507                Debug_Flag_Dot_TT := Val;
1508             when 'U' =>
1509                Debug_Flag_Dot_UU := Val;
1510             when 'V' =>
1511                Debug_Flag_Dot_VV := Val;
1512             when 'W' =>
1513                Debug_Flag_Dot_WW := Val;
1514             when 'X' =>
1515                Debug_Flag_Dot_XX := Val;
1516             when 'Y' =>
1517                Debug_Flag_Dot_YY := Val;
1518             when 'Z' =>
1519                Debug_Flag_Dot_ZZ := Val;
1520          end case;
1521
1522       else
1523          case LLet (C) is
1524             when 'a' =>
1525                Debug_Flag_Dot_A := Val;
1526             when 'b' =>
1527                Debug_Flag_Dot_B := Val;
1528             when 'c' =>
1529                Debug_Flag_Dot_C := Val;
1530             when 'd' =>
1531                Debug_Flag_Dot_D := Val;
1532             when 'e' =>
1533                Debug_Flag_Dot_E := Val;
1534             when 'f' =>
1535                Debug_Flag_Dot_F := Val;
1536             when 'g' =>
1537                Debug_Flag_Dot_G := Val;
1538             when 'h' =>
1539                Debug_Flag_Dot_H := Val;
1540             when 'i' =>
1541                Debug_Flag_Dot_I := Val;
1542             when 'j' =>
1543                Debug_Flag_Dot_J := Val;
1544             when 'k' =>
1545                Debug_Flag_Dot_K := Val;
1546             when 'l' =>
1547                Debug_Flag_Dot_L := Val;
1548             when 'm' =>
1549                Debug_Flag_Dot_M := Val;
1550             when 'n' =>
1551                Debug_Flag_Dot_N := Val;
1552             when 'o' =>
1553                Debug_Flag_Dot_O := Val;
1554             when 'p' =>
1555                Debug_Flag_Dot_P := Val;
1556             when 'q' =>
1557                Debug_Flag_Dot_Q := Val;
1558             when 'r' =>
1559                Debug_Flag_Dot_R := Val;
1560             when 's' =>
1561                Debug_Flag_Dot_S := Val;
1562             when 't' =>
1563                Debug_Flag_Dot_T := Val;
1564             when 'u' =>
1565                Debug_Flag_Dot_U := Val;
1566             when 'v' =>
1567                Debug_Flag_Dot_V := Val;
1568             when 'w' =>
1569                Debug_Flag_Dot_W := Val;
1570             when 'x' =>
1571                Debug_Flag_Dot_X := Val;
1572             when 'y' =>
1573                Debug_Flag_Dot_Y := Val;
1574             when 'z' =>
1575                Debug_Flag_Dot_Z := Val;
1576          end case;
1577       end if;
1578    end Set_Dotted_Debug_Flag;
1579
1580    --------------------------------
1581    -- Set_Underscored_Debug_Flag --
1582    --------------------------------
1583
1584    procedure Set_Underscored_Debug_Flag
1585      (C   : Character;
1586       Val : Boolean := True)
1587    is
1588       subtype Dig  is Character range '1' .. '9';
1589       subtype LLet is Character range 'a' .. 'z';
1590       subtype ULet is Character range 'A' .. 'Z';
1591
1592    begin
1593       if C in Dig then
1594          case Dig (C) is
1595             when '1' =>
1596                Debug_Flag_Underscore_1 := Val;
1597             when '2' =>
1598                Debug_Flag_Underscore_2 := Val;
1599             when '3' =>
1600                Debug_Flag_Underscore_3 := Val;
1601             when '4' =>
1602                Debug_Flag_Underscore_4 := Val;
1603             when '5' =>
1604                Debug_Flag_Underscore_5 := Val;
1605             when '6' =>
1606                Debug_Flag_Underscore_6 := Val;
1607             when '7' =>
1608                Debug_Flag_Underscore_7 := Val;
1609             when '8' =>
1610                Debug_Flag_Underscore_8 := Val;
1611             when '9' =>
1612                Debug_Flag_Underscore_9 := Val;
1613          end case;
1614
1615       elsif C in ULet then
1616          case ULet (C) is
1617             when 'A' =>
1618                Debug_Flag_Underscore_AA := Val;
1619             when 'B' =>
1620                Debug_Flag_Underscore_BB := Val;
1621             when 'C' =>
1622                Debug_Flag_Underscore_CC := Val;
1623             when 'D' =>
1624                Debug_Flag_Underscore_DD := Val;
1625             when 'E' =>
1626                Debug_Flag_Underscore_EE := Val;
1627             when 'F' =>
1628                Debug_Flag_Underscore_FF := Val;
1629             when 'G' =>
1630                Debug_Flag_Underscore_GG := Val;
1631             when 'H' =>
1632                Debug_Flag_Underscore_HH := Val;
1633             when 'I' =>
1634                Debug_Flag_Underscore_II := Val;
1635             when 'J' =>
1636                Debug_Flag_Underscore_JJ := Val;
1637             when 'K' =>
1638                Debug_Flag_Underscore_KK := Val;
1639             when 'L' =>
1640                Debug_Flag_Underscore_LL := Val;
1641             when 'M' =>
1642                Debug_Flag_Underscore_MM := Val;
1643             when 'N' =>
1644                Debug_Flag_Underscore_NN := Val;
1645             when 'O' =>
1646                Debug_Flag_Underscore_OO := Val;
1647             when 'P' =>
1648                Debug_Flag_Underscore_PP := Val;
1649             when 'Q' =>
1650                Debug_Flag_Underscore_QQ := Val;
1651             when 'R' =>
1652                Debug_Flag_Underscore_RR := Val;
1653             when 'S' =>
1654                Debug_Flag_Underscore_SS := Val;
1655             when 'T' =>
1656                Debug_Flag_Underscore_TT := Val;
1657             when 'U' =>
1658                Debug_Flag_Underscore_UU := Val;
1659             when 'V' =>
1660                Debug_Flag_Underscore_VV := Val;
1661             when 'W' =>
1662                Debug_Flag_Underscore_WW := Val;
1663             when 'X' =>
1664                Debug_Flag_Underscore_XX := Val;
1665             when 'Y' =>
1666                Debug_Flag_Underscore_YY := Val;
1667             when 'Z' =>
1668                Debug_Flag_Underscore_ZZ := Val;
1669          end case;
1670
1671       else
1672          case LLet (C) is
1673             when 'a' =>
1674                Debug_Flag_Underscore_A := Val;
1675             when 'b' =>
1676                Debug_Flag_Underscore_B := Val;
1677             when 'c' =>
1678                Debug_Flag_Underscore_C := Val;
1679             when 'd' =>
1680                Debug_Flag_Underscore_D := Val;
1681             when 'e' =>
1682                Debug_Flag_Underscore_E := Val;
1683             when 'f' =>
1684                Debug_Flag_Underscore_F := Val;
1685             when 'g' =>
1686                Debug_Flag_Underscore_G := Val;
1687             when 'h' =>
1688                Debug_Flag_Underscore_H := Val;
1689             when 'i' =>
1690                Debug_Flag_Underscore_I := Val;
1691             when 'j' =>
1692                Debug_Flag_Underscore_J := Val;
1693             when 'k' =>
1694                Debug_Flag_Underscore_K := Val;
1695             when 'l' =>
1696                Debug_Flag_Underscore_L := Val;
1697             when 'm' =>
1698                Debug_Flag_Underscore_M := Val;
1699             when 'n' =>
1700                Debug_Flag_Underscore_N := Val;
1701             when 'o' =>
1702                Debug_Flag_Underscore_O := Val;
1703             when 'p' =>
1704                Debug_Flag_Underscore_P := Val;
1705             when 'q' =>
1706                Debug_Flag_Underscore_Q := Val;
1707             when 'r' =>
1708                Debug_Flag_Underscore_R := Val;
1709             when 's' =>
1710                Debug_Flag_Underscore_S := Val;
1711             when 't' =>
1712                Debug_Flag_Underscore_T := Val;
1713             when 'u' =>
1714                Debug_Flag_Underscore_U := Val;
1715             when 'v' =>
1716                Debug_Flag_Underscore_V := Val;
1717             when 'w' =>
1718                Debug_Flag_Underscore_W := Val;
1719             when 'x' =>
1720                Debug_Flag_Underscore_X := Val;
1721             when 'y' =>
1722                Debug_Flag_Underscore_Y := Val;
1723             when 'z' =>
1724                Debug_Flag_Underscore_Z := Val;
1725          end case;
1726       end if;
1727    end Set_Underscored_Debug_Flag;
1728
1729 end Debug;
This page took 0.091925 seconds and 5 git commands to generate.