* config/i386/uwin.h: Remove SUBTARGET_PROLOGUE.
[official-gcc.git] / gcc / ada / exp_dbug.ads
blob951ccc33a3072f2cf4b8541a2e4ead53a78abfb0
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- E X P _ D B U G --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1996-2002 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, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
21 -- --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 -- --
25 ------------------------------------------------------------------------------
27 -- Expand routines for generation of special declarations used by the
28 -- debugger. In accordance with the Dwarf 2.2 specification, certain
29 -- type names are encoded to provide information to the debugger.
31 with Types; use Types;
32 with Uintp; use Uintp;
33 with Get_Targ; use Get_Targ;
35 package Exp_Dbug is
37 -----------------------------------------------------
38 -- Encoding and Qualification of Names of Entities --
39 -----------------------------------------------------
41 -- This section describes how the names of entities are encoded in
42 -- the generated debugging information.
44 -- An entity in Ada has a name of the form X.Y.Z ... E where X,Y,Z
45 -- are the enclosing scopes (not including Standard at the start).
47 -- The encoding of the name follows this basic qualified naming scheme,
48 -- where the encoding of individual entity names is as described in
49 -- Namet (i.e. in particular names present in the original source are
50 -- folded to all lower case, with upper half and wide characters encoded
51 -- as described in Namet). Upper case letters are used only for entities
52 -- generated by the compiler.
54 -- There are two cases, global entities, and local entities. In more
55 -- formal terms, local entities are those which have a dynamic enclosing
56 -- scope, and global entities are at the library level, except that we
57 -- always consider procedures to be global entities, even if they are
58 -- nested (that's because at the debugger level a procedure name refers
59 -- to the code, and the code is indeed a global entity, including the
60 -- case of nested procedures.) In addition, we also consider all types
61 -- to be global entities, even if they are defined within a procedure.
63 -- The reason for treating all type names as global entities is that
64 -- a number of our type encodings work by having related type names,
65 -- and we need the full qualification to keep this unique.
67 -- For global entities, the encoded name includes all components of the
68 -- fully expanded name (but omitting Standard at the start). For example,
69 -- if a library level child package P.Q has an embedded package R, and
70 -- there is an entity in this embdded package whose name is S, the encoded
71 -- name will include the components p.q.r.s.
73 -- For local entities, the encoded name only includes the components
74 -- up to the enclosing dynamic scope (other than a block). At run time,
75 -- such a dynamic scope is a subprogram, and the debugging formats know
76 -- about local variables of procedures, so it is not necessary to have
77 -- full qualification for such entities. In particular this means that
78 -- direct local variables of a procedure are not qualified.
80 -- As an example of the local name convention, consider a procedure V.W
81 -- with a local variable X, and a nested block Y containing an entity
82 -- Z. The fully qualified names of the entities X and Z are:
84 -- V.W.X
85 -- V.W.Y.Z
87 -- but since V.W is a subprogram, the encoded names will end up
88 -- encoding only
90 -- x
91 -- y.z
93 -- The separating dots are translated into double underscores.
95 -----------------------------
96 -- Handling of Overloading --
97 -----------------------------
99 -- The above scheme is incomplete with respect to overloaded
100 -- subprograms, since overloading can legitimately result in a
101 -- case of two entities with exactly the same fully qualified names.
102 -- To distinguish between entries in a set of overloaded subprograms,
103 -- the encoded names are serialized by adding one of the suffixes:
105 -- $n (dollar sign)
106 -- __nn (two underscores)
108 -- where nn is a serial number (2 for the second overloaded function,
109 -- 2 for the third, etc.). We use $ if this symbol is allowed, and
110 -- double underscore if it is not. In the remaining examples in this
111 -- section, we use a $ sign, but the $ is replaced by __ throughout
112 -- these examples if $ sign is not available. A suffix of $1 is
113 -- always omitted (i.e. no suffix implies the first instance).
115 -- These names are prefixed by the normal full qualification. So
116 -- for example, the third instance of the subprogram qrs in package
117 -- yz would have the name:
119 -- yz__qrs$3
121 -- A more subtle case arises with entities declared within overloaded
122 -- subprograms. If we have two overloaded subprograms, and both declare
123 -- an entity xyz, then the fully expanded name of the two xyz's is the
124 -- same. To distinguish these, we add the same __n suffix at the end of
125 -- the inner entity names.
127 -- In more complex cases, we can have multiple levels of overloading,
128 -- and we must make sure to distinguish which final declarative region
129 -- we are talking about. For this purpose, we use a more complex suffix
130 -- which has the form:
132 -- $nn_nn_nn ...
134 -- where the nn values are the homonym numbers as needed for any of
135 -- the qualifying entities, separated by a single underscore. If all
136 -- the nn values are 1, the suffix is omitted, Otherwise the suffix
137 -- is present (including any values of 1). The following example
138 -- shows how this suffixing works.
140 -- package body Yz is
141 -- procedure Qrs is -- Name is yz__qrs
142 -- procedure Tuv is ... end; -- Name is yz__qrs__tuv
143 -- begin ... end Qrs;
145 -- procedure Qrs (X: Int) is -- Name is yz__qrs$2
146 -- procedure Tuv is ... end; -- Name is yz__qrs__tuv$2_1
147 -- procedure Tuv (X: Int) is -- Name is yz__qrs__tuv$2_2
148 -- begin ... end Tuv;
150 -- procedure Tuv (X: Float) is -- Name is yz__qrs__tuv$2_3
151 -- type m is new float; -- Name is yz__qrs__tuv__m$2_3
152 -- begin ... end Tuv;
153 -- begin ... end Qrs;
154 -- end Yz;
156 --------------------
157 -- Operator Names --
158 --------------------
160 -- The above rules applied to operator names would result in names
161 -- with quotation marks, which are not typically allowed by assemblers
162 -- and linkers, and even if allowed would be odd and hard to deal with.
163 -- To avoid this problem, operator names are encoded as follows:
165 -- Oabs abs
166 -- Oand and
167 -- Omod mod
168 -- Onot not
169 -- Oor or
170 -- Orem rem
171 -- Oxor xor
172 -- Oeq =
173 -- One /=
174 -- Olt <
175 -- Ole <=
176 -- Ogt >
177 -- Oge >=
178 -- Oadd +
179 -- Osubtract -
180 -- Oconcat &
181 -- Omultiply *
182 -- Odivide /
183 -- Oexpon **
185 -- These names are prefixed by the normal full qualification, and
186 -- suffixed by the overloading identification. So for example, the
187 -- second operator "=" defined in package Extra.Messages would
188 -- have the name:
190 -- extra__messages__Oeq__2
192 ----------------------------------
193 -- Resolving Other Name Clashes --
194 ----------------------------------
196 -- It might be thought that the above scheme is complete, but in Ada 95,
197 -- full qualification is insufficient to uniquely identify an entity
198 -- in the program, even if it is not an overloaded subprogram. There
199 -- are two possible confusions:
201 -- a.b
203 -- interpretation 1: entity b in body of package a
204 -- interpretation 2: child procedure b of package a
206 -- a.b.c
208 -- interpretation 1: entity c in child package a.b
209 -- interpretation 2: entity c in nested package b in body of a
211 -- It is perfectly legal in both cases for both interpretations to
212 -- be valid within a single program. This is a bit of a surprise since
213 -- certainly in Ada 83, full qualification was sufficient, but not in
214 -- Ada 95. The result is that the above scheme can result in duplicate
215 -- names. This would not be so bad if the effect were just restricted
216 -- to debugging information, but in fact in both the above cases, it
217 -- is possible for both symbols to be external names, and so we have
218 -- a real problem of name clashes.
220 -- To deal with this situation, we provide two additional encoding
221 -- rules for names
223 -- First: all library subprogram names are preceded by the string
224 -- _ada_ (which causes no duplications, since normal Ada names can
225 -- never start with an underscore. This not only solves the first
226 -- case of duplication, but also solves another pragmatic problem
227 -- which is that otherwise Ada procedures can generate names that
228 -- clash with existing system function names. Most notably, we can
229 -- have clashes in the case of procedure Main with the C main that
230 -- in some systems is always present.
232 -- Second, for the case where nested packages declared in package
233 -- bodies can cause trouble, we add a suffix which shows which
234 -- entities in the list are body-nested packages, i.e. packages
235 -- whose spec is within a package body. The rules are as follows,
236 -- given a list of names in a qualified name name1.name2....
238 -- If none are body-nested package entities, then there is no suffix
240 -- If at least one is a body-nested package entity, then the suffix
241 -- is X followed by a string of b's and n's (b = body-nested package
242 -- entity, n = not a body-nested package).
244 -- There is one element in this string for each entity in the encoded
245 -- expanded name except the first (the rules are such that the first
246 -- entity of the encoded expanded name can never be a body-nested'
247 -- package. Trailing n's are omitted, as is the last b (there must
248 -- be at least one b, or we would not be generating a suffix at all).
250 -- For example, suppose we have
252 -- package x is
253 -- pragma Elaborate_Body;
254 -- m1 : integer; -- #1
255 -- end x;
257 -- package body x is
258 -- package y is m2 : integer; end y; -- #2
259 -- package body y is
260 -- package z is r : integer; end z; -- #3
261 -- end;
262 -- m3 : integer; -- #4
263 -- end x;
265 -- package x.y is
266 -- pragma Elaborate_Body;
267 -- m2 : integer; -- #5
268 -- end x.y;
270 -- package body x.y is
271 -- m3 : integer; -- #6
272 -- procedure j is -- #7
273 -- package k is
274 -- z : integer; -- #8
275 -- end k;
276 -- begin
277 -- null;
278 -- end j;
279 -- end x.y;
281 -- procedure x.m3 is begin null; end; -- #9
283 -- Then the encodings would be:
285 -- #1. x__m1 (no BNPE's in sight)
286 -- #2. x__y__m2X (y is a BNPE)
287 -- #3. x__y__z__rXb (y is a BNPE, so is z)
288 -- #4. x__m3 (no BNPE's in sight)
289 -- #5. x__y__m2 (no BNPE's in sight)
290 -- #6. x__y__m3 (no BNPE's in signt)
291 -- #7. x__y__j (no BNPE's in sight)
292 -- #8. k__z (no BNPE's, only up to procedure)
293 -- #9 _ada_x__m3 (library level subprogram)
295 -- Note that we have instances here of both kind of potential name
296 -- clashes, and the above examples show how the encodings avoid the
297 -- clash as follows:
299 -- Lines #4 and #9 both refer to the entity x.m3, but #9 is a library
300 -- level subprogram, so it is preceded by the string _ada_ which acts
301 -- to distinguish it from the package body entity.
303 -- Lines #2 and #5 both refer to the entity x.y.m2, but the first
304 -- instance is inside the body-nested package y, so there is an X
305 -- suffix to distinguish it from the child library entity.
307 -- Note that enumeration literals never need Xb type suffixes, since
308 -- they are never referenced using global external names.
310 ---------------------
311 -- Interface Names --
312 ---------------------
314 -- Note: if an interface name is present, then the external name
315 -- is taken from the specified interface name. Given the current
316 -- limitations of the gcc backend, this means that the debugging
317 -- name is also set to the interface name, but conceptually, it
318 -- would be possible (and indeed desirable) to have the debugging
319 -- information still use the Ada name as qualified above, so we
320 -- still fully qualify the name in the front end.
322 -------------------------------------
323 -- Encodings Related to Task Types --
324 -------------------------------------
326 -- Each task object defined by a single task declaration is associated
327 -- with a prefix that is used to qualify procedures defined in that
328 -- task. Given
330 -- package body P is
331 -- task body TaskObj is
332 -- procedure F1 is ... end;
333 -- begin
334 -- B;
335 -- end TaskObj;
336 -- end P;
338 -- The name of subprogram TaskObj.F1 is encoded as p__taskobjTK__f1,
339 -- The body, B, is contained in a subprogram whose name is
340 -- p__taskobjTKB.
342 ------------------------------------------
343 -- Encodings Related to Protected Types --
344 ------------------------------------------
346 -- Each protected type has an associated record type, that describes
347 -- the actual layout of the private data. In addition to the private
348 -- components of the type, the Corresponding_Record_Type includes one
349 -- component of type Protection, which is the actual lock structure.
350 -- The run-time size of the protected type is the size of the corres-
351 -- ponding record.
353 -- For a protected type prot, the Corresponding_Record_Type is encoded
354 -- as protV.
356 -- The operations of a protected type are encoded as follows: each
357 -- operation results in two subprograms, a locking one that is called
358 -- from outside of the object, and a non-locking one that is used for
359 -- calls from other operations on the same object. The locking operation
360 -- simply acquires the lock, and then calls the non-locking version.
361 -- The names of all of these have a prefix constructed from the name of
362 -- the type, the string "PT", and a suffix which is P or N, depending on
363 -- whether this is the protected/non-locking version of the operation.
365 -- Given the declaration:
367 -- protected type lock is
368 -- function get return integer;
369 -- procedure set (x: integer);
370 -- private
371 -- value : integer := 0;
372 -- end lock;
374 -- the following operations are created:
376 -- lockPT_getN
377 -- lockPT_getP,
378 -- lockPT_setN
379 -- lockPT_setP
381 ----------------------------------------------------
382 -- Conversion between Entities and External Names --
383 ----------------------------------------------------
385 No_Dollar_In_Label : constant Boolean := Get_No_Dollar_In_Label;
386 -- True iff the target allows dollar signs ("$") in external names
388 procedure Get_External_Name
389 (Entity : Entity_Id;
390 Has_Suffix : Boolean);
391 -- Set Name_Buffer and Name_Len to the external name of entity E.
392 -- The external name is the Interface_Name, if specified, unless
393 -- the entity has an address clause or a suffix.
395 -- If the Interface is not present, or not used, the external name
396 -- is the concatenation of:
398 -- - the string "_ada_", if the entity is a library subprogram,
399 -- - the names of any enclosing scopes, each followed by "__",
400 -- or "X_" if the next entity is a subunit)
401 -- - the name of the entity
402 -- - the string "$" (or "__" if target does not allow "$"), followed
403 -- by homonym suffix, if the entity is an overloaded subprogram
404 -- or is defined within an overloaded subprogram.
406 procedure Get_External_Name_With_Suffix
407 (Entity : Entity_Id;
408 Suffix : String);
409 -- Set Name_Buffer and Name_Len to the external name of entity E.
410 -- If Suffix is the empty string the external name is as above,
411 -- otherwise the external name is the concatenation of:
413 -- - the string "_ada_", if the entity is a library subprogram,
414 -- - the names of any enclosing scopes, each followed by "__",
415 -- or "X_" if the next entity is a subunit)
416 -- - the name of the entity
417 -- - the string "$" (or "__" if target does not allow "$"), followed
418 -- by homonym suffix, if the entity is an overloaded subprogram
419 -- or is defined within an overloaded subprogram.
420 -- - the string "___" followed by Suffix
422 ----------------------------
423 -- Debug Name Compression --
424 ----------------------------
426 -- The full qualification of names can lead to long names, and this
427 -- section describes the method used to compress these names. Such
428 -- compression is attempted if one of the following holds:
430 -- The length exceeds a maximum set in hostparm, currently set
431 -- to 128, but can be changed as needed.
433 -- The compiler switch -gnatC is set, setting the Compress_Debug_Names
434 -- switch in Opt to True.
436 -- If either of these conditions holds, name compression is attempted
437 -- by replacing the qualifying section as follows.
439 -- Given a name of the form
441 -- a__b__c__d
443 -- where a,b,c,d are arbitrary strings not containing a sequence
444 -- of exactly two underscores, the name is rewritten as:
446 -- XC????????_d
448 -- where ???????? are 8 hex digits representing a 32-bit checksum
449 -- value that identifies the sequence of compressed names. In
450 -- addition a dummy type declaration is generated as shown by
451 -- the following example. Supposed we have three compression
452 -- sequences
454 -- XC1234abcd corresponding to a__b__c__ prefix
455 -- XCabcd1234 corresponding to a__b__ prefix
456 -- XCab1234cd corresponding to a__ prefix
458 -- then an enumeration type declaration is generated:
460 -- type XC is
461 -- (XC1234abcdXnn, aXnn, bXnn, cXnn,
462 -- XCabcd1234Xnn, aXnn, bXnn,
463 -- XCab1234cdXnn, aXnn);
465 -- showing the meaning of each compressed prefix, so the debugger
466 -- can interpret the exact sequence of names that correspond to the
467 -- compressed sequence. The Xnn suffixes in the above are simply
468 -- serial numbers that are guaranteed to be different to ensure
469 -- that all names are unique, and are otherwise ignored.
471 --------------------------------------------
472 -- Subprograms for Handling Qualification --
473 --------------------------------------------
475 procedure Qualify_Entity_Names (N : Node_Id);
476 -- Given a node N, that represents a block, subprogram body, or package
477 -- body or spec, or protected or task type, sets a fully qualified name
478 -- for the defining entity of given construct, and also sets fully
479 -- qualified names for all enclosed entities of the construct (using
480 -- First_Entity/Next_Entity). Note that the actual modifications of the
481 -- names is postponed till a subsequent call to Qualify_All_Entity_Names.
482 -- Note: this routine does not deal with prepending _ada_ to library
483 -- subprogram names. The reason for this is that we only prepend _ada_
484 -- to the library entity itself, and not to names built from this name.
486 procedure Qualify_All_Entity_Names;
487 -- When Qualify_Entity_Names is called, no actual name changes are made,
488 -- i.e. the actual calls to Qualify_Entity_Name are deferred until a call
489 -- is made to this procedure. The reason for this deferral is that when
490 -- names are changed semantic processing may be affected. By deferring
491 -- the changes till just before gigi is called, we avoid any concerns
492 -- about such effects. Gigi itself does not use the names except for
493 -- output of names for debugging purposes (which is why we are doing
494 -- the name changes in the first place.
496 -- Note: the routines Get_Unqualified_[Decoded]_Name_String in Namet
497 -- are useful to remove qualification from a name qualified by the
498 -- call to Qualify_All_Entity_Names.
500 procedure Generate_Auxiliary_Types;
501 -- The process of qualifying names may result in name compression which
502 -- requires dummy enumeration types to be generated. This subprogram
503 -- ensures that these types are appropriately included in the tree.
505 --------------------------------
506 -- Handling of Numeric Values --
507 --------------------------------
509 -- All numeric values here are encoded as strings of decimal digits.
510 -- Only integer values need to be encoded. A negative value is encoded
511 -- as the corresponding positive value followed by a lower case m for
512 -- minus to indicate that the value is negative (e.g. 2m for -2).
514 -------------------------
515 -- Type Name Encodings --
516 -------------------------
518 -- In the following typ is the name of the type as normally encoded by
519 -- the debugger rules, i.e. a non-qualified name, all in lower case,
520 -- with standard encoding of upper half and wide characters
522 ------------------------
523 -- Encapsulated Types --
524 ------------------------
526 -- In some cases, the compiler encapsulates a type by wrapping it in
527 -- a structure. For example, this is used when a size or alignment
528 -- specification requires a larger type. Consider:
530 -- type y is mod 2 ** 64;
531 -- for y'size use 256;
533 -- In this case the compile generates a structure type y___PAD, which
534 -- has a single field whose name is F. This single field is 64 bits
535 -- long and contains the actual value.
537 -- A similar encapsulation is done for some packed array types,
538 -- in which case the structure type is y___LJM and the field name
539 -- is OBJECT.
541 -- When the debugger sees an object of a type whose name has a
542 -- suffix not otherwise mentioned in this specification, the type
543 -- is a record containing a single field, and the name of that field
544 -- is all upper-case letters, it should look inside to get the value
545 -- of the field, and neither the outer structure name, nor the
546 -- field name should appear when the value is printed.
548 -----------------------
549 -- Fixed-Point Types --
550 -----------------------
552 -- Fixed-point types are encoded using a suffix that indicates the
553 -- delta and small values. The actual type itself is a normal
554 -- integer type.
556 -- typ___XF_nn_dd
557 -- typ___XF_nn_dd_nn_dd
559 -- The first form is used when small = delta. The value of delta (and
560 -- small) is given by the rational nn/dd, where nn and dd are decimal
561 -- integers.
563 -- The second form is used if the small value is different from the
564 -- delta. In this case, the first nn/dd rational value is for delta,
565 -- and the second value is for small.
567 ------------------------------
568 -- VAX Floating-Point Types --
569 ------------------------------
571 -- Vax floating-point types are represented at run time as integer
572 -- types, which are treated specially by the code generator. Their
573 -- type names are encoded with the following suffix:
575 -- typ___XFF
576 -- typ___XFD
577 -- typ___XFG
579 -- representing the Vax F Float, D Float, and G Float types. The
580 -- debugger must treat these specially. In particular, printing
581 -- these values can be achieved using the debug procedures that
582 -- are provided in package System.Vax_Float_Operations:
584 -- procedure Debug_Output_D (Arg : D);
585 -- procedure Debug_Output_F (Arg : F);
586 -- procedure Debug_Output_G (Arg : G);
588 -- These three procedures take a Vax floating-point argument, and
589 -- output a corresponding decimal representation to standard output
590 -- with no terminating line return.
592 --------------------
593 -- Discrete Types --
594 --------------------
596 -- Discrete types are coded with a suffix indicating the range in
597 -- the case where one or both of the bounds are discriminants or
598 -- variable.
600 -- Note: at the current time, we also encode static bounds if they
601 -- do not match the natural machine type bounds, but this may be
602 -- removed in the future, since it is redundant for most debugging
603 -- formats. However, we do not ever need XD encoding for enumeration
604 -- base types, since here it is always clear what the bounds are
605 -- from the number of enumeration literals, and of course we do
606 -- not need to encode the dummy XR types generated for renamings.
608 -- typ___XD
609 -- typ___XDL_lowerbound
610 -- typ___XDU_upperbound
611 -- typ___XDLU_lowerbound__upperbound
613 -- If a discrete type is a natural machine type (i.e. its bounds
614 -- correspond in a natural manner to its size), then it is left
615 -- unencoded. The above encoding forms are used when there is a
616 -- constrained range that does not correspond to the size or that
617 -- has discriminant references or other non-static bounds.
619 -- The first form is used if both bounds are dynamic, in which case
620 -- two constant objects are present whose names are typ___L and
621 -- typ___U in the same scope as typ, and the values of these constants
622 -- indicate the bounds. As far as the debugger is concerned, these
623 -- are simply variables that can be accessed like any other variables.
624 -- In the enumeration case, these values correspond to the Enum_Rep
625 -- values for the lower and upper bounds.
627 -- The second form is used if the upper bound is dynamic, but the
628 -- lower bound is either constant or depends on a discriminant of
629 -- the record with which the type is associated. The upper bound
630 -- is stored in a constant object of name typ___U as previously
631 -- described, but the lower bound is encoded directly into the
632 -- name as either a decimal integer, or as the discriminant name.
634 -- The third form is similarly used if the lower bound is dynamic,
635 -- but the upper bound is static or a discriminant reference, in
636 -- which case the lower bound is stored in a constant object of
637 -- name typ___L, and the upper bound is encoded directly into the
638 -- name as either a decimal integer, or as the discriminant name.
640 -- The fourth form is used if both bounds are discriminant references
641 -- or static values, with the encoding first for the lower bound,
642 -- then for the upper bound, as previously described.
644 -------------------
645 -- Modular Types --
646 -------------------
648 -- A type declared
650 -- type x is mod N;
652 -- Is encoded as a subrange of an unsigned base type with lower bound
653 -- 0 and upper bound N. That is, there is no name encoding. We use
654 -- the standard encodings provided by the debugging format. Thus
655 -- we give these types a non-standard interpretation: the standard
656 -- interpretation of our encoding would not, in general, imply that
657 -- arithmetic on type x was to be performed modulo N (especially not
658 -- when N is not a power of 2).
660 ------------------
661 -- Biased Types --
662 ------------------
664 -- Only discrete types can be biased, and the fact that they are
665 -- biased is indicated by a suffix of the form:
667 -- typ___XB_lowerbound__upperbound
669 -- Here lowerbound and upperbound are decimal integers, with the
670 -- usual (postfix "m") encoding for negative numbers. Biased
671 -- types are only possible where the bounds are static, and the
672 -- values are represented as unsigned offsets from the lower
673 -- bound given. For example:
675 -- type Q is range 10 .. 15;
676 -- for Q'size use 3;
678 -- The size clause will force values of type Q in memory to be
679 -- stored in biased form (e.g. 11 will be represented by the
680 -- bit pattern 001).
682 ----------------------------------------------
683 -- Record Types with Variable-Length Fields --
684 ----------------------------------------------
686 -- The debugging formats do not fully support these types, and indeed
687 -- some formats simply generate no useful information at all for such
688 -- types. In order to provide information for the debugger, gigi creates
689 -- a parallel type in the same scope with one of the names
691 -- type___XVE
692 -- type___XVU
694 -- The former name is used for a record and the latter for the union
695 -- that is made for a variant record (see below) if that union has
696 -- variable size. These encodings suffix any other encodings that
697 -- might be suffixed to the type name.
699 -- The idea here is to provide all the needed information to interpret
700 -- objects of the original type in the form of a "fixed up" type, which
701 -- is representable using the normal debugging information.
703 -- There are three cases to be dealt with. First, some fields may have
704 -- variable positions because they appear after variable-length fields.
705 -- To deal with this, we encode *all* the field bit positions of the
706 -- special ___XV type in a non-standard manner.
708 -- The idea is to encode not the position, but rather information
709 -- that allows computing the position of a field from the position
710 -- of the previous field. The algorithm for computing the actual
711 -- positions of all fields and the length of the record is as
712 -- follows. In this description, let P represent the current
713 -- bit position in the record.
715 -- 1. Initialize P to 0.
717 -- 2. For each field in the record,
719 -- 2a. If an alignment is given (see below), then round P
720 -- up, if needed, to the next multiple of that alignment.
722 -- 2b. If a bit position is given, then increment P by that
723 -- amount (that is, treat it as an offset from the end of the
724 -- preceding record).
726 -- 2c. Assign P as the actual position of the field.
728 -- 2d. Compute the length, L, of the represented field (see below)
729 -- and compute P'=P+L. Unless the field represents a variant part
730 -- (see below and also Variant Record Encoding), set P to P'.
732 -- The alignment, if present, is encoded in the field name of the
733 -- record, which has a suffix:
735 -- fieldname___XVAnn
737 -- where the nn after the XVA indicates the alignment value in storage
738 -- units. This encoding is present only if an alignment is present.
740 -- The size of the record described by an XVE-encoded type (in bits)
741 -- is generally the maximum value attained by P' in step 2d above,
742 -- rounded up according to the record's alignment.
744 -- Second, the variable-length fields themselves are represented by
745 -- replacing the type by a special access type. The designated type
746 -- of this access type is the original variable-length type, and the
747 -- fact that this field has been transformed in this way is signalled
748 -- by encoding the field name as:
750 -- field___XVL
752 -- where field is the original field name. If a field is both
753 -- variable-length and also needs an alignment encoding, then the
754 -- encodings are combined using:
756 -- field___XVLnn
758 -- Note: the reason that we change the type is so that the resulting
759 -- type has no variable-length fields. At least some of the formats
760 -- used for debugging information simply cannot tolerate variable-
761 -- length fields, so the encoded information would get lost.
763 -- Third, in the case of a variant record, the special union
764 -- that contains the variants is replaced by a normal C union.
765 -- In this case, the positions are all zero.
767 -- Discriminants appear before any variable-length fields that depend
768 -- on them, with one exception. In some cases, a discriminant
769 -- governing the choice of a variant clause may appear in the list
770 -- of fields of an XVE type after the entry for the variant clause
771 -- itself (this can happen in the presence of a representation clause
772 -- for the record type in the source program). However, when this
773 -- happens, the discriminant's position may be determined by first
774 -- applying the rules described in this section, ignoring the variant
775 -- clause. As a result, discriminants can always be located
776 -- independently of the variable-length fields that depend on them.
778 -- The size of the ___XVE or ___XVU record or union is set to the
779 -- alignment (in bytes) of the original object so that the debugger
780 -- can calculate the size of the original type.
782 -- As an example of this encoding, consider the declarations:
784 -- type Q is array (1 .. V1) of Float; -- alignment 4
785 -- type R is array (1 .. V2) of Long_Float; -- alignment 8
787 -- type X is record
788 -- A : Character;
789 -- B : Float;
790 -- C : String (1 .. V3);
791 -- D : Float;
792 -- E : Q;
793 -- F : R;
794 -- G : Float;
795 -- end record;
797 -- The encoded type looks like:
799 -- type anonymousQ is access Q;
800 -- type anonymousR is access R;
802 -- type X___XVE is record
803 -- A : Character; -- position contains 0
804 -- B : Float; -- position contains 24
805 -- C___XVL : access String (1 .. V3); -- position contains 0
806 -- D___XVA4 : Float; -- position contains 0
807 -- E___XVL4 : anonymousQ; -- position contains 0
808 -- F___XVL8 : anonymousR; -- position contains 0
809 -- G : Float; -- position contains 0
810 -- end record;
812 -- Any bit sizes recorded for fields other than dynamic fields and
813 -- variants are honored as for ordinary records.
815 -- Notes:
817 -- 1) The B field could also have been encoded by using a position
818 -- of zero, and an alignment of 4, but in such a case, the coding by
819 -- position is preferred (since it takes up less space). We have used
820 -- the (illegal) notation access xxx as field types in the example
821 -- above.
823 -- 2) The E field does not actually need the alignment indication
824 -- but this may not be detected in this case by the conversion
825 -- routines.
827 -- 3) Our conventions do not cover all XVE-encoded records in which
828 -- some, but not all, fields have representation clauses. Such
829 -- records may, therefore, be displayed incorrectly by debuggers.
830 -- This situation is not common.
832 -----------------------
833 -- Base Record Types --
834 -----------------------
836 -- Under certain circumstances, debuggers need two descriptions
837 -- of a record type, one that gives the actual details of the
838 -- base type's structure (as described elsewhere in these
839 -- comments) and one that may be used to obtain information
840 -- about the particular subtype and the size of the objects
841 -- being typed. In such cases the compiler will substitute a
842 -- type whose name is typically compiler-generated and
843 -- irrelevant except as a key for obtaining the actual type.
844 -- Specifically, if this name is x, then we produce a record
845 -- type named x___XVS consisting of one field. The name of
846 -- this field is that of the actual type being encoded, which
847 -- we'll call y (the type of this single field is arbitrary).
848 -- Both x and y may have corresponding ___XVE types.
850 -- The size of the objects typed as x should be obtained from
851 -- the structure of x (and x___XVE, if applicable) as for
852 -- ordinary types unless there is a variable named x___XVZ, which,
853 -- if present, will hold the the size (in bits) of x.
855 -- The type x will either be a subtype of y (see also Subtypes
856 -- of Variant Records, below) or will contain no fields at
857 -- all. The layout, types, and positions of these fields will
858 -- be accurate, if present. (Currently, however, the GDB
859 -- debugger makes no use of x except to determine its size).
861 -- Among other uses, XVS types are sometimes used to encode
862 -- unconstrained types. For example, given
864 -- subtype Int is INTEGER range 0..10;
865 -- type T1 (N: Int := 0) is record
866 -- F1: String (1 .. N);
867 -- end record;
868 -- type AT1 is array (INTEGER range <>) of T1;
870 -- the element type for AT1 might have a type defined as if it had
871 -- been written:
873 -- type at1___C_PAD is record null; end record;
874 -- for at1___C_PAD'Size use 16 * 8;
876 -- and there would also be
878 -- type at1___C_PAD___XVS is record t1: Integer; end record;
879 -- type t1 is ...
881 -- Had the subtype Int been dynamic:
883 -- subtype Int is INTEGER range 0 .. M; -- M a variable
885 -- Then the compiler would also generate a declaration whose effect
886 -- would be
888 -- at1___C_PAD___XVZ: constant Integer := 32 + M * 8 + padding term;
890 -- Not all unconstrained types are so encoded; the XVS
891 -- convention may be unnecessary for unconstrained types of
892 -- fixed size. However, this encoding is always necessary when
893 -- a subcomponent type (array element's type or record field's
894 -- type) is an unconstrained record type some of whose
895 -- components depend on discriminant values.
897 -----------------
898 -- Array Types --
899 -----------------
901 -- Since there is no way for the debugger to obtain the index subtypes
902 -- for an array type, we produce a type that has the name of the
903 -- array type followed by "___XA" and is a record whose field names
904 -- are the names of the types for the bounds. The types of these
905 -- fields is an integer type which is meaningless.
907 -- To conserve space, we do not produce this type unless one of
908 -- the index types is either an enumeration type, has a variable
909 -- upper bound, has a lower bound different from the constant 1,
910 -- is a biased type, or is wider than "sizetype".
912 -- Given the full encoding of these types (see above description for
913 -- the encoding of discrete types), this means that all necessary
914 -- information for addressing arrays is available. In some
915 -- debugging formats, some or all of the bounds information may
916 -- be available redundantly, particularly in the fixed-point case,
917 -- but this information can in any case be ignored by the debugger.
919 ----------------------------
920 -- Note on Implicit Types --
921 ----------------------------
923 -- The compiler creates implicit type names in many situations where
924 -- a type is present semantically, but no specific name is present.
925 -- For example:
927 -- S : Integer range M .. N;
929 -- Here the subtype of S is not integer, but rather an anonymous
930 -- subtype of Integer. Where possible, the compiler generates names
931 -- for such anonymous types that are related to the type from which
932 -- the subtype is obtained as follows:
934 -- T name suffix
936 -- where name is the name from which the subtype is obtained, using
937 -- lower case letters and underscores, and suffix starts with an upper
938 -- case letter. For example, the name for the above declaration of S
939 -- might be:
941 -- TintegerS4b
943 -- If the debugger is asked to give the type of an entity and the type
944 -- has the form T name suffix, it is probably appropriate to just use
945 -- "name" in the response since this is what is meaningful to the
946 -- programmer.
948 -------------------------------------------------
949 -- Subprograms for Handling Encoded Type Names --
950 -------------------------------------------------
952 procedure Get_Encoded_Name (E : Entity_Id);
953 -- If the entity is a typename, store the external name of
954 -- the entity as in Get_External_Name, followed by three underscores
955 -- plus the type encoding in Name_Buffer with the length in Name_Len,
956 -- and an ASCII.NUL character stored following the name.
957 -- Otherwise set Name_Buffer and Name_Len to hold the entity name.
959 --------------
960 -- Renaming --
961 --------------
963 -- Debugging information is generated for exception, object, package,
964 -- and subprogram renaming (generic renamings are not significant, since
965 -- generic templates are not relevant at debugging time).
967 -- Consider a renaming declaration of the form
969 -- x typ renames y;
971 -- There is one case in which no special debugging information is required,
972 -- namely the case of an object renaming where the backend allocates a
973 -- reference for the renamed variable, and the entity x is this reference.
974 -- The debugger can handle this case without any special processing or
975 -- encoding (it won't know it was a renaming, but that does not matter).
977 -- All other cases of renaming generate a dummy type definition for
978 -- an entity whose name is:
980 -- x___XR for an object renaming
981 -- x___XRE for an exception renaming
982 -- x___XRP for a package renaming
984 -- The name is fully qualified in the usual manner, i.e. qualified in
985 -- the same manner as the entity x would be.
987 -- Note: subprogram renamings are not encoded at the present time.
989 -- The type is an enumeration type with a single enumeration literal
990 -- that is an identifier which describes the renamed variable.
992 -- For the simple entity case, where y is an entity name,
993 -- the enumeration is of the form:
995 -- (y___XE)
997 -- i.e. the enumeration type has a single field, whose name
998 -- matches the name y, with the XE suffix. The entity for this
999 -- enumeration literal is fully qualified in the usual manner.
1000 -- All subprogram, exception, and package renamings fall into
1001 -- this category, as well as simple object renamings.
1003 -- For the object renaming case where y is a selected component or an
1004 -- indexed component, the literal name is suffixed by additional fields
1005 -- that give details of the components. The name starts as above with
1006 -- a y___XE entity indicating the outer level variable. Then a series
1007 -- of selections and indexing operations can be specified as follows:
1009 -- Indexed component
1011 -- A series of subscript values appear in sequence, the number
1012 -- corresponds to the number of dimensions of the array. The
1013 -- subscripts have one of the following two forms:
1015 -- XSnnn
1017 -- Here nnn is a constant value, encoded as a decimal
1018 -- integer (pos value for enumeration type case). Negative
1019 -- values have a trailing 'm' as usual.
1021 -- XSe
1023 -- Here e is the (unqualified) name of a constant entity in
1024 -- the same scope as the renaming which contains the subscript
1025 -- value.
1027 -- Slice
1029 -- For the slice case, we have two entries. The first is for
1030 -- the lower bound of the slice, and has the form
1032 -- XLnnn
1033 -- XLe
1035 -- Specifies the lower bound, using exactly the same encoding
1036 -- as for an XS subscript as described above.
1038 -- Then the upper bound appears in the usual XSnnn/XSe form
1040 -- Selected component
1042 -- For a selected component, we have a single entry
1044 -- XRf
1046 -- Here f is the field name for the selection
1048 -- For an explicit deference (.all), we have a single entry
1050 -- XA
1052 -- As an example, consider the declarations:
1054 -- package p is
1055 -- type q is record
1056 -- m : string (2 .. 5);
1057 -- end record;
1059 -- type r is array (1 .. 10, 1 .. 20) of q;
1061 -- g : r;
1063 -- z : string renames g (1,5).m(2 ..3)
1064 -- end p;
1066 -- The generated type definition would appear as
1068 -- type p__z___XR is
1069 -- (p__g___XEXS1XS5XRmXL2XS3);
1070 -- p__q___XE--------------------outer entity is g
1071 -- XS1-----------------first subscript for g
1072 -- XS5--------------second subscript for g
1073 -- XRm-----------select field m
1074 -- XL2--------lower bound of slice
1075 -- XS3-----upper bound of slice
1077 function Debug_Renaming_Declaration (N : Node_Id) return Node_Id;
1078 -- The argument N is a renaming declaration. The result is a type
1079 -- declaration as described in the above paragraphs. If not special
1080 -- debug declaration, than Empty is returned.
1082 ---------------------------
1083 -- Packed Array Encoding --
1084 ---------------------------
1086 -- For every packed array, two types are created, and both appear in
1087 -- the debugging output.
1089 -- The original declared array type is a perfectly normal array type,
1090 -- and its index bounds indicate the original bounds of the array.
1092 -- The corresponding packed array type, which may be a modular type, or
1093 -- may be an array of bytes type (see Exp_Pakd for full details). This
1094 -- is the type that is actually used in the generated code and for
1095 -- debugging information for all objects of the packed type.
1097 -- The name of the corresponding packed array type is:
1099 -- ttt___XPnnn
1101 -- where
1102 -- ttt is the name of the original declared array
1103 -- nnn is the component size in bits (1-31)
1105 -- When the debugger sees that an object is of a type that is encoded
1106 -- in this manner, it can use the original type to determine the bounds,
1107 -- and the component size to determine the packing details.
1109 -- Packed arrays are represented in tightly packed form, with no extra
1110 -- bits between components. This is true even when the component size
1111 -- is not a factor of the storage unit size, so that as a result it is
1112 -- possible for components to cross storage unit boundaries.
1114 -- The layout in storage is identical, regardless of whether the
1115 -- implementation type is a modular type or an array-of-bytes type.
1116 -- See Exp_Pakd for details of how these implementation types are used,
1117 -- but for the purpose of the debugger, only the starting address of
1118 -- the object in memory is significant.
1120 -- The following example should show clearly how the packing works in
1121 -- the little-endian and big-endian cases:
1123 -- type B is range 0 .. 7;
1124 -- for B'Size use 3;
1126 -- type BA is array (0 .. 5) of B;
1127 -- pragma Pack (BA);
1129 -- BV : constant BA := (1,2,3,4,5,6);
1131 -- Little endian case
1133 -- BV'Address + 2 BV'Address + 1 BV'Address + 0
1134 -- +-----------------+-----------------+-----------------+
1135 -- | 0 0 0 0 0 0 1 1 | 0 1 0 1 1 0 0 0 | 1 1 0 1 0 0 0 1 |
1136 -- +-----------------+-----------------+-----------------+
1137 -- <---------> <-----> <---> <---> <-----> <---> <--->
1138 -- unused bits BV(5) BV(4) BV(3) BV(2) BV(1) BV(0)
1140 -- Big endian case
1142 -- BV'Address + 0 BV'Address + 1 BV'Address + 2
1143 -- +-----------------+-----------------+-----------------+
1144 -- | 0 0 1 0 1 0 0 1 | 1 1 0 0 1 0 1 1 | 1 0 0 0 0 0 0 0 |
1145 -- +-----------------+-----------------+-----------------+
1146 -- <---> <---> <-----> <---> <---> <-----> <--------->
1147 -- BV(0) BV(1) BV(2) BV(3) BV(4) BV(5) unused bits
1149 ------------------------------------------------------
1150 -- Subprograms for Handling Packed Array Type Names --
1151 ------------------------------------------------------
1153 function Make_Packed_Array_Type_Name
1154 (Typ : Entity_Id;
1155 Csize : Uint)
1156 return Name_Id;
1157 -- This function is used in Exp_Pakd to create the name that is encoded
1158 -- as described above. The entity Typ provides the name ttt, and the
1159 -- value Csize is the component size that provides the nnn value.
1161 --------------------------------------
1162 -- Pointers to Unconstrained Arrays --
1163 --------------------------------------
1165 -- There are two kinds of pointers to arrays. The debugger can tell
1166 -- which format is in use by the form of the type of the pointer.
1168 -- Fat Pointers
1170 -- Fat pointers are represented as a struct with two fields. This
1171 -- struct has two distinguished field names:
1173 -- P_ARRAY is a pointer to the array type. The name of this
1174 -- type is the unconstrained type followed by "___XUA". This
1175 -- array will have bounds which are the discriminants, and
1176 -- hence are unparsable, but will give the number of
1177 -- subscripts and the component type.
1179 -- P_BOUNDS is a pointer to a struct, the name of whose type is the
1180 -- unconstrained array name followed by "___XUB" and which has
1181 -- fields of the form
1183 -- LBn (n a decimal integer) lower bound of n'th dimension
1184 -- UBn (n a decimal integer) upper bound of n'th dimension
1186 -- The bounds may be any integral type. In the case of an
1187 -- enumeration type, Enum_Rep values are used.
1189 -- The debugging information will sometimes reference an anonymous
1190 -- fat pointer type. Such types are given the name xxx___XUP, where
1191 -- xxx is the name of the designated type. If the debugger is asked
1192 -- to output such a type name, the appropriate form is "access xxx".
1194 -- Thin Pointers
1196 -- Thin pointers are represented as a pointer to the ARRAY field of
1197 -- a structure with two fields. The name of the structure type is
1198 -- that of the unconstrained array followed by "___XUT".
1200 -- The field ARRAY contains the array value. This array field is
1201 -- typically a variable-length array, and consequently the entire
1202 -- record structure will be encoded as previously described,
1203 -- resulting in a type with suffix "___XUT___XVE".
1205 -- The field BOUNDS is a struct containing the bounds as above.
1207 --------------------------------------
1208 -- Tagged Types and Type Extensions --
1209 --------------------------------------
1211 -- A type C derived from a tagged type P has a field named "_parent"
1212 -- of type P that contains its inherited fields. The type of this
1213 -- field is usually P (encoded as usual if it has a dynamic size),
1214 -- but may be a more distant ancestor, if P is a null extension of
1215 -- that type.
1217 -- The type tag of a tagged type is a field named _tag, of type void*.
1218 -- If the type is derived from another tagged type, its _tag field is
1219 -- found in its _parent field.
1221 -----------------------------
1222 -- Variant Record Encoding --
1223 -----------------------------
1225 -- The variant part of a variant record is encoded as a single field
1226 -- in the enclosing record, whose name is:
1228 -- discrim___XVN
1230 -- where discrim is the unqualified name of the variant. This field name
1231 -- is built by gigi (not by code in this unit). In the case of an
1232 -- Unchecked_Union record, this discriminant will not appear in the
1233 -- record, and the debugger must proceed accordingly (basically it
1234 -- can treat this case as it would a C union).
1236 -- The type corresponding to this field has a name that is obtained
1237 -- by concatenating the type name with the above string and is similar
1238 -- to a C union, in which each member of the union corresponds to one
1239 -- variant. However, unlike a C union, the size of the type may be
1240 -- variable even if each of the components are fixed size, since it
1241 -- includes a computation of which variant is present. In that case,
1242 -- it will be encoded as above and a type with the suffix "___XVN___XVU"
1243 -- will be present.
1245 -- The name of the union member is encoded to indicate the choices, and
1246 -- is a string given by the following grammar:
1248 -- union_name ::= {choice} | others_choice
1249 -- choice ::= simple_choice | range_choice
1250 -- simple_choice ::= S number
1251 -- range_choice ::= R number T number
1252 -- number ::= {decimal_digit} [m]
1253 -- others_choice ::= O (upper case letter O)
1255 -- The m in a number indicates a negative value. As an example of this
1256 -- encoding scheme, the choice 1 .. 4 | 7 | -10 would be represented by
1258 -- R1T4S7S10m
1260 -- In the case of enumeration values, the values used are the
1261 -- actual representation values in the case where an enumeration type
1262 -- has an enumeration representation spec (i.e. they are values that
1263 -- correspond to the use of the Enum_Rep attribute).
1265 -- The type of the inner record is given by the name of the union
1266 -- type (as above) concatenated with the above string. Since that
1267 -- type may itself be variable-sized, it may also be encoded as above
1268 -- with a new type with a further suffix of "___XVU".
1270 -- As an example, consider:
1272 -- type Var (Disc : Boolean := True) is record
1273 -- M : Integer;
1275 -- case Disc is
1276 -- when True =>
1277 -- R : Integer;
1278 -- S : Integer;
1280 -- when False =>
1281 -- T : Integer;
1282 -- end case;
1283 -- end record;
1285 -- V1 : Var;
1287 -- In this case, the type var is represented as a struct with three
1288 -- fields, the first two are "disc" and "m", representing the values
1289 -- of these record components.
1291 -- The third field is a union of two types, with field names S1 and O.
1292 -- S1 is a struct with fields "r" and "s", and O is a struct with
1293 -- fields "t".
1295 ------------------------------------------------
1296 -- Subprograms for Handling Variant Encodings --
1297 ------------------------------------------------
1299 procedure Get_Variant_Encoding (V : Node_Id);
1300 -- This procedure is called by Gigi with V being the variant node.
1301 -- The corresponding encoding string is returned in Name_Buffer with
1302 -- the length of the string in Name_Len, and an ASCII.NUL character
1303 -- stored following the name.
1305 ---------------------------------
1306 -- Subtypes of Variant Records --
1307 ---------------------------------
1309 -- A subtype of a variant record is represented by a type in which the
1310 -- union field from the base type is replaced by one of the possible
1311 -- values. For example, if we have:
1313 -- type Var (Disc : Boolean := True) is record
1314 -- M : Integer;
1316 -- case Disc is
1317 -- when True =>
1318 -- R : Integer;
1319 -- S : Integer;
1321 -- when False =>
1322 -- T : Integer;
1323 -- end case;
1325 -- end record;
1326 -- V1 : Var;
1327 -- V2 : Var (True);
1328 -- V3 : Var (False);
1330 -- Here V2 for example is represented with a subtype whose name is
1331 -- something like TvarS3b, which is a struct with three fields. The
1332 -- first two fields are "disc" and "m" as for the base type, and
1333 -- the third field is S1, which contains the fields "r" and "s".
1335 -- The debugger should simply ignore structs with names of the form
1336 -- corresponding to variants, and consider the fields inside as
1337 -- belonging to the containing record.
1339 -------------------------------------------
1340 -- Character literals in Character Types --
1341 -------------------------------------------
1343 -- Character types are enumeration types at least one of whose
1344 -- enumeration literals is a character literal. Enumeration literals
1345 -- are usually simply represented using their identifier names. In
1346 -- the case where an enumeration literal is a character literal, the
1347 -- name aencoded as described in the following paragraph.
1349 -- A name QUhh, where each 'h' is a lower-case hexadecimal digit,
1350 -- stands for a character whose Unicode encoding is hh, and
1351 -- QWhhhh likewise stands for a wide character whose encoding
1352 -- is hhhh. The representation values are encoded as for ordinary
1353 -- enumeration literals (and have no necessary relationship to the
1354 -- values encoded in the names).
1356 -- For example, given the type declaration
1358 -- type x is (A, 'C', B);
1360 -- the second enumeration literal would be named QU43 and the
1361 -- value assigned to it would be 1.
1363 end Exp_Dbug;