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 (two-byte UTF-8) \\
151 \DWATEASCIITARG{} & \addtoindex{ASCII} character (one-byte) \\
152 \DWATEUCSTARG{} & \addtoindex{ISO 10646} character (four-byte) \\
157 \textit{The \DWATEdecimalfloat{} encoding is intended for
158 floating\dash point representations that have a power\dash of\dash ten
159 exponent, such as that specified in IEEE 754R.}
161 \textit{The \DWATEUTF{} encoding is intended for \addtoindex{Unicode}
162 string encodings (see the Universal Character Set standard,
163 ISO/IEC 10646\dash 1:1993). For example, the
164 \addtoindex{C++} type char16\_t is
165 represented by a base type entry with a name attribute whose
166 value is \doublequote{char16\_t}, an encoding attribute whose value
167 is \DWATEUTF{} and a byte size attribute whose value is 2.}
169 \textit{The \DWATEASCII{} and \DWATEUCS{} encodings are intended for
170 the {Fortran 2003} string kinds \texttt{ASCII} (ISO/IEC 646:1991) and
171 \texttt{ISO\_10646} (UCS-4 in ISO//IEC 10646:2000).}
174 \DWATEpackeddecimal{}
176 \DWATEnumericstring{}
178 represent packed and unpacked decimal string numeric data
179 types, respectively, either of which may be
181 \addtoindexx{decimal scale attribute}
183 \addtoindexx{decimal sign attribute}
185 \addtoindexx{digit count attribute}
187 \hypertarget{chap:DWATdecimalsigndecimalsignrepresentation}{}
189 \hypertarget{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}{}
190 base types are used in combination with
192 \DWATdigitcount{} and
197 A \DWATdecimalsign{} attribute
198 \addtoindexx{decimal sign attribute}
199 is an \livelink{chap:classconstant}{integer constant} that
200 conveys the representation of the sign of the decimal type
201 (see Table \refersec{tab:decimalsignattributevalues}).
202 Its \livelink{chap:classconstant}{integer constant} value is interpreted to
203 mean that the type has a leading overpunch, trailing overpunch,
204 leading separate or trailing separate sign representation or,
205 alternatively, no sign at all.
208 \caption{Decimal sign attribute values}
209 \label{tab:decimalsignattributevalues}
211 \begin{tabular}{l|p{9cm}}
215 \DWDSunsignedTARG{} & Unsigned \\
216 \DWDSleadingoverpunchTARG{} & Sign
217 is encoded in the most significant digit in a target\dash dependent manner \\
218 \DWDStrailingoverpunchTARG{} & Sign
219 is encoded in the least significant digit in a target\dash dependent manner \\
220 \DWDSleadingseparateTARG{}
221 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
222 to the left of the most significant digit. \\
223 \DWDStrailingseparateTARG{}
224 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
225 to the right of the least significant digit. \\
226 &Packed decimal type: Least significant nibble contains
227 a target\dash dependent value
228 indicating positive or negative. \\
233 \hypertarget{chap:DWATdecimalscaledecimalscalefactor}{}
234 The \DWATdecimalscale{}
236 \addtoindexx{decimal scale attribute}
237 is an integer constant value
238 that represents the exponent of the base ten scale factor to
239 be applied to an instance of the type. A scale of zero puts the
240 decimal point immediately to the right of the least significant
241 digit. Positive scale moves the decimal point to the right
242 and implies that additional zero digits on the right are not
243 stored in an instance of the type. Negative scale moves the
244 decimal point to the left; if the absolute value of the scale
245 is larger than the digit count, this implies additional zero
246 digits on the left are not stored in an instance of the type.
251 \addtoindexx{digit count attribute}
252 is an \livelink{chap:classconstant}{integer constant}
253 value that represents the number of digits in an instance of
258 \hypertarget{chap:DWATpicturestringpicturestringfornumericstringtype}{}
259 type is used to represent an edited
260 numeric or alphanumeric data type. It is used in combination
261 with a \DWATpicturestring{} attribute whose value is a
262 null\dash terminated string containing the target\dash dependent picture
263 string associated with the type.
265 If the edited base type entry describes an edited numeric
266 data type, the edited type entry has a \DWATdigitcount{} and a
267 \DWATdecimalscale{} attribute.
268 \addtoindexx{decimal scale attribute}
269 These attributes have the same
270 interpretation as described for the
271 \DWATEpackeddecimal{} and
272 \DWATEnumericstring{} base
273 types. If the edited type entry
274 describes an edited alphanumeric data type, the edited type
275 entry does not have these attributes.
278 \textit{The presence or absence of the \DWATdigitcount{} and
279 \DWATdecimalscale{} attributes
280 \addtoindexx{decimal scale attribute}
281 allows a debugger to easily
282 distinguish edited numeric from edited alphanumeric, although
283 in principle the digit count and scale are derivable by
284 interpreting the picture string.}
286 The \DWATEsignedfixed{} and \DWATEunsignedfixed{} entries
287 describe signed and unsigned fixed\dash point binary data types,
290 The fixed binary type entries have
291 \addtoindexx{digit count attribute}
294 attribute with the same interpretation as described for the
295 \DWATEpackeddecimal{} and \DWATEnumericstring{} base types.
298 For a data type with a decimal scale factor, the fixed binary
300 \DWATdecimalscale{} attribute
301 \addtoindexx{decimal scale attribute}
303 interpretation as described for the
304 \DWATEpackeddecimal{}
305 and \DWATEnumericstring{} base types.
307 \hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}{}
308 For a data type with a binary scale factor, the fixed
309 \addtoindexx{binary scale attribute}
310 binary type entry has a
311 \DWATbinaryscale{} attribute.
313 \DWATbinaryscale{} attribute
314 is an \livelink{chap:classconstant}{integer constant} value
315 that represents the exponent of the base two scale factor to
316 be applied to an instance of the type. Zero scale puts the
317 binary point immediately to the right of the least significant
318 bit. Positive scale moves the binary point to the right and
319 implies that additional zero bits on the right are not stored
320 in an instance of the type. Negative scale moves the binary
321 point to the left; if the absolute value of the scale is
322 larger than the number of bits, this implies additional zero
323 bits on the left are not stored in an instance of the type.
326 \hypertarget{chap:DWATsmallscalefactorforfixedpointtype}{}
327 a data type with a non\dash decimal and non\dash binary scale factor,
328 the fixed binary type entry has a
329 \DWATsmall{} attribute which
330 \addtoindexx{small attribute}
332 \DWTAGconstant{} entry. The scale factor value
333 is interpreted in accordance with the value defined by the
334 \DWTAGconstant{} entry. The value represented is the product
335 of the integer value in memory and the associated constant
338 \textit{The \DWATsmall{} attribute
339 is defined with the \addtoindex{Ada} \texttt{small}
342 \section{Unspecified Type Entries}
343 \label{chap:unspecifiedtypeentries}
344 \addtoindexx{unspecified type entry}
345 \addtoindexx{void type|see{unspecified type entry}}
346 Some languages have constructs in which a type
347 may be left unspecified or the absence of a type
348 may be explicitly indicated.
350 An unspecified (implicit, unknown, ambiguous or nonexistent)
351 type is represented by a debugging information entry with
352 the tag \DWTAGunspecifiedtypeTARG.
353 If a name has been given
354 to the type, then the corresponding unspecified type entry
355 has a \DWATname{} attribute
356 \addtoindexx{name attribute}
358 a null\dash terminated
359 string containing the name as it appears in the source program.
361 The interpretation of this debugging information entry is
362 intentionally left flexible to allow it to be interpreted
363 appropriately in different languages. For example, in
364 \addtoindex{C} and \addtoindex{C++}
365 the language implementation can provide an unspecified type
366 entry with the name \doublequote{void} which can be referenced by the
367 type attribute of pointer types and typedef declarations for
369 Sections \refersec{chap:typemodifierentries} and
370 %The following reference was valid, so the following is probably correct.
371 Section \refersec{chap:typedefentries},
372 respectively). As another
373 example, in \addtoindex{Ada} such an unspecified type entry can be referred
374 to by the type attribute of an access type where the denoted
375 \addtoindexx{incomplete type (Ada)}
376 type is incomplete (the name is declared as a type but the
377 definition is deferred to a separate compilation unit).
379 \addtoindex{C++} permits using the
380 \addtoindexi{\texttt{auto}}{\texttt{auto return type}} specifier for the return
381 type of a member function declaration.
382 The actual return type is deduced based on the definition of the
383 function, so it may not be known when the function is declared. The language
384 implementation can provide an unspecified type entry with the name \texttt{auto} which
385 can be referenced by the return type attribute of a function declaration entry.
386 When the function is later defined, the \DWTAGsubprogram{} entry for the definition
387 includes a reference to the actual return type.
390 \section{Type Modifier Entries}
391 \label{chap:typemodifierentries}
392 \addtoindexx{type modifier entry}
393 \addtoindexx{type modifier|see{atomic type entry}}
394 \addtoindexx{type modifier|see{constant type entry}}
395 \addtoindexx{type modifier|see{reference type entry}}
396 \addtoindexx{type modifier|see{restricted type entry}}
397 \addtoindexx{type modifier|see{packed type entry}}
398 \addtoindexx{type modifier|see{pointer type entry}}
399 \addtoindexx{type modifier|see{shared type entry}}
400 \addtoindexx{type modifier|see{volatile type entry}}
401 A base or user\dash defined type may be modified in different ways
402 in different languages. A type modifier is represented in
403 DWARF by a debugging information entry with one of the tags
404 given in Table \refersec{tab:typemodifiertags}.
406 If a name has been given to the modified type in the source
407 program, then the corresponding modified type entry has
408 a \DWATname{} attribute
409 \addtoindexx{name attribute}
410 whose value is a null\dash terminated
411 string containing the modified type name as it appears in
414 Each of the type modifier entries has
415 \addtoindexx{type attribute}
417 \DWATtype{} attribute,
418 whose value is a \livelink{chap:classreference}{reference}
419 to a debugging information entry
420 describing a base type, a user-defined type or another type
423 A modified type entry describing a
424 \addtoindexx{pointer type entry}
425 pointer or \addtoindex{reference type}
426 (using \DWTAGpointertype,
427 \DWTAGreferencetype{} or
428 \DWTAGrvaluereferencetype)
429 % Another instance of no-good-place-to-put-index entry.
431 \addtoindexx{address class!attribute}
433 \hypertarget{chap:DWATadressclasspointerorreferencetypes}{}
436 attribute to describe how objects having the given pointer
437 or reference type ought to be dereferenced.
439 A modified type entry describing a \addtoindex{UPC} shared qualified type
440 (using \DWTAGsharedtype) may have a
441 \DWATcount{} attribute
442 \addtoindexx{count attribute}
443 whose value is a constant expressing the (explicit or implied) blocksize specified for the
444 type in the source. If no count attribute is present, then the \doublequote{infinite}
445 blocksize is assumed.
447 When multiple type modifiers are chained together to modify
448 a base or user-defined type, the tree ordering reflects the
450 \addtoindexx{reference type entry, lvalue|see{reference type entry}}
452 \addtoindexx{reference type entry, rvalue|see{rvalue reference type entry}}
454 \addtoindexx{parameter|see{macro formal parameter list}}
456 \addtoindexx{parameter|see{\textit{this} parameter}}
458 \addtoindexx{parameter|see{variable parameter attribute}}
460 \addtoindexx{parameter|see{optional parameter attribute}}
462 \addtoindexx{parameter|see{unspecified parameters entry}}
464 \addtoindexx{parameter|see{template value parameter entry}}
466 \addtoindexx{parameter|see{template type parameter entry}}
468 \addtoindexx{parameter|see{formal parameter entry}}
472 \caption{Type modifier tags}
473 \label{tab:typemodifiertags}
475 \begin{tabular}{l|p{9cm}}
477 Name&Meaning\\ \hline
478 \DWTAGatomictypeTARG{} & C \addtoindex{\_Atomic} qualified type \\
479 \DWTAGconsttypeTARG{} & C or C++ const qualified type
480 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
481 \DWTAGpackedtypeTARG& \addtoindex{Pascal} or Ada packed type\addtoindexx{packed type entry}
482 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
483 \DWTAGpointertypeTARG{} & Pointer to an object of
484 the type being modified \addtoindexx{pointer qualified type entry} \\
485 \DWTAGreferencetypeTARG& \addtoindex{C++} (lvalue) reference
486 to an object of the type
487 \addtoindexx{reference type entry}
488 \mbox{being} modified
489 \addtoindexx{reference qualified type entry} \\
490 \DWTAGrestricttypeTARG& \addtoindex{C}
492 \addtoindexx{restricted type entry}
494 \addtoindexx{restrict qualified type} \\
495 \DWTAGrvaluereferencetypeTARG{} & \addtoindex{C++}
496 \addtoindexx{rvalue reference type entry}
498 \addtoindexx{restricted type entry}
499 reference to an object of the type \mbox{being} modified
500 \addtoindexx{rvalue reference qualified type entry} \\
501 \DWTAGsharedtypeTARG&\addtoindex{UPC} shared qualified type
502 \addtoindexx{shared qualified type entry} \\
503 \DWTAGvolatiletypeTARG&\addtoindex{C} or \addtoindex{C++} volatile qualified type
504 \addtoindexx{volatile qualified type entry} \\
510 \textit{As examples of how type modifiers are ordered, consider the following
511 \addtoindex{C} declarations:}
512 \begin{lstlisting}[numbers=none]
513 const unsigned char * volatile p;
515 \textit{which represents a volatile pointer to a constant
516 character. This is encoded in DWARF as:}
520 \DWTAGvariable(p) -->
521 \DWTAGvolatiletype -->
522 \DWTAGpointertype -->
524 \DWTAGbasetype(unsigned char)
529 \textit{On the other hand}
530 \begin{lstlisting}[numbers=none]
531 volatile unsigned char * const restrict p;
533 \textit{represents a restricted constant
534 pointer to a volatile character. This is encoded as:}
538 \DWTAGvariable(p) -->
539 \DWTAGrestricttype -->
541 \DWTAGpointertype -->
542 \DWTAGvolatiletype -->
543 \DWTAGbasetype(unsigned char)
547 \section{Typedef Entries}
548 \label{chap:typedefentries}
549 A named type that is defined in terms of another type
550 definition is represented by a debugging information entry with
551 \addtoindexx{typedef entry}
552 the tag \DWTAGtypedefTARG.
553 The typedef entry has a \DWATname{} attribute
554 \addtoindexx{name attribute}
555 whose value is a null\dash terminated string containing
556 the name of the typedef as it appears in the source program.
558 The typedef entry may also contain
559 \addtoindexx{type attribute}
561 \DWATtype{} attribute whose
562 value is a \livelink{chap:classreference}{reference}
563 to the type named by the typedef. If
564 the debugging information entry for a typedef represents
565 a declaration of the type that is not also a definition,
566 it does not contain a type attribute.
568 \textit{Depending on the language, a named type that is defined in
569 terms of another type may be called a type alias, a subtype,
570 a constrained type and other terms. A type name declared with
571 no defining details may be termed an
572 \addtoindexx{incomplete type}
573 incomplete, forward or hidden type.
574 While the DWARF \DWTAGtypedef{} entry was
575 originally inspired by the like named construct in
576 \addtoindex{C} and \addtoindex{C++},
577 it is broadly suitable for similar constructs (by whatever
578 source syntax) in other languages.}
580 \section{Array Type Entries}
581 \label{chap:arraytypeentries}
582 \label{chap:DWTAGgenericsubrange}
584 \textit{Many languages share the concept of an \doublequote{array,} which is
585 \addtoindexx{array type entry}
586 a table of components of identical type.}
588 An array type is represented by a debugging information entry
589 with the tag \DWTAGarraytypeTARG.
590 If a name has been given to
591 \addtoindexx{array!declaration of type}
592 the array type in the source program, then the corresponding
593 array type entry has a \DWATname{} attribute
594 \addtoindexx{name attribute}
596 null\dash terminated string containing the array type name as it
597 appears in the source program.
600 \hypertarget{chap:DWATorderingarrayrowcolumnordering}{}
601 array type entry describing a multidimensional array may
602 \addtoindexx{array!element ordering}
603 have a \DWATordering{} attribute whose
604 \livelink{chap:classconstant}{integer constant} value is
605 interpreted to mean either row-major or column-major ordering
606 of array elements. The set of values and their meanings
607 for the ordering attribute are listed in
608 Table \refersec{tab:arrayordering}.
610 ordering attribute is present, the default ordering for the
611 source language (which is indicated by the
614 \addtoindexx{language attribute}
615 of the enclosing compilation unit entry) is assumed.
617 \begin{simplenametable}[1.8in]{Array ordering}{tab:arrayordering}
618 \DWORDcolmajorTARG{} \\
619 \DWORDrowmajorTARG{} \\
620 \end{simplenametable}
622 The ordering attribute may optionally appear on one-dimensional
623 arrays; it will be ignored.
625 An array type entry has
626 \addtoindexx{type attribute}
627 a \DWATtype{} attribute
629 \addtoindexx{array!element type}
630 the type of each element of the array.
632 If the amount of storage allocated to hold each element of an
633 object of the given array type is different from the amount
634 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
635 of storage that is normally allocated to hold an individual
636 \hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}{}
638 \hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}{}
639 indicated element type, then the array type
640 \addtoindexx{bit stride attribute}
644 \addtoindexx{byte stride attribute}
647 \addtoindexx{bit stride attribute}
649 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
651 element of the array.
653 The array type entry may have either a \DWATbytesize{} or a
654 \DWATbitsize{} attribute
655 (see Section \refersec{chap:byteandbitsizes}),
657 amount of storage needed to hold an instance of the array type.
659 \textit{If the size of the array can be determined statically at
660 compile time, this value can usually be computed by multiplying
661 the number of array elements by the size of each element.}
664 Each array dimension is described by a debugging information
665 entry with either the
666 \addtoindexx{subrange type entry!as array dimension}
667 tag \DWTAGsubrangetype{} or the
668 \addtoindexx{enumeration type entry!as array dimension}
670 \DWTAGenumerationtype. These entries are
672 array type entry and are ordered to reflect the appearance of
673 the dimensions in the source program (that is, leftmost dimension
674 first, next to leftmost second, and so on).
676 \textit{In languages that have no concept of a
677 \doublequote{multidimensional array} (for example,
678 \addtoindex{C}), an array of arrays may
679 be represented by a debugging information entry for a
680 multidimensional array.}
682 Alternatively, for an array with dynamic rank the array dimensions
683 are described by a debugging information entry with the tag
684 \DWTAGgenericsubrangeTARG.
685 This entry has the same attributes as a
686 \DWTAGsubrangetype{} entry; however,
687 there is just one \DWTAGgenericsubrangeNAME{} entry and it describes all of the
688 dimensions of the array.
689 If \DWTAGgenericsubrangeNAME{}
690 is used, the number of dimensions must be specified using a
691 \DWATrank{} attribute. See also Section
692 \refersec{chap:DWATrank}.
696 Other attributes especially applicable to arrays are
698 \DWATassociated{} and
700 which are described in
701 Section \refersec{chap:dynamictypeproperties}.
702 For relevant examples, see also Appendix \refersec{app:fortranarrayexample}.
704 \section{Coarray Type Entries}
705 \label{chap:coarraytypeentries}
706 \addtoindexx{coarray}
707 \textit{In Fortran, a \doublequote{coarray} is an array whose
708 elements are located in different processes rather than in the
709 memory of one process. The individual elements
710 of a coarray can be scalars or arrays.
711 Similar to arrays, coarrays have \doublequote{codimensions} that are
712 indexed using a \doublequote{coindex} or multiple \doublequote{coindices}.
713 \addtoindexx{codimension|see{coarray}}
714 \addtoindexx{coindex|see{coarray}}
717 A coarray type is represented by a debugging information entry
718 with the tag \DWTAGcoarraytypeTARG.
719 If a name has been given to the
720 coarray type in the source, then the corresponding coarray type
721 entry has a \DWATname{} attribute whose value is a null-terminated
722 string containing the array type name as it appears in the source
725 A coarray entry has one or more \DWTAGsubrangetype{} child entries,
726 one for each codimension. It also has a \DWATtype{} attribute
727 describing the type of each element of the coarray.
729 \textit{In a coarray application, the run-time number of processes in the application
730 is part of the coindex calculation. It is represented in the Fortran source by
731 a coindex which is declared with a \doublequote{*} as the upper bound. To express this
732 concept in DWARF, the \DWTAGsubrangetype{} child entry for that index has
733 only a lower bound and no upper bound.}
735 \textit{How coarray elements are located and how coindices are
736 converted to process specifications is processor-dependent.}
739 \section{Structure, Union, Class and Interface Type Entries}
740 \label{chap:structureunionclassandinterfacetypeentries}
742 \textit{The languages
744 \addtoindex{C++}, and
745 \addtoindex{Pascal}, among others, allow the
746 programmer to define types that are collections of related
747 \addtoindexx{structure type entry}
749 In \addtoindex{C} and \addtoindex{C++}, these collections are called
750 \doublequote{structures.}
751 In \addtoindex{Pascal}, they are called \doublequote{records.}
752 The components may be of different types. The components are
753 called \doublequote{members} in \addtoindex{C} and
754 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
756 \textit{The components of these collections each exist in their
757 own space in computer memory. The components of a \addtoindex{C} or \addtoindex{C++}
758 \doublequote{union} all coexist in the same memory.}
760 \textit{\addtoindex{Pascal} and
761 other languages have a \doublequote{discriminated union,}
762 \addtoindexx{discriminated union|see {variant entry}}
763 also called a \doublequote{variant record.} Here, selection of a
764 number of alternative substructures (\doublequote{variants}) is based
765 on the value of a component that is not part of any of those
766 substructures (the \doublequote{discriminant}).}
768 \textit{\addtoindex{C++} and
769 \addtoindex{Java} have the notion of \doublequote{class,} which is in some
770 ways similar to a structure. A class may have \doublequote{member
771 functions} which are subroutines that are within the scope
772 of a class or structure.}
774 \textit{The \addtoindex{C++} notion of
775 structure is more general than in \addtoindex{C}, being
776 equivalent to a class with minor differences. Accordingly,
777 in the following discussion statements about
778 \addtoindex{C++} classes may
779 be understood to apply to \addtoindex{C++} structures as well.}
781 \subsection{Structure, Union and Class Type Entries}
782 \label{chap:structureunionandclasstypeentries}
785 Structure, union, and class types are represented by debugging
786 \addtoindexx{structure type entry}
788 \addtoindexx{union type entry}
790 \addtoindexx{class type entry}
792 \DWTAGstructuretypeTARG,
794 and \DWTAGclasstypeTARG,
795 respectively. If a name has been given to the structure,
796 union, or class in the source program, then the corresponding
797 structure type, union type, or class type entry has a
798 \DWATname{} attribute
799 \addtoindexx{name attribute}
800 whose value is a null\dash terminated string
801 containing the type name as it appears in the source program.
803 The members of a structure, union, or class are represented
804 by debugging information entries that are owned by the
805 corresponding structure type, union type, or class type entry
806 and appear in the same order as the corresponding declarations
807 in the source program.
809 A structure type, union type or class type entry may have
810 either a \DWATbytesize{} or a
811 \DWATbitsize{} attribute
812 \hypertarget{chap:DWATbitsizedatamemberbitsize}{}
813 (see Section \refersec{chap:byteandbitsizes}),
814 whose value is the amount of storage needed
815 to hold an instance of the structure, union or class type,
816 including any padding.
818 An incomplete structure, union or class type
819 \addtoindexx{incomplete structure/union/class}
821 \addtoindexx{incomplete type}
822 represented by a structure, union or class
823 entry that does not have a byte size attribute and that has
824 \addtoindexx{declaration attribute}
825 a \DWATdeclaration{} attribute.
827 If the complete declaration of a type has been placed in
828 \hypertarget{chap:DWATsignaturetypesignature}{}
829 a separate \addtoindex{type unit}
830 (see Section \refersec{chap:separatetypeunitentries}),
831 an incomplete declaration
832 \addtoindexx{incomplete type}
833 of that type in the compilation unit may provide
834 the unique 64\dash bit signature of the type using
835 \addtoindexx{type signature}
839 If a structure, union or class entry represents the definition
840 of a structure, union or class member corresponding to a prior
841 incomplete structure, union or class, the entry may have a
842 \DWATspecification{} attribute
843 \addtoindexx{specification attribute}
844 whose value is a \livelink{chap:classreference}{reference} to
845 the debugging information entry representing that incomplete
848 Structure, union and class entries containing the
849 \DWATspecification{} attribute
850 \addtoindexx{specification attribute}
851 do not need to duplicate
852 information provided by the declaration entry referenced by the
853 specification attribute. In particular, such entries do not
854 need to contain an attribute for the name of the structure,
855 union or class they represent if such information is already
856 provided in the declaration.
858 \textit{For \addtoindex{C} and \addtoindex{C++},
860 \addtoindexx{data member|see {member entry (data)}}
861 member declarations occurring within
862 the declaration of a structure, union or class type are
863 considered to be \doublequote{definitions} of those members, with
864 the exception of \doublequote{static} data members, whose definitions
865 appear outside of the declaration of the enclosing structure,
866 union or class type. Function member declarations appearing
867 within a structure, union or class type declaration are
868 definitions only if the body of the function also appears
869 within the type declaration.}
871 If the definition for a given member of the structure, union
872 or class does not appear within the body of the declaration,
873 that member also has a debugging information entry describing
874 its definition. That latter entry has a
875 \DWATspecification{} attribute
876 \addtoindexx{specification attribute}
877 referencing the debugging information entry
878 owned by the body of the structure, union or class entry and
879 representing a non\dash defining declaration of the data, function
880 or type member. The referenced entry will not have information
881 about the location of that member (low and high pc attributes
882 for function members, location descriptions for data members)
883 and will have a \DWATdeclaration{} attribute.
886 \textit{Consider a nested class whose
887 definition occurs outside of the containing class definition, as in:}
889 \begin{lstlisting}[numbers=none]
896 \textit{The two different structs can be described in
897 different compilation units to
898 facilitate DWARF space compression
899 (see Appendix \refersec{app:usingcompilationunits}).}
901 \subsection{Interface Type Entries}
902 \label{chap:interfacetypeentries}
904 \textit{The \addtoindex{Java} language defines \doublequote{interface} types.
906 \addtoindexx{interface type entry}
907 in \addtoindex{Java} is similar to a \addtoindex{C++} or
908 \addtoindex{Java} class with only abstract
909 methods and constant data members.}
912 \addtoindexx{interface type entry}
913 are represented by debugging information
915 tag \DWTAGinterfacetypeTARG.
917 An interface type entry has
918 a \DWATname{} attribute,
919 \addtoindexx{name attribute}
921 value is a null\dash terminated string containing the type name
922 as it appears in the source program.
924 The members of an interface are represented by debugging
925 information entries that are owned by the interface type
926 entry and that appear in the same order as the corresponding
927 declarations in the source program.
929 \subsection{Derived or Extended Structs, Classes and Interfaces}
930 \label{chap:derivedorextendedstructsclasesandinterfaces}
932 \textit{In \addtoindex{C++}, a class (or struct)
934 \addtoindexx{derived type (C++)|see{inheritance entry}}
935 be \doublequote{derived from} or be a
936 \doublequote{subclass of} another class.
937 In \addtoindex{Java}, an interface may \doublequote{extend}
938 \addtoindexx{extended type (Java)|see{inheritance entry}}
940 \addtoindexx{implementing type (Java)|see{inheritance entry}}
941 or more other interfaces, and a class may \doublequote{extend} another
942 class and/or \doublequote{implement} one or more interfaces. All of these
943 relationships may be described using the following. Note that
944 in \addtoindex{Java},
945 the distinction between extends and implements is
946 implied by the entities at the two ends of the relationship.}
948 A class type or interface type entry that describes a
949 derived, extended or implementing class or interface owns
950 \addtoindexx{implementing type (Java)|see{inheritance entry}}
951 debugging information entries describing each of the classes
952 or interfaces it is derived from, extending or implementing,
953 respectively, ordered as they were in the source program. Each
955 \addtoindexx{inheritance entry}
957 tag \DWTAGinheritanceTARG.
960 \addtoindexx{type attribute}
962 \addtoindexx{inheritance entry}
964 \DWATtype{} attribute whose value is
965 a reference to the debugging information entry describing the
966 class or interface from which the parent class or structure
967 of the inheritance entry is derived, extended or implementing.
970 \addtoindexx{inheritance entry}
971 for a class that derives from or extends
972 \hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}{}
973 another class or struct also has
974 \addtoindexx{data member location attribute}
976 \DWATdatamemberlocation{}
977 attribute, whose value describes the location of the beginning
978 of the inherited type relative to the beginning address of the
979 instance of the derived class. If that value is a constant, it is the offset
980 in bytes from the beginning of the class to the beginning of
981 the instance of the inherited type. Otherwise, the value must be a location
982 description. In this latter case, the beginning address of
983 the instance of the derived class is pushed on the expression stack before
984 the \addtoindex{location description}
985 is evaluated and the result of the
986 evaluation is the location of the instance of the inherited type.
988 \textit{The interpretation of the value of this attribute for
989 inherited types is the same as the interpretation for data
991 (see Section \referfol{chap:datamemberentries}). }
994 \addtoindexx{inheritance entry}
996 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}{}
998 \addtoindexx{accessibility attribute}
1000 \DWATaccessibility{}
1002 If no accessibility attribute
1003 is present, private access is assumed for an entry of a class
1004 and public access is assumed for an entry of an interface,
1008 \hypertarget{chap:DWATvirtualityvirtualityofbaseclass}{}
1009 the class referenced by the
1010 \addtoindexx{inheritance entry}
1011 inheritance entry serves
1012 as a \addtoindex{C++} virtual base class, the inheritance entry has a
1013 \DWATvirtuality{} attribute.
1015 \textit{For a \addtoindex{C++} virtual base, the
1016 \addtoindex{data member location attribute}
1017 will usually consist of a non-trivial
1018 \addtoindex{location description}.}
1020 \subsection{Access Declarations}
1021 \label{chap:accessdeclarations}
1023 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1024 \addtoindexx{access declaration entry}
1025 change the accessibility of individual class members from the
1026 overall accessibility specified by the inheritance declaration.
1027 A single access declaration may refer to a set of overloaded
1030 If a derived class or structure contains access declarations,
1031 each such declaration may be represented by a debugging
1032 information entry with the tag
1033 \DWTAGaccessdeclarationTARG.
1035 such entry is a child of the class or structure type entry.
1037 An access declaration entry has
1038 a \DWATname{} attribute,
1039 \addtoindexx{name attribute}
1041 value is a null\dash terminated string representing the name used
1042 in the declaration in the source program, including any class
1043 or structure qualifiers.
1045 An access declaration entry
1046 \hypertarget{chap:DWATaccessibilitycppbaseclasses}{}
1049 \DWATaccessibility{}
1050 attribute describing the declared accessibility of the named
1055 \subsection{Friends}
1056 \label{chap:friends}
1058 Each \doublequote{friend}
1059 \addtoindexx{friend entry}
1060 declared by a structure, union or class
1061 \hypertarget{chap:DWATfriendfriendrelationship}{}
1062 type may be represented by a debugging information entry
1063 that is a child of the structure, union or class type entry;
1064 the friend entry has the
1065 tag \DWTAGfriendTARG.
1068 \addtoindexx{friend attribute}
1069 a \DWATfriend{} attribute, whose value is
1070 a reference to the debugging information entry describing
1071 the declaration of the friend.
1074 \subsection{Data Member Entries}
1075 \label{chap:datamemberentries}
1077 A data member (as opposed to a member function) is
1078 represented by a debugging information entry with the
1079 tag \DWTAGmemberTARG.
1081 \addtoindexx{member entry (data)}
1082 member entry for a named member has
1083 a \DWATname{} attribute
1084 \addtoindexx{name attribute}
1085 whose value is a null\dash terminated
1086 string containing the member name as it appears in the source
1087 program. If the member entry describes an
1088 \addtoindex{anonymous union},
1089 the name attribute is omitted or the value of the attribute
1090 consists of a single zero byte.
1092 The data member entry has
1093 \addtoindexx{type attribute}
1095 \DWATtype{} attribute to denote
1096 \addtoindexx{member entry (data)}
1097 the type of that member.
1099 A data member entry may
1100 \addtoindexx{accessibility attribute}
1102 \DWATaccessibility{}
1103 attribute. If no accessibility attribute is present, private
1104 access is assumed for an entry of a class and public access
1105 is assumed for an entry of a structure, union, or interface.
1108 \hypertarget{chap:DWATmutablemutablepropertyofmemberdata}{}
1110 \addtoindexx{member entry (data)}
1112 \addtoindexx{mutable attribute}
1113 have a \DWATmutable{} attribute,
1114 which is a \livelink{chap:classflag}{flag}.
1115 This attribute indicates whether the data
1116 member was declared with the mutable storage class specifier.
1118 The beginning of a data member
1119 \addtoindexx{beginning of a data member}
1120 is described relative to
1121 \addtoindexx{beginning of an object}
1122 the beginning of the object in which it is immediately
1123 contained. In general, the beginning is characterized by
1124 both an address and a bit offset within the byte at that
1125 address. When the storage for an entity includes all of
1126 the bits in the beginning byte, the beginning bit offset is
1129 Bit offsets in DWARF use the bit numbering and direction
1130 conventions that are appropriate to the current language on
1134 \addtoindexx{member entry (data)}
1135 corresponding to a data member that is
1136 \hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}{}
1138 \hypertarget{chap:DWATdatamemberlocationdatamemberlocation}{}
1139 in a structure, union or class may have either
1140 \addtoindexx{data member location attribute}
1142 \DWATdatamemberlocation{} attribute or a
1143 \DWATdatabitoffset{}
1144 attribute. If the beginning of the data member is the same as
1145 the beginning of the containing entity then neither attribute
1149 For a \DWATdatamemberlocation{} attribute
1150 \addtoindexx{data member location attribute}
1151 there are two cases:
1152 \begin{enumerate}[1. ]
1153 \item If the value is an \livelink{chap:classconstant}{integer constant},
1155 in bytes from the beginning of the containing entity. If
1156 the beginning of the containing entity has a non-zero bit
1157 offset then the beginning of the member entry has that same
1160 \item Otherwise, the value must be a \addtoindex{location description}.
1162 this case, the beginning of the containing entity must be byte
1163 aligned. The beginning address is pushed on the DWARF stack
1164 before the \addtoindex{location} description is evaluated; the result of
1165 the evaluation is the base address of the member entry.
1167 \textit{The push on the DWARF expression stack of the base address of
1168 the containing construct is equivalent to execution of the
1169 \DWOPpushobjectaddress{} operation
1170 (see Section \refersec{chap:stackoperations});
1171 \DWOPpushobjectaddress{} therefore
1172 is not needed at the
1173 beginning of a \addtoindex{location description} for a data member.
1175 result of the evaluation is a location---either an address or
1176 the name of a register, not an offset to the member.}
1178 \textit{A \DWATdatamemberlocation{}
1180 \addtoindexx{data member location attribute}
1181 that has the form of a
1182 \addtoindex{location description} is not valid for a data member contained
1183 in an entity that is not byte aligned because DWARF operations
1184 do not allow for manipulating or computing bit offsets.}
1189 For a \DWATdatabitoffset{} attribute,
1190 the value is an \livelink{chap:classconstant}{integer constant}
1191 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1192 that specifies the number of bits
1193 from the beginning of the containing entity to the beginning
1194 of the data member. This value must be greater than or equal
1195 to zero, but is not limited to less than the number of bits
1198 If the size of a data member is not the same as the size
1199 of the type given for the data member, the data member has
1200 \addtoindexx{bit size attribute}
1201 either a \DWATbytesize{}
1202 or a \DWATbitsize{} attribute whose
1203 \livelink{chap:classconstant}{integer constant} value
1204 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1206 of storage needed to hold the value of the data member.
1208 \textit{Bit fields in \addtoindex{C} and \addtoindex{C++}
1210 \addtoindexx{bit fields}
1212 \addtoindexx{data bit offset}
1214 \addtoindexx{data bit size}
1216 \DWATdatabitoffset{} and
1217 \DWATbitsize{} attributes.}
1220 \textit{This Standard uses the following bit numbering and direction
1221 conventions in examples. These conventions are for illustrative
1222 purposes and other conventions may apply on particular
1225 \item \textit{For big\dash endian architectures, bit offsets are
1226 counted from high-order to low\dash order bits within a byte (or
1227 larger storage unit); in this case, the bit offset identifies
1228 the high\dash order bit of the object.}
1230 \item \textit{For little\dash endian architectures, bit offsets are
1231 counted from low\dash order to high\dash order bits within a byte (or
1232 larger storage unit); in this case, the bit offset identifies
1233 the low\dash order bit of the object.}
1237 \textit{In either case, the bit so identified is defined as the
1238 \addtoindexx{beginning of an object}
1239 beginning of the object.}
1242 \textit{For example, take one possible representation of the following
1243 \addtoindex{C} structure definition
1244 in both big\dash and little\dash endian byte orders:}
1255 \textit{Figures \referfol{fig:bigendiandatabitoffsets} and
1256 \refersec{fig:littleendiandatabitoffsets}
1257 show the structure layout
1258 and data bit offsets for example big\dash\ and little\dash endian
1259 architectures, respectively. Both diagrams show a structure
1260 that begins at address A and whose size is four bytes. Also,
1261 high order bits are to the left and low order bits are to
1273 Addresses increase ->
1274 | A | A + 1 | A + 2 | A + 3 |
1276 Data bit offsets increase ->
1277 +---------------+---------------+---------------+---------------+
1278 |0 4|5 10|11 15|16 23|24 31|
1279 | j | k | m | n | <pad> |
1281 +---------------------------------------------------------------+
1285 \caption{Big-endian data bit offsets}
1286 \label{fig:bigendiandatabitoffsets}
1297 <- Addresses increase
1298 | A + 3 | A + 2 | A + 1 | A |
1300 <- Data bit offsets increase
1301 +---------------+---------------+---------------+---------------+
1302 |31 24|23 16|15 11|10 5|4 0|
1303 | <pad> | n | m | k | j |
1305 +---------------------------------------------------------------+
1309 \caption{Little-endian data bit offsets}
1310 \label{fig:littleendiandatabitoffsets}
1314 \textit{Note that data member bit offsets in this example are the
1315 same for both big\dash\ and little\dash endian architectures even
1316 though the fields are allocated in different directions
1317 (high\dash order to low-order versus low\dash order to high\dash order);
1318 the bit naming conventions for memory and/or registers of
1319 the target architecture may or may not make this seem natural.}
1321 \textit{For a more extensive example showing nested and packed records
1323 Appendix \refersec{app:pascalexample}.}
1326 \textit{Attribute \DWATdatabitoffset{}
1328 \addtoindex{DWARF Version 4}, unchanged in \addtoindex{DWARF Version 5},
1329 and is also used for base types
1331 \refersec{chap:basetypeentries}).
1333 \livetarg{chap:DWATbitoffsetdatamemberbitlocation}{}
1334 attributes \DWATbitoffset{} and
1335 \DWATbytesize{} when used to
1336 identify the beginning of bit field data members as defined
1337 in DWARF V3 and earlier. The \DWATbytesize,
1340 attribute combination is deprecated for data members in DWARF
1341 Version 4 and later. See Section 5.6.6 in the DWARF Version 4
1342 specification for a discussion of compatibility considerations.}
1344 \subsection{Member Function Entries}
1345 \label{chap:memberfunctionentries}
1347 A member function is represented by a
1348 \addtoindexx{member function entry}
1349 debugging information entry
1351 \addtoindexx{subprogram entry!as member function}
1352 tag \DWTAGsubprogram.
1353 The member function entry
1354 may contain the same attributes and follows the same rules
1355 as non\dash member global subroutine entries
1356 (see Section \refersec{chap:subroutineandentrypointentries}).
1358 \textit{In particular, if the member function entry is an
1359 instantiation of a member function template, it follows the
1360 same rules as function template instantiations (see Section
1361 \refersec{chap:functiontemplateinstantiations}).
1365 \addtoindexx{accessibility attribute}
1366 member function entry may have a
1367 \DWATaccessibility{}
1368 attribute. If no accessibility attribute is present, private
1369 access is assumed for an entry of a class and public access
1370 is assumed for an entry of a structure, union or interface.
1373 \hypertarget{chap:DWATvirtualityvirtualityoffunction}{}
1374 the member function entry describes a virtual function,
1375 then that entry has a
1376 \DWATvirtuality{} attribute.
1379 \hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}{}
1380 the member function entry describes an explicit member
1381 function, then that entry has
1382 \addtoindexx{explicit attribute}
1384 \DWATexplicit{} attribute.
1387 \hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{}
1388 entry for a virtual function also has a
1389 \DWATvtableelemlocation{}
1390 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1391 a \addtoindex{location description}
1392 yielding the address of the slot
1393 for the function within the virtual function table for the
1394 enclosing class. The address of an object of the enclosing
1395 type is pushed onto the expression stack before the location
1396 description is evaluated.
1399 \hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{}
1400 the member function entry describes a non\dash static member
1401 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1402 function, then that entry
1403 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1405 \addtoindexx{object pointer attribute}
1406 a \DWATobjectpointer{}
1408 whose value is a \livelink{chap:classreference}{reference}
1409 to the formal parameter entry
1410 that corresponds to the object for which the function is
1411 called. The name attribute of that formal parameter is defined
1412 by the current language (for example,
1413 \texttt{this} for \addtoindex{C++} or \texttt{self}
1414 for \addtoindex{Objective C}
1415 and some other languages). That parameter
1416 also has a \DWATartificial{} attribute whose value is true.
1418 Conversely, if the member function entry describes a static
1419 member function, the entry does not have
1420 \addtoindexx{object pointer attribute}
1422 \DWATobjectpointer{}
1425 \textit{In \addtoindex{C++}, non-static member functions can have const-volatile
1426 qualifiers, which affect the type of the first formal parameter (the
1427 \doublequote{\texttt{this}}-pointer).}
1429 If the member function entry describes a non\dash static member
1430 function that has a const\dash volatile qualification, then
1431 the entry describes a non\dash static member function whose
1432 object formal parameter has a type that has an equivalent
1433 const\dash volatile qualification.
1435 \textit{In \addtoindex{C++11}, non-static member functions can also have one of the
1436 ref-qualifiers, \& and \&\&. They do not change the type of the
1437 \doublequote{\texttt{this}}-pointer, but they affect the types of object values the
1438 function can be invoked on.}
1440 The member function entry may have an \DWATreferenceNAME{} attribute
1441 \livetarg{chap:DWATreferenceofnonstaticmember}{}
1442 to indicate a non-static member function that can only be called on
1443 l-value objects, or the \DWATrvaluereferenceNAME{} attribute
1444 \livetarg{chap:DWATrvaluereferenceofnonstaticmember}{}
1445 to indicate that it can only be called on pr-values and x-values.
1447 If a subroutine entry represents the defining declaration
1448 of a member function and that definition appears outside of
1449 the body of the enclosing class declaration, the subroutine
1451 \DWATspecification{} attribute,
1452 \addtoindexx{specification attribute}
1454 a reference to the debugging information entry representing
1455 the declaration of this function member. The referenced entry
1456 will be a child of some class (or structure) type entry.
1458 Subroutine entries containing the
1459 \DWATspecification{} attribute
1460 \addtoindexx{specification attribute}
1461 do not need to duplicate information provided
1462 by the declaration entry referenced by the specification
1463 attribute. In particular, such entries do not need to contain
1464 a name attribute giving the name of the function member whose
1465 definition they represent.
1466 Similarly, such entries do not need to contain a return type attribute,
1467 unless the return type on the declaration was unspecified (for example, the
1468 declaration used the \addtoindex{C++} \addtoindex{\texttt{auto} return type} specifier).
1471 \subsection{Class Template Instantiations}
1472 \label{chap:classtemplateinstantiations}
1474 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1475 type that may be instantiated when an instance of the class
1476 is declared or defined. The generic description of the class may include
1477 parameterized types, parameterized compile-time constant
1478 values, and/or parameterized run-time constant addresses.
1479 DWARF does not represent the generic template
1480 definition, but does represent each instantiation.}
1482 A class template instantiation is represented by a
1483 debugging information entry with the tag \DWTAGclasstype,
1484 \DWTAGstructuretype{} or
1485 \DWTAGuniontype. With the following
1486 exceptions, such an entry will contain the same attributes
1487 and have the same types of child entries as would an entry
1488 for a class type defined explicitly using the instantiation
1489 types and values. The exceptions are:
1491 \begin{enumerate}[1. ]
1492 \item Template parameters are described and referenced as
1493 specified in Section \refersec{chap:templateparameters}.
1496 \item If the compiler has generated a special compilation unit to
1498 \addtoindexx{template instantiation!and special compilation unit}
1499 template instantiation and that special compilation
1500 unit has a different name from the compilation unit containing
1501 the template definition, the name attribute for the debugging
1502 information entry representing the special compilation unit
1503 should be empty or omitted.
1506 \item If the class type entry representing the template
1507 instantiation or any of its child entries contains declaration
1508 coordinate attributes, those attributes should refer to
1509 the source for the template definition, not to any source
1510 generated artificially by the compiler.
1514 \subsection{Variant Entries}
1515 \label{chap:variantentries}
1517 A variant part of a structure is represented by a debugging
1518 information entry\addtoindexx{variant part entry} with the
1519 tag \DWTAGvariantpartTARG{} and is
1520 owned by the corresponding structure type entry.
1522 If the variant part has a discriminant, the discriminant is
1523 \hypertarget{chap:DWATdiscrdiscriminantofvariantpart}{}
1525 \addtoindexx{discriminant (entry)}
1526 separate debugging information entry which
1527 is a child of the variant part entry. This entry has the form
1529 \addtoindexx{member entry (data)!as discriminant}
1530 structure data member entry. The variant part entry will
1531 \addtoindexx{discriminant attribute}
1533 \DWATdiscr{} attribute
1534 whose value is a \livelink{chap:classreference}{reference} to
1535 the member entry for the discriminant.
1537 If the variant part does not have a discriminant (tag field),
1538 the variant part entry has
1539 \addtoindexx{type attribute}
1541 \DWATtype{} attribute to represent
1544 Each variant of a particular variant part is represented by
1545 \hypertarget{chap:DWATdiscrvaluediscriminantvalue}{}
1546 a debugging information entry\addtoindexx{variant entry} with the
1547 tag \DWTAGvariantTARG{}
1548 and is a child of the variant part entry. The value that
1549 selects a given variant may be represented in one of three
1550 ways. The variant entry may have a
1551 \DWATdiscrvalue{} attribute
1552 whose value represents a single case label. The value of this
1553 attribute is encoded as an LEB128 number. The number is signed
1554 if the tag type for the variant part containing this variant
1555 is a signed type. The number is unsigned if the tag type is
1560 \hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}{}
1561 the variant entry may contain
1562 \addtoindexx{discriminant list attribute}
1565 attribute, whose value represents a list of discriminant
1566 values. This list is represented by any of the
1567 \livelink{chap:classblock}{block} forms and
1568 may contain a mixture of case labels and label ranges. Each
1569 item on the list is prefixed with a discriminant value
1570 descriptor that determines whether the list item represents
1571 a single label or a label range. A single case label is
1572 represented as an LEB128 number as defined above for
1573 \addtoindexx{discriminant value attribute}
1576 attribute. A label range is represented by
1577 two LEB128 numbers, the low value of the range followed by the
1578 high value. Both values follow the rules for signedness just
1579 described. The discriminant value descriptor is an integer
1580 constant that may have one of the values given in
1581 Table \refersec{tab:discriminantdescriptorvalues}.
1583 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1584 \DWDSClabelTARG{} \\
1585 \DWDSCrangeTARG{} \\
1586 \end{simplenametable}
1588 If a variant entry has neither a \DWATdiscrvalue{}
1589 attribute nor a \DWATdiscrlist{} attribute, or if it has
1590 a \DWATdiscrlist{} attribute with 0 size, the variant is a
1593 The components selected by a particular variant are represented
1594 by debugging information entries owned by the corresponding
1595 variant entry and appear in the same order as the corresponding
1596 declarations in the source program.
1599 \section{Condition Entries}
1600 \label{chap:conditionentries}
1602 \textit{COBOL has the notion of
1603 \addtoindexx{level-88 condition, COBOL}
1604 a \doublequote{level\dash 88 condition} that
1605 associates a data item, called the conditional variable, with
1606 a set of one or more constant values and/or value ranges.
1607 % Note: the {} after \textquoteright (twice) is necessary to assure a following space separator
1608 Semantically, the condition is \textquoteleft true\textquoteright{}
1610 variable's value matches any of the described constants,
1611 and the condition is \textquoteleft false\textquoteright{} otherwise.}
1613 The \DWTAGconditionTARG{}
1614 debugging information entry\addtoindexx{condition entry}
1616 logical condition that tests whether a given data item\textquoteright s
1617 value matches one of a set of constant values. If a name
1618 has been given to the condition, the condition entry has a
1619 \DWATname{} attribute
1620 \addtoindexx{name attribute}
1621 whose value is a null\dash terminated string
1622 giving the condition name as it appears in the source program.
1624 The condition entry's parent entry describes the conditional
1625 variable; normally this will be a \DWTAGvariable,
1627 \DWTAGformalparameter{} entry.
1629 \addtoindexx{formal parameter entry}
1631 entry has an array type, the condition can test any individual
1632 element, but not the array as a whole. The condition entry
1633 implicitly specifies a \doublequote{comparison type} that is the
1634 type of an array element if the parent has an array type;
1635 otherwise it is the type of the parent entry.
1638 The condition entry owns \DWTAGconstant{} and/or
1639 \DWTAGsubrangetype{} entries that describe the constant
1640 values associated with the condition. If any child entry
1641 \addtoindexx{type attribute}
1643 a \DWATtype{} attribute,
1644 that attribute should describe a type
1645 compatible with the comparison type (according to the source
1646 language); otherwise the child\textquoteright s type is the same as the
1649 \textit{For conditional variables with alphanumeric types, COBOL
1650 permits a source program to provide ranges of alphanumeric
1651 constants in the condition. Normally a subrange type entry
1652 does not describe ranges of strings; however, this can be
1653 represented using bounds attributes that are references to
1654 constant entries describing strings. A subrange type entry may
1655 refer to constant entries that are siblings of the subrange
1659 \section{Enumeration Type Entries}
1660 \label{chap:enumerationtypeentries}
1662 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1663 a fixed number of symbolic values.}
1665 An enumeration type is represented by a debugging information
1667 \DWTAGenumerationtypeTARG.
1669 If a name has been given to the enumeration type in the source
1670 program, then the corresponding enumeration type entry has
1671 a \DWATname{} attribute
1672 \addtoindexx{name attribute}
1673 whose value is a null\dash terminated
1674 string containing the enumeration type name as it appears
1675 in the source program.
1677 The \addtoindex{enumeration type entry}
1679 \addtoindexx{type attribute}
1680 a \DWATtype{} attribute
1681 which refers to the underlying data type used to implement
1682 the enumeration. The entry also may have a
1683 \DWATbytesize{} attribute whose
1684 \livelink{chap:classconstant}{integer constant} value is the number of bytes
1685 required to hold an instance of the enumeration. If no \DWATbytesize{} attribute
1686 is present, the size for holding an instance of the enumeration is given by the size
1687 of the underlying data type.
1690 If an enumeration type has type safe
1691 \addtoindexx{type safe enumeration types}
1694 \begin{enumerate}[1. ]
1695 \item Enumerators are contained in the scope of the enumeration type, and/or
1697 \item Enumerators are not implicitly converted to another type
1700 then the \addtoindex{enumeration type entry} may
1701 \addtoindexx{enum class|see{type-safe enumeration}}
1702 have a \DWATenumclass{}
1703 attribute, which is a \livelink{chap:classflag}{flag}.
1704 In a language that offers only
1705 one kind of enumeration declaration, this attribute is not
1708 \textit{In \addtoindex{C} or \addtoindex{C++},
1709 the underlying type will be the appropriate
1710 integral type determined by the compiler from the properties of
1711 \hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}{}
1712 the enumeration literal values.
1713 A \addtoindex{C++} type declaration written
1714 using enum class declares a strongly typed enumeration and
1715 is represented using \DWTAGenumerationtype{}
1716 in combination with \DWATenumclass.}
1718 Each enumeration literal is represented by a debugging
1719 \addtoindexx{enumeration literal|see{enumeration entry}}
1720 information entry with the
1721 tag \DWTAGenumeratorTARG.
1723 such entry is a child of the
1724 \addtoindex{enumeration type entry}, and the
1725 enumerator entries appear in the same order as the declarations
1726 of the enumeration literals in the source program.
1728 Each \addtoindex{enumerator entry} has a
1729 \DWATname{} attribute, whose
1730 \addtoindexx{name attribute}
1731 value is a null\dash terminated string containing the name of the
1732 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}{}
1733 enumeration literal as it appears in the source program.
1734 Each enumerator entry also has a
1735 \DWATconstvalue{} attribute,
1736 whose value is the actual numeric value of the enumerator as
1737 represented on the target system.
1740 If the enumeration type occurs as the description of a
1741 \addtoindexx{enumeration type endry!as array dimension}
1742 dimension of an array type, and the stride for that dimension
1743 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}{}
1744 is different than what would otherwise be determined, then
1745 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}{}
1746 the enumeration type entry has either a
1748 or \DWATbitstride{} attribute
1749 \addtoindexx{bit stride attribute}
1750 which specifies the separation
1751 between successive elements along the dimension as described
1753 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1755 \DWATbitstride{} attribute
1756 \addtoindexx{bit stride attribute}
1757 is interpreted as bits and the value of
1758 \addtoindexx{byte stride attribute}
1761 attribute is interpreted as bytes.
1764 \section{Subroutine Type Entries}
1765 \label{chap:subroutinetypeentries}
1767 \textit{It is possible in \addtoindex{C}
1768 to declare pointers to subroutines
1769 that return a value of a specific type. In both
1770 \addtoindex{C} and \addtoindex{C++},
1771 it is possible to declare pointers to subroutines that not
1772 only return a value of a specific type, but accept only
1773 arguments of specific types. The type of such pointers would
1774 be described with a \doublequote{pointer to} modifier applied to a
1775 user\dash defined type.}
1778 A subroutine type is represented by a debugging information
1780 \addtoindexx{subroutine type entry}
1781 tag \DWTAGsubroutinetypeTARG.
1783 been given to the subroutine type in the source program,
1784 then the corresponding subroutine type entry has
1785 a \DWATname{} attribute
1786 \addtoindexx{name attribute}
1787 whose value is a null\dash terminated string containing
1788 the subroutine type name as it appears in the source program.
1790 If the subroutine type describes a function that returns
1791 a value, then the subroutine type entry has
1792 \addtoindexx{type attribute}
1794 attribute to denote the type returned by the subroutine. If
1795 the types of the arguments are necessary to describe the
1796 subroutine type, then the corresponding subroutine type
1797 entry owns debugging information entries that describe the
1798 arguments. These debugging information entries appear in the
1799 order that the corresponding argument types appear in the
1802 \textit{In \addtoindex{C} there
1803 is a difference between the types of functions
1804 declared using function prototype style declarations and
1805 those declared using non\dash prototype declarations.}
1808 \hypertarget{chap:DWATprototypedsubroutineprototype}{}
1809 subroutine entry declared with a function prototype style
1810 declaration may have
1811 \addtoindexx{prototyped attribute}
1813 \DWATprototyped{} attribute, which is
1814 a \livelink{chap:classflag}{flag}.
1816 Each debugging information entry owned by a subroutine
1817 type entry corresponds to either a formal parameter or the sequence of
1818 unspecified parameters of the subprogram type:
1820 \begin{enumerate}[1. ]
1821 \item A formal parameter of a parameter list (that has a
1822 specific type) is represented by a debugging information entry
1823 with the tag \DWTAGformalparameter.
1824 Each formal parameter
1826 \addtoindexx{type attribute}
1827 a \DWATtype{} attribute that refers to the type of
1828 the formal parameter.
1830 \item The unspecified parameters of a variable parameter list
1831 \addtoindexx{unspecified parameters entry}
1833 \addtoindexx{\texttt{...} parameters|see{unspecified parameters entry}}
1834 represented by a debugging information entry with the
1835 tag \DWTAGunspecifiedparameters.
1838 \textit{\addtoindex{C++} const-volatile qualifiers are encoded as
1839 part of the type of the
1840 \doublequote{\texttt{this}}-pointer.
1841 \addtoindex{C++11} reference and rvalue-reference qualifiers are encoded using
1842 the \DWATreference{} and \DWATrvaluereference{} attributes, respectively.
1843 See also Section \refersec{chap:memberfunctionentries}.}
1845 A subroutine type entry may have the \DWATreference{} or
1846 \DWATrvaluereference{} attribute to indicate that it describes the
1847 type of a member function with reference or rvalue-reference
1848 semantics, respectively.
1851 \section{String Type Entries}
1852 \label{chap:stringtypeentries}
1854 \textit{A \doublequote{string} is a sequence of characters that have specific
1855 \addtoindexx{string type entry}
1856 semantics and operations that distinguish them from arrays of
1858 \addtoindex{Fortran} is one of the languages that has a string
1859 type. Note that \doublequote{string} in this context refers to a target
1860 machine concept, not the class string as used in this document
1861 (except for the name attribute).}
1863 A string type is represented by a debugging information entry
1864 with the tag \DWTAGstringtypeTARG.
1865 If a name has been given to
1866 the string type in the source program, then the corresponding
1867 string type entry has a
1868 \DWATname{} attribute
1869 \addtoindexx{name attribute}
1871 a null\dash terminated string containing the string type name as
1872 it appears in the source program.
1875 \addtoindex{Fortran 2003} language standard allows string
1876 types that are composed of different types of (same sized) characters.
1877 While there is no standard list of character kinds, the kinds
1878 \addttindex{ASCII} (see \DWATEASCII), \addttindex{ISO\_10646}
1879 (see \DWATEUCS) and \texttt{DEFAULT} are defined.}
1881 A string type entry may have a \DWATtype{}
1882 \livetargi{char:DWAATtypeofstringtype}{attribute}{type attribute!of string type entry}
1883 describing how each character is encoded and is to be interpreted.
1884 The value of this attribute is a \CLASSreference to a
1885 \DWTAGbasetype{} base type entry. If the attribute is absent,
1886 then the character is encoded using the system default.
1889 The string type entry may have a
1890 \DWATbytesize{} attribute or
1892 attribute, whose value
1893 (see Section \refersec{chap:byteandbitsizes})
1895 storage needed to hold a value of the string type.
1898 \hypertarget{chap:DWATstringlengthstringlengthofstringtype}{}
1899 string type entry may also have a
1900 \DWATstringlength{} attribute
1902 \addtoindexx{string length attribute}
1904 \addtoindex{location description} yielding the location
1905 where the length of the string is stored in the program.
1906 If the \DWATstringlength{} attribute is not present, the size
1907 of the string is assumed to be the amount of storage that is
1908 allocated for the string (as specified by the \DWATbytesize{}
1909 or \DWATbitsize{} attribute).
1911 The string type entry may also have a
1912 \DWATstringlengthbytesizeNAME{}
1914 \DWATstringlengthbitsizeNAME{} attribute,
1915 \addtoindexx{string length attribute!size of length data}
1916 whose value (see Section \refersec{chap:byteandbitsizes})
1917 is the size of the data to be retrieved from the location
1918 referenced by the string length attribute. If no (byte or bit)
1919 size attribute is present, the size of the data to be retrieved
1921 \addtoindex{size of an address} on the target machine.
1923 \addtoindexx{DWARF Version 5} % Avoid italics
1924 \textit{Prior to DWARF Version 5, the meaning of a
1925 \DWATbytesize{} attribute depends on the presence of the
1926 \DWATstringlength{} attribute:
1928 \item If \DWATstringlength{} is present, \DWATbytesize{}
1929 specifies the size of the length data to be retrieved
1930 from the location specified by the \DWATstringlength{} attribute.
1931 \item If \DWATstringlength{} is not present, \DWATbytesize{}
1932 specifies the amount of storage allocated for objects
1935 In DWARF Version 5, \DWATbytesize{} always specifies the amount of storage
1936 allocated for objects of the string type.}
1939 \section{Set Type Entries}
1940 \label{chap:settypeentries}
1942 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1943 a group of values of ordinal type.}
1945 A set is represented by a debugging information entry with
1946 the tag \DWTAGsettypeTARG.
1947 \addtoindexx{set type entry}
1948 If a name has been given to the
1949 set type, then the set type entry has
1950 a \DWATname{} attribute
1951 \addtoindexx{name attribute}
1952 whose value is a null\dash terminated string containing the
1953 set type name as it appears in the source program.
1955 The set type entry has
1956 \addtoindexx{type attribute}
1957 a \DWATtype{} attribute to denote the
1958 type of an element of the set.
1961 If the amount of storage allocated to hold each element of an
1962 object of the given set type is different from the amount of
1963 storage that is normally allocated to hold an individual object
1964 of the indicated element type, then the set type entry has
1965 either a \DWATbytesize{} attribute, or
1966 \DWATbitsize{} attribute
1967 whose value (see Section \refersec{chap:byteandbitsizes}) is
1968 the amount of storage needed to hold a value of the set type.
1971 \section{Subrange Type Entries}
1972 \label{chap:subrangetypeentries}
1974 \textit{Several languages support the concept of a \doublequote{subrange}
1975 type object. These objects can represent a subset of the
1976 values that an object of the basis type for the subrange can
1978 Subrange type entries may also be used to represent
1979 the bounds of array dimensions.}
1981 A subrange type is represented by a debugging information
1983 \addtoindexx{subrange type entry}
1984 tag \DWTAGsubrangetypeTARG.
1986 given to the subrange type, then the subrange type entry
1987 has a \DWATname{} attribute
1988 \addtoindexx{name attribute}
1989 whose value is a null\dash terminated
1990 string containing the subrange type name as it appears in
1993 The tag \DWTAGgenericsubrange{} is
1994 used to describe arrays with a dynamic rank. See Section
1995 \refersec{chap:DWTAGgenericsubrange}.
1997 The subrange entry may have
1998 \addtoindexx{type attribute}
1999 a \DWATtype{} attribute to describe
2000 the type of object, called the basis type, of whose values
2001 this subrange is a subset.
2003 If the amount of storage allocated to hold each element of an
2004 object of the given subrange type is different from the amount
2005 of storage that is normally allocated to hold an individual
2006 object of the indicated element type, then the subrange
2008 \DWATbytesize{} attribute or
2010 attribute, whose value
2011 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2013 storage needed to hold a value of the subrange type.
2016 \hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{}
2017 subrange entry may have
2018 \addtoindexx{threads scaled attribute}
2020 \DWATthreadsscaled{} attribute,
2021 which is a \livelink{chap:classflag}{flag}.
2022 If present, this attribute indicates whether
2023 this subrange represents a \addtoindex{UPC} array bound which is scaled
2024 by the runtime THREADS value (the number of \addtoindex{UPC} threads in
2025 this execution of the program).
2027 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
2029 \begin{lstlisting}[numbers=none]
2030 int shared foo[34*THREADS][10][20];
2034 \hypertarget{chap:DWATlowerboundlowerboundofsubrange}{}
2036 \hypertarget{chap:DWATupperboundupperboundofsubrange}{}
2037 entry may have the attributes
2039 \addtoindexx{lower bound attribute}
2040 and \DWATupperbound{}
2041 \addtoindexx{upper bound attribute} to specify, respectively, the lower
2042 and upper bound values of the subrange. The
2045 \hypertarget{chap:DWATcountelementsofsubrangetype}{}
2047 % FIXME: The following matches DWARF4: odd as there is no default count.
2048 \addtoindexx{count attribute!default}
2050 \addtoindexx{count attribute}
2052 \DWATcount{} attribute,
2054 value describes the number of elements in the subrange rather
2055 than the value of the last element. The value of each of
2056 these attributes is determined as described in
2057 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2059 If the lower bound value is missing, the value is assumed to
2060 be a language\dash dependent default constant as defined in
2061 Table \refersec{tab:languageencodings}.
2062 \addtoindexx{lower bound attribute!default}
2064 If the upper bound and count are missing, then the upper bound value is
2065 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
2067 If the subrange entry has no type attribute describing the
2068 basis type, the basis type is determined as follows:
2069 \begin{enumerate}[1. ]
2071 If there is a lower bound attribute that references an object,
2072 the basis type is assumed to be the same as the type of that object.
2074 Otherwise, if there is an upper bound or count attribute that references
2075 an object, the basis type is assumed to be the same as the type of that object.
2077 Otherwise, the type is
2078 assumed to be the same type, in the source language of the
2079 compilation unit containing the subrange entry, as a signed
2080 integer with the same size as an address on the target machine.
2083 If the subrange type occurs as the description of a dimension
2084 of an array type, and the stride for that dimension is
2085 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}{}
2086 different than what would otherwise be determined, then
2087 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}{}
2088 the subrange type entry has either
2089 \addtoindexx{byte stride attribute}
2091 \DWATbytestride{} or
2092 \DWATbitstride{} attribute
2093 \addtoindexx{bit stride attribute}
2094 which specifies the separation
2095 between successive elements along the dimension as described
2097 Section \refersec{chap:byteandbitsizes}.
2099 \textit{Note that the stride can be negative.}
2102 \section{Pointer to Member Type Entries}
2103 \label{chap:pointertomembertypeentries}
2105 \textit{In \addtoindex{C++}, a
2106 pointer to a data or function member of a class or
2107 structure is a unique type.}
2109 A debugging information entry representing the type of an
2110 object that is a pointer to a structure or class member has
2111 the tag \DWTAGptrtomembertypeTARG.
2113 If the \addtoindex{pointer to member type} has a name, the
2114 \addtoindexx{pointer to member type entry}
2115 pointer to member entry has a
2116 \DWATname{} attribute,
2117 \addtoindexx{name attribute}
2119 null\dash terminated string containing the type name as it appears
2120 in the source program.
2122 The \addtoindex{pointer to member} entry
2124 \addtoindexx{type attribute}
2125 a \DWATtype{} attribute to
2126 describe the type of the class or structure member to which
2127 objects of this type may point.
2129 The \addtoindexx{pointer to member} entry also
2130 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{}
2132 \DWATcontainingtype{}
2133 attribute, whose value is a \livelink{chap:classreference}{reference} to a debugging
2134 information entry for the class or structure to whose members
2135 objects of this type may point.
2137 The \addtoindex{pointer to member entry}
2138 \hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}{}
2140 \DWATuselocation{} attribute
2141 \addtoindexx{use location attribute}
2143 \addtoindex{location description} that computes the
2144 address of the member of the class to which the pointer to
2145 member entry points.
2147 \textit{The method used to find the address of a given member of a
2148 class or structure is common to any instance of that class
2149 or structure and to any instance of the pointer or member
2150 type. The method is thus associated with the type entry,
2151 rather than with each instance of the type.}
2153 The \DWATuselocation{} description is used in conjunction
2154 with the location descriptions for a particular object of the
2155 given \addtoindex{pointer to member type} and for a particular structure or
2156 class instance. The \DWATuselocation{}
2157 attribute expects two values to be
2158 \addtoindexi{pushed}{address!implicit push for member operator}
2159 onto the DWARF expression stack before
2160 the \DWATuselocation{} description is evaluated.
2162 \addtoindexi{pushed}{address!implicit push for member operator}
2163 is the value of the \addtoindex{pointer to member} object
2164 itself. The second value
2165 \addtoindexi{pushed}{address!implicit push for member operator}
2166 is the base address of the
2167 entire structure or union instance containing the member
2168 whose address is being calculated.
2171 \textit{For an expression such as}
2173 \begin{lstlisting}[numbers=none]
2176 \textit{where \texttt{mbr\_ptr} has some \addtoindex{pointer to member type}, a debugger should:}
2177 \begin{enumerate}[1. ]
2178 \item \textit{Push the value of \texttt{mbr\_ptr} onto the DWARF expression stack.}
2179 \item \textit{Push the base address of \texttt{object} onto the DWARF expression stack.}
2180 \item \textit{Evaluate the \DWATuselocation{} description
2181 given in the type of \texttt{mbr\_ptr}.}
2185 \section{File Type Entries}
2186 \label{chap:filetypeentries}
2188 \textit{Some languages, such as \addtoindex{Pascal},
2189 provide a data type to represent
2192 A file type is represented by a debugging information entry
2194 \addtoindexx{file type entry}
2197 If the file type has a name,
2198 the file type entry has a \DWATname{} attribute,
2199 \addtoindexx{name attribute}
2201 is a null\dash terminated string containing the type name as it
2202 appears in the source program.
2204 The file type entry has
2205 \addtoindexx{type attribute}
2206 a \DWATtype{} attribute describing
2207 the type of the objects contained in the file.
2209 The file type entry also
2210 \addtoindexx{byte size}
2212 \addtoindexx{bit size}
2215 \DWATbitsize{} attribute, whose value
2216 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2217 is the amount of storage need to hold a value of the file type.
2219 \section{Dynamic Type Entries and Properties}
2221 \subsection{Dynamic Type Entries}
2222 \textit{Some languages such as
2223 \addtoindex{Fortran 90}, provide types whose values
2224 may be dynamically allocated or associated with a variable
2225 under explicit program control. However, unlike the related
2226 pointer type in \addtoindex{C} or
2227 \addtoindex{C++}, the indirection involved in accessing
2228 the value of the variable is generally implicit, that is, not
2229 indicated as part of program source.}
2231 A dynamic type entry is used to declare a dynamic type that is
2232 \doublequote{just like} another non-dynamic type without needing to
2233 replicate the full description of that other type.
2235 A dynamic type is represented by a debugging information entry
2236 with the tag \DWTAGdynamictypeTARG. If a name has been given to the
2237 dynamic type, then the dynamic type has a \DWATname{} attribute
2238 whose value is a null-terminated string containing the dynamic
2239 type name as it appears in the source.
2241 A dynamic type entry has a \DWATtype{} attribute whose value is a
2242 reference to the type of the entities that are dynamically allocated.
2244 A dynamic type entry also has a \DWATdatalocation, and may also
2245 have \DWATallocated{} and/or \DWATassociated{} attributes as
2246 described in Section \referfol{chap:dynamictypeproperties}. The type referenced by the
2247 \DWATtype{} attribute must not have any of these attributes.
2249 \subsection{Dynamic Type Properties}
2250 \label{chap:dynamictypeproperties}
2252 The \DWATdatalocation, \DWATallocated{} and \DWATassociated{}
2253 attributes described in this section can be used for any type, not
2254 just dynamic types.}
2257 \subsubsection{Data Location}
2258 \label{chap:datalocation}
2260 \textit{Some languages may represent objects using descriptors to hold
2261 information, including a location and/or run\dash time parameters,
2262 about the data that represents the value for that object.}
2264 \hypertarget{chap:DWATdatalocationindirectiontoactualdata}{}
2265 The \DWATdatalocation{}
2266 attribute may be used with any
2267 \addtoindexx{data location attribute}
2268 type that provides one or more levels of
2269 \addtoindexx{hidden indirection|see{data location attribute}}
2271 and/or run\dash time parameters in its representation. Its value
2272 is a \addtoindex{location description}.
2273 The result of evaluating this
2274 description yields the location of the data for an object.
2275 When this attribute is omitted, the address of the data is
2276 the same as the address of the object.
2279 \textit{This location description will typically begin with
2280 \DWOPpushobjectaddress{}
2281 which loads the address of the
2282 object which can then serve as a descriptor in subsequent
2283 calculation. For an example using
2285 for a \addtoindex{Fortran 90 array}, see
2286 Appendix \refersec{app:fortranarrayexample}.}
2288 \subsubsection{Allocation and Association Status}
2289 \label{chap:allocationandassociationstatus}
2291 \textit{Some languages, such as \addtoindex{Fortran 90},
2292 provide types whose values
2293 may be dynamically allocated or associated with a variable
2294 under explicit program control.}
2296 \hypertarget{chap:DWATallocatedallocationstatusoftypes}{}
2300 \addtoindexx{allocated attribute}
2301 may optionally be used with any
2302 type for which objects of the type can be explicitly allocated
2303 and deallocated. The presence of the attribute indicates that
2304 objects of the type are allocatable and deallocatable. The
2305 integer value of the attribute (see below) specifies whether
2306 an object of the type is
2307 currently allocated or not.
2309 \hypertarget{chap:DWATassociatedassociationstatusoftypes}{}
2311 \DWATassociated{} attribute
2313 \addtoindexx{associated attribute}
2314 optionally be used with
2315 any type for which objects of the type can be dynamically
2316 associated with other objects. The presence of the attribute
2317 indicates that objects of the type can be associated. The
2318 integer value of the attribute (see below) indicates whether
2319 an object of the type is currently associated or not.
2321 \textit{While these attributes are defined specifically with
2322 \addtoindex{Fortran 90} ALLOCATABLE and POINTER types
2323 in mind, usage is not limited
2324 to just that language.}
2326 The value of these attributes is determined as described in
2327 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2329 A non\dash zero value is interpreted as allocated or associated,
2330 and zero is interpreted as not allocated or not associated.
2332 \textit{For \addtoindex{Fortran 90},
2333 if the \DWATassociated{}
2334 attribute is present,
2335 the type has the POINTER property where either the parent
2336 variable is never associated with a dynamic object or the
2337 implementation does not track whether the associated object
2338 is static or dynamic. If the \DWATallocated{} attribute is
2339 present and the \DWATassociated{} attribute is not, the type
2340 has the ALLOCATABLE property. If both attributes are present,
2341 then the type should be assumed to have the POINTER property
2342 (and not ALLOCATABLE); the \DWATallocated{} attribute may then
2343 be used to indicate that the association status of the object
2344 resulted from execution of an ALLOCATE statement rather than
2345 pointer assignment.}
2347 \textit{For examples using
2348 \DWATallocated{} for \addtoindex{Ada} and
2349 \addtoindex{Fortran 90}
2351 see Appendix \refersec{app:aggregateexamples}.}
2353 \subsubsection{Array Rank}
2354 \label{chap:DWATrank}
2355 \addtoindexx{array!assumed-rank}
2356 \addtoindexx{assumed-rank array|see{array, assumed-rank}}
2357 \textit{The Fortran language supports \doublequote{assumed-rank arrays}. The
2358 rank (the number of dimensions) of an assumed-rank array is unknown
2359 at compile time. The Fortran runtime stores the rank in the array
2360 descriptor metadata.}
2363 \hypertarget{chap:DWATrankofdynamicarray}{\DWATrankINDX}
2364 attribute indicates that an array's rank
2365 (number of dimensions) is dynamic, and therefore unknown at compile
2366 time. The value of the \DWATrankNAME{} attribute is either an integer constant
2367 or a location expression whose evaluation yields the dynamic rank.
2369 The bounds of an array with dynamic rank are described using a
2370 \DWTAGgenericsubrange{} entry, which
2371 is the dynamic rank array equivalent of
2372 \DWTAGsubrangetype. The
2373 difference is that a \DWTAGgenericsubrange{} entry contains generic
2374 lower/upper bound and stride expressions that need to be evaluated for
2375 each dimension. Before any expression contained in a
2376 \DWTAGgenericsubrange{} can be evaluated, the dimension for which the
2377 expression is to be evaluated needs to be pushed onto the stack. The
2378 expression will use it to find the offset of the respective field in
2379 the array descriptor metadata.
2381 \textit{The Fortran compiler is free to choose any layout for the
2382 array descriptor. In particular, the upper and lower bounds and
2383 stride values do not need to be bundled into a structure or record,
2384 but could be laid end to end in the containing descriptor, pointed
2385 to by the descriptor, or even allocated independently of the
2388 Dimensions are enumerated $0$ to $\mathit{rank}-1$ in a left-to-right
2391 \textit{For an example in Fortran 2008, see
2392 Section~\refersec{app:assumedrankexample}.}
2395 \section{Template Alias Entries}
2396 \label{chap:templatealiasentries}
2399 In \addtoindex{C++}, a template alias is a form of typedef that has template
2400 parameters. DWARF does not represent the template alias definition
2401 but does represent instantiations of the alias.
2404 A type named using a template alias is represented
2405 by a debugging information entry
2406 \addtoindexx{template alias entry}
2408 \DWTAGtemplatealiasTARG.
2409 The template alias entry has a
2410 \DWATname{} attribute
2411 \addtoindexx{name attribute}
2412 whose value is a null\dash terminated string
2413 containing the name of the template alias as it appears in
2415 The template alias entry has child entries describing the template
2416 actual parameters (see Section \refersec{chap:templateparameters}).