2 \label{chap:typeentries}
3 This section presents the debugging information entries
4 that describe program types: base types, modified types and
5 user\dash defined types.
7 If the scope of the declaration of a named type begins after
8 \hypertarget{chap:DWATstartscopetypedeclaration}{}
9 the low pc value for the scope most closely enclosing the
10 declaration, the declaration may have a
12 attribute as described for objects in
13 Section \refersec{chap:dataobjectentries}.
15 \section{Base Type Entries}
16 \label{chap:basetypeentries}
18 \textit{A base type is a data type that is not defined in terms of
20 \addtoindexx{fundamental type|see{base type entry}}
21 Each programming language has a set of base
22 types that are considered to be built into that language.}
24 A base type is represented by a debugging information entry
28 A \addtoindex{base type entry}
29 has a \DWATname{} attribute
31 \addtoindexx{name attribute}
33 a null\dash terminated string containing the name of the base type
34 as recognized by the programming language of the compilation
35 unit containing the base type entry.
38 \addtoindexx{encoding attribute}
39 a \DWATencoding{} attribute describing
40 how the base type is encoded and is to be interpreted. The
41 value of this attribute is an
42 \livelink{chap:classconstant}{integer constant}. The set of
43 values and their meanings for the
44 \DWATencoding{} attribute
46 Table \refersec{tab:encodingattributevalues}
50 may have a \DWATendianity{} attribute
51 \addtoindexx{endianity attribute}
53 Section \refersec{chap:dataobjectentries}.
54 If omitted, the encoding assumes the representation that
55 is the default for the target architecture.
58 \hypertarget{chap:DWATbytesizedataobjectordatatypesize}{}
59 either a \DWATbytesize{} attribute
60 \hypertarget{chap:DWATbitsizebasetypebitsize}{}
61 or a \DWATbitsize{} attribute
62 \addtoindexx{bit size attribute}
63 whose \livelink{chap:classconstant}{integer constant} value
64 (see Section \refersec{chap:byteandbitsizes})
65 is the amount of storage needed to hold
69 \textit{For example, the
70 \addtoindex{C} type \texttt{int} on a machine that uses 32\dash bit
71 integers is represented by a base type entry with a name
72 attribute whose value is \doublequote{int}, an encoding attribute
73 whose value is \DWATEsigned{}
74 and a byte size attribute whose value is 4.}
76 If the value of an object of the given type does not fully
77 occupy the storage described by a byte size attribute,
78 \hypertarget{chap:DWATdatabitoffsetbasetypebitlocation}{}
79 the base type entry may also have
80 \addtoindexx{bit size attribute}
83 \DWATdatabitoffset{} attribute,
85 \addtoindexx{data bit offset attribute}
87 \livelink{chap:classconstant}{integer constant} values
88 (see Section \refersec{chap:staticanddynamicvaluesofattributes}).
90 attribute describes the actual size in bits used to represent
91 values of the given type. The data bit offset attribute is the
92 offset in bits from the beginning of the containing storage to
93 the beginning of the value. Bits that are part of the offset
94 are padding. The data bit offset uses the bit numbering and
95 direction conventions that are appropriate to the current
97 target system to locate the beginning of the storage and
98 value. If this attribute is omitted a default data bit offset
104 \addtoindexx{bit offset attribute}
106 \addtoindexx{data bit offset attribute}
108 \addtoindex{DWARF Version 4}, unchanged in \addtoindex{DWARF Version 5}, and
109 is also used for bit field members
110 (see Section \refersec{chap:datamemberentries}).
112 \hypertarget{chap:DWATbitoffsetbasetypebitlocation}{}
113 replaces the attribute
116 \addtoindexx{bit offset attribute (V3)}
117 types as defined in DWARF V3 and earlier.
119 is deprecated for use in base types in DWARF Version 4 and later.
120 See Section 5.1 in the DWARF Version 4
121 specification for a discussion of compatibility considerations.}
124 \caption{Encoding attribute values}
125 \label{tab:encodingattributevalues}
127 \begin{tabular}{l|p{8cm}}
129 Name&Meaning\\ \hline
130 \DWATEaddressTARG{} & linear machine address (for segmented\break
132 Section \refersec{chap:segmentedaddresses}) \\
133 \DWATEbooleanTARG& true or false \\
135 \DWATEcomplexfloatTARG& complex binary
136 floating\dash point number \\
137 \DWATEfloatTARG{} & binary floating\dash point number \\
138 \DWATEimaginaryfloatTARG& imaginary binary
139 floating\dash point number \\
140 \DWATEsignedTARG& signed binary integer \\
141 \DWATEsignedcharTARG& signed character \\
142 \DWATEunsignedTARG{} & unsigned binary integer \\
143 \DWATEunsignedcharTARG{} & unsigned character \\
144 \DWATEpackeddecimalTARG{} & packed decimal \\
145 \DWATEnumericstringTARG& numeric string \\
146 \DWATEeditedTARG{} & edited string \\
147 \DWATEsignedfixedTARG{} & signed fixed\dash point scaled integer \\
148 \DWATEunsignedfixedTARG& unsigned fixed\dash point scaled integer \\
149 \DWATEdecimalfloatTARG{} & decimal floating\dash point number \\
150 \DWATEUTFTARG{} & \addtoindex{Unicode} character \\
155 \textit{The \DWATEdecimalfloat{} encoding is intended for
156 floating\dash point representations that have a power\dash of\dash ten
157 exponent, such as that specified in IEEE 754R.}
159 \textit{The \DWATEUTF{} encoding is intended for \addtoindex{Unicode}
160 string encodings (see the Universal Character Set standard,
161 ISO/IEC 10646\dash 1:1993). For example, the
162 \addtoindex{C++} type char16\_t is
163 represented by a base type entry with a name attribute whose
164 value is \doublequote{char16\_t}, an encoding attribute whose value
165 is \DWATEUTF{} and a byte size attribute whose value is 2.}
168 \DWATEpackeddecimal{}
170 \DWATEnumericstring{}
172 represent packed and unpacked decimal string numeric data
173 types, respectively, either of which may be
175 \addtoindexx{decimal scale attribute}
177 \addtoindexx{decimal sign attribute}
179 \addtoindexx{digit count attribute}
181 \hypertarget{chap:DWATdecimalsigndecimalsignrepresentation}{}
183 \hypertarget{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}{}
184 base types are used in combination with
186 \DWATdigitcount{} and
191 A \DWATdecimalsign{} attribute
192 \addtoindexx{decimal sign attribute}
193 is an \livelink{chap:classconstant}{integer constant} that
194 conveys the representation of the sign of the decimal type
195 (see Table \refersec{tab:decimalsignattributevalues}).
196 Its \livelink{chap:classconstant}{integer constant} value is interpreted to
197 mean that the type has a leading overpunch, trailing overpunch,
198 leading separate or trailing separate sign representation or,
199 alternatively, no sign at all.
202 \caption{Decimal sign attribute values}
203 \label{tab:decimalsignattributevalues}
205 \begin{tabular}{l|p{9cm}}
209 \DWDSunsignedTARG{} & Unsigned \\
210 \DWDSleadingoverpunchTARG{} & Sign
211 is encoded in the most significant digit in a target\dash dependent manner \\
212 \DWDStrailingoverpunchTARG{} & Sign
213 is encoded in the least significant digit in a target\dash dependent manner \\
214 \DWDSleadingseparateTARG{}
215 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
216 to the left of the most significant digit. \\
217 \DWDStrailingseparateTARG{}
218 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
219 to the right of the least significant digit. \\
220 &Packed decimal type: Least significant nibble contains
221 a target\dash dependent value
222 indicating positive or negative. \\
230 \addtoindexx{digit count attribute}
231 is an \livelink{chap:classconstant}{integer constant}
232 value that represents the number of digits in an instance of
235 \hypertarget{chap:DWATdecimalscaledecimalscalefactor}{}
236 The \DWATdecimalscale{}
238 \addtoindexx{decimal scale attribute}
239 is an integer constant value
240 that represents the exponent of the base ten scale factor to
241 be applied to an instance of the type. A scale of zero puts the
242 decimal point immediately to the right of the least significant
243 digit. Positive scale moves the decimal point to the right
244 and implies that additional zero digits on the right are not
245 stored in an instance of the type. Negative scale moves the
246 decimal point to the left; if the absolute value of the scale
247 is larger than the digit count, this implies additional zero
248 digits on the left are not stored in an instance of the type.
252 \hypertarget{chap:DWATpicturestringpicturestringfornumericstringtype}{}
253 type is used to represent an edited
254 numeric or alphanumeric data type. It is used in combination
255 with a \DWATpicturestring{} attribute whose value is a
256 null\dash terminated string containing the target\dash dependent picture
257 string associated with the type.
259 If the edited base type entry describes an edited numeric
260 data type, the edited type entry has a \DWATdigitcount{} and a
261 \DWATdecimalscale{} attribute.
262 \addtoindexx{decimal scale attribute}
263 These attributes have the same
264 interpretation as described for the
265 \DWATEpackeddecimal{} and
266 \DWATEnumericstring{} base
267 types. If the edited type entry
268 describes an edited alphanumeric data type, the edited type
269 entry does not have these attributes.
272 \textit{The presence or absence of the \DWATdigitcount{} and
273 \DWATdecimalscale{} attributes
274 \addtoindexx{decimal scale attribute}
275 allows a debugger to easily
276 distinguish edited numeric from edited alphanumeric, although
277 in principle the digit count and scale are derivable by
278 interpreting the picture string.}
280 The \DWATEsignedfixed{} and \DWATEunsignedfixed{} entries
281 describe signed and unsigned fixed\dash point binary data types,
284 The fixed binary type entries have
285 \addtoindexx{digit count attribute}
288 attribute with the same interpretation as described for the
289 \DWATEpackeddecimal{} and \DWATEnumericstring{} base types.
292 For a data type with a decimal scale factor, the fixed binary
294 \DWATdecimalscale{} attribute
295 \addtoindexx{decimal scale attribute}
297 interpretation as described for the
298 \DWATEpackeddecimal{}
299 and \DWATEnumericstring{} base types.
301 \hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}{}
302 For a data type with a binary scale factor, the fixed
303 \addtoindexx{binary scale attribute}
304 binary type entry has a
305 \DWATbinaryscale{} attribute.
307 \DWATbinaryscale{} attribute
308 is an \livelink{chap:classconstant}{integer constant} value
309 that represents the exponent of the base two scale factor to
310 be applied to an instance of the type. Zero scale puts the
311 binary point immediately to the right of the least significant
312 bit. Positive scale moves the binary point to the right and
313 implies that additional zero bits on the right are not stored
314 in an instance of the type. Negative scale moves the binary
315 point to the left; if the absolute value of the scale is
316 larger than the number of bits, this implies additional zero
317 bits on the left are not stored in an instance of the type.
320 \hypertarget{chap:DWATsmallscalefactorforfixedpointtype}{}
321 a data type with a non\dash decimal and non\dash binary scale factor,
322 the fixed binary type entry has a
323 \DWATsmall{} attribute which
324 \addtoindexx{small attribute}
326 \DWTAGconstant{} entry. The scale factor value
327 is interpreted in accordance with the value defined by the
328 \DWTAGconstant{} entry. The value represented is the product
329 of the integer value in memory and the associated constant
332 \textit{The \DWATsmall{} attribute
333 is defined with the \addtoindex{Ada} \texttt{small}
336 \section{Unspecified Type Entries}
337 \label{chap:unspecifiedtypeentries}
338 \addtoindexx{unspecified type entry}
339 \addtoindexx{void type|see{unspecified type entry}}
340 Some languages have constructs in which a type
341 may be left unspecified or the absence of a type
342 may be explicitly indicated.
344 An unspecified (implicit, unknown, ambiguous or nonexistent)
345 type is represented by a debugging information entry with
346 the tag \DWTAGunspecifiedtypeTARG.
347 If a name has been given
348 to the type, then the corresponding unspecified type entry
349 has a \DWATname{} attribute
350 \addtoindexx{name attribute}
352 a null\dash terminated
353 string containing the name as it appears in the source program.
355 The interpretation of this debugging information entry is
356 intentionally left flexible to allow it to be interpreted
357 appropriately in different languages. For example, in
358 \addtoindex{C} and \addtoindex{C++}
359 the language implementation can provide an unspecified type
360 entry with the name \doublequote{void} which can be referenced by the
361 type attribute of pointer types and typedef declarations for
363 Sections \refersec{chap:typemodifierentries} and
364 %The following reference was valid, so the following is probably correct.
365 Section \refersec{chap:typedefentries},
366 respectively). As another
367 example, in \addtoindex{Ada} such an unspecified type entry can be referred
368 to by the type attribute of an access type where the denoted
369 \addtoindexx{incomplete type (Ada)}
370 type is incomplete (the name is declared as a type but the
371 definition is deferred to a separate compilation unit).
373 \section{Type Modifier Entries}
374 \label{chap:typemodifierentries}
375 \addtoindexx{type modifier entry}
377 A base or user\dash defined type may be modified in different ways
378 in different languages. A type modifier is represented in
379 DWARF by a debugging information entry with one of the tags
380 given in Table \refersec{tab:typemodifiertags}.
381 \addtoindexx{type modifier|see{constant type entry}}
382 \addtoindexx{type modifier|see{reference type entry}}
383 \addtoindexx{type modifier|see{restricted type entry}}
384 \addtoindexx{type modifier|see{packed type entry}}
385 \addtoindexx{type modifier|see{pointer type entry}}
386 \addtoindexx{type modifier|see{shared type entry}}
387 \addtoindexx{type modifier|see{volatile type entry}}
389 If a name has been given to the modified type in the source
390 program, then the corresponding modified type entry has
391 a \DWATname{} attribute
392 \addtoindexx{name attribute}
393 whose value is a null\dash terminated
394 string containing the modified type name as it appears in
397 Each of the type modifier entries has
398 \addtoindexx{type attribute}
400 \DWATtype{} attribute,
401 whose value is a \livelink{chap:classreference}{reference}
402 to a debugging information entry
403 describing a base type, a user-defined type or another type
406 A modified type entry describing a
407 \addtoindexx{pointer type entry}
408 pointer or \addtoindex{reference type}
409 (using \DWTAGpointertype,
410 \DWTAGreferencetype{} or
411 \DWTAGrvaluereferencetype)
412 % Another instance of no-good-place-to-put-index entry.
414 \addtoindexx{address class!attribute}
416 \hypertarget{chap:DWATadressclasspointerorreferencetypes}{}
419 attribute to describe how objects having the given pointer
420 or reference type ought to be dereferenced.
422 A modified type entry describing a \addtoindex{UPC} shared qualified type
423 (using \DWTAGsharedtype) may have a
424 \DWATcount{} attribute
425 \addtoindexx{count attribute}
426 whose value is a constant expressing the (explicit or implied) blocksize specified for the
427 type in the source. If no count attribute is present, then the \doublequote{infinite}
428 blocksize is assumed.
430 When multiple type modifiers are chained together to modify
431 a base or user-defined type, the tree ordering reflects the
433 \addtoindexx{reference type entry, lvalue|see{reference type entry}}
435 \addtoindexx{reference type entry, rvalue|see{rvalue reference type entry}}
437 \addtoindexx{parameter|see{macro formal parameter list}}
439 \addtoindexx{parameter|see{\textit{this} parameter}}
441 \addtoindexx{parameter|see{variable parameter attribute}}
443 \addtoindexx{parameter|see{optional parameter attribute}}
445 \addtoindexx{parameter|see{unspecified parameters entry}}
447 \addtoindexx{parameter|see{template value parameter entry}}
449 \addtoindexx{parameter|see{template type parameter entry}}
451 \addtoindexx{parameter|see{formal parameter entry}}
455 \caption{Type modifier tags}
456 \label{tab:typemodifiertags}
458 \begin{tabular}{l|p{9cm}}
460 Name&Meaning\\ \hline
461 \DWTAGconsttypeTARG{} & C or C++ const qualified type
462 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
463 \DWTAGpackedtypeTARG& \addtoindex{Pascal} or Ada packed type\addtoindexx{packed type entry}
464 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
465 \DWTAGpointertypeTARG{} & Pointer to an object of
466 the type being modified \addtoindexx{pointer qualified type entry} \\
467 \DWTAGreferencetypeTARG& C++ (lvalue) reference
468 to an object of the type
469 \addtoindexx{reference type entry}
471 \addtoindexx{reference qualified type entry} \\
472 \DWTAGrestricttypeTARG& \addtoindex{C}
474 \addtoindexx{restricted type entry}
476 \addtoindexx{restrict qualified type} \\
477 \DWTAGrvaluereferencetypeTARG{} & C++
478 \addtoindexx{rvalue reference type entry}
480 \addtoindexx{restricted type entry}
481 reference to an object of the type being modified
482 \addtoindexx{rvalue reference qualified type entry} \\
483 \DWTAGsharedtypeTARG&\addtoindex{UPC} shared qualified type
484 \addtoindexx{shared qualified type entry} \\
485 \DWTAGvolatiletypeTARG&C or C++ volatile qualified type
486 \addtoindexx{volatile qualified type entry} \\
491 %The following clearpage prevents splitting the example across pages.
492 \textit{As examples of how type modifiers are ordered, consider the following
493 \addtoindex{C} declarations:}
494 \begin{lstlisting}[numbers=none]
495 const unsigned char * volatile p;
497 \textit{which represents a volatile pointer to a constant
498 character. This is encoded in DWARF as:}
502 \DWTAGvariable(p) -->
503 \DWTAGvolatiletype -->
504 \DWTAGpointertype -->
506 \DWTAGbasetype(unsigned char)
511 \textit{On the other hand}
512 \begin{lstlisting}[numbers=none]
513 volatile unsigned char * const restrict p;
515 \textit{represents a restricted constant
516 pointer to a volatile character. This is encoded as:}
520 \DWTAGvariable(p) -->
521 \DWTAGrestricttype -->
523 \DWTAGpointertype -->
524 \DWTAGvolatiletype -->
525 \DWTAGbasetype(unsigned char)
529 \section{Typedef Entries}
530 \label{chap:typedefentries}
531 A named type that is defined in terms of another type
532 definition is represented by a debugging information entry with
533 \addtoindexx{typedef entry}
534 the tag \DWTAGtypedefTARG.
535 The typedef entry has a \DWATname{} attribute
536 \addtoindexx{name attribute}
537 whose value is a null\dash terminated string containing
538 the name of the typedef as it appears in the source program.
540 The typedef entry may also contain
541 \addtoindexx{type attribute}
543 \DWATtype{} attribute whose
544 value is a \livelink{chap:classreference}{reference}
545 to the type named by the typedef. If
546 the debugging information entry for a typedef represents
547 a declaration of the type that is not also a definition,
548 it does not contain a type attribute.
550 \textit{Depending on the language, a named type that is defined in
551 terms of another type may be called a type alias, a subtype,
552 a constrained type and other terms. A type name declared with
553 no defining details may be termed an
554 \addtoindexx{incomplete type}
555 incomplete, forward or hidden type.
556 While the DWARF \DWTAGtypedef{} entry was
557 originally inspired by the like named construct in
558 \addtoindex{C} and \addtoindex{C++},
559 it is broadly suitable for similar constructs (by whatever
560 source syntax) in other languages.}
562 \section{Array Type Entries}
563 \label{chap:arraytypeentries}
564 \label{chap:DWTAGgenericsubrange}
566 \textit{Many languages share the concept of an \doublequote{array,} which is
567 \addtoindexx{array type entry}
568 a table of components of identical type.}
570 An array type is represented by a debugging information entry
571 with the tag \DWTAGarraytypeTARG.
572 If a name has been given to
573 \addtoindexx{array!declaration of type}
574 the array type in the source program, then the corresponding
575 array type entry has a \DWATname{} attribute
576 \addtoindexx{name attribute}
578 null\dash terminated string containing the array type name as it
579 appears in the source program.
582 \hypertarget{chap:DWATorderingarrayrowcolumnordering}{}
583 array type entry describing a multidimensional array may
584 \addtoindexx{array!element ordering}
585 have a \DWATordering{} attribute whose
586 \livelink{chap:classconstant}{integer constant} value is
587 interpreted to mean either row-major or column-major ordering
588 of array elements. The set of values and their meanings
589 for the ordering attribute are listed in
590 Table \refersec{tab:arrayordering}.
592 ordering attribute is present, the default ordering for the
593 source language (which is indicated by the
596 \addtoindexx{language attribute}
597 of the enclosing compilation unit entry) is assumed.
599 \begin{simplenametable}[1.8in]{Array ordering}{tab:arrayordering}
600 \DWORDcolmajorTARG{} \\
601 \DWORDrowmajorTARG{} \\
602 \end{simplenametable}
604 The ordering attribute may optionally appear on one-dimensional
605 arrays; it will be ignored.
607 An array type entry has
608 \addtoindexx{type attribute}
609 a \DWATtype{} attribute
611 \addtoindexx{array!element type}
612 the type of each element of the array.
614 If the amount of storage allocated to hold each element of an
615 object of the given array type is different from the amount
616 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
617 of storage that is normally allocated to hold an individual
618 \hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}{}
620 \hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}{}
621 indicated element type, then the array type
622 \addtoindexx{bit stride attribute}
626 \addtoindexx{byte stride attribute}
629 \addtoindexx{bit stride attribute}
631 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
633 element of the array.
635 The array type entry may have either a \DWATbytesize{} or a
636 \DWATbitsize{} attribute
637 (see Section \refersec{chap:byteandbitsizes}),
639 amount of storage needed to hold an instance of the array type.
641 \textit{If the size of the array can be determined statically at
642 compile time, this value can usually be computed by multiplying
643 the number of array elements by the size of each element.}
646 Each array dimension is described by a debugging information
647 entry with either the
648 \addtoindexx{subrange type entry!as array dimension}
649 tag \DWTAGsubrangetype{} or the
650 \addtoindexx{enumeration type entry!as array dimension}
652 \DWTAGenumerationtype. These entries are
654 array type entry and are ordered to reflect the appearance of
655 the dimensions in the source program (i.e., leftmost dimension
656 first, next to leftmost second, and so on).
658 \textit{In languages that have no concept of a
659 \doublequote{multidimensional array} (for example,
660 \addtoindex{C}), an array of arrays may
661 be represented by a debugging information entry for a
662 multidimensional array.}
664 Alternatively, for an array with dynamic rank the array dimensions
665 are described by a debugging information entry with the tag
666 \DWTAGgenericsubrangeTARG.
667 This entry has the same attributes as a
668 \DWTAGsubrangetype{} entry; however,
669 there is just one \DWTAGgenericsubrangeNAME{} entry and it describes all of the
670 dimensions of the array.
671 If \DWTAGgenericsubrangeNAME{}
672 is used, the number of dimensions must be specified using a
673 \DWATrank{} attribute. See also Section
674 \refersec{chap:DWATrank}.
678 Other attributes especially applicable to arrays are
680 \DWATassociated{} and
682 which are described in
683 Section \refersec{chap:dynamictypeproperties}.
684 For relevant examples, see also Appendix \refersec{app:fortranarrayexample}.
686 \section{Coarray Type Entries}
687 \label{chap:coarraytypeentries}
688 \addtoindexx{coarray}
689 \textit{In Fortran, a \doublequote{coarray} is an array whose
690 elements are located in different processes rather than in the
691 memory of one process. The individual elements
692 of a coarray can be scalars or arrays.
693 Similar to arrays, coarrays have \doublequote{codimensions} that are
694 indexed using a \doublequote{coindex} or multiple \doublequote{coindices}.
695 \addtoindexx{codimension|see{coarray}}
696 \addtoindexx{coindex|see{coarray}}
699 A coarray type is represented by a debugging information entry
700 with the tag \DWTAGcoarraytypeTARG.
701 If a name has been given to the
702 coarray type in the source, then the corresponding coarray type
703 entry has a \DWATname{} attribute whose value is a null-terminated
704 string containing the array type name as it appears in the source
707 A coarray entry has one or more \DWTAGsubrangetype{} child entries,
708 one for each codimension. It also has a \DWATtype{} attribute
709 describing the type of each element of the coarray.
711 \textit{In a coarray application, the run-time number of processes in the application
712 is part of the coindex calculation. It is represented in the Fortran source by
713 a coindex which is declared with a \doublequote{*} as the upper bound. To express this
714 concept in DWARF, the \DWTAGsubrangetype{} child entry for that index has
715 only a lower bound and no upper bound.}
717 \textit{How coarray elements are located and how coindices are
718 converted to process specifications is processor-dependent.}
720 \section{Structure, Union, Class and Interface Type Entries}
721 \label{chap:structureunionclassandinterfacetypeentries}
723 \textit{The languages
725 \addtoindex{C++}, and
726 \addtoindex{Pascal}, among others, allow the
727 programmer to define types that are collections of related
728 \addtoindexx{structure type entry}
730 In \addtoindex{C} and \addtoindex{C++}, these collections are called
731 \doublequote{structures.}
732 In \addtoindex{Pascal}, they are called \doublequote{records.}
733 The components may be of different types. The components are
734 called \doublequote{members} in \addtoindex{C} and
735 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
737 \textit{The components of these collections each exist in their
738 own space in computer memory. The components of a C or C++
739 \doublequote{union} all coexist in the same memory.}
741 \textit{\addtoindex{Pascal} and
742 other languages have a \doublequote{discriminated union,}
743 \addtoindexx{discriminated union|see {variant entry}}
744 also called a \doublequote{variant record.} Here, selection of a
745 number of alternative substructures (\doublequote{variants}) is based
746 on the value of a component that is not part of any of those
747 substructures (the \doublequote{discriminant}).}
749 \textit{\addtoindex{C++} and
750 \addtoindex{Java} have the notion of \doublequote{class,} which is in some
751 ways similar to a structure. A class may have \doublequote{member
752 functions} which are subroutines that are within the scope
753 of a class or structure.}
755 \textit{The \addtoindex{C++} notion of
756 structure is more general than in \addtoindex{C}, being
757 equivalent to a class with minor differences. Accordingly,
758 in the following discussion statements about
759 \addtoindex{C++} classes may
760 be understood to apply to \addtoindex{C++} structures as well.}
762 \subsection{Structure, Union and Class Type Entries}
763 \label{chap:structureunionandclasstypeentries}
766 Structure, union, and class types are represented by debugging
767 \addtoindexx{structure type entry}
769 \addtoindexx{union type entry}
771 \addtoindexx{class type entry}
773 \DWTAGstructuretypeTARG,
775 and \DWTAGclasstypeTARG,
776 respectively. If a name has been given to the structure,
777 union, or class in the source program, then the corresponding
778 structure type, union type, or class type entry has a
779 \DWATname{} attribute
780 \addtoindexx{name attribute}
781 whose value is a null\dash terminated string
782 containing the type name as it appears in the source program.
784 The members of a structure, union, or class are represented
785 by debugging information entries that are owned by the
786 corresponding structure type, union type, or class type entry
787 and appear in the same order as the corresponding declarations
788 in the source program.
790 A structure type, union type or class type entry may have
791 either a \DWATbytesize{} or a
792 \DWATbitsize{} attribute
793 \hypertarget{chap:DWATbitsizedatamemberbitsize}{}
794 (see Section \refersec{chap:byteandbitsizes}),
795 whose value is the amount of storage needed
796 to hold an instance of the structure, union or class type,
797 including any padding.
799 An incomplete structure, union or class type
800 \addtoindexx{incomplete structure/union/class}
802 \addtoindexx{incomplete type}
803 represented by a structure, union or class
804 entry that does not have a byte size attribute and that has
805 \addtoindexx{declaration attribute}
806 a \DWATdeclaration{} attribute.
808 If the complete declaration of a type has been placed in
809 \hypertarget{chap:DWATsignaturetypesignature}{}
810 a separate \addtoindex{type unit}
811 (see Section \refersec{chap:separatetypeunitentries}),
812 an incomplete declaration
813 \addtoindexx{incomplete type}
814 of that type in the compilation unit may provide
815 the unique 64\dash bit signature of the type using
816 \addtoindexx{type signature}
820 If a structure, union or class entry represents the definition
821 of a structure, union or class member corresponding to a prior
822 incomplete structure, union or class, the entry may have a
823 \DWATspecification{} attribute
824 \addtoindexx{specification attribute}
825 whose value is a \livelink{chap:classreference}{reference} to
826 the debugging information entry representing that incomplete
829 Structure, union and class entries containing the
830 \DWATspecification{} attribute
831 \addtoindexx{specification attribute}
832 do not need to duplicate
833 information provided by the declaration entry referenced by the
834 specification attribute. In particular, such entries do not
835 need to contain an attribute for the name of the structure,
836 union or class they represent if such information is already
837 provided in the declaration.
839 \textit{For \addtoindex{C} and \addtoindex{C++},
841 \addtoindexx{data member|see {member entry (data)}}
842 member declarations occurring within
843 the declaration of a structure, union or class type are
844 considered to be \doublequote{definitions} of those members, with
845 the exception of \doublequote{static} data members, whose definitions
846 appear outside of the declaration of the enclosing structure,
847 union or class type. Function member declarations appearing
848 within a structure, union or class type declaration are
849 definitions only if the body of the function also appears
850 within the type declaration.}
852 If the definition for a given member of the structure, union
853 or class does not appear within the body of the declaration,
854 that member also has a debugging information entry describing
855 its definition. That latter entry has a
856 \DWATspecification{} attribute
857 \addtoindexx{specification attribute}
858 referencing the debugging information entry
859 owned by the body of the structure, union or class entry and
860 representing a non\dash defining declaration of the data, function
861 or type member. The referenced entry will not have information
862 about the location of that member (low and high pc attributes
863 for function members, location descriptions for data members)
864 and will have a \DWATdeclaration{} attribute.
867 \textit{Consider a nested class whose
868 definition occurs outside of the containing class definition, as in:}
870 \begin{lstlisting}[numbers=none]
877 \textit{The two different structs can be described in
878 different compilation units to
879 facilitate DWARF space compression
880 (see Appendix \refersec{app:usingcompilationunits}).}
882 \subsection{Interface Type Entries}
883 \label{chap:interfacetypeentries}
885 \textit{The \addtoindex{Java} language defines \doublequote{interface} types.
887 \addtoindexx{interface type entry}
888 in \addtoindex{Java} is similar to a \addtoindex{C++} or
889 \addtoindex{Java} class with only abstract
890 methods and constant data members.}
893 \addtoindexx{interface type entry}
894 are represented by debugging information
896 tag \DWTAGinterfacetypeTARG.
898 An interface type entry has
899 a \DWATname{} attribute,
900 \addtoindexx{name attribute}
902 value is a null\dash terminated string containing the type name
903 as it appears in the source program.
905 The members of an interface are represented by debugging
906 information entries that are owned by the interface type
907 entry and that appear in the same order as the corresponding
908 declarations in the source program.
910 \subsection{Derived or Extended Structs, Classes and Interfaces}
911 \label{chap:derivedorextendedstructsclasesandinterfaces}
913 \textit{In \addtoindex{C++}, a class (or struct)
915 \addtoindexx{derived type (C++)|see{inheritance entry}}
916 be \doublequote{derived from} or be a
917 \doublequote{subclass of} another class.
918 In \addtoindex{Java}, an interface may \doublequote{extend}
919 \addtoindexx{extended type (Java)|see{inheritance entry}}
921 \addtoindexx{implementing type (Java)|see{inheritance entry}}
922 or more other interfaces, and a class may \doublequote{extend} another
923 class and/or \doublequote{implement} one or more interfaces. All of these
924 relationships may be described using the following. Note that
925 in \addtoindex{Java},
926 the distinction between extends and implements is
927 implied by the entities at the two ends of the relationship.}
929 A class type or interface type entry that describes a
930 derived, extended or implementing class or interface owns
931 \addtoindexx{implementing type (Java)|see{inheritance entry}}
932 debugging information entries describing each of the classes
933 or interfaces it is derived from, extending or implementing,
934 respectively, ordered as they were in the source program. Each
936 \addtoindexx{inheritance entry}
938 tag \DWTAGinheritanceTARG.
941 \addtoindexx{type attribute}
943 \addtoindexx{inheritance entry}
945 \DWATtype{} attribute whose value is
946 a reference to the debugging information entry describing the
947 class or interface from which the parent class or structure
948 of the inheritance entry is derived, extended or implementing.
951 \addtoindexx{inheritance entry}
952 for a class that derives from or extends
953 \hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}{}
954 another class or struct also has
955 \addtoindexx{data member location attribute}
957 \DWATdatamemberlocation{}
958 attribute, whose value describes the location of the beginning
959 of the inherited type relative to the beginning address of the
960 instance of the derived class. If that value is a constant, it is the offset
961 in bytes from the beginning of the class to the beginning of
962 the instance of the inherited type. Otherwise, the value must be a location
963 description. In this latter case, the beginning address of
964 the instance of the derived class is pushed on the expression stack before
965 the \addtoindex{location description}
966 is evaluated and the result of the
967 evaluation is the location of the instance of the inherited type.
969 \textit{The interpretation of the value of this attribute for
970 inherited types is the same as the interpretation for data
972 (see Section \referfol{chap:datamemberentries}). }
975 \addtoindexx{inheritance entry}
977 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}{}
979 \addtoindexx{accessibility attribute}
983 If no accessibility attribute
984 is present, private access is assumed for an entry of a class
985 and public access is assumed for an entry of an interface,
989 \hypertarget{chap:DWATvirtualityvirtualityofbaseclass}{}
990 the class referenced by the
991 \addtoindexx{inheritance entry}
992 inheritance entry serves
993 as a \addtoindex{C++} virtual base class, the inheritance entry has a
994 \DWATvirtuality{} attribute.
996 \textit{For a \addtoindex{C++} virtual base, the
997 \addtoindex{data member location attribute}
998 will usually consist of a non-trivial
999 \addtoindex{location description}.}
1001 \subsection{Access Declarations}
1002 \label{chap:accessdeclarations}
1004 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1005 \addtoindexx{access declaration entry}
1006 change the accessibility of individual class members from the
1007 overall accessibility specified by the inheritance declaration.
1008 A single access declaration may refer to a set of overloaded
1011 If a derived class or structure contains access declarations,
1012 each such declaration may be represented by a debugging
1013 information entry with the tag
1014 \DWTAGaccessdeclarationTARG.
1016 such entry is a child of the class or structure type entry.
1018 An access declaration entry has
1019 a \DWATname{} attribute,
1020 \addtoindexx{name attribute}
1022 value is a null\dash terminated string representing the name used
1023 in the declaration in the source program, including any class
1024 or structure qualifiers.
1026 An access declaration entry
1027 \hypertarget{chap:DWATaccessibilitycppbaseclasses}{}
1030 \DWATaccessibility{}
1031 attribute describing the declared accessibility of the named
1036 \subsection{Friends}
1037 \label{chap:friends}
1039 Each \doublequote{friend}
1040 \addtoindexx{friend entry}
1041 declared by a structure, union or class
1042 \hypertarget{chap:DWATfriendfriendrelationship}{}
1043 type may be represented by a debugging information entry
1044 that is a child of the structure, union or class type entry;
1045 the friend entry has the
1046 tag \DWTAGfriendTARG.
1049 \addtoindexx{friend attribute}
1050 a \DWATfriend{} attribute, whose value is
1051 a reference to the debugging information entry describing
1052 the declaration of the friend.
1055 \subsection{Data Member Entries}
1056 \label{chap:datamemberentries}
1058 A data member (as opposed to a member function) is
1059 represented by a debugging information entry with the
1060 tag \DWTAGmemberTARG.
1062 \addtoindexx{member entry (data)}
1063 member entry for a named member has
1064 a \DWATname{} attribute
1065 \addtoindexx{name attribute}
1066 whose value is a null\dash terminated
1067 string containing the member name as it appears in the source
1068 program. If the member entry describes an
1069 \addtoindex{anonymous union},
1070 the name attribute is omitted or the value of the attribute
1071 consists of a single zero byte.
1073 The data member entry has
1074 \addtoindexx{type attribute}
1076 \DWATtype{} attribute to denote
1077 \addtoindexx{member entry (data)}
1078 the type of that member.
1080 A data member entry may
1081 \addtoindexx{accessibility attribute}
1083 \DWATaccessibility{}
1084 attribute. If no accessibility attribute is present, private
1085 access is assumed for an entry of a class and public access
1086 is assumed for an entry of a structure, union, or interface.
1089 \hypertarget{chap:DWATmutablemutablepropertyofmemberdata}{}
1091 \addtoindexx{member entry (data)}
1093 \addtoindexx{mutable attribute}
1094 have a \DWATmutable{} attribute,
1095 which is a \livelink{chap:classflag}{flag}.
1096 This attribute indicates whether the data
1097 member was declared with the mutable storage class specifier.
1099 The beginning of a data member
1100 \addtoindexx{beginning of a data member}
1101 is described relative to
1102 \addtoindexx{beginning of an object}
1103 the beginning of the object in which it is immediately
1104 contained. In general, the beginning is characterized by
1105 both an address and a bit offset within the byte at that
1106 address. When the storage for an entity includes all of
1107 the bits in the beginning byte, the beginning bit offset is
1110 Bit offsets in DWARF use the bit numbering and direction
1111 conventions that are appropriate to the current language on
1115 \addtoindexx{member entry (data)}
1116 corresponding to a data member that is
1117 \hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}{}
1119 \hypertarget{chap:DWATdatamemberlocationdatamemberlocation}{}
1120 in a structure, union or class may have either
1121 \addtoindexx{data member location attribute}
1123 \DWATdatamemberlocation{} attribute or a
1124 \DWATdatabitoffset{}
1125 attribute. If the beginning of the data member is the same as
1126 the beginning of the containing entity then neither attribute
1130 For a \DWATdatamemberlocation{} attribute
1131 \addtoindexx{data member location attribute}
1132 there are two cases:
1133 \begin{enumerate}[1. ]
1134 \item If the value is an \livelink{chap:classconstant}{integer constant},
1136 in bytes from the beginning of the containing entity. If
1137 the beginning of the containing entity has a non-zero bit
1138 offset then the beginning of the member entry has that same
1141 \item Otherwise, the value must be a \addtoindex{location description}.
1143 this case, the beginning of the containing entity must be byte
1144 aligned. The beginning address is pushed on the DWARF stack
1145 before the \addtoindex{location} description is evaluated; the result of
1146 the evaluation is the base address of the member entry.
1148 \textit{The push on the DWARF expression stack of the base address of
1149 the containing construct is equivalent to execution of the
1150 \DWOPpushobjectaddress{} operation
1151 (see Section \refersec{chap:stackoperations});
1152 \DWOPpushobjectaddress{} therefore
1153 is not needed at the
1154 beginning of a \addtoindex{location description} for a data member.
1156 result of the evaluation is a location---either an address or
1157 the name of a register, not an offset to the member.}
1159 \textit{A \DWATdatamemberlocation{}
1161 \addtoindexx{data member location attribute}
1162 that has the form of a
1163 \addtoindex{location description} is not valid for a data member contained
1164 in an entity that is not byte aligned because DWARF operations
1165 do not allow for manipulating or computing bit offsets.}
1169 For a \DWATdatabitoffset{} attribute,
1170 the value is an \livelink{chap:classconstant}{integer constant}
1171 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1172 that specifies the number of bits
1173 from the beginning of the containing entity to the beginning
1174 of the data member. This value must be greater than or equal
1175 to zero, but is not limited to less than the number of bits
1178 If the size of a data member is not the same as the size
1179 of the type given for the data member, the data member has
1180 \addtoindexx{bit size attribute}
1181 either a \DWATbytesize{}
1182 or a \DWATbitsize{} attribute whose
1183 \livelink{chap:classconstant}{integer constant} value
1184 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1186 of storage needed to hold the value of the data member.
1188 \textit{Bit fields in \addtoindex{C} and \addtoindex{C++}
1190 \addtoindexx{bit fields}
1192 \addtoindexx{data bit offset}
1194 \addtoindexx{data bit size}
1196 \DWATdatabitoffset{} and
1197 \DWATbitsize{} attributes.}
1200 \textit{This Standard uses the following bit numbering and direction
1201 conventions in examples. These conventions are for illustrative
1202 purposes and other conventions may apply on particular
1205 \item \textit{For big\dash endian architectures, bit offsets are
1206 counted from high-order to low\dash order bits within a byte (or
1207 larger storage unit); in this case, the bit offset identifies
1208 the high\dash order bit of the object.}
1210 \item \textit{For little\dash endian architectures, bit offsets are
1211 counted from low\dash order to high\dash order bits within a byte (or
1212 larger storage unit); in this case, the bit offset identifies
1213 the low\dash order bit of the object.}
1217 \textit{In either case, the bit so identified is defined as the
1218 \addtoindexx{beginning of an object}
1219 beginning of the object.}
1221 \textit{For example, take one possible representation of the following
1222 \addtoindex{C} structure definition
1223 in both big\dash and little\dash endian byte orders:}
1234 \textit{Figures \referfol{fig:bigendiandatabitoffsets} and
1235 \refersec{fig:littleendiandatabitoffsets}
1236 show the structure layout
1237 and data bit offsets for example big\dash\ and little\dash endian
1238 architectures, respectively. Both diagrams show a structure
1239 that begins at address A and whose size is four bytes. Also,
1240 high order bits are to the left and low order bits are to
1252 Addresses increase ->
1253 | A | A + 1 | A + 2 | A + 3 |
1255 Data bit offsets increase ->
1256 +---------------+---------------+---------------+---------------+
1257 |0 4|5 10|11 15|16 23|24 31|
1258 | j | k | m | n | <pad> |
1260 +---------------------------------------------------------------+
1264 \caption{Big-endian data bit offsets}
1265 \label{fig:bigendiandatabitoffsets}
1276 <- Addresses increase
1277 | A + 3 | A + 2 | A + 1 | A |
1279 <- Data bit offsets increase
1280 +---------------+---------------+---------------+---------------+
1281 |31 24|23 16|15 11|10 5|4 0|
1282 | <pad> | n | m | k | j |
1284 +---------------------------------------------------------------+
1288 \caption{Little-endian data bit offsets}
1289 \label{fig:littleendiandatabitoffsets}
1292 \textit{Note that data member bit offsets in this example are the
1293 same for both big\dash\ and little\dash endian architectures even
1294 though the fields are allocated in different directions
1295 (high\dash order to low-order versus low\dash order to high\dash order);
1296 the bit naming conventions for memory and/or registers of
1297 the target architecture may or may not make this seem natural.}
1299 \textit{For a more extensive example showing nested and packed records
1301 Appendix \refersec{app:pascalexample}.}
1303 \textit{Attribute \DWATdatabitoffset{}
1305 \addtoindex{DWARF Version 4}, unchanged in \addtoindex{DWARF Version 5},
1306 and is also used for base types
1308 \refersec{chap:basetypeentries}).
1310 \livetarg{chap:DWATbitoffsetdatamemberbitlocation}{}
1311 attributes \DWATbitoffset{} and
1312 \DWATbytesize{} when used to
1313 identify the beginning of bit field data members as defined
1314 in DWARF V3 and earlier. The \DWATbytesize,
1317 attribute combination is deprecated for data members in DWARF
1318 Version 4 and later. See Section 5.6.6 in the DWARF Version 4
1319 specification for a discussion of compatibility considerations.}
1321 \subsection{Member Function Entries}
1322 \label{chap:memberfunctionentries}
1324 A member function is represented by a
1325 \addtoindexx{member function entry}
1326 debugging information entry
1328 \addtoindexx{subprogram entry!as member function}
1329 tag \DWTAGsubprogram.
1330 The member function entry
1331 may contain the same attributes and follows the same rules
1332 as non\dash member global subroutine entries
1333 (see Section \refersec{chap:subroutineandentrypointentries}).
1335 \textit{In particular, if the member function entry is an
1336 instantiation of a member function template, it follows the
1337 same rules as function template instantiations (see Section
1338 \refersec{chap:functiontemplateinstantiations}).
1342 \addtoindexx{accessibility attribute}
1343 member function entry may have a
1344 \DWATaccessibility{}
1345 attribute. If no accessibility attribute is present, private
1346 access is assumed for an entry of a class and public access
1347 is assumed for an entry of a structure, union or interface.
1350 \hypertarget{chap:DWATvirtualityvirtualityoffunction}{}
1351 the member function entry describes a virtual function,
1352 then that entry has a
1353 \DWATvirtuality{} attribute.
1356 \hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}{}
1357 the member function entry describes an explicit member
1358 function, then that entry has
1359 \addtoindexx{explicit attribute}
1361 \DWATexplicit{} attribute.
1364 \hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{}
1365 entry for a virtual function also has a
1366 \DWATvtableelemlocation{}
1367 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1368 a \addtoindex{location description}
1369 yielding the address of the slot
1370 for the function within the virtual function table for the
1371 enclosing class. The address of an object of the enclosing
1372 type is pushed onto the expression stack before the location
1373 description is evaluated.
1376 \hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{}
1377 the member function entry describes a non\dash static member
1378 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1379 function, then that entry
1380 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1382 \addtoindexx{object pointer attribute}
1383 a \DWATobjectpointer{}
1385 whose value is a \livelink{chap:classreference}{reference}
1386 to the formal parameter entry
1387 that corresponds to the object for which the function is
1388 called. The name attribute of that formal parameter is defined
1389 by the current language (for example,
1390 \texttt{this} for \addtoindex{C++} or \texttt{self}
1391 for \addtoindex{Objective C}
1392 and some other languages). That parameter
1393 also has a \DWATartificial{} attribute whose value is true.
1395 Conversely, if the member function entry describes a static
1396 member function, the entry does not have
1397 \addtoindexx{object pointer attribute}
1399 \DWATobjectpointer{}
1402 If the member function entry describes a non\dash static member
1403 function that has a const\dash volatile qualification, then
1404 the entry describes a non\dash static member function whose
1405 object formal parameter has a type that has an equivalent
1406 const\dash volatile qualification.
1408 If a subroutine entry represents the defining declaration
1409 of a member function and that definition appears outside of
1410 the body of the enclosing class declaration, the subroutine
1412 \DWATspecification{} attribute,
1413 \addtoindexx{specification attribute}
1415 a reference to the debugging information entry representing
1416 the declaration of this function member. The referenced entry
1417 will be a child of some class (or structure) type entry.
1419 Subroutine entries containing the
1420 \DWATspecification{} attribute
1421 \addtoindexx{specification attribute}
1422 do not need to duplicate information provided
1423 by the declaration entry referenced by the specification
1424 attribute. In particular, such entries do not need to contain
1425 attributes for the name or return type of the function member
1426 whose definition they represent.
1429 \subsection{Class Template Instantiations}
1430 \label{chap:classtemplateinstantiations}
1432 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1433 type that may be instantiated when an instance of the class
1434 is declared or defined. The generic description of the class may include
1435 parameterized types, parameterized compile-time constant
1436 values, and/or parameterized run-time constant addresses.
1437 DWARF does not represent the generic template
1438 definition, but does represent each instantiation.}
1440 A class template instantiation is represented by a
1441 debugging information entry with the tag \DWTAGclasstype,
1442 \DWTAGstructuretype{} or
1443 \DWTAGuniontype. With the following
1444 exceptions, such an entry will contain the same attributes
1445 and have the same types of child entries as would an entry
1446 for a class type defined explicitly using the instantiation
1447 types and values. The exceptions are:
1449 \begin{enumerate}[1. ]
1450 \item Template parameters are described and referenced as
1451 specified in Section \refersec{chap:templateparameters}.
1454 \item If the compiler has generated a special compilation unit to
1456 \addtoindexx{template instantiation!and special compilation unit}
1457 template instantiation and that special compilation
1458 unit has a different name from the compilation unit containing
1459 the template definition, the name attribute for the debugging
1460 information entry representing the special compilation unit
1461 should be empty or omitted.
1464 \item If the class type entry representing the template
1465 instantiation or any of its child entries contains declaration
1466 coordinate attributes, those attributes should refer to
1467 the source for the template definition, not to any source
1468 generated artificially by the compiler.
1472 \subsection{Variant Entries}
1473 \label{chap:variantentries}
1475 A variant part of a structure is represented by a debugging
1476 information entry\addtoindexx{variant part entry} with the
1477 tag \DWTAGvariantpartTARG{} and is
1478 owned by the corresponding structure type entry.
1480 If the variant part has a discriminant, the discriminant is
1481 \hypertarget{chap:DWATdiscrdiscriminantofvariantpart}{}
1483 \addtoindexx{discriminant (entry)}
1484 separate debugging information entry which
1485 is a child of the variant part entry. This entry has the form
1487 \addtoindexx{member entry (data)!as discriminant}
1488 structure data member entry. The variant part entry will
1489 \addtoindexx{discriminant attribute}
1491 \DWATdiscr{} attribute
1492 whose value is a \livelink{chap:classreference}{reference} to
1493 the member entry for the discriminant.
1495 If the variant part does not have a discriminant (tag field),
1496 the variant part entry has
1497 \addtoindexx{type attribute}
1499 \DWATtype{} attribute to represent
1502 Each variant of a particular variant part is represented by
1503 \hypertarget{chap:DWATdiscrvaluediscriminantvalue}{}
1504 a debugging information entry\addtoindexx{variant entry} with the
1505 tag \DWTAGvariantTARG{}
1506 and is a child of the variant part entry. The value that
1507 selects a given variant may be represented in one of three
1508 ways. The variant entry may have a
1509 \DWATdiscrvalue{} attribute
1510 whose value represents a single case label. The value of this
1511 attribute is encoded as an LEB128 number. The number is signed
1512 if the tag type for the variant part containing this variant
1513 is a signed type. The number is unsigned if the tag type is
1518 \hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}{}
1519 the variant entry may contain
1520 \addtoindexx{discriminant list attribute}
1523 attribute, whose value represents a list of discriminant
1524 values. This list is represented by any of the
1525 \livelink{chap:classblock}{block} forms and
1526 may contain a mixture of case labels and label ranges. Each
1527 item on the list is prefixed with a discriminant value
1528 descriptor that determines whether the list item represents
1529 a single label or a label range. A single case label is
1530 represented as an LEB128 number as defined above for
1531 \addtoindexx{discriminant value attribute}
1534 attribute. A label range is represented by
1535 two LEB128 numbers, the low value of the range followed by the
1536 high value. Both values follow the rules for signedness just
1537 described. The discriminant value descriptor is an integer
1538 constant that may have one of the values given in
1539 Table \refersec{tab:discriminantdescriptorvalues}.
1541 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1542 \DWDSClabelTARG{} \\
1543 \DWDSCrangeTARG{} \\
1544 \end{simplenametable}
1546 If a variant entry has neither a \DWATdiscrvalue{}
1547 attribute nor a \DWATdiscrlist{} attribute, or if it has
1548 a \DWATdiscrlist{} attribute with 0 size, the variant is a
1551 The components selected by a particular variant are represented
1552 by debugging information entries owned by the corresponding
1553 variant entry and appear in the same order as the corresponding
1554 declarations in the source program.
1556 \section{Condition Entries}
1557 \label{chap:conditionentries}
1559 \textit{COBOL has the notion of
1560 \addtoindexx{level-88 condition, COBOL}
1561 a \doublequote{level\dash 88 condition} that
1562 associates a data item, called the conditional variable, with
1563 a set of one or more constant values and/or value ranges.
1564 % Note: the {} after \textquoteright (twice) is necessary to assure a following space separator
1565 Semantically, the condition is \textquoteleft true\textquoteright{}
1567 variable's value matches any of the described constants,
1568 and the condition is \textquoteleft false\textquoteright{} otherwise.}
1570 The \DWTAGconditionTARG{}
1571 debugging information entry\addtoindexx{condition entry}
1573 logical condition that tests whether a given data item\textquoteright s
1574 value matches one of a set of constant values. If a name
1575 has been given to the condition, the condition entry has a
1576 \DWATname{} attribute
1577 \addtoindexx{name attribute}
1578 whose value is a null\dash terminated string
1579 giving the condition name as it appears in the source program.
1581 The condition entry's parent entry describes the conditional
1582 variable; normally this will be a \DWTAGvariable,
1584 \DWTAGformalparameter{} entry.
1586 \addtoindexx{formal parameter entry}
1588 entry has an array type, the condition can test any individual
1589 element, but not the array as a whole. The condition entry
1590 implicitly specifies a \doublequote{comparison type} that is the
1591 type of an array element if the parent has an array type;
1592 otherwise it is the type of the parent entry.
1595 The condition entry owns \DWTAGconstant{} and/or
1596 \DWTAGsubrangetype{} entries that describe the constant
1597 values associated with the condition. If any child entry
1598 \addtoindexx{type attribute}
1600 a \DWATtype{} attribute,
1601 that attribute should describe a type
1602 compatible with the comparison type (according to the source
1603 language); otherwise the child\textquoteright s type is the same as the
1606 \textit{For conditional variables with alphanumeric types, COBOL
1607 permits a source program to provide ranges of alphanumeric
1608 constants in the condition. Normally a subrange type entry
1609 does not describe ranges of strings; however, this can be
1610 represented using bounds attributes that are references to
1611 constant entries describing strings. A subrange type entry may
1612 refer to constant entries that are siblings of the subrange
1616 \section{Enumeration Type Entries}
1617 \label{chap:enumerationtypeentries}
1619 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1620 a fixed number of symbolic values.}
1622 An enumeration type is represented by a debugging information
1624 \DWTAGenumerationtypeTARG.
1626 If a name has been given to the enumeration type in the source
1627 program, then the corresponding enumeration type entry has
1628 a \DWATname{} attribute
1629 \addtoindexx{name attribute}
1630 whose value is a null\dash terminated
1631 string containing the enumeration type name as it appears
1632 in the source program. This entry also has a
1634 attribute whose \livelink{chap:classconstant}{integer constant}
1635 value is the number of bytes
1636 required to hold an instance of the enumeration.
1638 The \addtoindex{enumeration type entry}
1640 \addtoindexx{type attribute}
1641 a \DWATtype{} attribute
1642 which refers to the underlying data type used to implement
1645 If an enumeration type has type safe
1646 \addtoindexx{type safe enumeration types}
1649 \begin{enumerate}[1. ]
1650 \item Enumerators are contained in the scope of the enumeration type, and/or
1652 \item Enumerators are not implicitly converted to another type
1655 then the \addtoindex{enumeration type entry} may
1656 \addtoindexx{enum class|see{type-safe enumeration}}
1657 have a \DWATenumclass{}
1658 attribute, which is a \livelink{chap:classflag}{flag}.
1659 In a language that offers only
1660 one kind of enumeration declaration, this attribute is not
1663 \textit{In \addtoindex{C} or \addtoindex{C++},
1664 the underlying type will be the appropriate
1665 integral type determined by the compiler from the properties of
1666 \hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}{}
1667 the enumeration literal values.
1668 A \addtoindex{C++} type declaration written
1669 using enum class declares a strongly typed enumeration and
1670 is represented using \DWTAGenumerationtype{}
1671 in combination with \DWATenumclass.}
1673 Each enumeration literal is represented by a debugging
1674 \addtoindexx{enumeration literal|see{enumeration entry}}
1675 information entry with the
1676 tag \DWTAGenumeratorTARG.
1678 such entry is a child of the
1679 \addtoindex{enumeration type entry}, and the
1680 enumerator entries appear in the same order as the declarations
1681 of the enumeration literals in the source program.
1683 Each \addtoindex{enumerator entry} has a
1684 \DWATname{} attribute, whose
1685 \addtoindexx{name attribute}
1686 value is a null\dash terminated string containing the name of the
1687 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}{}
1688 enumeration literal as it appears in the source program.
1689 Each enumerator entry also has a
1690 \DWATconstvalue{} attribute,
1691 whose value is the actual numeric value of the enumerator as
1692 represented on the target system.
1695 If the enumeration type occurs as the description of a
1696 \addtoindexx{enumeration type endry!as array dimension}
1697 dimension of an array type, and the stride for that dimension
1698 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}{}
1699 is different than what would otherwise be determined, then
1700 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}{}
1701 the enumeration type entry has either a
1703 or \DWATbitstride{} attribute
1704 \addtoindexx{bit stride attribute}
1705 which specifies the separation
1706 between successive elements along the dimension as described
1708 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1710 \DWATbitstride{} attribute
1711 \addtoindexx{bit stride attribute}
1712 is interpreted as bits and the value of
1713 \addtoindexx{byte stride attribute}
1716 attribute is interpreted as bytes.
1719 \section{Subroutine Type Entries}
1720 \label{chap:subroutinetypeentries}
1722 \textit{It is possible in \addtoindex{C}
1723 to declare pointers to subroutines
1724 that return a value of a specific type. In both
1725 \addtoindex{C} and \addtoindex{C++},
1726 it is possible to declare pointers to subroutines that not
1727 only return a value of a specific type, but accept only
1728 arguments of specific types. The type of such pointers would
1729 be described with a \doublequote{pointer to} modifier applied to a
1730 user\dash defined type.}
1732 A subroutine type is represented by a debugging information
1734 \addtoindexx{subroutine type entry}
1735 tag \DWTAGsubroutinetypeTARG.
1737 been given to the subroutine type in the source program,
1738 then the corresponding subroutine type entry has
1739 a \DWATname{} attribute
1740 \addtoindexx{name attribute}
1741 whose value is a null\dash terminated string containing
1742 the subroutine type name as it appears in the source program.
1744 If the subroutine type describes a function that returns
1745 a value, then the subroutine type entry has
1746 \addtoindexx{type attribute}
1748 attribute to denote the type returned by the subroutine. If
1749 the types of the arguments are necessary to describe the
1750 subroutine type, then the corresponding subroutine type
1751 entry owns debugging information entries that describe the
1752 arguments. These debugging information entries appear in the
1753 order that the corresponding argument types appear in the
1756 \textit{In \addtoindex{C} there
1757 is a difference between the types of functions
1758 declared using function prototype style declarations and
1759 those declared using non\dash prototype declarations.}
1762 \hypertarget{chap:DWATprototypedsubroutineprototype}{}
1763 subroutine entry declared with a function prototype style
1764 declaration may have
1765 \addtoindexx{prototyped attribute}
1767 \DWATprototyped{} attribute, which is
1768 a \livelink{chap:classflag}{flag}.
1770 Each debugging information entry owned by a subroutine
1771 type entry corresponds to either a formal parameter or the sequence of
1772 unspecified parameters of the subprogram type:
1774 \begin{enumerate}[1. ]
1775 \item A formal parameter of a parameter list (that has a
1776 specific type) is represented by a debugging information entry
1777 with the tag \DWTAGformalparameter.
1778 Each formal parameter
1780 \addtoindexx{type attribute}
1781 a \DWATtype{} attribute that refers to the type of
1782 the formal parameter.
1784 \item The unspecified parameters of a variable parameter list
1785 \addtoindexx{unspecified parameters entry}
1787 \addtoindexx{\texttt{...} parameters|see{unspecified parameters entry}}
1788 represented by a debugging information entry with the
1789 tag \DWTAGunspecifiedparameters.
1794 \section{String Type Entries}
1795 \label{chap:stringtypeentries}
1797 \textit{A \doublequote{string} is a sequence of characters that have specific
1798 \addtoindexx{string type entry}
1799 semantics and operations that distinguish them from arrays of
1801 \addtoindex{Fortran} is one of the languages that has a string
1802 type. Note that \doublequote{string} in this context refers to a target
1803 machine concept, not the class string as used in this document
1804 (except for the name attribute).}
1806 A string type is represented by a debugging information entry
1807 with the tag \DWTAGstringtypeTARG.
1808 If a name has been given to
1809 the string type in the source program, then the corresponding
1810 string type entry has a
1811 \DWATname{} attribute
1812 \addtoindexx{name attribute}
1814 a null\dash terminated string containing the string type name as
1815 it appears in the source program.
1818 The string type entry may have a
1819 \DWATbytesize{} attribute or
1821 attribute, whose value
1822 (see Section \refersec{chap:byteandbitsizes})
1824 storage needed to hold a value of the string type.
1828 \hypertarget{chap:DWATstringlengthstringlengthofstringtype}{}
1829 string type entry may also have a
1830 \DWATstringlength{} attribute
1832 \addtoindexx{string length attribute}
1834 \addtoindex{location description} yielding the location
1835 where the length of the string is stored in the program.
1836 If the \DWATstringlength{} attribute is not present, the size
1837 of the string is assumed to be the amount of storage that is
1838 allocated for the string (as specified by the \DWATbytesize{}
1839 or \DWATbitsize{} attribute).
1841 The string type entry may also have a
1842 \DWATstringlengthbytesizeTARG{}
1844 \DWATstringlengthbitsizeTARG{} attribute,
1845 \addtoindexx{string length attribute!size of length data}
1846 whose value (see Section \refersec{chap:byteandbitsizes})
1847 is the size of the data to be retrieved from the location
1848 referenced by the string length attribute. If no (byte or bit)
1849 size attribute is present, the size of the data to be retrieved
1851 \addtoindex{size of an address} on the target machine.
1853 \addtoindexx{DWARF Version 5} % Avoid italics
1854 \textit{Prior to DWARF Version 5, the meaning of a
1855 \DWATbytesize{} attribute depends on the presence of the
1856 \DWATstringlength{} attribute:
1858 \item If \DWATstringlength{} is present, \DWATbytesize{}
1859 specifies the size of the length data to be retrieved
1860 from the location specified by the \DWATstringlength{} attribute.
1861 \item If \DWATstringlength{} is not present, \DWATbytesize{}
1862 specifies the amount of storage allocated for objects
1865 In DWARF Version 5, \DWATbytesize{} always specifies the amount of storage
1866 allocated for objects of the string type.}
1868 \section{Set Type Entries}
1869 \label{chap:settypeentries}
1871 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1872 a group of values of ordinal type.}
1874 A set is represented by a debugging information entry with
1875 the tag \DWTAGsettypeTARG.
1876 \addtoindexx{set type entry}
1877 If a name has been given to the
1878 set type, then the set type entry has
1879 a \DWATname{} attribute
1880 \addtoindexx{name attribute}
1881 whose value is a null\dash terminated string containing the
1882 set type name as it appears in the source program.
1884 The set type entry has
1885 \addtoindexx{type attribute}
1886 a \DWATtype{} attribute to denote the
1887 type of an element of the set.
1890 If the amount of storage allocated to hold each element of an
1891 object of the given set type is different from the amount of
1892 storage that is normally allocated to hold an individual object
1893 of the indicated element type, then the set type entry has
1894 either a \DWATbytesize{} attribute, or
1895 \DWATbitsize{} attribute
1896 whose value (see Section \refersec{chap:byteandbitsizes}) is
1897 the amount of storage needed to hold a value of the set type.
1900 \section{Subrange Type Entries}
1901 \label{chap:subrangetypeentries}
1903 \textit{Several languages support the concept of a \doublequote{subrange}
1904 type object. These objects can represent a subset of the
1905 values that an object of the basis type for the subrange can
1907 Subrange type entries may also be used to represent
1908 the bounds of array dimensions.}
1910 A subrange type is represented by a debugging information
1912 \addtoindexx{subrange type entry}
1913 tag \DWTAGsubrangetypeTARG.
1915 given to the subrange type, then the subrange type entry
1916 has a \DWATname{} attribute
1917 \addtoindexx{name attribute}
1918 whose value is a null\dash terminated
1919 string containing the subrange type name as it appears in
1922 The tag \DWTAGgenericsubrange{} is
1923 used to describe arrays with a dynamic rank. See Section
1924 \refersec{chap:DWTAGgenericsubrange}.
1926 The subrange entry may have
1927 \addtoindexx{type attribute}
1928 a \DWATtype{} attribute to describe
1929 the type of object, called the basis type, of whose values
1930 this subrange is a subset.
1932 If the amount of storage allocated to hold each element of an
1933 object of the given subrange type is different from the amount
1934 of storage that is normally allocated to hold an individual
1935 object of the indicated element type, then the subrange
1937 \DWATbytesize{} attribute or
1939 attribute, whose value
1940 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1942 storage needed to hold a value of the subrange type.
1945 \hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{}
1946 subrange entry may have
1947 \addtoindexx{threads scaled attribute}
1949 \DWATthreadsscaled{} attribute,
1950 which is a \livelink{chap:classflag}{flag}.
1951 If present, this attribute indicates whether
1952 this subrange represents a \addtoindex{UPC} array bound which is scaled
1953 by the runtime THREADS value (the number of UPC threads in
1954 this execution of the program).
1956 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
1958 \begin{lstlisting}[numbers=none]
1959 int shared foo[34*THREADS][10][20];
1963 \hypertarget{chap:DWATlowerboundlowerboundofsubrange}{}
1965 \hypertarget{chap:DWATupperboundupperboundofsubrange}{}
1966 entry may have the attributes
1968 \addtoindexx{lower bound attribute}
1969 and \DWATupperbound{}
1970 \addtoindexx{upper bound attribute} to specify, respectively, the lower
1971 and upper bound values of the subrange. The
1974 \hypertarget{chap:DWATcountelementsofsubrangetype}{}
1976 % FIXME: The following matches DWARF4: odd as there is no default count.
1977 \addtoindexx{count attribute!default}
1979 \addtoindexx{count attribute}
1981 \DWATcount{} attribute,
1983 value describes the number of elements in the subrange rather
1984 than the value of the last element. The value of each of
1985 these attributes is determined as described in
1986 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1988 If the lower bound value is missing, the value is assumed to
1989 be a language\dash dependent default constant.
1990 \addtoindexx{lower bound attribute!default}
1991 The default lower bound is 0 for
1992 \addtoindex{C}, \addtoindex{C++},
1995 \addtoindex{Haskell},
1997 \addtoindex{Objective C},
1998 \addtoindex{Objective C++},
1999 \addtoindex{OpenCL},
2000 \addtoindex{Python}, and
2002 The default lower bound is 1 for
2005 \addtoindex{Fortran},
2006 \addtoindex{Modula-2},
2007 \addtoindex{Modula-3},
2008 \addtoindex{Pascal} and
2011 \textit{No other default lower bound values are currently defined.}
2013 If the upper bound and count are missing, then the upper bound value is
2014 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
2016 If the subrange entry has no type attribute describing the
2017 basis type, the basis type is determined as follows:
2018 \begin{enumerate}[1. ]
2020 If there is a lower bound attribute that references an object,
2021 the basis type is assumed to be the same as the type of that object.
2023 Otherwise, if there is an upper bound or count attribute that references
2024 an object, the basis type is assumed to be the same as the type of that object.
2026 Otherwise, the type is
2027 assumed to be the same type, in the source language of the
2028 compilation unit containing the subrange entry, as a signed
2029 integer with the same size as an address on the target machine.
2032 If the subrange type occurs as the description of a dimension
2033 of an array type, and the stride for that dimension is
2034 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}{}
2035 different than what would otherwise be determined, then
2036 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}{}
2037 the subrange type entry has either
2038 \addtoindexx{byte stride attribute}
2040 \DWATbytestride{} or
2041 \DWATbitstride{} attribute
2042 \addtoindexx{bit stride attribute}
2043 which specifies the separation
2044 between successive elements along the dimension as described
2046 Section \refersec{chap:byteandbitsizes}.
2048 \textit{Note that the stride can be negative.}
2050 \section{Pointer to Member Type Entries}
2051 \label{chap:pointertomembertypeentries}
2053 \textit{In \addtoindex{C++}, a
2054 pointer to a data or function member of a class or
2055 structure is a unique type.}
2057 A debugging information entry representing the type of an
2058 object that is a pointer to a structure or class member has
2059 the tag \DWTAGptrtomembertypeTARG.
2061 If the \addtoindex{pointer to member type} has a name, the
2062 \addtoindexx{pointer to member type entry}
2063 pointer to member entry has a
2064 \DWATname{} attribute,
2065 \addtoindexx{name attribute}
2067 null\dash terminated string containing the type name as it appears
2068 in the source program.
2070 The \addtoindex{pointer to member} entry
2072 \addtoindexx{type attribute}
2073 a \DWATtype{} attribute to
2074 describe the type of the class or structure member to which
2075 objects of this type may point.
2077 The \addtoindexx{pointer to member} entry also
2078 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{}
2080 \DWATcontainingtype{}
2081 attribute, whose value is a \livelink{chap:classreference}{reference} to a debugging
2082 information entry for the class or structure to whose members
2083 objects of this type may point.
2085 The \addtoindex{pointer to member entry}
2086 \hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}{}
2088 \DWATuselocation{} attribute
2089 \addtoindexx{use location attribute}
2091 \addtoindex{location description} that computes the
2092 address of the member of the class to which the pointer to
2093 member entry points.
2095 \textit{The method used to find the address of a given member of a
2096 class or structure is common to any instance of that class
2097 or structure and to any instance of the pointer or member
2098 type. The method is thus associated with the type entry,
2099 rather than with each instance of the type.}
2101 The \DWATuselocation{} description is used in conjunction
2102 with the location descriptions for a particular object of the
2103 given \addtoindex{pointer to member type} and for a particular structure or
2104 class instance. The \DWATuselocation{}
2105 attribute expects two values to be
2106 \addtoindexi{pushed}{address!implicit push for member operator}
2107 onto the DWARF expression stack before
2108 the \DWATuselocation{} description is evaluated.
2110 \addtoindexi{pushed}{address!implicit push for member operator}
2111 is the value of the \addtoindex{pointer to member} object
2112 itself. The second value
2113 \addtoindexi{pushed}{address!implicit push for member operator}
2114 is the base address of the
2115 entire structure or union instance containing the member
2116 whose address is being calculated.
2119 \textit{For an expression such as}
2121 \begin{lstlisting}[numbers=none]
2124 \textit{where \texttt{mbr\_ptr} has some \addtoindex{pointer to member type}, a debugger should:}
2125 \begin{enumerate}[1. ]
2126 \item \textit{Push the value of \texttt{mbr\_ptr} onto the DWARF expression stack.}
2127 \item \textit{Push the base address of \texttt{object} onto the DWARF expression stack.}
2128 \item \textit{Evaluate the \DWATuselocation{} description
2129 given in the type of \texttt{mbr\_ptr}.}
2133 \section{File Type Entries}
2134 \label{chap:filetypeentries}
2136 \textit{Some languages, such as \addtoindex{Pascal},
2137 provide a data type to represent
2140 A file type is represented by a debugging information entry
2142 \addtoindexx{file type entry}
2145 If the file type has a name,
2146 the file type entry has a \DWATname{} attribute,
2147 \addtoindexx{name attribute}
2149 is a null\dash terminated string containing the type name as it
2150 appears in the source program.
2152 The file type entry has
2153 \addtoindexx{type attribute}
2154 a \DWATtype{} attribute describing
2155 the type of the objects contained in the file.
2157 The file type entry also
2158 \addtoindexx{byte size}
2160 \addtoindexx{bit size}
2163 \DWATbitsize{} attribute, whose value
2164 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2165 is the amount of storage need to hold a value of the file type.
2167 \subsection{Dynamic Type Properties}
2168 \label{chap:dynamictypeproperties}
2169 \subsection{Data Location}
2170 \label{chap:datalocation}
2172 \textit{Some languages may represent objects using descriptors to hold
2173 information, including a location and/or run\dash time parameters,
2174 about the data that represents the value for that object.}
2176 \hypertarget{chap:DWATdatalocationindirectiontoactualdata}{}
2177 The \DWATdatalocation{}
2178 attribute may be used with any
2179 \addtoindexx{data location attribute}
2180 type that provides one or more levels of
2181 \addtoindexx{hidden indirection|see{data location attribute}}
2183 and/or run\dash time parameters in its representation. Its value
2184 is a \addtoindex{location description}.
2185 The result of evaluating this
2186 description yields the location of the data for an object.
2187 When this attribute is omitted, the address of the data is
2188 the same as the address of the object.
2191 \textit{This location description will typically begin with
2192 \DWOPpushobjectaddress{}
2193 which loads the address of the
2194 object which can then serve as a descriptor in subsequent
2195 calculation. For an example using
2197 for a \addtoindex{Fortran 90 array}, see
2198 Appendix \refersec{app:fortranarrayexample}.}
2200 \subsection{Allocation and Association Status}
2201 \label{chap:allocationandassociationstatus}
2203 \textit{Some languages, such as \addtoindex{Fortran 90},
2204 provide types whose values
2205 may be dynamically allocated or associated with a variable
2206 under explicit program control.}
2208 \hypertarget{chap:DWATallocatedallocationstatusoftypes}{}
2212 \addtoindexx{allocated attribute}
2213 may optionally be used with any
2214 type for which objects of the type can be explicitly allocated
2215 and deallocated. The presence of the attribute indicates that
2216 objects of the type are allocatable and deallocatable. The
2217 integer value of the attribute (see below) specifies whether
2218 an object of the type is
2219 currently allocated or not.
2221 \hypertarget{chap:DWATassociatedassociationstatusoftypes}{}
2223 \DWATassociated{} attribute
2225 \addtoindexx{associated attribute}
2226 optionally be used with
2227 any type for which objects of the type can be dynamically
2228 associated with other objects. The presence of the attribute
2229 indicates that objects of the type can be associated. The
2230 integer value of the attribute (see below) indicates whether
2231 an object of the type is currently associated or not.
2233 \textit{While these attributes are defined specifically with
2234 \addtoindex{Fortran 90} ALLOCATABLE and POINTER types
2235 in mind, usage is not limited
2236 to just that language.}
2238 The value of these attributes is determined as described in
2239 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2241 A non\dash zero value is interpreted as allocated or associated,
2242 and zero is interpreted as not allocated or not associated.
2244 \textit{For \addtoindex{Fortran 90},
2245 if the \DWATassociated{}
2246 attribute is present,
2247 the type has the POINTER property where either the parent
2248 variable is never associated with a dynamic object or the
2249 implementation does not track whether the associated object
2250 is static or dynamic. If the \DWATallocated{} attribute is
2251 present and the \DWATassociated{} attribute is not, the type
2252 has the ALLOCATABLE property. If both attributes are present,
2253 then the type should be assumed to have the POINTER property
2254 (and not ALLOCATABLE); the \DWATallocated{} attribute may then
2255 be used to indicate that the association status of the object
2256 resulted from execution of an ALLOCATE statement rather than
2257 pointer assignment.}
2259 \textit{For examples using
2260 \DWATallocated{} for \addtoindex{Ada} and
2261 \addtoindex{Fortran 90}
2263 see Appendix \refersec{app:aggregateexamples}.}
2265 \subsection{Array Rank}
2266 \label{chap:DWATrank}
2267 \addtoindexx{array!assumed-rank}
2268 \addtoindexx{assumed-rank array|see{array, assumed-rank}}
2269 \textit{The Fortran language supports \doublequote{assumed-rank arrays}. The
2270 rank (the number of dimensions) of an assumed-rank array is unknown
2271 at compile time. The Fortran runtime stores the rank in the array
2272 descriptor metadata.}
2275 \hypertarget{chap:DWATrankofdynamicarray}{\DWATrankINDX}
2276 attribute indicates that an array's rank
2277 (dimensionality) is dynamic, and therefore unknown at compile
2278 time. The value of the \DWATrankINDX{} attribute is either an integer constant
2279 or a location expression whose evaluation yields the dynamic rank.
2281 The bounds of an array with dynamic rank are described using the
2282 \DWTAGgenericsubrangeTARG{} tag, which
2283 is the dynamic rank array equivalent of
2284 \DWTAGsubrangetype. The
2285 difference is that a \DWTAGgenericsubrangeINDX{} contains generic
2286 lower/upper bound and stride expressions that need to be evaluated for
2287 each dimension: Before any expression contained in a
2288 \DWTAGgenericsubrangeINDX{} can be evaluated, the dimension for which the
2289 expression should be evaluated needs to be pushed onto the stack. The
2290 expression will use it to find the offset of the respective field in
2291 the array descriptor metadata.
2293 \textit{The Fortran compiler is free to choose any layout for the
2294 array descriptor. In particular, the upper and lower bounds and
2295 stride values do not need to be bundled into a structure or record,
2296 but could be laid end to end in the containing descriptor, pointed
2297 to by the descriptor, or even allocated independently of the
2300 Dimensions are enumerated $0$ to $\mathit{rank}-1$ in a left-to-right
2303 \textit{For an example in Fortran 2008, see
2304 Section~\refersec{app:assumedrankexample}.}
2307 \section{Template Alias Entries}
2308 \label{chap:templatealiasentries}
2311 In addtoindex{C++}, a template alias is a form of typedef that has template
2312 parameters. DWARF does not represent the template alias definition
2313 but does represent instantiations of the alias.
2316 A type named using a template alias is represented
2317 by a debugging information entry
2318 \addtoindexx{template alias entry}
2320 \DWTAGtemplatealiasTARG.
2321 The template alias entry has a
2322 \DWATname{} attribute
2323 \addtoindexx{name attribute}
2324 whose value is a null\dash terminated string
2325 containing the name of the template alias as it appears in
2327 The template alias entry has child entries describing the template
2328 actual parameters (see Section \refersec{chap:templateparameters}).