2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / ada / debug.adb
blob3a6be98930a1be7adc965895289d64d8e645105a
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- D E B U G --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1992-2008, 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 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 package body Debug is
36 ---------------------------------
37 -- Summary of Debug Flag Usage --
38 ---------------------------------
40 -- Debug flags for compiler (GNAT1)
42 -- da Generate messages tracking semantic analyzer progress
43 -- db Show encoding of type names for debug output
44 -- dc List names of units as they are compiled
45 -- dd Dynamic allocation of tables messages generated
46 -- de List the entity table
47 -- df Full tree/source print (includes withed units)
48 -- dg Print source from tree (generated code only)
49 -- dh Generate listing showing loading of name table hash chains
50 -- di Generate messages for visibility linking/delinking
51 -- dj Suppress "junk null check" for access parameter values
52 -- dk Generate GNATBUG message on abort, even if previous errors
53 -- dl Generate unit load trace messages
54 -- dm Allow VMS features even if not OpenVMS version
55 -- dn Generate messages for node/list allocation
56 -- do Print source from tree (original code only)
57 -- dp Generate messages for parser scope stack push/pops
58 -- dq No auto-alignment of small records
59 -- dr Generate parser resynchronization messages
60 -- ds Print source from tree (including original and generated stuff)
61 -- dt Print full tree
62 -- du Uncheck categorization pragmas
63 -- dv Output trace of overload resolution
64 -- dw Print trace of semantic scope stack
65 -- dx Force expansion on, even if no code being generated
66 -- dy Print tree of package Standard
67 -- dz Print source of package Standard
69 -- dA All entities included in representation information output
70 -- dB Output debug encoding of type names and variants
71 -- dC Output debugging information on check suppression
72 -- dD Delete elaboration checks in inner level routines
73 -- dE Apply elaboration checks to predefined units
74 -- dF Front end data layout enabled
75 -- dG Generate all warnings including those normally suppressed
76 -- dH Hold (kill) call to gigi
77 -- dI Inhibit internal name numbering in gnatG listing
78 -- dJ Output debugging trace info for JGNAT (Java VM version of GNAT)
79 -- dK Kill all error messages
80 -- dL Output trace information on elaboration checking
81 -- dM Asssume all variables are modified (no current values)
82 -- dN No file name information in exception messages
83 -- dO Output immediate error messages
84 -- dP Do not check for controlled objects in preelaborable packages
85 -- dQ
86 -- dR Bypass check for correct version of s-rpc
87 -- dS Never convert numbers to machine numbers in Sem_Eval
88 -- dT Convert to machine numbers only for constant declarations
89 -- dU Enable garbage collection of unreachable entities
90 -- dV Enable viewing of all symbols in debugger
91 -- dW Disable warnings on calls for IN OUT parameters
92 -- dX
93 -- dY Enable configurable run-time mode
94 -- dZ Generate listing showing the contents of the dispatch tables
96 -- d.a
97 -- d.b
98 -- d.c
99 -- d.d
100 -- d.e
101 -- d.f Inhibit folding of static expressions
102 -- d.g Enable conversion of raise into goto
103 -- d.h
104 -- d.i
105 -- d.j
106 -- d.k
107 -- d.l Use Ada 95 semantics for limited function returns
108 -- d.m For -gnatl, print full source only for main unit
109 -- d.n
110 -- d.o
111 -- d.p
112 -- d.q
113 -- d.r Enable OK_To_Reorder_Components in non-variant records
114 -- d.s Disable expansion of slice move, use memmove
115 -- d.t Disable static allocation of library level dispatch tables
116 -- d.u
117 -- d.v Enable OK_To_Reorder_Components in variant records
118 -- d.w Do not check for infinite while loops
119 -- d.x No exception handlers
120 -- d.y
121 -- d.z
123 -- d.A
124 -- d.B
125 -- d.C
126 -- d.D
127 -- d.E
128 -- d.F
129 -- d.G
130 -- d.H
131 -- d.I Inspector mode
132 -- d.J
133 -- d.K
134 -- d.L
135 -- d.M
136 -- d.N
137 -- d.O
138 -- d.P
139 -- d.Q
140 -- d.R
141 -- d.S Force Optimize_Alignment (Space)
142 -- d.T Force Optimize_Alignment (Time)
143 -- d.U
144 -- d.V
145 -- d.W
146 -- d.X
147 -- d.Y
148 -- d.Z
150 -- d1 Error msgs have node numbers where possible
151 -- d2 Eliminate error flags in verbose form error messages
152 -- d3 Dump bad node in Comperr on an abort
153 -- d4 Inhibit automatic krunch of predefined library unit files
154 -- d5 Debug output for tree read/write
155 -- d6 Default access unconstrained to thin pointers
156 -- d7 Do not output version & file time stamp in -gnatv or -gnatl mode
157 -- d8 Force opposite endianness in packed stuff
158 -- d9
160 -- Debug flags for binder (GNATBIND)
162 -- da All links (including internal units) listed if there is a cycle
163 -- db Output information from Better_Choice
164 -- dc List units as they are chosen
165 -- dd
166 -- de Elaboration dependencies including system units
167 -- df
168 -- dg
169 -- dh
170 -- di Ignore_Errors mode for reading ali files
171 -- dj
172 -- dk
173 -- dl
174 -- dm
175 -- dn List details of manipulation of Num_Pred values
176 -- do Use old preference for elaboration order
177 -- dp
178 -- dq
179 -- dr
180 -- ds
181 -- dt
182 -- du List units as they are acquired
183 -- dv
184 -- dw
185 -- dx Force binder to read xref information from ali files
186 -- dy
187 -- dz
189 -- Debug flags used in package Make and its clients (e.g. GNATMAKE)
191 -- da
192 -- db
193 -- dc
194 -- dd
195 -- de
196 -- df
197 -- dg
198 -- dh
199 -- di
200 -- dj
201 -- dk
202 -- dl
203 -- dm
204 -- dn Do not delete temp files created by gnatmake
205 -- do
206 -- dp Prints the contents of the Q used by Make.Compile_Sources
207 -- dq Prints source files as they are enqueued and dequeued
208 -- dr
209 -- ds
210 -- dt Display time stamps when there is a mismatch
211 -- du List units as their ali files are acquired
212 -- dv
213 -- dw Prints the list of units withed by the unit currently explored
214 -- dx
215 -- dy
216 -- dz
218 --------------------------------------------
219 -- Documentation for Compiler Debug Flags --
220 --------------------------------------------
222 -- da Generate messages tracking semantic analyzer progress. A message
223 -- is output showing each node as it gets analyzed, expanded,
224 -- resolved, or evaluated. This option is useful for finding out
225 -- exactly where a bomb during semantic analysis is occurring.
227 -- db In Exp_Dbug, certain type names are encoded to include debugging
228 -- information. This debug switch causes lines to be output showing
229 -- the encodings used.
231 -- dc List names of units as they are compiled. One line of output will
232 -- be generated at the start of compiling each unit (package or
233 -- subprogram).
235 -- dd Dynamic allocation of tables messages generated. Each time a
236 -- table is reallocated, a line is output indicating the expansion.
238 -- de List the entity table
240 -- df Full tree/source print (includes withed units). Normally the tree
241 -- output (dt) or recreated source output (dg,do,ds) includes only
242 -- the main unit. If df is set, then the output in either case
243 -- includes all compiled units (see also dg,do,ds,dt). Note that to
244 -- be effective, this swich must be used in combination with one or
245 -- more of dt, dg, do or ds.
247 -- dg Print the source recreated from the generated tree. In the case
248 -- where the tree has been rewritten this output includes only the
249 -- generated code, not the original code (see also df,do,ds,dz).
250 -- This flag differs from -gnatG in that the output also includes
251 -- non-source generated null statements, and freeze nodes, which
252 -- are normally omitted in -gnatG mode.
254 -- dh Generates a table at the end of a compilation showing how the hash
255 -- table chains built by the Namet package are loaded. This is useful
256 -- in ensuring that the hashing algorithm (in Namet.Hash) is working
257 -- effectively with typical sets of program identifiers.
259 -- di Generate messages for visibility linking/delinking
261 -- dj Suppress "junk null check" for access parameters. This flag permits
262 -- Ada programs to pass null parameters to access parameters, and to
263 -- explicitly check such access values against the null literal.
264 -- Neither of these is valid Ada, but both were allowed in versions of
265 -- GNAT before 3.10, so this switch can ease the transition process.
267 -- dk Immediate kill on abort. Normally on an abort (i.e. a call to
268 -- Comperr.Compiler_Abort), the GNATBUG message is not given if
269 -- there is a previous error. This debug switch bypasses this test
270 -- and gives the message unconditionally (useful for debugging).
272 -- dl Generate unit load trace messages. A line of traceback output is
273 -- generated each time a request is made to the library manager to
274 -- load a new unit.
276 -- dm Some features are permitted only in OpenVMS ports of GNAT (e.g.
277 -- the specification of passing by descriptor). Normally any use
278 -- of these features will be flagged as an error, but this debug
279 -- flag allows acceptance of these features in non OpenVMS ports.
280 -- Of course they may not have any useful effect, and in particular
281 -- attempting to generate code with this flag set may blow up.
282 -- The flag also forces the use of 64-bits for Long_Integer.
284 -- dn Generate messages for node/list allocation. Each time a node or
285 -- list header is allocated, a line of output is generated. Certain
286 -- other basic tree operations also cause a line of output to be
287 -- generated. This option is useful in seeing where the parser is
288 -- blowing up.;
290 -- do Print the source recreated from the generated tree. In the case
291 -- where the tree has been rewritten, this output includes only the
292 -- original code, not the generated code (see also df,dg,ds,dz).
294 -- dp Generate messages for parser scope stack push/pops. A line of
295 -- output by the parser each time the parser scope stack is either
296 -- pushed or popped. Useful in debugging situations where the
297 -- parser scope stack ends up incorrectly synchronized
299 -- dq In layout version 1.38, 2002/01/12, a circuit was implemented
300 -- to give decent default alignment to short records that had no
301 -- specific alignment set. This debug option restores the previous
302 -- behavior of giving such records poor alignments, typically 1.
303 -- This may be useful in dealing with transition.
305 -- dr Generate parser resynchronization messages. Normally the parser
306 -- resynchronizes quietly. With this debug option, two messages
307 -- are generated, one when the parser starts a resynchronization
308 -- skip, and another when it resumes parsing. Useful in debugging
309 -- inadequate error recovery situations.
311 -- ds Print the source recreated from the generated tree. In the case
312 -- where the tree has been rewritten this output includes both the
313 -- generated code and the original code with the generated code
314 -- being enlosed in curly brackets (see also df,do,ds,dz)
316 -- dt Print full tree. The generated tree is output (see also df,dy)
318 -- du Uncheck categorization pragmas. This debug switch causes the
319 -- categorization pragmas (Pure, Preelaborate etc) to be ignored
320 -- so that normal checks are not made (this is particularly useful
321 -- for adding temporary debugging code to units that have pragmas
322 -- that are inconsistent with the debugging code added.
324 -- dv Output trace of overload resolution. Outputs messages for
325 -- overload attempts that involve cascaded errors, or where
326 -- an interepretation is incompatible with the context.
328 -- dw Write semantic scope stack messages. Each time a scope is created
329 -- or removed, a message is output (see the Sem_Ch8.Push_Scope and
330 -- Sem_Ch8.Pop_Scope subprograms).
332 -- dx Force expansion on, even if no code being generated. Normally the
333 -- expander is inhibited if no code is generated. This switch forces
334 -- expansion to proceed normally even if the backend is not being
335 -- called. This is particularly useful for debugging purposes when
336 -- using the front-end only version of the compiler (which normally
337 -- would never do any expansion).
339 -- dy Print tree of package Standard. Normally the tree print out does
340 -- not include package Standard, even if the -df switch is set. This
341 -- switch forces output of the internal tree built for Standard.
343 -- dz Print source of package Standard. Normally the source print out
344 -- does not include package Standard, even if the -df switch is set.
345 -- This switch forces output of the source recreated from the internal
346 -- tree built for Standard. Note that this differs from -gnatS in
347 -- that it prints from the actual tree using the normal Sprint
348 -- circuitry for printing trees.
350 -- dA Forces output of representation information, including full
351 -- information for all internal type and object entities, as well
352 -- as all user defined type and object entities including private
353 -- and incomplete types. This debug switch also automatically sets
354 -- the equivalent of -gnatR3m.
356 -- dB Output debug encodings for types and variants. See Exp_Dbug for
357 -- exact form of the generated output.
359 -- dC Output trace information showing the decisions made during
360 -- check suppression activity in unit Checks.
362 -- dD Delete new elaboration checks. This flag causes GNAT to return
363 -- to the 3.13a elaboration semantics, and to suppress the fixing
364 -- of two bugs. The first is in the context of inner routines in
365 -- dynamic elaboration mode, when the subprogram we are in was
366 -- called at elaboration time by a unit that was also compiled with
367 -- dynamic elaboration checks. In this case, if A calls B calls C,
368 -- and all are in different units, we need an elaboration check at
369 -- each call. These nested checks were only put in recently (see
370 -- version 1.80 of Sem_Elab) and we provide this debug flag to
371 -- revert to the previous behavior in case of regressions. The
372 -- other behavior reverted by this flag is the treatment of the
373 -- Elaborate_Body pragma in static elaboration mode. This used to
374 -- be treated as not needing elaboration checking, but in fact in
375 -- general Elaborate_All is still required because of nested calls.
377 -- dE Apply compile time elaboration checking for with relations between
378 -- predefined units. Normally no checks are made (it seems that at
379 -- least on the SGI, such checks run into trouble).
381 -- dF Front end data layout enabled. Normally front end data layout
382 -- is only enabled if the target parameter Backend_Layout is False.
383 -- This debugging switch enables it unconditionally.
385 -- dG Generate all warnings. Normally Errout suppresses warnings on
386 -- units that are not part of the main extended source, and also
387 -- suppresses warnings on instantiations in the main extended
388 -- source that duplicate warnings already posted on the template.
389 -- This switch stops both kinds of deletion and causes Errout to
390 -- post all warnings sent to it.
392 -- dH Inhibit call to gigi. This is useful for testing front end data
393 -- layout, and may be useful in other debugging situations where
394 -- you do not want gigi to intefere with the testing.
396 -- dI Inhibit internal name numbering in gnatDG listing. Any sequence of
397 -- the form <uppercase-letter><digits><lowercase-letter> appearing in
398 -- a name is replaced by <uppercase-letter>...<lowercase-letter>. This
399 -- is used in the fixed bugs run to minimize system and version
400 -- dependency in filed -gnatD or -gnatG output.
402 -- dJ Generate debugging trace output for the JGNAT back end. This
403 -- consists of symbolic Java Byte Code sequences for all generated
404 -- classes plus additional information to indicate local variables
405 -- and methods.
407 -- dK Kill all error messages. This debug flag suppresses the output
408 -- of all error messages. It is used in regression tests where the
409 -- error messages are target dependent and irrelevant.
411 -- dL Output trace information on elaboration checking. This debug
412 -- switch causes output to be generated showing each call or
413 -- instantiation as it is checked, and the progress of the recursive
414 -- trace through calls at elaboration time.
416 -- dM Assume all variables have been modified, and ignore current value
417 -- indications. This debug flag disconnects the tracking of constant
418 -- values (see Exp_Ch2.Expand_Current_Value).
420 -- dN Do not generate file name information in exception messages
422 -- dO Output immediate error messages. This causes error messages to
423 -- be output as soon as they are generated (disconnecting several
424 -- circuits for improvement of messages, deletion of duplicate
425 -- messages etc). Useful to diagnose compiler bombs caused by
426 -- erroneous handling of error situations
428 -- dP Do not check for controlled objects in preelaborable packages.
429 -- RM 10.2.1(9) forbids the use of library level controlled objects
430 -- in preelaborable packages, but this restriction is a huge pain,
431 -- especially in the predefined library units.
433 -- dQ needs full documentation ???
435 -- dR Bypass the check for a proper version of s-rpc being present
436 -- to use the -gnatz? switch. This allows debugging of the use
437 -- of stubs generation without needing to have GLADE (or some
438 -- other PCS installed).
440 -- dS Omit conversion of fpt numbers to exact machine numbers in
441 -- non-static evaluation contexts (see Check_Non_Static_Context).
442 -- This is intended for testing out timing problems with this
443 -- conversion circuit.
445 -- dT Similar to dS, but omits the conversions only in the case where
446 -- the parent is not a constant declaration.
448 -- dU Enable garbage collection of unreachable entities. This enables
449 -- both the reachability analysis and changing the Is_Public and
450 -- Is_Eliminated flags.
452 -- dV Enable viewing of all symbols in debugger. Causes debug information
453 -- to be generated for all symbols, including internal symbols. This
454 -- is enabled by default for -gnatD, but this switch allows this to
455 -- be enabled without generating modified source files. Note that the
456 -- use of -gnatdV ensures in the dwarf/elf case that all symbols that
457 -- are present in the elf tables are also in the dwarf tables (which
458 -- seems to be required by some tools). Another effect of dV is to
459 -- generate full qualified names, including internal names generated
460 -- for blocks and loops.
462 -- dW Disable warnings when a possibly uninitialized scalar value is
463 -- passed to an IN OUT parameter of a procedure. This usage is a
464 -- quite improper bounded error [erroneous in Ada 83] situation,
465 -- and would normally generate a warning. However, to ease the
466 -- task of transitioning incorrect legacy code, we provide this
467 -- undocumented feature for suppressing these warnings.
469 -- dY Enable configurable run-time mode, just as though the System file
470 -- had Configurable_Run_Time_Mode set to True. This is useful in
471 -- testing high integrity mode.
473 -- dZ Generate listing showing the contents of the dispatch tables. Each
474 -- line has an internally generated number used for references between
475 -- tagged types and primitives. For each primitive the output has the
476 -- following fields:
478 -- - Letter 'P' or letter 's': The former indicates that this
479 -- primitive will be located in a primary dispatch table. The
480 -- latter indicates that it will be located in a secondary
481 -- dispatch table.
483 -- - Name of the primitive. In case of predefined Ada primitives
484 -- the text "(predefined)" is added before the name, and these
485 -- acronyms are used: SR (Stream_Read), SW (Stream_Write), SI
486 -- (Stream_Input), SO (Stream_Output), DA (Deep_Adjust), DF
487 -- (Deep_Finalize). In addition Oeq identifies the equality
488 -- operator, and "_assign" the assignment.
490 -- - If the primitive covers interface types, two extra fields
491 -- referencing other primitives are generated: "Alias" references
492 -- the primitive of the tagged type that covers an interface
493 -- primitive, and "AI_Alias" references the covered interface
494 -- primitive.
496 -- - The expression "at #xx" indicates the slot of the dispatch
497 -- table occupied by such primitive in its corresponding primary
498 -- or secondary dispatch table.
500 -- - In case of abstract subprograms the text "is abstract" is
501 -- added at the end of the line.
503 -- d.f Suppress folding of static expressions. This of course results
504 -- in seriously non-conforming behavior, but is useful sometimes
505 -- when tracking down handling of complex expressions.
507 -- d.g Enables conversion of a raise statement into a goto when the
508 -- relevant handler is statically determinable. For now we only try
509 -- this if this debug flag is set. Later we will enable this more
510 -- generally by default.
512 -- d.l Use Ada 95 semantics for limited function returns. This may be
513 -- used to work around the incompatibility introduced by AI-318-2.
514 -- It is useful only in -gnat05 mode.
516 -- d.m When -gnatl is used, the normal output includes full listings of
517 -- all files in the extended main source (body/spec/subunits). If this
518 -- debug switch is used, then the full listing is given only for the
519 -- main source (this corresponds to a previous behavior of -gnatl and
520 -- is used for running the ACATS tests).
522 -- d.r Forces the flag OK_To_Reorder_Components to be set in all record
523 -- base types that have no discriminants.
525 -- d.s Normally the compiler expands slice moves into loops if overlap
526 -- might be possible. This debug flag inhibits that expansion, and
527 -- the back end is expected to use an appropriate routine to handle
528 -- overlap, based on Forward_OK and Backwards_OK flags.
530 -- d.t The compiler has been modified (a fairly extensive modification)
531 -- to generate static dispatch tables for library level tagged types.
532 -- This debug switch disables this modification and reverts to the
533 -- previous dynamic construction of tables. It is there as a possible
534 -- work around if we run into trouble with the new implementation.
536 -- d.v Forces the flag OK_To_Reorder_Components to be set in all record
537 -- base types that have at least one discriminant (v = variant).
539 -- d.w This flag turns off the scanning of while loops to detect possible
540 -- infinite loops.
542 -- d.x No exception handlers in generated code. This causes exception
543 -- handlers to be eliminated from the generated code. They are still
544 -- fully compiled and analyzed, they just get eliminated from the
545 -- code generation step.
547 -- d.I Inspector mode. Relevant for VM_Target /= None. Try to generate
548 -- byte code, even in case of unsupported construct, for the sake
549 -- of static analysis tools.
551 -- d.S Force Optimize_Alignment (Space) mode as the default
553 -- d.T Force Optimize_Alignment (Time) mode as the default
555 -- d1 Error messages have node numbers where possible. Normally error
556 -- messages have only source locations. This option is useful when
557 -- debugging errors caused by expanded code, where the source location
558 -- does not give enough information.
560 -- d2 Suppress output of the error position flags for verbose form error
561 -- messages. The messages are still interspersed in the listing, but
562 -- without any error flags or extra blank lines. Also causes an extra
563 -- <<< to be output at the right margin. This is intended to be the
564 -- easiest format for checking conformance of ACATS B tests. This
565 -- flag also suppresses the additional messages explaining why a
566 -- non-static expression is non-static (see Sem_Eval.Why_Not_Static).
567 -- This avoids having to worry about these messages in ACATS testing.
569 -- d3 Causes Comperr to dump the contents of the node for which an abort
570 -- was detected (normally only the Node_Id of the node is output).
572 -- d4 Inhibits automatic krunching of predefined library unit file names.
573 -- Normally, as described in the spec of package Krunch, such files
574 -- are automatically krunched to 8 characters, with special treatment
575 -- of the prefixes Ada, System, and Interfaces. Setting this debug
576 -- switch disables this special treatment.
578 -- d5 Causes the tree read/write circuit to output detailed information
579 -- tracking the data that is read and written element by element.
581 -- d6 Normally access-to-unconstrained-array types are represented
582 -- using fat (double) pointers. Using this debug flag causes them
583 -- to default to thin. This can be used to test the performance
584 -- implications of using thin pointers, and also to test that the
585 -- compiler functions correctly with this choice.
587 -- d7 Normally a -gnatl or -gnatv listing includes the time stamp
588 -- of the source file. This debug flag suppresses this output,
589 -- and also suppresses the message with the version number.
590 -- This is useful in certain regression tests.
592 -- d8 This forces the packed stuff to generate code assuming the
593 -- opposite endianness from the actual correct value. Useful in
594 -- testing out code generation from the packed routines.
596 ------------------------------------------
597 -- Documentation for Binder Debug Flags --
598 ------------------------------------------
600 -- da Normally if there is an elaboration circularity, then in describing
601 -- the cycle, links involving internal units are omitted, since they
602 -- are irrelevant and confusing. This debug flag causes all links to
603 -- be listed, and is useful when diagnosing circularities introduced
604 -- by incorrect changes to the run-time library itself.
606 -- dc List units as they are chosen. As units are selected for addition to
607 -- the elaboration order, a line of output is generated showing which
608 -- unit has been selected.
610 -- de Similar to the effect of -e (output complete list of elaboration
611 -- dependencies) except that internal units are included in the
612 -- listing.
614 -- di Normally gnatbind calls Read_Ali with Ignore_Errors set to
615 -- False, since the binder really needs correct version ALI
616 -- files to do its job. This debug flag causes Ignore_Errors
617 -- mode to be set for the binder (and is particularly useful
618 -- for testing ignore errors mode).
620 -- dn List details of manipulation of Num_Pred values during execution of
621 -- the algorithm used to determine a correct order of elaboration. This
622 -- is useful in diagnosing any problems in its behavior.
624 -- do Use old elaboration order preference. The new preference rules
625 -- prefer specs with no bodies to specs with bodies, and between two
626 -- specs with bodies, prefers the one whose body is closer to being
627 -- able to be elaborated. This is a clear improvement, but we provide
628 -- this debug flag in case of regressions.
630 -- du List unit name and file name for each unit as it is read in
632 -- dx Force the binder to read (and then ignore) the xref information
633 -- in ali files (used to check that read circuit is working OK).
635 --------------------------------------------
636 -- Documentation for gnatmake Debug Flags --
637 --------------------------------------------
639 -- df Only output file names, not path names, in log
641 -- dn Do not delete temporary files created by gnatmake at the end
642 -- of execution, such as temporary config pragma files, mapping
643 -- files or project path files.
645 -- dp Prints the Q used by routine Make.Compile_Sources every time
646 -- we go around the main compile loop of Make.Compile_Sources
648 -- dq Prints source files as they are enqueued and dequeued in the Q
649 -- used by routine Make.Compile_Sources. Useful to figure out the
650 -- order in which sources are recompiled.
652 -- dt When a time stamp mismatch has been found for an ALI file,
653 -- display the source file name, the time stamp expected and
654 -- the time stamp found.
656 -- du List unit name and file name for each unit as it is read in
658 -- dw Prints the list of units withed by the unit currently explored
659 -- during the main loop of Make.Compile_Sources.
661 ---------------------------------------------
662 -- Documentation for gprbuild Debug Flags --
663 ---------------------------------------------
665 -- dn Do not delete temporary files createed by gprbuild at the end
666 -- of execution, such as temporary config pragma files, mapping
667 -- files or project path files.
669 -- dt When a time stamp mismatch has been found for an ALI file,
670 -- display the source file name, the time stamp expected and
671 -- the time stamp found.
673 --------------------
674 -- Set_Debug_Flag --
675 --------------------
677 procedure Set_Debug_Flag (C : Character; Val : Boolean := True) is
678 subtype Dig is Character range '1' .. '9';
679 subtype LLet is Character range 'a' .. 'z';
680 subtype ULet is Character range 'A' .. 'Z';
682 begin
683 if C in Dig then
684 case Dig (C) is
685 when '1' => Debug_Flag_1 := Val;
686 when '2' => Debug_Flag_2 := Val;
687 when '3' => Debug_Flag_3 := Val;
688 when '4' => Debug_Flag_4 := Val;
689 when '5' => Debug_Flag_5 := Val;
690 when '6' => Debug_Flag_6 := Val;
691 when '7' => Debug_Flag_7 := Val;
692 when '8' => Debug_Flag_8 := Val;
693 when '9' => Debug_Flag_9 := Val;
694 end case;
696 elsif C in ULet then
697 case ULet (C) is
698 when 'A' => Debug_Flag_AA := Val;
699 when 'B' => Debug_Flag_BB := Val;
700 when 'C' => Debug_Flag_CC := Val;
701 when 'D' => Debug_Flag_DD := Val;
702 when 'E' => Debug_Flag_EE := Val;
703 when 'F' => Debug_Flag_FF := Val;
704 when 'G' => Debug_Flag_GG := Val;
705 when 'H' => Debug_Flag_HH := Val;
706 when 'I' => Debug_Flag_II := Val;
707 when 'J' => Debug_Flag_JJ := Val;
708 when 'K' => Debug_Flag_KK := Val;
709 when 'L' => Debug_Flag_LL := Val;
710 when 'M' => Debug_Flag_MM := Val;
711 when 'N' => Debug_Flag_NN := Val;
712 when 'O' => Debug_Flag_OO := Val;
713 when 'P' => Debug_Flag_PP := Val;
714 when 'Q' => Debug_Flag_QQ := Val;
715 when 'R' => Debug_Flag_RR := Val;
716 when 'S' => Debug_Flag_SS := Val;
717 when 'T' => Debug_Flag_TT := Val;
718 when 'U' => Debug_Flag_UU := Val;
719 when 'V' => Debug_Flag_VV := Val;
720 when 'W' => Debug_Flag_WW := Val;
721 when 'X' => Debug_Flag_XX := Val;
722 when 'Y' => Debug_Flag_YY := Val;
723 when 'Z' => Debug_Flag_ZZ := Val;
724 end case;
726 else
727 case LLet (C) is
728 when 'a' => Debug_Flag_A := Val;
729 when 'b' => Debug_Flag_B := Val;
730 when 'c' => Debug_Flag_C := Val;
731 when 'd' => Debug_Flag_D := Val;
732 when 'e' => Debug_Flag_E := Val;
733 when 'f' => Debug_Flag_F := Val;
734 when 'g' => Debug_Flag_G := Val;
735 when 'h' => Debug_Flag_H := Val;
736 when 'i' => Debug_Flag_I := Val;
737 when 'j' => Debug_Flag_J := Val;
738 when 'k' => Debug_Flag_K := Val;
739 when 'l' => Debug_Flag_L := Val;
740 when 'm' => Debug_Flag_M := Val;
741 when 'n' => Debug_Flag_N := Val;
742 when 'o' => Debug_Flag_O := Val;
743 when 'p' => Debug_Flag_P := Val;
744 when 'q' => Debug_Flag_Q := Val;
745 when 'r' => Debug_Flag_R := Val;
746 when 's' => Debug_Flag_S := Val;
747 when 't' => Debug_Flag_T := Val;
748 when 'u' => Debug_Flag_U := Val;
749 when 'v' => Debug_Flag_V := Val;
750 when 'w' => Debug_Flag_W := Val;
751 when 'x' => Debug_Flag_X := Val;
752 when 'y' => Debug_Flag_Y := Val;
753 when 'z' => Debug_Flag_Z := Val;
754 end case;
755 end if;
756 end Set_Debug_Flag;
758 ---------------------------
759 -- Set_Dotted_Debug_Flag --
760 ---------------------------
762 procedure Set_Dotted_Debug_Flag (C : Character; Val : Boolean := True) is
763 subtype Dig is Character range '1' .. '9';
764 subtype LLet is Character range 'a' .. 'z';
765 subtype ULet is Character range 'A' .. 'Z';
767 begin
768 if C in Dig then
769 case Dig (C) is
770 when '1' => Debug_Flag_Dot_1 := Val;
771 when '2' => Debug_Flag_Dot_2 := Val;
772 when '3' => Debug_Flag_Dot_3 := Val;
773 when '4' => Debug_Flag_Dot_4 := Val;
774 when '5' => Debug_Flag_Dot_5 := Val;
775 when '6' => Debug_Flag_Dot_6 := Val;
776 when '7' => Debug_Flag_Dot_7 := Val;
777 when '8' => Debug_Flag_Dot_8 := Val;
778 when '9' => Debug_Flag_Dot_9 := Val;
779 end case;
781 elsif C in ULet then
782 case ULet (C) is
783 when 'A' => Debug_Flag_Dot_AA := Val;
784 when 'B' => Debug_Flag_Dot_BB := Val;
785 when 'C' => Debug_Flag_Dot_CC := Val;
786 when 'D' => Debug_Flag_Dot_DD := Val;
787 when 'E' => Debug_Flag_Dot_EE := Val;
788 when 'F' => Debug_Flag_Dot_FF := Val;
789 when 'G' => Debug_Flag_Dot_GG := Val;
790 when 'H' => Debug_Flag_Dot_HH := Val;
791 when 'I' => Debug_Flag_Dot_II := Val;
792 when 'J' => Debug_Flag_Dot_JJ := Val;
793 when 'K' => Debug_Flag_Dot_KK := Val;
794 when 'L' => Debug_Flag_Dot_LL := Val;
795 when 'M' => Debug_Flag_Dot_MM := Val;
796 when 'N' => Debug_Flag_Dot_NN := Val;
797 when 'O' => Debug_Flag_Dot_OO := Val;
798 when 'P' => Debug_Flag_Dot_PP := Val;
799 when 'Q' => Debug_Flag_Dot_QQ := Val;
800 when 'R' => Debug_Flag_Dot_RR := Val;
801 when 'S' => Debug_Flag_Dot_SS := Val;
802 when 'T' => Debug_Flag_Dot_TT := Val;
803 when 'U' => Debug_Flag_Dot_UU := Val;
804 when 'V' => Debug_Flag_Dot_VV := Val;
805 when 'W' => Debug_Flag_Dot_WW := Val;
806 when 'X' => Debug_Flag_Dot_XX := Val;
807 when 'Y' => Debug_Flag_Dot_YY := Val;
808 when 'Z' => Debug_Flag_Dot_ZZ := Val;
809 end case;
811 else
812 case LLet (C) is
813 when 'a' => Debug_Flag_Dot_A := Val;
814 when 'b' => Debug_Flag_Dot_B := Val;
815 when 'c' => Debug_Flag_Dot_C := Val;
816 when 'd' => Debug_Flag_Dot_D := Val;
817 when 'e' => Debug_Flag_Dot_E := Val;
818 when 'f' => Debug_Flag_Dot_F := Val;
819 when 'g' => Debug_Flag_Dot_G := Val;
820 when 'h' => Debug_Flag_Dot_H := Val;
821 when 'i' => Debug_Flag_Dot_I := Val;
822 when 'j' => Debug_Flag_Dot_J := Val;
823 when 'k' => Debug_Flag_Dot_K := Val;
824 when 'l' => Debug_Flag_Dot_L := Val;
825 when 'm' => Debug_Flag_Dot_M := Val;
826 when 'n' => Debug_Flag_Dot_N := Val;
827 when 'o' => Debug_Flag_Dot_O := Val;
828 when 'p' => Debug_Flag_Dot_P := Val;
829 when 'q' => Debug_Flag_Dot_Q := Val;
830 when 'r' => Debug_Flag_Dot_R := Val;
831 when 's' => Debug_Flag_Dot_S := Val;
832 when 't' => Debug_Flag_Dot_T := Val;
833 when 'u' => Debug_Flag_Dot_U := Val;
834 when 'v' => Debug_Flag_Dot_V := Val;
835 when 'w' => Debug_Flag_Dot_W := Val;
836 when 'x' => Debug_Flag_Dot_X := Val;
837 when 'y' => Debug_Flag_Dot_Y := Val;
838 when 'z' => Debug_Flag_Dot_Z := Val;
839 end case;
840 end if;
841 end Set_Dotted_Debug_Flag;
843 end Debug;