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-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
103 is\addtoindexx{bit offset attribute (Version 3)}
104 \addtoindexx{bit offset attribute (Version 3)|see{\textit{also} data bit offset attribute}}
106 \addtoindexx{data bit offset attribute}
108 \DWARFVersionIV{}, unchanged in \DWARFVersionV{}, and
109 is also used for bit field members
110 (see Section \refersec{chap:datamemberentries}).
111 %\hypertarget{chap:DWATbitoffsetbasetypebitlocation}{}
112 It replaces the attribute DW\_AT\_bit\_offset
113 \addtoindexx{bit offset attribute (Version 3)}
115 types as defined in \DWARFVersionIII{} and earlier.
116 DW\_AT\_bit\_offset is deprecatedF
117 \addtoindexx{DW\_AT\_bit\_offset (deprecated)}
118 for use in base types in DWARF Version 4 and later.
119 See Section 5.1 in the \DWARFVersionIV{}
120 specification for a discussion of compatibility considerations.}
123 \caption{Encoding attribute values}
124 \label{tab:encodingattributevalues}
126 \begin{tabular}{l|p{8cm}}
128 Name&Meaning\\ \hline
129 \DWATEaddressTARG{} & linear machine address (for segmented\break
131 Section \refersec{chap:segmentedaddresses}) \\
132 \DWATEbooleanTARG& true or false \\
134 \DWATEcomplexfloatTARG& complex binary
135 floating\dash point number \\
136 \DWATEfloatTARG{} & binary floating\dash point number \\
137 \DWATEimaginaryfloatTARG& imaginary binary
138 floating\dash point number \\
139 \DWATEsignedTARG& signed binary integer \\
140 \DWATEsignedcharTARG& signed character \\
141 \DWATEunsignedTARG{} & unsigned binary integer \\
142 \DWATEunsignedcharTARG{} & unsigned character \\
143 \DWATEpackeddecimalTARG{} & packed decimal \\
144 \DWATEnumericstringTARG& numeric string \\
145 \DWATEeditedTARG{} & edited string \\
146 \DWATEsignedfixedTARG{} & signed fixed\dash point scaled integer \\
147 \DWATEunsignedfixedTARG& unsigned fixed\dash point scaled integer \\
148 \DWATEdecimalfloatTARG{} & decimal floating\dash point number \\
149 \DWATEUTFTARG{} & \addtoindexi{Unicode character}{Unicode character base type} \\
150 \DWATEASCIITARG{} & \addtoindexi{ASCII character}{ASCII character base type}\\
151 \DWATEUCSTARG{} & \addtoindexi{ISO 10646 character}{ISO 10646 character base type}
152 \addtoindexx{ISO 10646 character set standard} \\
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).
164 \addtoindexx{ISO 10646 character set standard}
166 \addtoindex{C++} type char16\_t is
167 represented by a base type entry with a name attribute whose
168 value is \doublequote{char16\_t}, an encoding attribute whose value
169 is \DWATEUTF{} and a byte size attribute whose value is 2.}
171 \textit{The \DWATEASCII{} and \DWATEUCS{} encodings are intended for
172 the {Fortran 2003} string kinds
173 \texttt{ASCII}\index{ASCII@\texttt{ASCII} (Fortran string kind)} (ISO/IEC 646:1991) and
174 \texttt{ISO\_10646}\index{ISO\_10646@\texttt{ISO\_10646} (Fortran string kind)} (UCS-4 in ISO/IEC 10646:2000).}
175 \addtoindexx{ISO 10646 character set standard}
178 \DWATEpackeddecimal{}
180 \DWATEnumericstring{}
182 represent packed and unpacked decimal string numeric data
183 types, respectively, either of which may be
185 \addtoindexx{decimal scale attribute}
187 \addtoindexx{decimal sign attribute}
189 \addtoindexx{digit count attribute}
191 \hypertarget{chap:DWATdecimalsigndecimalsignrepresentation}{}
193 \hypertarget{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}{}
194 base types are used in combination with
196 \DWATdigitcount{} and
201 A \DWATdecimalsign{} attribute
202 \addtoindexx{decimal sign attribute}
203 is an \livelink{chap:classconstant}{integer constant} that
204 conveys the representation of the sign of the decimal type
205 (see Table \refersec{tab:decimalsignattributevalues}).
206 Its \livelink{chap:classconstant}{integer constant} value is interpreted to
207 mean that the type has a leading overpunch, trailing overpunch,
208 leading separate or trailing separate sign representation or,
209 alternatively, no sign at all.
212 \caption{Decimal sign attribute values}
213 \label{tab:decimalsignattributevalues}
215 \begin{tabular}{l|p{9cm}}
219 \DWDSunsignedTARG{} & Unsigned \\
220 \DWDSleadingoverpunchTARG{} & Sign
221 is encoded in the most significant digit in a target\dash dependent manner \\
222 \DWDStrailingoverpunchTARG{} & Sign
223 is encoded in the least significant digit in a target\dash dependent manner \\
224 \DWDSleadingseparateTARG{}
225 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
226 to the left of the most significant digit. \\
227 \DWDStrailingseparateTARG{}
228 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
229 to the right of the least significant digit. \\
230 &Packed decimal type: Least significant nibble contains
231 a target\dash dependent value
232 indicating positive or negative. \\
237 \hypertarget{chap:DWATdecimalscaledecimalscalefactor}{}
238 The \DWATdecimalscale{}
240 \addtoindexx{decimal scale attribute}
241 is an integer constant value
242 that represents the exponent of the base ten scale factor to
243 be applied to an instance of the type. A scale of zero puts the
244 decimal point immediately to the right of the least significant
245 digit. Positive scale moves the decimal point to the right
246 and implies that additional zero digits on the right are not
247 stored in an instance of the type. Negative scale moves the
248 decimal point to the left; if the absolute value of the scale
249 is larger than the digit count, this implies additional zero
250 digits on the left are not stored in an instance of the type.
255 \addtoindexx{digit count attribute}
256 is an \livelink{chap:classconstant}{integer constant}
257 value that represents the number of digits in an instance of
262 \hypertarget{chap:DWATpicturestringpicturestringfornumericstringtype}{}
263 type is used to represent an edited
264 numeric or alphanumeric data type. It is used in combination
265 with a \DWATpicturestring{} attribute whose value is a
266 null\dash terminated string containing the target\dash dependent picture
267 string associated with the type.
269 If the edited base type entry describes an edited numeric
270 data type, the edited type entry has a \DWATdigitcount{} and a
271 \DWATdecimalscale{} attribute.
272 \addtoindexx{decimal scale attribute}
273 These attributes have the same
274 interpretation as described for the
275 \DWATEpackeddecimal{} and
276 \DWATEnumericstring{} base
277 types. If the edited type entry
278 describes an edited alphanumeric data type, the edited type
279 entry does not have these attributes.
282 \textit{The presence or absence of the \DWATdigitcount{} and
283 \DWATdecimalscale{} attributes
284 \addtoindexx{decimal scale attribute}
285 allows a debugger to easily
286 distinguish edited numeric from edited alphanumeric, although
287 in principle the digit count and scale are derivable by
288 interpreting the picture string.}
290 The \DWATEsignedfixed{} and \DWATEunsignedfixed{} entries
291 describe signed and unsigned fixed\dash point binary data types,
294 The fixed binary type entries have
295 \addtoindexx{digit count attribute}
298 attribute with the same interpretation as described for the
299 \DWATEpackeddecimal{} and \DWATEnumericstring{} base types.
302 For a data type with a decimal scale factor, the fixed binary
304 \DWATdecimalscale{} attribute
305 \addtoindexx{decimal scale attribute}
307 interpretation as described for the
308 \DWATEpackeddecimal{}
309 and \DWATEnumericstring{} base types.
311 \hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}{}
312 For a data type with a binary scale factor, the fixed
313 \addtoindexx{binary scale attribute}
314 binary type entry has a
315 \DWATbinaryscale{} attribute.
317 \DWATbinaryscale{} attribute
318 is an \livelink{chap:classconstant}{integer constant} value
319 that represents the exponent of the base two scale factor to
320 be applied to an instance of the type. Zero scale puts the
321 binary point immediately to the right of the least significant
322 bit. Positive scale moves the binary point to the right and
323 implies that additional zero bits on the right are not stored
324 in an instance of the type. Negative scale moves the binary
325 point to the left; if the absolute value of the scale is
326 larger than the number of bits, this implies additional zero
327 bits on the left are not stored in an instance of the type.
330 \hypertarget{chap:DWATsmallscalefactorforfixedpointtype}{}
331 a data type with a non\dash decimal and non\dash binary scale factor,
332 the fixed binary type entry has a
333 \DWATsmall{} attribute which
334 \addtoindexx{small attribute}
336 \DWTAGconstant{} entry. The scale factor value
337 is interpreted in accordance with the value defined by the
338 \DWTAGconstant{} entry. The value represented is the product
339 of the integer value in memory and the associated constant
342 \textit{The \DWATsmall{} attribute
343 is defined with the \addtoindex{Ada} \texttt{small}
346 \section{Unspecified Type Entries}
347 \label{chap:unspecifiedtypeentries}
348 \addtoindexx{unspecified type entry}
349 \addtoindexx{void type|see{unspecified type entry}}
350 Some languages have constructs in which a type
351 may be left unspecified or the absence of a type
352 may be explicitly indicated.
354 An unspecified (implicit, unknown, ambiguous or nonexistent)
355 type is represented by a debugging information entry with
356 the tag \DWTAGunspecifiedtypeTARG.
357 If a name has been given
358 to the type, then the corresponding unspecified type entry
359 has a \DWATname{} attribute
360 \addtoindexx{name attribute}
362 a null\dash terminated
363 string containing the name as it appears in the source program.
365 \textit{The interpretation of this debugging information entry is
366 intentionally left flexible to allow it to be interpreted
367 appropriately in different languages. For example, in
368 \addtoindex{C} and \addtoindex{C++}
369 the language implementation can provide an unspecified type
370 entry with the name \doublequote{void} which can be referenced by the
371 type attribute of pointer types and typedef declarations for
373 Sections \refersec{chap:typemodifierentries} and
374 %The following reference was valid, so the following is probably correct.
375 Section \refersec{chap:typedefentries},
376 respectively). As another
377 example, in \addtoindex{Ada} such an unspecified type entry can be referred
378 to by the type attribute of an access type where the denoted
379 \addtoindexx{incomplete type (Ada)}
380 type is incomplete (the name is declared as a type but the
381 definition is deferred to a separate compilation unit).}
383 \textit{\addtoindex{C++} permits using the
384 \autoreturntype{} specifier for the return type of a member function declaration.
385 The actual return type is deduced based on the definition of the
386 function, so it may not be known when the function is declared. The language
387 implementation can provide an unspecified type entry with the name \texttt{auto} which
388 can be referenced by the return type attribute of a function declaration entry.
389 When the function is later defined, the \DWTAGsubprogram{} entry for the definition
390 includes a reference to the actual return type.}
393 \section{Type Modifier Entries}
394 \label{chap:typemodifierentries}
395 \addtoindexx{type modifier entry}
396 \addtoindexx{type modifier|see{atomic type entry}}
397 \addtoindexx{type modifier|see{constant type entry}}
398 \addtoindexx{type modifier|see{reference type entry}}
399 \addtoindexx{type modifier|see{restricted type entry}}
400 \addtoindexx{type modifier|see{packed type entry}}
401 \addtoindexx{type modifier|see{pointer type entry}}
402 \addtoindexx{type modifier|see{shared type entry}}
403 \addtoindexx{type modifier|see{volatile type entry}}
404 A base or user\dash defined type may be modified in different ways
405 in different languages. A type modifier is represented in
406 DWARF by a debugging information entry with one of the tags
407 given in Table \refersec{tab:typemodifiertags}.
409 If a name has been given to the modified type in the source
410 program, then the corresponding modified type entry has
411 a \DWATname{} attribute
412 \addtoindexx{name attribute}
413 whose value is a null\dash terminated
414 string containing the modified type name as it appears in
417 Each of the type modifier entries has
418 \addtoindexx{type attribute}
420 \DWATtype{} attribute,
421 whose value is a \livelink{chap:classreference}{reference}
422 to a debugging information entry
423 describing a base type, a user-defined type or another type
426 A modified type entry describing a
427 \addtoindexx{pointer type entry}
428 pointer or \addtoindex{reference type}
429 (using \DWTAGpointertype,
430 \DWTAGreferencetype{} or
431 \DWTAGrvaluereferencetype)
432 % Another instance of no-good-place-to-put-index entry.
434 \addtoindexx{address class attribute}
436 \hypertarget{chap:DWATadressclasspointerorreferencetypes}{}
439 attribute to describe how objects having the given pointer
440 or reference type ought to be dereferenced.
442 A modified type entry describing a \addtoindex{UPC} shared qualified type
443 (using \DWTAGsharedtype) may have a
444 \DWATcount{} attribute
445 \addtoindexx{count attribute}
446 whose value is a constant expressing the (explicit or implied) blocksize specified for the
447 type in the source. If no count attribute is present, then the \doublequote{infinite}
448 blocksize is assumed.
450 When multiple type modifiers are chained together to modify
451 a base or user-defined type, the tree ordering reflects the
453 \addtoindexx{reference type entry, lvalue|see{reference type entry}}
455 \addtoindexx{reference type entry, rvalue|see{rvalue reference type entry}}
457 \addtoindexx{parameter|see{macro formal parameter list}}
459 \addtoindexx{parameter|see{\textit{this} parameter}}
461 \addtoindexx{parameter|see{variable parameter attribute}}
463 \addtoindexx{parameter|see{optional parameter attribute}}
465 \addtoindexx{parameter|see{unspecified parameters entry}}
467 \addtoindexx{parameter|see{template value parameter entry}}
469 \addtoindexx{parameter|see{template type parameter entry}}
471 \addtoindexx{parameter|see{formal parameter entry}}
475 \caption{Type modifier tags}
476 \label{tab:typemodifiertags}
478 \begin{tabular}{l|p{9cm}}
480 Name&Meaning\\ \hline
481 \DWTAGatomictypeTARG{} & C \addtoindex{\_Atomic} qualified type \\
482 \DWTAGconsttypeTARG{} & C or C++ const qualified type
483 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
484 \DWTAGpackedtypeTARG& \addtoindex{Pascal} or Ada packed type\addtoindexx{packed type entry}
485 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
486 \DWTAGpointertypeTARG{} & Pointer to an object of
487 the type being modified \addtoindexx{pointer qualified type entry} \\
488 \DWTAGreferencetypeTARG& \addtoindex{C++} (lvalue) reference
489 to an object of the type
490 \addtoindexx{reference type entry}
491 \mbox{being} modified
492 \addtoindexx{reference qualified type entry} \\
493 \DWTAGrestricttypeTARG& \addtoindex{C}
495 \addtoindexx{restricted type entry}
497 \addtoindexx{restrict qualified type} \\
498 \DWTAGrvaluereferencetypeTARG{} & \addtoindex{C++}
499 \addtoindexx{rvalue reference type entry}
501 \addtoindexx{restricted type entry}
502 reference to an object of the type \mbox{being} modified
503 \addtoindexx{rvalue reference qualified type entry} \\
504 \DWTAGsharedtypeTARG&\addtoindex{UPC} shared qualified type
505 \addtoindexx{shared qualified type entry} \\
506 \DWTAGvolatiletypeTARG&\addtoindex{C} or \addtoindex{C++} volatile qualified type
507 \addtoindexx{volatile qualified type entry} \\
513 \textit{As examples of how type modifiers are ordered, consider the following
514 \addtoindex{C} declarations:}
515 \begin{lstlisting}[numbers=none]
516 const unsigned char * volatile p;
518 \textit{which represents a volatile pointer to a constant
519 character. This is encoded in DWARF as:}
523 \DWTAGvariable(p) -->
524 \DWTAGvolatiletype -->
525 \DWTAGpointertype -->
527 \DWTAGbasetype(unsigned char)
532 \textit{On the other hand}
533 \begin{lstlisting}[numbers=none]
534 volatile unsigned char * const restrict p;
536 \textit{represents a restricted constant
537 pointer to a volatile character. This is encoded as:}
541 \DWTAGvariable(p) -->
542 \DWTAGrestricttype -->
544 \DWTAGpointertype -->
545 \DWTAGvolatiletype -->
546 \DWTAGbasetype(unsigned char)
550 \section{Typedef Entries}
551 \label{chap:typedefentries}
552 A named type that is defined in terms of another type
553 definition is represented by a debugging information entry with
554 \addtoindexx{typedef entry}
555 the tag \DWTAGtypedefTARG.
556 The typedef entry has a \DWATname{} attribute
557 \addtoindexx{name attribute}
558 whose value is a null\dash terminated string containing
559 the name of the typedef as it appears in the source program.
561 The typedef entry may also contain
562 \addtoindexx{type attribute}
564 \DWATtype{} attribute whose
565 value is a \livelink{chap:classreference}{reference}
566 to the type named by the typedef. If
567 the debugging information entry for a typedef represents
568 a declaration of the type that is not also a definition,
569 it does not contain a type attribute.
571 \textit{Depending on the language, a named type that is defined in
572 terms of another type may be called a type alias, a subtype,
573 a constrained type and other terms. A type name declared with
574 no defining details may be termed an
575 \addtoindexx{incomplete type}
576 incomplete, forward or hidden type.
577 While the DWARF \DWTAGtypedef{} entry was
578 originally inspired by the like named construct in
579 \addtoindex{C} and \addtoindex{C++},
580 it is broadly suitable for similar constructs (by whatever
581 source syntax) in other languages.}
583 \section{Array Type Entries}
584 \label{chap:arraytypeentries}
585 \label{chap:DWTAGgenericsubrange}
587 \textit{Many languages share the concept of an \doublequote{array,} which is
588 \addtoindexx{array type entry}
589 a table of components of identical type.}
591 An array type is represented by a debugging information entry
592 with the tag \DWTAGarraytypeTARG.
593 If a name has been given to
594 \addtoindexx{array!declaration of type}
595 the array type in the source program, then the corresponding
596 array type entry has a \DWATname{} attribute
597 \addtoindexx{name attribute}
599 null\dash terminated string containing the array type name as it
600 appears in the source program.
603 \hypertarget{chap:DWATorderingarrayrowcolumnordering}{}
604 array type entry describing a multidimensional array may
605 \addtoindexx{array!element ordering}
606 have a \DWATordering{} attribute whose
607 \livelink{chap:classconstant}{integer constant} value is
608 interpreted to mean either row-major or column-major ordering
609 of array elements. The set of values and their meanings
610 for the ordering attribute are listed in
611 Table \refersec{tab:arrayordering}.
613 ordering attribute is present, the default ordering for the
614 source language (which is indicated by the
617 \addtoindexx{language attribute}
618 of the enclosing compilation unit entry) is assumed.
620 \begin{simplenametable}[1.8in]{Array ordering}{tab:arrayordering}
621 \DWORDcolmajorTARG{} \\
622 \DWORDrowmajorTARG{} \\
623 \end{simplenametable}
625 The ordering attribute may optionally appear on one-dimensional
626 arrays; it will be ignored.
628 An array type entry has
629 \addtoindexx{type attribute}
630 a \DWATtype{} attribute
632 \addtoindexx{array!element type}
633 the type of each element of the array.
635 If the amount of storage allocated to hold each element of an
636 object of the given array type is different from the amount
637 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
638 of storage that is normally allocated to hold an individual
639 \hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}{}
641 \hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}{}
642 indicated element type, then the array type
643 \addtoindexx{bit stride attribute}
647 \addtoindexx{byte stride attribute}
650 \addtoindexx{bit stride attribute}
652 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
654 element of the array.
656 The array type entry may have either a \DWATbytesize{} or a
657 \DWATbitsize{} attribute
658 (see Section \refersec{chap:byteandbitsizes}),
660 amount of storage needed to hold an instance of the array type.
662 \textit{If the size of the array can be determined statically at
663 compile time, this value can usually be computed by multiplying
664 the number of array elements by the size of each element.}
667 Each array dimension is described by a debugging information
668 entry with either the
669 \addtoindexx{subrange type entry!as array dimension}
670 tag \DWTAGsubrangetype{} or the
671 \addtoindexx{enumeration type entry!as array dimension}
673 \DWTAGenumerationtype. These entries are
675 array type entry and are ordered to reflect the appearance of
676 the dimensions in the source program (that is, leftmost dimension
677 first, next to leftmost second, and so on).
679 \textit{In languages that have no concept of a
680 \doublequote{multidimensional array} (for example,
681 \addtoindex{C}), an array of arrays may
682 be represented by a debugging information entry for a
683 multidimensional array.}
685 Alternatively, for an array with dynamic rank the array dimensions
686 are described by a debugging information entry with the tag
687 \DWTAGgenericsubrangeTARG.
688 This entry has the same attributes as a
689 \DWTAGsubrangetype{} entry; however,
690 there is just one \DWTAGgenericsubrangeNAME{} entry and it describes all of the
691 dimensions of the array.
692 If \DWTAGgenericsubrangeNAME{}
693 is used, the number of dimensions must be specified using a
694 \DWATrank{} attribute. See also Section
695 \refersec{chap:DWATrank}.
698 Other attributes especially applicable to arrays are
700 \DWATassociated{} and
702 which are described in
703 Section \refersec{chap:dynamictypeproperties}.
704 For relevant examples, see also Appendix \refersec{app:fortranarrayexample}.
706 \section{Coarray Type Entries}
707 \label{chap:coarraytypeentries}
708 \addtoindexx{coarray}
709 \textit{In Fortran, a \doublequote{coarray} is an array whose
710 elements are located in different processes rather than in the
711 memory of one process. The individual elements
712 of a coarray can be scalars or arrays.
713 Similar to arrays, coarrays have \doublequote{codimensions} that are
714 indexed using a \doublequote{coindex} or multiple \doublequote{coindices}.
715 \addtoindexx{codimension|see{coarray}}
716 \addtoindexx{coindex|see{coarray}}
719 A coarray type is represented by a debugging information entry
720 with the tag \DWTAGcoarraytypeTARG.
721 If a name has been given to the
722 coarray type in the source, then the corresponding coarray type
723 entry has a \DWATname{} attribute whose value is a null-terminated
724 string containing the array type name as it appears in the source
727 A coarray entry has one or more \DWTAGsubrangetype{} child entries,
728 one for each codimension. It also has a \DWATtype{} attribute
729 describing the type of each element of the coarray.
731 \textit{In a coarray application, the run-time number of processes in the application
732 is part of the coindex calculation. It is represented in the Fortran source by
733 a coindex which is declared with a \doublequote{*} as the upper bound. To express this
734 concept in DWARF, the \DWTAGsubrangetype{} child entry for that index has
735 only a lower bound and no upper bound.}
737 \textit{How coarray elements are located and how coindices are
738 converted to process specifications is implementation-dependent.}
741 \section{Structure, Union, Class and Interface Type Entries}
742 \label{chap:structureunionclassandinterfacetypeentries}
744 \textit{The languages
746 \addtoindex{C++}, and
747 \addtoindex{Pascal}, among others, allow the
748 programmer to define types that are collections of related
749 \addtoindexx{structure type entry}
751 In \addtoindex{C} and \addtoindex{C++}, these collections are called
752 \doublequote{structures.}
753 In \addtoindex{Pascal}, they are called \doublequote{records.}
754 The components may be of different types. The components are
755 called \doublequote{members} in \addtoindex{C} and
756 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
758 \textit{The components of these collections each exist in their
759 own space in computer memory. The components of a \addtoindex{C} or \addtoindex{C++}
760 \doublequote{union} all coexist in the same memory.}
762 \textit{\addtoindex{Pascal} and
763 other languages have a \doublequote{discriminated union,}
764 \addtoindexx{discriminated union|see {variant entry}}
765 also called a \doublequote{variant record.} Here, selection of a
766 number of alternative substructures (\doublequote{variants}) is based
767 on the value of a component that is not part of any of those
768 substructures (the \doublequote{discriminant}).}
770 \textit{\addtoindex{C++} and
771 \addtoindex{Java} have the notion of \doublequote{class,} which is in some
772 ways similar to a structure. A class may have \doublequote{member
773 functions} which are subroutines that are within the scope
774 of a class or structure.}
776 \textit{The \addtoindex{C++} notion of
777 structure is more general than in \addtoindex{C}, being
778 equivalent to a class with minor differences. Accordingly,
779 in the following discussion, statements about
780 \addtoindex{C++} classes may
781 be understood to apply to \addtoindex{C++} structures as well.}
783 \subsection{Structure, Union and Class Type Entries}
784 \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, union, or class type may have a \DWATexportsymbolsNAME{}
811 \livetarg{chap:DWATexportsymbolsofstructunionclass}{}
812 which indicates that all member names defined within
813 the structure, union, or class may be referenced as if they were
814 defined within the containing structure, union, or class.
816 \textit{This may be used to describe anonymous structures, unions
817 and classes in \addtoindex{C} or \addtoindex{C++}}.
819 A structure type, union type or class type entry may have
820 either a \DWATbytesize{} or a
821 \DWATbitsize{} attribute
822 \hypertarget{chap:DWATbitsizedatamemberbitsize}{}
823 (see Section \refersec{chap:byteandbitsizes}),
824 whose value is the amount of storage needed
825 to hold an instance of the structure, union or class type,
826 including any padding.
828 An incomplete structure, union or class type
829 \addtoindexx{incomplete structure/union/class}
831 \addtoindexx{incomplete type}
832 represented by a structure, union or class
833 entry that does not have a byte size attribute and that has
834 \addtoindexx{declaration attribute}
835 a \DWATdeclaration{} attribute.
837 If the complete declaration of a type has been placed in
838 \hypertarget{chap:DWATsignaturetypesignature}{}
839 a separate \addtoindex{type unit}
840 (see Section \refersec{chap:typeunitentries}),
841 an incomplete declaration
842 \addtoindexx{incomplete type}
843 of that type in the compilation unit may provide
844 the unique 64-bit signature of the type using
845 \addtoindexx{type signature}
849 If a structure, union or class entry represents the definition
850 of a structure, union or class member corresponding to a prior
851 incomplete structure, union or class, the entry may have a
852 \DWATspecification{} attribute
853 \addtoindexx{specification attribute}
854 whose value is a \livelink{chap:classreference}{reference} to
855 the debugging information entry representing that incomplete
858 Structure, union and class entries containing the
859 \DWATspecification{} attribute
860 \addtoindexx{specification attribute}
861 do not need to duplicate
862 information provided by the declaration entry referenced by the
863 specification attribute. In particular, such entries do not
864 need to contain an attribute for the name of the structure,
865 union or class they represent if such information is already
866 provided in the declaration.
868 \textit{For \addtoindex{C} and \addtoindex{C++},
870 \addtoindexx{data member|see {member entry (data)}}
871 member declarations occurring within
872 the declaration of a structure, union or class type are
873 considered to be \doublequote{definitions} of those members, with
874 the exception of \doublequote{static} data members, whose definitions
875 appear outside of the declaration of the enclosing structure,
876 union or class type. Function member declarations appearing
877 within a structure, union or class type declaration are
878 definitions only if the body of the function also appears
879 within the type declaration.}
881 If the definition for a given member of the structure, union
882 or class does not appear within the body of the declaration,
883 that member also has a debugging information entry describing
884 its definition. That latter entry has a
885 \DWATspecification{} attribute
886 \addtoindexx{specification attribute}
887 referencing the debugging information entry
888 owned by the body of the structure, union or class entry and
889 representing a non\dash defining declaration of the data, function
890 or type member. The referenced entry will not have information
891 about the location of that member (low and high pc attributes
892 for function members, location descriptions for data members)
893 and will have a \DWATdeclaration{} attribute.
896 \textit{Consider a nested class whose
897 definition occurs outside of the containing class definition, as in:}
899 \begin{lstlisting}[numbers=none]
906 \textit{The two different structs can be described in
907 different compilation units to
908 facilitate DWARF space compression
909 (see Appendix \refersec{app:usingcompilationunits}).}
912 A structure type, union type or class type entry may have a
913 \DWATcallingconvention{} attribute,
914 \addtoindexx{calling convention attribute}
915 whose value indicates whether a value of the type should be passed by reference
916 or passed by value. The set of calling convention codes for use with types
917 \addtoindexx{calling convention codes!for types}
918 \hypertarget{chap:DWATcallingconventionfortypes}{}
919 is given in Table \referfol{tab:callingconventioncodesfortypes}.
921 \begin{simplenametable}[2.2in]{Calling convention codes for types}{tab:callingconventioncodesfortypes}
923 \DWCCpassbyvalueTARG \\
924 \DWCCpassbyreferenceTARG \\
925 \end{simplenametable}
927 If this attribute is not present, or its value is
928 \DWCCnormalNAME, the convention to be used for an object of the
929 given type is assumed to be unspecified.
931 \textit{Note that \DWCCnormalNAME{} is also used as a calling convention
932 code for certain subprograms
933 (see Table \refersec{tab:callingconventioncodesforsubroutines}).}
935 \textit{If unspecified, a consumer may be able to deduce the calling
936 convention based on knowledge of the type and the ABI.}
939 \subsection{Interface Type Entries}
940 \label{chap:interfacetypeentries}
942 \textit{The \addtoindex{Java} language defines \doublequote{interface} types.
944 \addtoindexx{interface type entry}
945 in \addtoindex{Java} is similar to a \addtoindex{C++} or
946 \addtoindex{Java} class with only abstract
947 methods and constant data members.}
950 \addtoindexx{interface type entry}
951 are represented by debugging information
953 tag \DWTAGinterfacetypeTARG.
955 An interface type entry has
956 a \DWATname{} attribute,
957 \addtoindexx{name attribute}
959 value is a null\dash terminated string containing the type name
960 as it appears in the source program.
962 The members of an interface are represented by debugging
963 information entries that are owned by the interface type
964 entry and that appear in the same order as the corresponding
965 declarations in the source program.
967 \subsection{Derived or Extended Structures, Classes and Interfaces}
968 \label{chap:derivedorextendedstructsclasesandinterfaces}
970 \textit{In \addtoindex{C++}, a class (or struct)
972 \addtoindexx{derived type (C++)|see{inheritance entry}}
973 be \doublequote{derived from} or be a
974 \doublequote{subclass of} another class.
975 In \addtoindex{Java}, an interface may \doublequote{extend}
976 \addtoindexx{extended type (Java)|see{inheritance entry}}
978 \addtoindexx{implementing type (Java)|see{inheritance entry}}
979 or more other interfaces, and a class may \doublequote{extend} another
980 class and/or \doublequote{implement} one or more interfaces. All of these
981 relationships may be described using the following. Note that
982 in \addtoindex{Java},
983 the distinction between extends and implements is
984 implied by the entities at the two ends of the relationship.}
986 A class type or interface type entry that describes a
987 derived, extended or implementing class or interface owns
988 \addtoindexx{implementing type (Java)|see{inheritance entry}}
989 debugging information entries describing each of the classes
990 or interfaces it is derived from, extending or implementing,
991 respectively, ordered as they were in the source program. Each
993 \addtoindexx{inheritance entry}
995 tag \DWTAGinheritanceTARG.
999 \addtoindexx{type attribute}
1001 \addtoindexx{inheritance entry}
1003 \DWATtype{} attribute whose value is
1004 a reference to the debugging information entry describing the
1005 class or interface from which the parent class or structure
1006 of the inheritance entry is derived, extended or implementing.
1008 An inheritance entry
1009 \addtoindexx{inheritance entry}
1010 for a class that derives from or extends
1011 \hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}{}
1012 another class or struct also has
1013 \addtoindexx{data member location attribute}
1015 \DWATdatamemberlocation{}
1016 attribute, whose value describes the location of the beginning
1017 of the inherited type relative to the beginning address of the
1018 instance of the derived class. If that value is a constant, it is the offset
1019 in bytes from the beginning of the class to the beginning of
1020 the instance of the inherited type. Otherwise, the value must be a location
1021 description. In this latter case, the beginning address of
1022 the instance of the derived class is pushed on the expression stack before
1023 the \addtoindex{location description}
1024 is evaluated and the result of the
1025 evaluation is the location of the instance of the inherited type.
1027 \textit{The interpretation of the value of this attribute for
1028 inherited types is the same as the interpretation for data
1030 (see Section \referfol{chap:datamemberentries}). }
1033 \addtoindexx{inheritance entry}
1035 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}{}
1037 \addtoindexx{accessibility attribute}
1039 \DWATaccessibility{}
1041 If no accessibility attribute is present, private access
1042 is assumed for an entry of a class and public access is
1043 assumed for an entry of a struct, union or interface.
1045 If\hypertarget{chap:DWATvirtualityvirtualityofbaseclass}{}
1046 the class referenced by the
1047 \addtoindexx{inheritance entry}
1048 inheritance entry serves
1049 as a \addtoindex{C++} virtual base class, the inheritance entry has a
1050 \DWATvirtuality{} attribute.
1052 \textit{For a \addtoindex{C++} virtual base, the
1053 \addtoindex{data member location attribute}
1054 will usually consist of a non-trivial
1055 \addtoindex{location description}.}
1057 \subsection{Access Declarations}
1058 \label{chap:accessdeclarations}
1060 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1061 \addtoindexx{access declaration entry}
1062 change the accessibility of individual class members from the
1063 overall accessibility specified by the inheritance declaration.
1064 A single access declaration may refer to a set of overloaded
1067 If a derived class or structure contains access declarations,
1068 each such declaration may be represented by a debugging
1069 information entry with the tag
1070 \DWTAGaccessdeclarationTARG.
1072 such entry is a child of the class or structure type entry.
1074 An access declaration entry has
1075 a \DWATname{} attribute,
1076 \addtoindexx{name attribute}
1078 value is a null\dash terminated string representing the name used
1079 in the declaration in the source program, including any class
1080 or structure qualifiers.
1082 An access declaration entry
1083 \hypertarget{chap:DWATaccessibilitycppbaseclasses}{}
1086 \DWATaccessibility{}
1087 attribute describing the declared accessibility of the named
1092 \subsection{Friends}
1093 \label{chap:friends}
1095 Each \doublequote{friend}
1096 \addtoindexx{friend entry}
1097 declared by a structure, union or class
1098 \hypertarget{chap:DWATfriendfriendrelationship}{}
1099 type may be represented by a debugging information entry
1100 that is a child of the structure, union or class type entry;
1101 the friend entry has the
1102 tag \DWTAGfriendTARG.
1105 \addtoindexx{friend attribute}
1106 a \DWATfriend{} attribute, whose value is
1107 a reference to the debugging information entry describing
1108 the declaration of the friend.
1111 \subsection{Data Member Entries}
1112 \label{chap:datamemberentries}
1114 A data member (as opposed to a member function) is
1115 represented by a debugging information entry with the
1116 tag \DWTAGmemberTARG.
1118 \addtoindexx{member entry (data)}
1119 member entry for a named member has
1120 a \DWATname{} attribute
1121 \addtoindexx{name attribute}
1122 whose value is a null\dash terminated
1123 string containing the member name as it appears in the source
1124 program. If the member entry describes an
1125 \addtoindex{anonymous union},
1126 the name attribute is omitted or the value of the attribute
1127 consists of a single zero byte.
1129 The data member entry has
1130 \addtoindexx{type attribute}
1132 \DWATtype{} attribute to denote
1133 \addtoindexx{member entry (data)}
1134 the type of that member.
1136 A data member entry may
1137 \addtoindexx{accessibility attribute}
1139 \DWATaccessibility{}
1140 attribute. If no accessibility attribute is present, private
1141 access is assumed for an entry of a class and public access
1142 is assumed for an entry of a structure, union, or interface.
1145 \hypertarget{chap:DWATmutablemutablepropertyofmemberdata}{}
1147 \addtoindexx{member entry (data)}
1149 \addtoindexx{mutable attribute}
1150 have a \DWATmutable{} attribute,
1151 which is a \livelink{chap:classflag}{flag}.
1152 This attribute indicates whether the data
1153 member was declared with the mutable storage class specifier.
1155 The beginning of a data member
1156 \addtoindexx{beginning of a data member}
1157 is described relative to
1158 \addtoindexx{beginning of an object}
1159 the beginning of the object in which it is immediately
1160 contained. In general, the beginning is characterized by
1161 both an address and a bit offset within the byte at that
1162 address. When the storage for an entity includes all of
1163 the bits in the beginning byte, the beginning bit offset is
1166 Bit offsets in DWARF use the bit numbering and direction
1167 conventions that are appropriate to the current language on
1171 \addtoindexx{member entry (data)}
1172 corresponding to a data member that is
1173 \hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}{}
1175 \hypertarget{chap:DWATdatamemberlocationdatamemberlocation}{}
1176 in a structure, union or class may have either
1177 \addtoindexx{data member location attribute}
1179 \DWATdatamemberlocation{} attribute or a
1180 \DWATdatabitoffset{}
1181 attribute. If the beginning of the data member is the same as
1182 the beginning of the containing entity then neither attribute
1186 For a \DWATdatamemberlocation{} attribute
1187 \addtoindexx{data member location attribute}
1188 there are two cases:
1189 \begin{enumerate}[1. ]
1190 \item If the value is an \livelink{chap:classconstant}{integer constant},
1192 in bytes from the beginning of the containing entity. If
1193 the beginning of the containing entity has a non-zero bit
1194 offset then the beginning of the member entry has that same
1197 \item Otherwise, the value must be a \addtoindex{location description}.
1199 this case, the beginning of the containing entity must be byte
1200 aligned. The beginning address is pushed on the DWARF stack
1201 before the \addtoindex{location} description is evaluated; the result of
1202 the evaluation is the base address of the member entry.
1204 \textit{The push on the DWARF expression stack of the base address of
1205 the containing construct is equivalent to execution of the
1206 \DWOPpushobjectaddress{} operation
1207 (see Section \refersec{chap:stackoperations});
1208 \DWOPpushobjectaddress{} therefore
1209 is not needed at the
1210 beginning of a \addtoindex{location description} for a data member.
1212 result of the evaluation is a location---either an address or
1213 the name of a register, not an offset to the member.}
1215 \textit{A \DWATdatamemberlocation{}
1217 \addtoindexx{data member location attribute}
1218 that has the form of a
1219 \addtoindex{location description} is not valid for a data member contained
1220 in an entity that is not byte aligned because DWARF operations
1221 do not allow for manipulating or computing bit offsets.}
1226 For a \DWATdatabitoffset{} attribute,
1227 the value is an \livelink{chap:classconstant}{integer constant}
1228 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1229 that specifies the number of bits
1230 from the beginning of the containing entity to the beginning
1231 of the data member. This value must be greater than or equal
1232 to zero, but is not limited to less than the number of bits
1235 If the size of a data member is not the same as the size
1236 of the type given for the data member, the data member has
1237 \addtoindexx{bit size attribute}
1238 either a \DWATbytesize{}
1239 or a \DWATbitsize{} attribute whose
1240 \livelink{chap:classconstant}{integer constant} value
1241 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1243 of storage needed to hold the value of the data member.
1245 \textit{Bit fields in \addtoindex{C} and \addtoindex{C++}
1247 \addtoindexx{bit fields}
1249 \addtoindexx{data bit offset}
1251 \addtoindexx{data bit size}
1253 \DWATdatabitoffset{} and
1254 \DWATbitsize{} attributes.}
1257 \textit{This Standard uses the following bit numbering and direction
1258 conventions in examples. These conventions are for illustrative
1259 purposes and other conventions may apply on particular
1262 \item \textit{For big\dash endian architectures, bit offsets are
1263 counted from high-order to low\dash order bits within a byte (or
1264 larger storage unit); in this case, the bit offset identifies
1265 the high\dash order bit of the object.}
1267 \item \textit{For little\dash endian architectures, bit offsets are
1268 counted from low\dash order to high\dash order bits within a byte (or
1269 larger storage unit); in this case, the bit offset identifies
1270 the low\dash order bit of the object.}
1274 \textit{In either case, the bit so identified is defined as the
1275 \addtoindexx{beginning of an object}
1276 beginning of the object.}
1279 \textit{For example, take one possible representation of the following
1280 \addtoindex{C} structure definition
1281 in both big\dash and little\dash endian byte orders:}
1292 \textit{Figures \referfol{fig:bigendiandatabitoffsets} and
1293 \refersec{fig:littleendiandatabitoffsets}
1294 show the structure layout
1295 and data bit offsets for example big\dash\ and little\dash endian
1296 architectures, respectively. Both diagrams show a structure
1297 that begins at address A and whose size is four bytes. Also,
1298 high order bits are to the left and low order bits are to
1310 Addresses increase ->
1311 | A | A + 1 | A + 2 | A + 3 |
1313 Data bit offsets increase ->
1314 +---------------+---------------+---------------+---------------+
1315 |0 4|5 10|11 15|16 23|24 31|
1316 | j | k | m | n | <pad> |
1318 +---------------------------------------------------------------+
1322 \caption{Big-endian data bit offsets}
1323 \label{fig:bigendiandatabitoffsets}
1334 <- Addresses increase
1335 | A + 3 | A + 2 | A + 1 | A |
1337 <- Data bit offsets increase
1338 +---------------+---------------+---------------+---------------+
1339 |31 24|23 16|15 11|10 5|4 0|
1340 | <pad> | n | m | k | j |
1342 +---------------------------------------------------------------+
1346 \caption{Little-endian data bit offsets}
1347 \label{fig:littleendiandatabitoffsets}
1351 \textit{Note that data member bit offsets in this example are the
1352 same for both big\dash\ and little\dash endian architectures even
1353 though the fields are allocated in different directions
1354 (high\dash order to low-order versus low\dash order to high\dash order);
1355 the bit naming conventions for memory and/or registers of
1356 the target architecture may or may not make this seem natural.}
1358 \textit{For a more extensive example showing nested and packed records
1360 Appendix \refersec{app:pascalexample}.}
1363 \textit{Attribute \DWATdatabitoffset{}
1365 \addtoindex{DWARF Version 4}, unchanged in \DWARFVersionV,
1366 and is also used for base types
1368 \refersec{chap:basetypeentries}).
1369 %\livetarg{chap:DWATbitoffsetdatamemberbitlocation}{}
1370 It replaces the attributes
1371 DW\_AT\_bit\_offset\addtoindexx{bit offset attribute (Version 3)}
1372 and \DWATbytesize{} when used to
1373 identify the beginning of bit field data members as defined
1374 in \DWARFVersionIII{} and earlier. The
1377 DW\_AT\_bit\_offset\addtoindexx{DW\_AT\_bit\_offset (deprecated)}
1378 attribute combination is deprecated for data members in
1379 \DWARFVersionIV{} and later. See Section 5.6.6 in the \DWARFVersionIV{}
1380 specification for a discussion of compatibility considerations.}
1382 \subsection{Member Function Entries}
1383 \label{chap:memberfunctionentries}
1385 A member function is represented by a
1386 \addtoindexx{member function entry}
1387 debugging information entry
1389 \addtoindexx{subprogram entry!as member function}
1390 tag \DWTAGsubprogram.
1391 The member function entry
1392 may contain the same attributes and follows the same rules
1393 as non\dash member global subroutine entries
1394 (see Section \refersec{chap:subroutineandentrypointentries}).
1397 \textit{In particular, if the member function entry is an
1398 instantiation of a member function template, it follows the
1399 same rules as function template instantiations (see Section
1400 \refersec{chap:functiontemplateinstantiations}).
1404 \addtoindexx{accessibility attribute}
1405 member function entry may have a
1406 \DWATaccessibility{}
1407 attribute. If no accessibility attribute is present, private
1408 access is assumed for an entry of a class and public access
1409 is assumed for an entry of a structure, union or interface.
1412 \hypertarget{chap:DWATvirtualityvirtualityoffunction}{}
1413 the member function entry describes a virtual function,
1414 then that entry has a
1415 \DWATvirtuality{} attribute.
1418 \hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}{}
1419 the member function entry describes an explicit member
1420 function, then that entry has
1421 \addtoindexx{explicit attribute}
1423 \DWATexplicit{} attribute.
1426 \hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{}
1427 entry for a virtual function also has a
1428 \DWATvtableelemlocation{}
1429 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1430 a \addtoindex{location description}
1431 yielding the address of the slot
1432 for the function within the virtual function table for the
1433 enclosing class. The address of an object of the enclosing
1434 type is pushed onto the expression stack before the location
1435 description is evaluated.
1438 \hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{}
1439 the member function entry describes a non\dash static member
1440 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1441 function, then that entry
1442 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1444 \addtoindexx{object pointer attribute}
1445 a \DWATobjectpointer{}
1447 whose value is a \livelink{chap:classreference}{reference}
1448 to the formal parameter entry
1449 that corresponds to the object for which the function is
1450 called. The name attribute of that formal parameter is defined
1451 by the current language (for example,
1452 \texttt{this} for \addtoindex{C++} or \texttt{self}
1453 for \addtoindex{Objective C}
1454 and some other languages). That parameter
1455 also has a \DWATartificial{} attribute whose value is true.
1457 Conversely, if the member function entry describes a static
1458 member function, the entry does not have
1459 \addtoindexx{object pointer attribute}
1461 \DWATobjectpointer{}
1464 \textit{In \addtoindex{C++}, non-static member functions can have const-volatile
1465 qualifiers, which affect the type of the first formal parameter (the
1466 \doublequote{\texttt{this}}-pointer).}
1468 If the member function entry describes a non\dash static member
1469 function that has a const\dash volatile qualification, then
1470 the entry describes a non\dash static member function whose
1471 object formal parameter has a type that has an equivalent
1472 const\dash volatile qualification.
1474 \textit{Beginning in \addtoindex{C++:2011 (ISO)}, non-static member
1475 functions can also have one of the ref-qualifiers, \& and \&\&.
1476 These do not change the type of the
1477 \doublequote{\texttt{this}}-pointer, but they do affect the types of
1478 object values on which the function can be invoked.}
1481 The member function entry may have an \DWATreferenceNAME{} attribute
1482 \livetarg{chap:DWATreferenceofnonstaticmember}{}
1483 to indicate a non-static member function that can only be called on
1484 lvalue objects, or the \DWATrvaluereferenceNAME{} attribute
1485 \livetarg{chap:DWATrvaluereferenceofnonstaticmember}{}
1486 to indicate that it can only be called on prvalues and xvalues.
1488 \textit{The lvalue, prvalue and xvalue concepts are defined in the
1489 \addtoindex{C++:2011} and later standards and not repeated or
1490 considered further in DWARF.}
1492 If a subroutine entry represents the defining declaration
1493 of a member function and that definition appears outside of
1494 the body of the enclosing class declaration, the subroutine
1496 \DWATspecification{} attribute,
1497 \addtoindexx{specification attribute}
1499 a reference to the debugging information entry representing
1500 the declaration of this function member. The referenced entry
1501 will be a child of some class (or structure) type entry.
1504 Subroutine entries containing the
1505 \DWATspecification{} attribute
1506 \addtoindexx{specification attribute}
1507 do not need to duplicate information provided
1508 by the declaration entry referenced by the specification
1509 attribute. In particular, such entries do not need to contain
1510 a name attribute giving the name of the function member whose
1511 definition they represent.
1512 Similarly, such entries do not need to contain a return type
1513 attribute, unless the return type on the declaration was
1514 unspecified (for example, the declaration used the
1515 \addtoindex{C++} \autoreturntype{} specifier).
1517 \textit{In \addtoindex{C++}, a member function may be declared
1518 as deleted. This prevents the compiler from generating a default
1519 implementation of a special member function such as a
1520 constructor or destructor, and can affect overload resolution
1521 when used on other member functions.}
1523 If the member function entry has been declared as deleted,
1524 \hypertarget{chap:DWATdeleted}{}
1525 then that entry has a \DWATdeletedNAME{}\livetarg{chap:DWATdeleteddef}{}
1526 attribute.\addtoindexx{deleted attribute}
1528 \textit{In \addtoindex{C++}, a special member function may be
1529 declared as defaulted, which explicitly declares a default
1530 compiler-generated implementation of the function. The
1531 declaration may have different effects on the calling
1532 convention used for objects of its class, depending on
1533 whether the default declaration is made inside or outside the
1536 If the member function has been declared as defaulted,
1537 then the entry has a \DWATdefaultedNAME{}\livetarg{chap:DWATdefaulteddef}{}
1538 attribute\addtoindexx{defaulted attribute}
1539 whose integer constant value indicates whether, and if so,
1540 how, that member is defaulted. The possible values and
1541 their meanings are shown in
1542 Table \referfol{tab:defaultedattributevaluenames}.
1546 \setlength{\extrarowheight}{0.1cm}
1547 \begin{longtable}{l|l}
1548 \caption{Defaulted attribute names} \label{tab:defaultedattributevaluenames} \\
1549 \hline \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1551 \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1553 \hline \emph{Continued on next page}
1556 \DWDEFAULTEDnoTARG & Not declared default \\
1557 \DWDEFAULTEDinclassTARG & Defaulted within the class \\
1558 \DWDEFAULTEDoutofclassTARG& Defaulted outside of the class \\
1563 \textit{An artificial member function (that is, a compiler-generated
1564 copy that does not appear in the source) does not have a
1565 \DWATdefaultedNAME{} attribute.}
1568 \subsection{Class Template Instantiations}
1569 \label{chap:classtemplateinstantiations}
1571 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1572 type that may be instantiated when an instance of the class
1573 is declared or defined. The generic description of the class may include
1574 parameterized types, parameterized compile-time constant
1575 values, and/or parameterized run-time constant addresses.
1576 DWARF does not represent the generic template
1577 definition, but does represent each instantiation.}
1579 A class template instantiation is represented by a
1580 debugging information entry with the tag \DWTAGclasstype,
1581 \DWTAGstructuretype{} or
1582 \DWTAGuniontype. With the following
1583 exceptions, such an entry will contain the same attributes
1584 and have the same types of child entries as would an entry
1585 for a class type defined explicitly using the instantiation
1586 types and values. The exceptions are:
1588 \begin{enumerate}[1. ]
1589 \item Template parameters are described and referenced as
1590 specified in Section \refersec{chap:templateparameters}.
1593 \item If the compiler has generated a special compilation unit to
1595 \addtoindexx{template instantiation!and special compilation unit}
1596 template instantiation and that special compilation
1597 unit has a different name from the compilation unit containing
1598 the template definition, the name attribute for the debugging
1599 information entry representing the special compilation unit
1600 should be empty or omitted.
1603 \item If the class type entry representing the template
1604 instantiation or any of its child entries contains declaration
1605 coordinate attributes, those attributes should refer to
1606 the source for the template definition, not to any source
1607 generated artificially by the compiler.
1611 \subsection{Variant Entries}
1612 \label{chap:variantentries}
1614 A variant part of a structure is represented by a debugging
1615 information entry\addtoindexx{variant part entry} with the
1616 tag \DWTAGvariantpartTARG{} and is
1617 owned by the corresponding structure type entry.
1619 If the variant part has a discriminant, the discriminant is
1620 \hypertarget{chap:DWATdiscrdiscriminantofvariantpart}{}
1622 \addtoindexx{discriminant (entry)}
1623 separate debugging information entry which
1624 is a child of the variant part entry. This entry has the form
1626 \addtoindexx{member entry (data)!as discriminant}
1627 structure data member entry. The variant part entry will
1628 \addtoindexx{discriminant attribute}
1630 \DWATdiscr{} attribute
1631 whose value is a \livelink{chap:classreference}{reference} to
1632 the member entry for the discriminant.
1634 If the variant part does not have a discriminant (tag field),
1635 the variant part entry has
1636 \addtoindexx{type attribute}
1638 \DWATtype{} attribute to represent
1641 Each variant of a particular variant part is represented by
1642 \hypertarget{chap:DWATdiscrvaluediscriminantvalue}{}
1643 a debugging information entry\addtoindexx{variant entry} with the
1644 tag \DWTAGvariantTARG{}
1645 and is a child of the variant part entry. The value that
1646 selects a given variant may be represented in one of three
1647 ways. The variant entry may have a
1648 \DWATdiscrvalue{} attribute
1649 whose value represents a single case label. The value of this
1650 attribute is encoded as an LEB128 number. The number is signed
1651 if the tag type for the variant part containing this variant
1652 is a signed type. The number is unsigned if the tag type is
1657 \hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}{}
1658 the variant entry may contain
1659 \addtoindexx{discriminant list attribute}
1662 attribute, whose value represents a list of discriminant
1663 values. This list is represented by any of the
1664 \livelink{chap:classblock}{block} forms and
1665 may contain a mixture of case labels and label ranges. Each
1666 item on the list is prefixed with a discriminant value
1667 descriptor that determines whether the list item represents
1668 a single label or a label range. A single case label is
1669 represented as an LEB128 number as defined above for
1670 \addtoindexx{discriminant value attribute}
1673 attribute. A label range is represented by
1674 two LEB128 numbers, the low value of the range followed by the
1675 high value. Both values follow the rules for signedness just
1676 described. The discriminant value descriptor is an integer
1677 constant that may have one of the values given in
1678 Table \refersec{tab:discriminantdescriptorvalues}.
1680 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1681 \DWDSClabelTARG{} \\
1682 \DWDSCrangeTARG{} \\
1683 \end{simplenametable}
1685 If a variant entry has neither a \DWATdiscrvalue{}
1686 attribute nor a \DWATdiscrlist{} attribute, or if it has
1687 a \DWATdiscrlist{} attribute with 0 size, the variant is a
1690 The components selected by a particular variant are represented
1691 by debugging information entries owned by the corresponding
1692 variant entry and appear in the same order as the corresponding
1693 declarations in the source program.
1696 \section{Condition Entries}
1697 \label{chap:conditionentries}
1699 \textit{COBOL has the notion of
1700 \addtoindexx{level-88 condition, COBOL}
1701 a \doublequote{level\dash 88 condition} that
1702 associates a data item, called the conditional variable, with
1703 a set of one or more constant values and/or value ranges.
1704 % Note: the {} after \textquoteright (twice) is necessary to assure a following space separator
1705 Semantically, the condition is \textquoteleft true\textquoteright{}
1707 variable's value matches any of the described constants,
1708 and the condition is \textquoteleft false\textquoteright{} otherwise.}
1710 The \DWTAGconditionTARG{}
1711 debugging information entry\addtoindexx{condition entry}
1713 logical condition that tests whether a given data item\textquoteright s
1714 value matches one of a set of constant values. If a name
1715 has been given to the condition, the condition entry has a
1716 \DWATname{} attribute
1717 \addtoindexx{name attribute}
1718 whose value is a null\dash terminated string
1719 giving the condition name as it appears in the source program.
1722 The condition entry's parent entry describes the conditional
1723 variable; normally this will be a \DWTAGvariable,
1725 \DWTAGformalparameter{} entry.
1727 \addtoindexx{formal parameter entry}
1729 entry has an array type, the condition can test any individual
1730 element, but not the array as a whole. The condition entry
1731 implicitly specifies a \doublequote{comparison type} that is the
1732 type of an array element if the parent has an array type;
1733 otherwise it is the type of the parent entry.
1736 The condition entry owns \DWTAGconstant{} and/or
1737 \DWTAGsubrangetype{} entries that describe the constant
1738 values associated with the condition. If any child entry
1739 \addtoindexx{type attribute}
1741 a \DWATtype{} attribute,
1742 that attribute should describe a type
1743 compatible with the comparison type (according to the source
1744 language); otherwise the child\textquoteright s type is the same as the
1747 \textit{For conditional variables with alphanumeric types, COBOL
1748 permits a source program to provide ranges of alphanumeric
1749 constants in the condition. Normally a subrange type entry
1750 does not describe ranges of strings; however, this can be
1751 represented using bounds attributes that are references to
1752 constant entries describing strings. A subrange type entry may
1753 refer to constant entries that are siblings of the subrange
1757 \section{Enumeration Type Entries}
1758 \label{chap:enumerationtypeentries}
1760 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1761 a fixed number of symbolic values.}
1763 An enumeration type is represented by a debugging information
1765 \DWTAGenumerationtypeTARG.
1767 If a name has been given to the enumeration type in the source
1768 program, then the corresponding enumeration type entry has
1769 a \DWATname{} attribute
1770 \addtoindexx{name attribute}
1771 whose value is a null\dash terminated
1772 string containing the enumeration type name as it appears
1773 in the source program.
1775 The \addtoindex{enumeration type entry}
1777 \addtoindexx{type attribute}
1778 a \DWATtype{} attribute
1779 which refers to the underlying data type used to implement
1780 the enumeration. The entry also may have a
1781 \DWATbytesize{} attribute whose
1782 \livelink{chap:classconstant}{integer constant} value is the number of bytes
1783 required to hold an instance of the enumeration. If no \DWATbytesize{} attribute
1784 is present, the size for holding an instance of the enumeration is given by the size
1785 of the underlying data type.
1788 If an enumeration type has type safe
1789 \addtoindexx{type safe enumeration types}
1792 \begin{enumerate}[1. ]
1793 \item Enumerators are contained in the scope of the enumeration type, and/or
1795 \item Enumerators are not implicitly converted to another type
1798 then the \addtoindex{enumeration type entry} may
1799 \addtoindexx{enum class|see{type-safe enumeration}}
1800 have a \DWATenumclass{}
1801 attribute, which is a \livelink{chap:classflag}{flag}.
1802 In a language that offers only
1803 one kind of enumeration declaration, this attribute is not
1806 \textit{In \addtoindex{C} or \addtoindex{C++},
1807 the underlying type will be the appropriate
1808 integral type determined by the compiler from the properties of
1809 \hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}{}
1810 the enumeration literal values.
1811 A \addtoindex{C++} type declaration written
1812 using enum class declares a strongly typed enumeration and
1813 is represented using \DWTAGenumerationtype{}
1814 in combination with \DWATenumclass.}
1816 Each enumeration literal is represented by a debugging
1817 \addtoindexx{enumeration literal|see{enumeration entry}}
1818 information entry with the
1819 tag \DWTAGenumeratorTARG.
1821 such entry is a child of the
1822 \addtoindex{enumeration type entry}, and the
1823 enumerator entries appear in the same order as the declarations
1824 of the enumeration literals in the source program.
1826 Each \addtoindex{enumerator entry} has a
1827 \DWATname{} attribute, whose
1828 \addtoindexx{name attribute}
1829 value is a null\dash terminated string containing the name of the
1830 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}{}
1831 enumeration literal as it appears in the source program.
1832 Each enumerator entry also has a
1833 \DWATconstvalue{} attribute,
1834 whose value is the actual numeric value of the enumerator as
1835 represented on the target system.
1838 If the enumeration type occurs as the description of a
1839 \addtoindexx{enumeration type entry!as array dimension}
1840 dimension of an array type, and the stride for that dimension
1841 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}{}
1842 is different than what would otherwise be determined, then
1843 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}{}
1844 the enumeration type entry has either a
1846 or \DWATbitstride{} attribute
1847 \addtoindexx{bit stride attribute}
1848 which specifies the separation
1849 between successive elements along the dimension as described
1851 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1853 \DWATbitstride{} attribute
1854 \addtoindexx{bit stride attribute}
1855 is interpreted as bits and the value of
1856 \addtoindexx{byte stride attribute}
1859 attribute is interpreted as bytes.
1862 \section{Subroutine Type Entries}
1863 \label{chap:subroutinetypeentries}
1865 \textit{It is possible in \addtoindex{C}
1866 to declare pointers to subroutines
1867 that return a value of a specific type. In both
1868 \addtoindex{C} and \addtoindex{C++},
1869 it is possible to declare pointers to subroutines that not
1870 only return a value of a specific type, but accept only
1871 arguments of specific types. The type of such pointers would
1872 be described with a \doublequote{pointer to} modifier applied to a
1873 user\dash defined type.}
1876 A subroutine type is represented by a debugging information
1878 \addtoindexx{subroutine type entry}
1879 tag \DWTAGsubroutinetypeTARG.
1881 been given to the subroutine type in the source program,
1882 then the corresponding subroutine type entry has
1883 a \DWATname{} attribute
1884 \addtoindexx{name attribute}
1885 whose value is a null\dash terminated string containing
1886 the subroutine type name as it appears in the source program.
1888 If the subroutine type describes a function that returns
1889 a value, then the subroutine type entry has
1890 \addtoindexx{type attribute}
1892 attribute to denote the type returned by the subroutine. If
1893 the types of the arguments are necessary to describe the
1894 subroutine type, then the corresponding subroutine type
1895 entry owns debugging information entries that describe the
1896 arguments. These debugging information entries appear in the
1897 order that the corresponding argument types appear in the
1900 \textit{In \addtoindex{C} there
1901 is a difference between the types of functions
1902 declared using function prototype style declarations and
1903 those declared using non\dash prototype declarations.}
1906 \hypertarget{chap:DWATprototypedsubroutineprototype}{}
1907 subroutine entry declared with a function prototype style
1908 declaration may have
1909 \addtoindexx{prototyped attribute}
1911 \DWATprototyped{} attribute, which is
1912 a \livelink{chap:classflag}{flag}.
1914 Each debugging information entry owned by a subroutine
1915 type entry corresponds to either a formal parameter or the sequence of
1916 unspecified parameters of the subprogram type:
1918 \begin{enumerate}[1. ]
1919 \item A formal parameter of a parameter list (that has a
1920 specific type) is represented by a debugging information entry
1921 with the tag \DWTAGformalparameter.
1922 Each formal parameter
1924 \addtoindexx{type attribute}
1925 a \DWATtype{} attribute that refers to the type of
1926 the formal parameter.
1928 \item The unspecified parameters of a variable parameter list
1929 \addtoindexx{unspecified parameters entry}
1931 \addtoindexx{\texttt{...} parameters|see{unspecified parameters entry}}
1932 represented by a debugging information entry with the
1933 tag \DWTAGunspecifiedparameters.
1936 \textit{\addtoindex{C++} const-volatile qualifiers are encoded as
1937 part of the type of the
1938 \doublequote{\texttt{this}}-pointer.
1939 \addtoindex{C++:2011 (ISO)} reference and rvalue-reference qualifiers are encoded using
1940 the \DWATreference{} and \DWATrvaluereference{} attributes, respectively.
1941 See also Section \refersec{chap:memberfunctionentries}.}
1944 A subroutine type entry may have the \DWATreference{} or
1945 \DWATrvaluereference{} attribute to indicate that it describes the
1946 type of a member function with reference or rvalue-reference
1947 semantics, respectively.
1950 \section{String Type Entries}
1951 \label{chap:stringtypeentries}
1953 \textit{A \doublequote{string} is a sequence of characters that have specific
1954 \addtoindexx{string type entry}
1955 semantics and operations that distinguish them from arrays of
1957 \addtoindex{Fortran} is one of the languages that has a string
1958 type. Note that \doublequote{string} in this context refers to a target
1959 machine concept, not the class string as used in this document
1960 (except for the name attribute).}
1962 A string type is represented by a debugging information entry
1963 with the tag \DWTAGstringtypeTARG.
1964 If a name has been given to
1965 the string type in the source program, then the corresponding
1966 string type entry has a
1967 \DWATname{} attribute
1968 \addtoindexx{name attribute}
1970 a null\dash terminated string containing the string type name as
1971 it appears in the source program.
1973 A string type entry may have a \DWATtype{}
1974 \livetargi{char:DWAATtypeofstringtype}{attribute}{type attribute!of string type entry}
1975 describing how each character is encoded and is to be interpreted.
1976 The value of this attribute is a \CLASSreference{} to a
1977 \DWTAGbasetype{} base type entry. If the attribute is absent,
1978 then the character is encoded using the system default.
1981 \addtoindex{Fortran 2003} language standard allows string
1982 types that are composed of different types of (same sized) characters.
1983 While there is no standard list of character kinds, the kinds
1984 \texttt{ASCII}\index{ASCII@\texttt{ASCII} (Fortran string kind)} (see \DWATEASCII),
1985 \texttt{ISO\_10646}\index{ISO\_10646@\texttt{ISO\_10646} (Fortran string kind)}
1986 \addtoindexx{ISO 10646 character set standard}
1988 \texttt{DEFAULT}\index{DEFAULT@\texttt{DEFAULT} (Fortran string kind)}
1992 The string type entry may have a
1993 \DWATbytesize{} attribute or
1995 attribute, whose value
1996 (see Section \refersec{chap:byteandbitsizes})
1998 storage needed to hold a value of the string type.
2001 \hypertarget{chap:DWATstringlengthstringlengthofstringtype}{}
2002 string type entry may also have a
2003 \DWATstringlength{} attribute
2005 \addtoindexx{string length attribute}
2007 \addtoindex{location description} yielding the location
2008 where the length of the string is stored in the program.
2009 If the \DWATstringlength{} attribute is not present, the size
2010 of the string is assumed to be the amount of storage that is
2011 allocated for the string (as specified by the \DWATbytesize{}
2012 or \DWATbitsize{} attribute).
2014 The string type entry may also have a
2015 \DWATstringlengthbytesizeNAME{}
2017 \DWATstringlengthbitsizeNAME{} attribute,
2018 \addtoindexx{string length attribute!size of length data}
2019 whose value (see Section \refersec{chap:byteandbitsizes})
2020 is the size of the data to be retrieved from the location
2021 referenced by the string length attribute. If no (byte or bit)
2022 size attribute is present, the size of the data to be retrieved
2024 \addtoindex{size of an address} on the target machine.
2027 \addtoindexx{DWARF Version 5} % Avoid italics
2028 \textit{Prior to DWARF Version 5, the meaning of a
2029 \DWATbytesize{} attribute depended on the presence of the
2030 \DWATstringlength{} attribute:
2032 \item If \DWATstringlength{} was present, \DWATbytesize{}
2033 specified the size of the length data to be retrieved
2034 from the location specified by the \DWATstringlength{} attribute.
2035 \item If \DWATstringlength{} was not present, \DWATbytesize{}
2036 specified the amount of storage allocated for objects
2039 In \DWARFVersionV{}, \DWATbytesize{} always specifies the amount of storage
2040 allocated for objects of the string type.}
2043 \section{Set Type Entries}
2044 \label{chap:settypeentries}
2046 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
2047 a group of values of ordinal type.}
2049 A set is represented by a debugging information entry with
2050 the tag \DWTAGsettypeTARG.
2051 \addtoindexx{set type entry}
2052 If a name has been given to the
2053 set type, then the set type entry has
2054 a \DWATname{} attribute
2055 \addtoindexx{name attribute}
2056 whose value is a null\dash terminated string containing the
2057 set type name as it appears in the source program.
2059 The set type entry has
2060 \addtoindexx{type attribute}
2061 a \DWATtype{} attribute to denote the
2062 type of an element of the set.
2065 If the amount of storage allocated to hold each element of an
2066 object of the given set type is different from the amount of
2067 storage that is normally allocated to hold an individual object
2068 of the indicated element type, then the set type entry has
2069 either a \DWATbytesize{} attribute, or
2070 \DWATbitsize{} attribute
2071 whose value (see Section \refersec{chap:byteandbitsizes}) is
2072 the amount of storage needed to hold a value of the set type.
2075 \section{Subrange Type Entries}
2076 \label{chap:subrangetypeentries}
2078 \textit{Several languages support the concept of a \doublequote{subrange}
2079 type object. These objects can represent a subset of the
2080 values that an object of the basis type for the subrange can
2082 Subrange type entries may also be used to represent
2083 the bounds of array dimensions.}
2085 A subrange type is represented by a debugging information
2087 \addtoindexx{subrange type entry}
2088 tag \DWTAGsubrangetypeTARG.
2090 given to the subrange type, then the subrange type entry
2091 has a \DWATname{} attribute
2092 \addtoindexx{name attribute}
2093 whose value is a null\dash terminated
2094 string containing the subrange type name as it appears in
2097 The tag \DWTAGgenericsubrange{} is
2098 used to describe arrays with a dynamic rank. See Section
2099 \refersec{chap:DWTAGgenericsubrange}.
2101 The subrange entry may have
2102 \addtoindexx{type attribute}
2103 a \DWATtype{} attribute to describe
2104 the type of object, called the basis type, of whose values
2105 this subrange is a subset.
2107 If the amount of storage allocated to hold each element of an
2108 object of the given subrange type is different from the amount
2109 of storage that is normally allocated to hold an individual
2110 object of the indicated element type, then the subrange
2112 \DWATbytesize{} attribute or
2114 attribute, whose value
2115 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2117 storage needed to hold a value of the subrange type.
2120 \hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{}
2121 subrange entry may have
2122 \addtoindexx{threads scaled attribute}
2124 \DWATthreadsscaled{} attribute,
2125 which is a \livelink{chap:classflag}{flag}.
2126 If present, this attribute indicates whether
2127 this subrange represents a \addtoindex{UPC} array bound which is scaled
2128 by the runtime THREADS value (the number of \addtoindex{UPC} threads in
2129 this execution of the program).
2131 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
2133 \begin{lstlisting}[numbers=none]
2134 int shared foo[34*THREADS][10][20];
2138 \hypertarget{chap:DWATlowerboundlowerboundofsubrange}{}
2140 \hypertarget{chap:DWATupperboundupperboundofsubrange}{}
2141 entry may have the attributes
2143 \addtoindexx{lower bound attribute}
2144 and \DWATupperbound{}
2145 \addtoindexx{upper bound attribute} to specify, respectively, the lower
2146 and upper bound values of the subrange. The
2149 \hypertarget{chap:DWATcountelementsofsubrangetype}{}
2151 % FIXME: The following matches DWARF4: odd as there is no default count.
2152 \addtoindexx{count attribute!default}
2154 \addtoindexx{count attribute}
2156 \DWATcount{} attribute,
2158 value describes the number of elements in the subrange rather
2159 than the value of the last element. The value of each of
2160 these attributes is determined as described in
2161 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2163 If the lower bound value is missing, the value is assumed to
2164 be a language\dash dependent default constant as defined in
2165 Table \refersec{tab:languageencodings}.
2166 \addtoindexx{lower bound attribute!default}
2168 If the upper bound and count are missing, then the upper bound value is
2169 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
2171 If the subrange entry has no type attribute describing the
2172 basis type, the basis type is determined as follows:
2173 \begin{enumerate}[1. ]
2175 If there is a lower bound attribute that references an object,
2176 the basis type is assumed to be the same as the type of that object.
2178 Otherwise, if there is an upper bound or count attribute that references
2179 an object, the basis type is assumed to be the same as the type of that object.
2181 Otherwise, the type is
2182 assumed to be the same type, in the source language of the
2183 compilation unit containing the subrange entry, as a signed
2184 integer with the same size as an address on the target machine.
2187 If the subrange type occurs as the description of a dimension
2188 of an array type, and the stride for that dimension is
2189 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}{}
2190 different than what would otherwise be determined, then
2191 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}{}
2192 the subrange type entry has either
2193 \addtoindexx{byte stride attribute}
2195 \DWATbytestride{} or
2196 \DWATbitstride{} attribute
2197 \addtoindexx{bit stride attribute}
2198 which specifies the separation
2199 between successive elements along the dimension as described
2201 Section \refersec{chap:byteandbitsizes}.
2203 \textit{Note that the stride can be negative.}
2206 \section{Pointer to Member Type Entries}
2207 \label{chap:pointertomembertypeentries}
2209 \textit{In \addtoindex{C++}, a
2210 pointer to a data or function member of a class or
2211 structure is a unique type.}
2213 A debugging information entry representing the type of an
2214 object that is a pointer to a structure or class member has
2215 the tag \DWTAGptrtomembertypeTARG.
2217 If the \addtoindex{pointer to member type} has a name, the
2218 \addtoindexx{pointer to member type entry}
2219 pointer to member entry has a
2220 \DWATname{} attribute,
2221 \addtoindexx{name attribute}
2223 null\dash terminated string containing the type name as it appears
2224 in the source program.
2226 The \addtoindex{pointer to member} entry
2228 \addtoindexx{type attribute}
2229 a \DWATtype{} attribute to
2230 describe the type of the class or structure member to which
2231 objects of this type may point.
2233 The \addtoindexx{pointer to member} entry also
2234 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{}
2236 \DWATcontainingtype{}
2237 attribute, whose value is a \livelink{chap:classreference}{reference} to a debugging
2238 information entry for the class or structure to whose members
2239 objects of this type may point.
2241 The \addtoindex{pointer to member entry}
2242 \hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}{}
2244 \DWATuselocation{} attribute
2245 \addtoindexx{use location attribute}
2247 \addtoindex{location description} that computes the
2248 address of the member of the class to which the pointer to
2249 member entry points.
2251 \textit{The method used to find the address of a given member of a
2252 class or structure is common to any instance of that class
2253 or structure and to any instance of the pointer or member
2254 type. The method is thus associated with the type entry,
2255 rather than with each instance of the type.}
2257 The \DWATuselocation{} description is used in conjunction
2258 with the location descriptions for a particular object of the
2259 given \addtoindex{pointer to member type} and for a particular structure or
2260 class instance. The \DWATuselocation{}
2261 attribute expects two values to be
2262 \addtoindexi{pushed}{address!implicit push for member operator}
2263 onto the DWARF expression stack before
2264 the \DWATuselocation{} description is evaluated.
2266 \addtoindexi{pushed}{address!implicit push for member operator}
2267 is the value of the \addtoindex{pointer to member} object
2268 itself. The second value
2269 \addtoindexi{pushed}{address!implicit push for member operator}
2270 is the base address of the
2271 entire structure or union instance containing the member
2272 whose address is being calculated.
2275 \textit{For an expression such as}
2277 \begin{lstlisting}[numbers=none]
2280 \textit{where \texttt{mbr\_ptr} has some \addtoindex{pointer to member type}, a debugger should:}
2281 \begin{enumerate}[1. ]
2282 \item \textit{Push the value of \texttt{mbr\_ptr} onto the DWARF expression stack.}
2283 \item \textit{Push the base address of \texttt{object} onto the DWARF expression stack.}
2284 \item \textit{Evaluate the \DWATuselocation{} description
2285 given in the type of \texttt{mbr\_ptr}.}
2289 \section{File Type Entries}
2290 \label{chap:filetypeentries}
2292 \textit{Some languages, such as \addtoindex{Pascal},
2293 provide a data type to represent
2296 A file type is represented by a debugging information entry
2298 \addtoindexx{file type entry}
2301 If the file type has a name,
2302 the file type entry has a \DWATname{} attribute,
2303 \addtoindexx{name attribute}
2305 is a null\dash terminated string containing the type name as it
2306 appears in the source program.
2308 The file type entry has
2309 \addtoindexx{type attribute}
2310 a \DWATtype{} attribute describing
2311 the type of the objects contained in the file.
2313 The file type entry also has a
2314 \DWATbytesize{}\addtoindexx{byte size attribute} or
2315 \DWATbitsize{}\addtoindexx{bit size attribute} attribute, whose value
2316 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2317 is the amount of storage need to hold a value of the file type.
2319 \section{Dynamic Type Entries and Properties}
2321 \subsection{Dynamic Type Entries}
2322 \textit{Some languages such as
2323 \addtoindex{Fortran 90}, provide types whose values
2324 may be dynamically allocated or associated with a variable
2325 under explicit program control. However, unlike the related
2326 pointer type in \addtoindex{C} or
2327 \addtoindex{C++}, the indirection involved in accessing
2328 the value of the variable is generally implicit, that is, not
2329 indicated as part of program source.}
2331 A dynamic type entry is used to declare a dynamic type that is
2332 \doublequote{just like} another non-dynamic type without needing to
2333 replicate the full description of that other type.
2335 A dynamic type is represented by a debugging information entry
2336 with the tag \DWTAGdynamictypeTARG. If a name has been given to the
2337 dynamic type, then the dynamic type has a \DWATname{} attribute
2338 whose value is a null-terminated string containing the dynamic
2339 type name as it appears in the source.
2341 A dynamic type entry has a \DWATtype{} attribute whose value is a
2342 reference to the type of the entities that are dynamically allocated.
2344 A dynamic type entry also has a \DWATdatalocation, and may also
2345 have \DWATallocated{} and/or \DWATassociated{} attributes as
2346 described in Section \referfol{chap:dynamictypeproperties}.
2347 A \DWATdatalocation, \DWATallocated{} or \DWATassociated{} attribute
2348 may not occur on a dynamic type entry if the same kind of attribute
2349 already occurs on the type referenced by the \DWATtype{} attribute.
2351 \subsection{Dynamic Type Properties}
2352 \label{chap:dynamictypeproperties}
2354 The \DWATdatalocation, \DWATallocated{} and \DWATassociated{}
2355 attributes described in this section can be used for any type, not
2356 just dynamic types.}
2359 \subsubsection{Data Location}
2360 \label{chap:datalocation}
2362 \textit{Some languages may represent objects using descriptors to hold
2363 information, including a location and/or run\dash time parameters,
2364 about the data that represents the value for that object.}
2366 \hypertarget{chap:DWATdatalocationindirectiontoactualdata}{}
2367 The \DWATdatalocation{}
2368 attribute may be used with any
2369 \addtoindexx{data location attribute}
2370 type that provides one or more levels of
2371 \addtoindexx{hidden indirection|see{data location attribute}}
2373 and/or run\dash time parameters in its representation. Its value
2374 is a \addtoindex{location description}.
2375 The result of evaluating this
2376 description yields the location of the data for an object.
2377 When this attribute is omitted, the address of the data is
2378 the same as the address of the object.
2381 \textit{This location description will typically begin with
2382 \DWOPpushobjectaddress{}
2383 which loads the address of the
2384 object which can then serve as a descriptor in subsequent
2385 calculation. For an example using
2387 for a \addtoindex{Fortran 90 array}, see
2388 Appendix \refersec{app:fortranarrayexample}.}
2390 \subsubsection{Allocation and Association Status}
2391 \label{chap:allocationandassociationstatus}
2393 \textit{Some languages, such as \addtoindex{Fortran 90},
2394 provide types whose values
2395 may be dynamically allocated or associated with a variable
2396 under explicit program control.}
2398 \hypertarget{chap:DWATallocatedallocationstatusoftypes}{}
2402 \addtoindexx{allocated attribute}
2403 may optionally be used with any
2404 type for which objects of the type can be explicitly allocated
2405 and deallocated. The presence of the attribute indicates that
2406 objects of the type are allocatable and deallocatable. The
2407 integer value of the attribute (see below) specifies whether
2408 an object of the type is
2409 currently allocated or not.
2412 \hypertarget{chap:DWATassociatedassociationstatusoftypes}{}
2414 \DWATassociated{} attribute
2416 \addtoindexx{associated attribute}
2417 optionally be used with
2418 any type for which objects of the type can be dynamically
2419 associated with other objects. The presence of the attribute
2420 indicates that objects of the type can be associated. The
2421 integer value of the attribute (see below) indicates whether
2422 an object of the type is currently associated or not.
2424 \textit{While these attributes are defined specifically with
2425 \addtoindex{Fortran 90} ALLOCATABLE and POINTER types
2426 in mind, usage is not limited
2427 to just that language.}
2429 The value of these attributes is determined as described in
2430 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2432 A non\dash zero value is interpreted as allocated or associated,
2433 and zero is interpreted as not allocated or not associated.
2435 \textit{For \addtoindex{Fortran 90},
2436 if the \DWATassociated{}
2437 attribute is present,
2438 the type has the POINTER property where either the parent
2439 variable is never associated with a dynamic object or the
2440 implementation does not track whether the associated object
2441 is static or dynamic. If the \DWATallocated{} attribute is
2442 present and the \DWATassociated{} attribute is not, the type
2443 has the ALLOCATABLE property. If both attributes are present,
2444 then the type should be assumed to have the POINTER property
2445 (and not ALLOCATABLE); the \DWATallocated{} attribute may then
2446 be used to indicate that the association status of the object
2447 resulted from execution of an ALLOCATE statement rather than
2448 pointer assignment.}
2450 \textit{For examples using
2451 \DWATallocated{} for \addtoindex{Ada} and
2452 \addtoindex{Fortran 90}
2454 see Appendix \refersec{app:aggregateexamples}.}
2456 \subsubsection{Array Rank}
2457 \label{chap:DWATrank}
2458 \addtoindexx{array!assumed-rank}
2459 \addtoindexx{assumed-rank array|see{array, assumed-rank}}
2460 \textit{The Fortran language supports \doublequote{assumed-rank arrays}. The
2461 rank (the number of dimensions) of an assumed-rank array is unknown
2462 at compile time. The Fortran runtime stores the rank in the array
2463 descriptor metadata.}
2466 \hypertarget{chap:DWATrankofdynamicarray}{\DWATrankINDX}
2467 attribute indicates that an array's rank
2468 (number of dimensions) is dynamic, and therefore unknown at compile
2469 time. The value of the \DWATrankNAME{} attribute is either an integer constant
2470 or a DWARF expression whose evaluation yields the dynamic rank.
2472 The bounds of an array with dynamic rank are described using a
2473 \DWTAGgenericsubrange{} entry, which
2474 is the dynamic rank array equivalent of
2475 \DWTAGsubrangetype. The
2476 difference is that a \DWTAGgenericsubrange{} entry contains generic
2477 lower/upper bound and stride expressions that need to be evaluated for
2478 each dimension. Before any expression contained in a
2479 \DWTAGgenericsubrange{} can be evaluated, the dimension for which the
2480 expression is to be evaluated needs to be pushed onto the stack. The
2481 expression will use it to find the offset of the respective field in
2482 the array descriptor metadata.
2484 \textit{The Fortran compiler is free to choose any layout for the
2485 array descriptor. In particular, the upper and lower bounds and
2486 stride values do not need to be bundled into a structure or record,
2487 but could be laid end to end in the containing descriptor, pointed
2488 to by the descriptor, or even allocated independently of the
2491 Dimensions are enumerated $0$ to $\mathit{rank}-1$ in source program
2494 \textit{For an example in Fortran 2008, see
2495 Section~\refersec{app:assumedrankexample}.}
2498 \section{Template Alias Entries}
2499 \label{chap:templatealiasentries}
2502 In \addtoindex{C++}, a template alias is a form of typedef that has template
2503 parameters. DWARF does not represent the template alias definition
2504 but does represent instantiations of the alias.
2507 A type named using a template alias is represented
2508 by a debugging information entry
2509 \addtoindexx{template alias entry}
2511 \DWTAGtemplatealiasTARG.
2512 The template alias entry has a
2513 \DWATname{} attribute
2514 \addtoindexx{name attribute}
2515 whose value is a null\dash terminated string
2516 containing the name of the template alias as it appears in
2518 The template alias entry has child entries describing the template
2519 actual parameters (see Section \refersec{chap:templateparameters}).