2 \label{chap:typeentries}
3 This section presents the debugging information entries
4 that describe program types: base types, modified types and
8 \section{Base Type Entries}
9 \label{chap:basetypeentries}
11 \textit{A base type is a data type that is not defined in terms of
13 \addtoindexx{fundamental type|see{base type entry}}
14 Each programming language has a set of base
15 types that are considered to be built into that language.}
17 A base type is represented by a debugging information entry
18 with the tag \DWTAGbasetypeTARG.
20 A \addtoindex{base type entry}
21 may have a \DWATname{} attribute\addtoindexx{name attribute}
23 a null-terminated string containing the name of the base type
24 as recognized by the programming language of the compilation
25 unit containing the base type entry.
28 \addtoindexx{encoding attribute}
29 a \DWATencoding{} attribute describing
30 how the base type is encoded and is to be interpreted.
31 The \DWATencoding{} attribute is described in
32 Section \referfol{chap:basetypeencodings}.
35 may have a \DWATendianity{} attribute
36 \addtoindexx{endianity attribute}
38 Section \refersec{chap:dataobjectentries}.
39 If omitted, the encoding assumes the representation that
40 is the default for the target architecture.
43 A base type entry has a
44 \addtoindexx{byte size attribute}
45 \DWATbytesize{}\hypertarget{chap:DWATbytesizedataobjectordatatypesize}{}
47 \addtoindexx{bit size attribute}
48 \DWATbitsize{}\hypertarget{chap:DWATbitsizebasetypebitsize}{}
49 attribute whose \livelink{chap:classconstant}{integer constant} value
50 (see Section \refersec{chap:byteandbitsizes})
51 is the amount of storage needed to hold a value of the type.
54 \textit{For example, the
55 \addtoindex{C} type \texttt{int} on a machine that uses 32-bit
56 integers is represented by a base type entry with a name
57 attribute whose value is \doublequote{int}, an encoding attribute
58 whose value is \DWATEsigned{}
59 and a byte size attribute whose value is 4.}
61 If the value of an object of the given type does not fully
62 occupy the storage described by a byte size
63 attribute,\hypertarget{chap:DWATdatabitoffsetbasetypebitlocation}{}
64 the base type entry may also have a
65 \DWATbitsizeDEFN{} and a \DWATdatabitoffsetDEFN{} attribute,
66 \addtoindexx{bit size attribute}
67 \addtoindexx{data bit offset attribute}
68 both of whose values are
69 \livelink{chap:classconstant}{integer constant} values
70 (see Section \refersec{chap:staticanddynamicvaluesofattributes}).
72 attribute describes the actual size in bits used to represent
73 values of the given type. The data bit offset attribute is the
74 offset in bits from the beginning of the containing storage to
75 the beginning of the value. Bits that are part of the offset
77 If this attribute is omitted a default data bit offset
80 A \DWTAGbasetype{} entry may have additional attributes that
81 augment certain of the base type encodings; these are described
82 in the following section.
84 \subsection{Base Type Encodings}
85 \label{chap:basetypeencodings}
87 \addtoindexx{encoding attribute}
88 a \DWATencoding{} attribute describing
89 how the base type is encoded and is to be interpreted. The
90 value of this attribute is an integer of class \CLASSconstant.
91 The set of values and their meanings for the
92 \DWATencoding{} attribute is given in
93 Table \refersec{tab:encodingattributevalues}.
95 \textit{In Table \ref{tab:encodingattributevalues}, encodings
96 are shown in groups that have similar characteristics purely
97 for presentation purposes. These groups are not part of this
100 \newcommand{\EncodingGroup}[1]{\multicolumn{2}{l}{\hspace{2cm}\bfseries\textit{#1}}}
102 \caption{Encoding attribute values}
103 \label{tab:encodingattributevalues}
105 \begin{tabular}{l|P{8cm}}
107 \bfseries Name & \bfseries Meaning\\ \hline
109 \EncodingGroup{Simple encodings} \\
110 \DWATEbooleanTARG & true or false \\
111 \DWATEaddressTARG{} & linear machine address$^a$ \\
112 \DWATEsignedTARG & signed binary integer \\
113 \DWATEsignedcharTARG & signed character \\
114 \DWATEunsignedTARG & unsigned binary integer \\
115 \DWATEunsignedcharTARG & unsigned character \\
117 \EncodingGroup{Character encodings} \\
118 \DWATEASCIITARG{} & \addtoindex{ISO/IEC 646:1991 character}
119 \addtoindexx{ASCII character} \\
120 \DWATEUCSTARG{} & \addtoindex{ISO/IEC 10646-1:1993 character (UCS-4)}
121 \addtoindexx{UCS character} \\
122 \DWATEUTFTARG{} & \addtoindex{ISO/IEC 10646-1:1993 character}
123 \addtoindexx{UTF character} \\
125 \EncodingGroup{Scaled encodings} \\
126 \DWATEsignedfixedTARG{} & signed fixed-point scaled integer \\
127 \DWATEunsignedfixedTARG & unsigned fixed-point scaled integer \\
129 \EncodingGroup{Floating-point encodings} \\
130 \DWATEfloatTARG & binary floating-point number \\
131 \DWATEcomplexfloatTARG & complex binary floating-point number \\
132 \DWATEimaginaryfloatTARG & imaginary binary floating-point number \\
133 \DWATEdecimalfloatTARG{} & \addtoindex{IEEE 754R decimal floating-point number} \\
135 \EncodingGroup{Decimal string encodings} \\
136 \DWATEpackeddecimalTARG & packed decimal number\\
137 \DWATEnumericstringTARG & numeric string \\
138 \DWATEeditedTARG & edited string \\
141 \multicolumn{2}{l}{$^a$For segmented addresses, see Section \refersec{chap:segmentedaddresses}} \\
145 \subsubsection{Simple Encodings}
146 \label{chap:simpleencodings}
147 Types with simple encodings are widely supported in many
148 programming languages and are not discussed further.
151 \subsubsection{Character Encodings}
152 \label{chap:characterencodings}
154 specifies the \addtoindex{Unicode} string encoding
155 (see the Universal Character Set standard,
156 ISO/IEC 10646\dash 1:1993).
157 \addtoindexx{ISO 10646 character set standard}
159 \textit{For example, the \addtoindex{C++} type char16\_t is
160 represented by a base type entry with a name attribute whose
161 value is \doublequote{char16\_t}, an encoding attribute whose value
162 is \DWATEUTF{} and a byte size attribute whose value is 2.}
165 \DWATEASCII{} and \DWATEUCS{} specify encodings for
166 the \addtoindex{Fortran 2003} string kinds
167 \texttt{ASCII}\index{ASCII@\texttt{ASCII} (Fortran string kind)} (ISO/IEC 646:1991) and
168 \texttt{ISO\_10646}\index{ISO\_10646@\texttt{ISO\_10646} (Fortran string kind)} (UCS-4 in ISO/IEC 10646:2000).
169 \addtoindexx{ISO 10646 character set standard}
171 \subsubsection{Scaled Encodings}
172 \label{chap:scaledencodings}
173 The \DWATEsignedfixed{} and \DWATEunsignedfixed{} entries
174 describe signed and unsigned fixed\dash point binary data types,
177 The fixed binary type encodings have a
178 \DWATdigitcount{} attribute\addtoindexx{digit count attribute}
179 with the same interpretation as described for the
180 \DWATEpackeddecimal{} and \DWATEnumericstring{} base type encodings
181 (see Section \refersec{chap:decimalstringencodings}).
184 For a data type with a decimal scale factor, the fixed binary
185 type entry has a \DWATdecimalscale{} attribute
186 \addtoindexx{decimal scale attribute}
187 with the same interpretation as described for the
188 \DWATEpackeddecimal{} and \DWATEnumericstring{} base types
189 (see Section \refersec{chap:decimalstringencodings}).
191 For\hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}{}
192 a data type with a binary scale factor, the fixed
193 binary type entry has a \DWATbinaryscaleNAME{} attribute.
194 The \DWATbinaryscaleDEFN{} attribute\addtoindexx{binary scale attribute}
195 is an \livelink{chap:classconstant}{integer constant} value
196 that represents the exponent of the base two scale factor to
197 be applied to an instance of the type. Zero scale puts the
198 binary point immediately to the right of the least significant
199 bit. Positive scale moves the binary point to the right and
200 implies that additional zero bits on the right are not stored
201 in an instance of the type. Negative scale moves the binary
202 point to the left; if the absolute value of the scale is
203 larger than the number of bits, this implies additional zero
204 bits on the left are not stored in an instance of the type.
206 For\hypertarget{chap:DWATsmallscalefactorforfixedpointtype}{}
207 a data type with a non-decimal and non-binary scale factor,
208 the fixed binary type entry has a \DWATsmallDEFN{} attribute which
209 \addtoindexx{small attribute} references a
210 \DWTAGconstant{} entry. The scale factor value
211 is interpreted in accordance with the value defined by the
212 \DWTAGconstant{} entry. The value represented is the product
213 of the integer value in memory and the associated constant
216 \textit{The \DWATsmall{} attribute is defined with the
217 \addtoindex{Ada} \texttt{small} attribute in mind.}
220 \subsubsection{Floating-Point Encodings}
221 \label{chap:floatingpointencodings}
222 Types with binary floating-point encodings
223 (\DWATEfloat{}, \DWATEcomplexfloat{} and \DWATEimaginaryfloat{})
224 are supported in many
225 programming languages and are not discussed further.
227 \DWATEdecimalfloat{} specifies
228 floating-point representations that have a power-of-ten
229 exponent, such as specified in IEEE 754R.
231 \subsubsection{Decimal String Encodings}
232 \label{chap:decimalstringencodings}
233 The \DWATEpackeddecimalDEFN{} and \DWATEnumericstringDEFN{}
235 represent packed and unpacked decimal string numeric data
236 types, respectively, either of which may be either
237 \addtoindexx{decimal scale attribute}
239 \addtoindexx{decimal sign attribute}
241 \addtoindexx{digit count attribute}
243 base types are used in combination with
245 \DWATdigitcount{} and
250 A\hypertarget{chap:DWATdecimalsigndecimalsignrepresentation}{}
251 \DWATdecimalsignDEFN{} attribute
252 \addtoindexx{decimal sign attribute}
253 is an \livelink{chap:classconstant}{integer constant} that
254 conveys the representation of the sign of the decimal type
255 (see Table \refersec{tab:decimalsignattributevalues}).
256 Its \livelink{chap:classconstant}{integer constant} value is interpreted to
257 mean that the type has a leading overpunch, trailing overpunch,
258 leading separate or trailing separate sign representation or,
259 alternatively, no sign at all.
262 \caption{Decimal sign attribute values}
263 \label{tab:decimalsignattributevalues}
265 \begin{tabular}{l|P{9cm}}
269 \DWDSunsignedTARG{} & Unsigned \\
270 \DWDSleadingoverpunchTARG{} & Sign
271 is encoded in the most significant digit in a target-dependent manner \\
272 \DWDStrailingoverpunchTARG{} & Sign
273 is encoded in the least significant digit in a target-dependent manner \\
274 \DWDSleadingseparateTARG{}
275 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
276 to the left of the most significant digit. \\
277 \DWDStrailingseparateTARG{}
278 & Decimal type: Sign is a \doublequote{+} or \doublequote{-} character
279 to the right of the least significant digit. \\
280 &Packed decimal type: Least significant nibble contains
281 a target\dash dependent value
282 indicating positive or negative. \\
288 The\hypertarget{chap:DWATdecimalscaledecimalscalefactor}{}
289 \DWATdecimalscaleDEFN{} attribute
290 \addtoindexx{decimal scale attribute}
291 is an integer constant value
292 that represents the exponent of the base ten scale factor to
293 be applied to an instance of the type. A scale of zero puts the
294 decimal point immediately to the right of the least significant
295 digit. Positive scale moves the decimal point to the right
296 and implies that additional zero digits on the right are not
297 stored in an instance of the type. Negative scale moves the
298 decimal point to the left; if the absolute value of the scale
299 is larger than the digit count, this implies additional zero
300 digits on the left are not stored in an instance of the type.
302 The\hypertarget{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}{}
303 \DWATdigitcountDEFN{} attribute
304 \addtoindexx{digit count attribute}
305 is an \livelink{chap:classconstant}{integer constant}
306 value that represents the number of digits in an instance of
309 The\hypertarget{chap:DWATpicturestringpicturestringfornumericstringtype}{}
310 \DWATEedited{} base type is used to represent an edited
311 numeric or alphanumeric data type. It is used in combination
312 with a \DWATpicturestringDEFN{} attribute whose value is a
313 null\dash terminated string containing the target\dash dependent picture
314 string associated with the type.
316 If the edited base type entry describes an edited numeric
317 data type, the edited type entry has a \DWATdigitcount{} and a
318 \DWATdecimalscale{} attribute.\addtoindexx{decimal scale attribute}
319 These attributes have the same
320 interpretation as described for the
321 \DWATEpackeddecimal{} and
322 \DWATEnumericstring{} base
323 types. If the edited type entry
324 describes an edited alphanumeric data type, the edited type
325 entry does not have these attributes.
327 \textit{The presence or absence of the \DWATdigitcount{} and
328 \DWATdecimalscale{} attributes\addtoindexx{decimal scale attribute}
329 allows a debugger to easily
330 distinguish edited numeric from edited alphanumeric, although
331 in principle the digit count and scale are derivable by
332 interpreting the picture string.}
335 \section{Unspecified Type Entries}
336 \label{chap:unspecifiedtypeentries}
337 \addtoindexx{unspecified type entry}
338 \addtoindexx{void type|see{unspecified type entry}}
339 Some languages have constructs in which a type
340 may be left unspecified or the absence of a type
341 may be explicitly indicated.
343 An unspecified (implicit, unknown, ambiguous or nonexistent)
344 type is represented by a debugging information entry with
345 the tag \DWTAGunspecifiedtypeTARG.
346 If a name has been given
347 to the type, then the corresponding unspecified type entry
348 has a \DWATname{} attribute
349 \addtoindexx{name attribute}
351 a null\dash terminated
352 string containing the name.
354 \textit{The interpretation of this debugging information entry is
355 intentionally left flexible to allow it to be interpreted
356 appropriately in different languages. For example, in
357 \addtoindex{C} and \addtoindex{C++}
358 the language implementation can provide an unspecified type
359 entry with the name \doublequote{void} which can be referenced by the
360 type attribute of pointer types and typedef declarations for
362 Sections \refersec{chap:typemodifierentries} and
363 %The following reference was valid, so the following is probably correct.
364 Section \refersec{chap:typedefentries},
365 respectively). As another
366 example, in \addtoindex{Ada} such an unspecified type entry can be referred
367 to by the type attribute of an access type where the denoted
368 \addtoindexx{incomplete type (Ada)}
369 type is incomplete (the name is declared as a type but the
370 definition is deferred to a separate compilation unit).}
372 \textit{\addtoindex{C++} permits using the
373 \autoreturntype{} specifier for the return type of a member function declaration.
374 The actual return type is deduced based on the definition of the
375 function, so it may not be known when the function is declared. The language
376 implementation can provide an unspecified type entry with the name \texttt{auto} which
377 can be referenced by the return type attribute of a function declaration entry.
378 When the function is later defined, the \DWTAGsubprogram{} entry for the definition
379 includes a reference to the actual return type.}
382 \section{Type Modifier Entries}
383 \label{chap:typemodifierentries}
384 \addtoindexx{type modifier entry}
385 \addtoindexx{type modifier|see{atomic type entry}}
386 \addtoindexx{type modifier|see{constant type entry}}
387 \addtoindexx{type modifier|see{reference type entry}}
388 \addtoindexx{type modifier|see{restricted type entry}}
389 \addtoindexx{type modifier|see{packed type entry}}
390 \addtoindexx{type modifier|see{pointer type entry}}
391 \addtoindexx{type modifier|see{shared type entry}}
392 \addtoindexx{type modifier|see{volatile type entry}}
393 A base or user\dash defined type may be modified in different ways
394 in different languages. A type modifier is represented in
395 DWARF by a debugging information entry with one of the tags
396 given in Table \refersec{tab:typemodifiertags}.
398 If a name has been given to the modified type in the source
399 program, then the corresponding modified type entry has
400 a \DWATname{} attribute
401 \addtoindexx{name attribute}
402 whose value is a null\dash terminated
403 string containing the modified type name.
405 Each of the type modifier entries has
406 \addtoindexx{type attribute}
408 \DWATtype{} attribute,
409 whose value is a \livelink{chap:classreference}{reference}
410 to a debugging information entry
411 describing a base type, a user-defined type or another type
414 A modified type entry describing a
415 \addtoindexx{pointer type entry}
416 pointer or \addtoindex{reference type}
417 (using \DWTAGpointertype,
418 \DWTAGreferencetype{} or
419 \DWTAGrvaluereferencetype)
420 % Another instance of no-good-place-to-put-index entry.
422 a\hypertarget{chap:DWATadressclasspointerorreferencetypes}{}
423 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
424 attribute to describe how objects having the given pointer
425 or reference type are dereferenced.
427 A modified type entry describing a \addtoindex{UPC} shared qualified type
428 (using \DWTAGsharedtype) may have a
429 \DWATcount{} attribute
430 \addtoindexx{count attribute}
431 whose value is a constant expressing the (explicit or implied) blocksize specified for the
432 type in the source. If no count attribute is present, then the \doublequote{infinite}
433 blocksize is assumed.
435 When multiple type modifiers are chained together to modify
436 a base or user-defined type, the tree ordering reflects the
438 \addtoindexx{reference type entry, lvalue|see{reference type entry}}
440 \addtoindexx{reference type entry, rvalue|see{rvalue reference type entry}}
442 \addtoindexx{parameter|see{macro formal parameter list}}
444 \addtoindexx{parameter|see{\textit{this} parameter}}
446 \addtoindexx{parameter|see{variable parameter attribute}}
448 \addtoindexx{parameter|see{optional parameter attribute}}
450 \addtoindexx{parameter|see{unspecified parameters entry}}
452 \addtoindexx{parameter|see{template value parameter entry}}
454 \addtoindexx{parameter|see{template type parameter entry}}
456 \addtoindexx{parameter|see{formal parameter entry}}
460 \caption{Type modifier tags}
461 \label{tab:typemodifiertags}
463 \begin{tabular}{l|P{9cm}}
465 Name&Meaning\\ \hline
466 \DWTAGatomictypeTARG{} &
467 atomic qualified type
471 \addtoindexx{atomic qualified type entry} \addtoindexx{C} \\
472 \DWTAGconsttypeTARG{} &
475 (for example in C, C++)
477 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
479 \DWTAGimmutabletypeTARG &
481 (for example, in \addtoindex{D})
483 \addtoindexx{immutable type} \\
484 \DWTAGpackedtypeTARG &
485 packed type\addtoindexx{packed type entry}
487 (for example in Ada, Pascal)
489 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
490 \DWTAGpointertypeTARG{} &
491 pointer to an object of the type being modified
492 \addtoindexx{pointer qualified type entry} \\
493 \DWTAGreferencetypeTARG &
495 reference to (lvalue of) an object of the type \mbox{being} modified
497 \addtoindexx{reference type entry}
498 \addtoindexx{reference qualified type entry} \\
499 \DWTAGrestricttypeTARG &
500 restrict qualified type
501 \addtoindexx{restricted type entry}
502 \addtoindexx{restrict qualified type} \addtoindexx{C} \\
503 \DWTAGrvaluereferencetypeTARG{} &
504 rvalue reference to an object of the type \mbox{being} modified
506 (for example, in \addtoindex{C++})
508 \addtoindexx{rvalue reference type entry}
509 \addtoindexx{restricted type entry}
510 \addtoindexx{rvalue reference qualified type entry} \\
511 \DWTAGsharedtypeTARG &
512 shared qualified type
514 (for example, in \addtoindex{UPC})
516 \addtoindexx{shared qualified type entry} \\
517 \DWTAGvolatiletypeTARG &
518 volatile qualified type
520 (for example, in \addtoindex{C}, \addtoindex{C++})
522 \addtoindexx{volatile qualified type entry} \\
528 \textit{As examples of how type modifiers are ordered, consider the following
529 \addtoindex{C} declarations:}
530 \begin{lstlisting}[numbers=none]
531 const unsigned char * volatile p;
533 \textit{which represents a volatile pointer to a constant
534 character. This is encoded in DWARF as:}
538 \DWTAGvariable(p) -->
539 \DWTAGvolatiletype -->
540 \DWTAGpointertype -->
542 \DWTAGbasetype(unsigned char)
547 \textit{On the other hand}
548 \begin{lstlisting}[numbers=none]
549 volatile unsigned char * const restrict p;
551 \textit{represents a restricted constant
552 pointer to a volatile character. This is encoded as:}
556 \DWTAGvariable(p) -->
557 \DWTAGrestricttype -->
559 \DWTAGpointertype -->
560 \DWTAGvolatiletype -->
561 \DWTAGbasetype(unsigned char)
565 \section{Typedef Entries}
566 \label{chap:typedefentries}
567 A named type that is defined in terms of another type
568 definition is represented by a debugging information entry with
569 \addtoindexx{typedef entry}
570 the tag \DWTAGtypedefTARG.
571 The typedef entry has a \DWATname{} attribute
572 \addtoindexx{name attribute}
573 whose value is a null\dash terminated string containing
574 the name of the typedef.
576 The typedef entry may also contain
577 \addtoindexx{type attribute}
579 \DWATtype{} attribute whose
580 value is a \livelink{chap:classreference}{reference}
581 to the type named by the typedef. If
582 the debugging information entry for a typedef represents
583 a declaration of the type that is not also a definition,
584 it does not contain a type attribute.
586 \textit{Depending on the language, a named type that is defined in
587 terms of another type may be called a type alias, a subtype,
588 a constrained type and other terms. A type name declared with
589 no defining details may be termed an
590 \addtoindexx{incomplete type}
591 incomplete, forward or hidden type.
592 While the DWARF \DWTAGtypedef{} entry was
593 originally inspired by the like named construct in
594 \addtoindex{C} and \addtoindex{C++},
595 it is broadly suitable for similar constructs (by whatever
596 source syntax) in other languages.}
598 \section{Array Type Entries}
599 \label{chap:arraytypeentries}
600 \label{chap:DWTAGgenericsubrange}
602 \textit{Many languages share the concept of an \doublequote{array,} which is
603 \addtoindexx{array type entry}
604 a table of components of identical type.}
606 An array type is represented by a debugging information entry
607 with the tag \DWTAGarraytypeTARG.
608 If a name has been given to
609 \addtoindexx{array!declaration of type}
610 the array type in the source program, then the corresponding
611 array type entry has a \DWATname{} attribute
612 \addtoindexx{name attribute}
614 null-terminated string containing the array type name.
616 The\hypertarget{chap:DWATorderingarrayrowcolumnordering}{}
617 array type entry describing a multidimensional array may
618 \addtoindexx{array!element ordering}
619 have a \DWATorderingDEFN{} attribute whose
620 \livelink{chap:classconstant}{integer constant} value is
621 interpreted to mean either row-major or column-major ordering
622 of array elements. The set of values and their meanings
623 for the ordering attribute are listed in
624 Table \referfol{tab:arrayordering}.
626 ordering attribute is present, the default ordering for the
627 source language (which is indicated by the
630 \addtoindexx{language attribute}
631 of the enclosing compilation unit entry) is assumed.
633 \begin{simplenametable}[1.8in]{Array ordering}{tab:arrayordering}
634 \DWORDcolmajorTARG{} \\
635 \DWORDrowmajorTARG{} \\
636 \end{simplenametable}
638 An array type entry has
639 \addtoindexx{type attribute}
640 a \DWATtype{} attribute
642 \addtoindexx{array!element type}
643 the type of each element of the array.
645 If the amount of storage allocated to hold each element of an
646 object of the given array type is different from the amount
647 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
648 of storage that is normally allocated to hold an individual object
649 of\hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}{}
650 the\hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}{}
651 indicated element type, then the array type entry has either a
652 \addtoindexx{byte stride attribute}
653 \DWATbytestrideDEFN{}
655 \addtoindexx{bit stride attribute}
657 attribute, whose value
658 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
660 element of the array.
662 The array type entry may have either a \DWATbytesize{} or a
663 \DWATbitsize{} attribute
664 (see Section \refersec{chap:byteandbitsizes}),
666 amount of storage needed to hold an instance of the array type.
668 \textit{If the size of the array can be determined statically at
669 compile time, this value can usually be computed by multiplying
670 the number of array elements by the size of each element.}
673 Each array dimension is described by a debugging information
674 entry with either the
675 \addtoindexx{subrange type entry!as array dimension}
676 tag \DWTAGsubrangetype{} or the
677 \addtoindexx{enumeration type entry!as array dimension}
679 \DWTAGenumerationtype. These entries are
681 array type entry and are ordered to reflect the appearance of
682 the dimensions in the source program (that is, leftmost dimension
683 first, next to leftmost second, and so on).
685 \textit{In languages that have no concept of a
686 \doublequote{multidimensional array} (for example,
687 \addtoindex{C}), an array of arrays may
688 be represented by a debugging information entry for a
689 multidimensional array.}
691 Alternatively, for an array with dynamic rank the array dimensions
692 are described by a debugging information entry with the tag
693 \DWTAGgenericsubrangeTARG.
694 This entry has the same attributes as a
695 \DWTAGsubrangetype{} entry; however,
696 there is just one \DWTAGgenericsubrangeNAME{} entry and it describes all of the
697 dimensions of the array.
698 If \DWTAGgenericsubrangeNAME{}
699 is used, the number of dimensions must be specified using a
700 \DWATrank{} attribute. See also Section
701 \refersec{chap:DWATrank}.
704 Other attributes especially applicable to arrays are
706 \DWATassociated{} and
708 which are described in
709 Section \refersec{chap:dynamicpropertiesoftypes}.
710 For relevant examples, see also Appendix \refersec{app:fortranarrayexample}.
712 \section{Coarray Type Entries}
713 \label{chap:coarraytypeentries}
714 \addtoindexx{coarray}
715 \textit{In Fortran, a \doublequote{coarray} is an array whose
716 elements are located in different processes rather than in the
717 memory of one process. The individual elements
718 of a coarray can be scalars or arrays.
719 Similar to arrays, coarrays have \doublequote{codimensions} that are
720 indexed using a \doublequote{coindex} or multiple \doublequote{coindices}.
721 \addtoindexx{codimension|see{coarray}}
722 \addtoindexx{coindex|see{coarray}}
725 A coarray type is represented by a debugging information entry
726 with the tag \DWTAGcoarraytypeTARG.
727 If a name has been given to the
728 coarray type in the source, then the corresponding coarray type
729 entry has a \DWATname{} attribute whose value is a null-terminated
730 string containing the array type name.
732 A coarray entry has one or more \DWTAGsubrangetype{} child entries,
733 one for each codimension. It also has a \DWATtype{} attribute
734 describing the type of each element of the coarray.
736 \textit{In a coarray application, the run-time number of processes in the application
737 is part of the coindex calculation. It is represented in the Fortran source by
738 a coindex which is declared with a \doublequote{*} as the upper bound. To express this
739 concept in DWARF, the \DWTAGsubrangetype{} child entry for that index has
740 only a lower bound and no upper bound.}
742 \textit{How coarray elements are located and how coindices are
743 converted to process specifications is implementation-defined.}
746 \section{Structure, Union, Class and Interface Type Entries}
747 \label{chap:structureunionclassandinterfacetypeentries}
749 \textit{The languages
751 \addtoindex{C++}, and
752 \addtoindex{Pascal}, among others, allow the
753 programmer to define types that are collections of related
754 \addtoindexx{structure type entry}
756 In \addtoindex{C} and \addtoindex{C++}, these collections are called
757 \doublequote{structures.}
758 In \addtoindex{Pascal}, they are called \doublequote{records.}
759 The components may be of different types. The components are
760 called \doublequote{members} in \addtoindex{C} and
761 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
763 \textit{The components of these collections each exist in their
764 own space in computer memory. The components of a \addtoindex{C} or \addtoindex{C++}
765 \doublequote{union} all coexist in the same memory.}
767 \textit{\addtoindex{Pascal} and
768 other languages have a \doublequote{discriminated union,}
769 \addtoindexx{discriminated union|see {variant entry}}
770 also called a \doublequote{variant record.} Here, selection of a
771 number of alternative substructures (\doublequote{variants}) is based
772 on the value of a component that is not part of any of those
773 substructures (the \doublequote{discriminant}).}
775 \textit{\addtoindex{C++} and
776 \addtoindex{Java} have the notion of \doublequote{class,} which is in some
777 ways similar to a structure. A class may have \doublequote{member
778 functions} which are subroutines that are within the scope
779 of a class or structure.}
781 \textit{The \addtoindex{C++} notion of
782 structure is more general than in \addtoindex{C}, being
783 equivalent to a class with minor differences. Accordingly,
784 in the following discussion, statements about
785 \addtoindex{C++} classes may
786 be understood to apply to \addtoindex{C++} structures as well.}
788 \subsection{Structure, Union and Class Type Entries}
789 \label{chap:structureunionandclasstypeentries}
790 Structure, union, and class types are represented by debugging
791 \addtoindexx{structure type entry}
793 \addtoindexx{union type entry}
795 \addtoindexx{class type entry}
797 \DWTAGstructuretypeTARG,
799 and \DWTAGclasstypeTARG,
800 respectively. If a name has been given to the structure,
801 union, or class in the source program, then the corresponding
802 structure type, union type, or class type entry has a
803 \DWATname{} attribute
804 \addtoindexx{name attribute}
805 whose value is a null\dash terminated string
806 containing the type name.
808 The members of a structure, union, or class are represented
809 by debugging information entries that are owned by the
810 corresponding structure type, union type, or class type entry
811 and appear in the same order as the corresponding declarations
812 in the source program.
814 A structure, union, or class type may have a \DWATexportsymbolsDEFN{}
815 attribute\addtoindexx{export symbols (of structure, class or union) attribute}
816 \livetarg{chap:DWATexportsymbolsofstructunionclass}{}
817 which indicates that all member names defined within
818 the structure, union, or class may be referenced as if they were
819 defined within the containing structure, union, or class.
821 \textit{This may be used to describe anonymous structures, unions
822 and classes in \addtoindex{C} or \addtoindex{C++}}.
824 A\hypertarget{chap:DWATbitsizedatamemberbitsize}{}
825 structure type, union type or class type entry may have
826 either a \DWATbytesize{} or a \DWATbitsize{} attribute
827 (see Section \refersec{chap:byteandbitsizes}),
828 whose value is the amount of storage needed
829 to hold an instance of the structure, union or class type,
830 including any padding.
832 An incomplete structure, union or class type
833 \addtoindexx{incomplete structure/union/class}
834 \addtoindexx{incomplete type}
835 is represented by a structure, union or class
836 entry that does not have a byte size attribute and that has
837 \addtoindexx{declaration attribute}
838 a \DWATdeclaration{} attribute.
840 If the complete declaration of a type has been placed
841 in\hypertarget{chap:DWATsignaturetypesignature}{}
842 a separate \addtoindex{type unit}
843 (see Section \refersec{chap:typeunitentries}),
844 an incomplete declaration
845 \addtoindexx{incomplete type}
846 of that type in the compilation unit may provide
847 the unique 8-byte signature of the type using a
848 \addtoindexx{type signature}
849 \DWATsignatureDEFN{} attribute.
851 If a structure, union or class entry represents the definition
852 of a structure, union or class member corresponding to a prior
853 incomplete structure, union or class, the entry may have a
854 \DWATspecification{} attribute
855 \addtoindexx{specification attribute}
856 whose value is a \livelink{chap:classreference}{reference} to
857 the debugging information entry representing that incomplete
860 Structure, union and class entries containing the
861 \DWATspecification{} attribute
862 \addtoindexx{specification attribute}
863 do not need to duplicate
864 information provided by the declaration entry referenced by the
865 specification attribute. In particular, such entries do not
866 need to contain an attribute for the name of the structure,
867 union or class they represent if such information is already
868 provided in the declaration.
870 \textit{For \addtoindex{C} and \addtoindex{C++},
872 \addtoindexx{data member|see {member entry (data)}}
873 member declarations occurring within
874 the declaration of a structure, union or class type are
875 considered to be \doublequote{definitions} of those members, with
876 the exception of \doublequote{static} data members, whose definitions
877 appear outside of the declaration of the enclosing structure,
878 union or class type. Function member declarations appearing
879 within a structure, union or class type declaration are
880 definitions only if the body of the function also appears
881 within the type declaration.}
883 If the definition for a given member of the structure, union
884 or class does not appear within the body of the declaration,
885 that member also has a debugging information entry describing
886 its definition. That latter entry has a
887 \DWATspecification{} attribute
888 \addtoindexx{specification attribute}
889 referencing the debugging information entry
890 owned by the body of the structure, union or class entry and
891 representing a non-defining declaration of the data, function
892 or type member. The referenced entry will not have information
893 about the location of that member (low and high PC attributes
894 for function members, location descriptions for data members)
895 and will have a \DWATdeclaration{} attribute.
898 \textit{Consider a nested class whose
899 definition occurs outside of the containing class definition, as in:}
901 \begin{lstlisting}[numbers=none]
908 \textit{The two different structs can be described in
909 different compilation units to
910 facilitate DWARF space compression
911 (see Appendix \refersec{app:usingcompilationunits}).}
914 A structure type, union type or class type entry may have a
915 \DWATcallingconventionDEFN{} attribute,
916 \addtoindexx{calling convention attribute!for types}
917 whose value indicates whether a value of the type
922 or passed by value. The set of calling convention codes for use with types
923 \addtoindexx{calling convention codes!for types}
924 is\hypertarget{chap:DWATcallingconventionfortypes}{}
925 given in Table \referfol{tab:callingconventioncodesfortypes}.
927 \begin{simplenametable}[2.2in]{Calling convention codes for types}{tab:callingconventioncodesfortypes}
929 \DWCCpassbyvalueTARG \\
930 \DWCCpassbyreferenceTARG \\
931 \end{simplenametable}
933 If this attribute is not present, or its value is
934 \DWCCnormalNAME, the convention to be used for an object of the
935 given type is assumed to be unspecified.
937 \textit{Note that \DWCCnormalNAME{} is also used as a calling convention
938 code for certain subprograms
939 (see Table \refersec{tab:callingconventioncodesforsubroutines}).}
941 \textit{If unspecified, a consumer may be able to deduce the calling
942 convention based on knowledge of the type and the ABI.}
945 \subsection{Interface Type Entries}
946 \label{chap:interfacetypeentries}
948 \textit{The \addtoindex{Java} language defines \doublequote{interface} types.
950 \addtoindexx{interface type entry}
951 in \addtoindex{Java} is similar to a \addtoindex{C++} or
952 \addtoindex{Java} class with only abstract
953 methods and constant data members.}
956 \addtoindexx{interface type entry}
957 are represented by debugging information
959 tag \DWTAGinterfacetypeTARG.
961 An interface type entry has
962 a \DWATname{} attribute,
963 \addtoindexx{name attribute}
964 whose value is a null\dash terminated string containing the
967 The members of an interface are represented by debugging
968 information entries that are owned by the interface type
969 entry and that appear in the same order as the corresponding
970 declarations in the source program.
972 \subsection{Derived or Extended Structures, Classes and Interfaces}
973 \label{chap:derivedorextendedstructsclasesandinterfaces}
975 \textit{In \addtoindex{C++}, a class (or struct)
977 \addtoindexx{derived type (C++)|see{inheritance entry}}
978 be \doublequote{derived from} or be a
979 \doublequote{subclass of} another class.
980 In \addtoindex{Java}, an interface may \doublequote{extend}
981 \addtoindexx{extended type (Java)|see{inheritance entry}}
983 \addtoindexx{implementing type (Java)|see{inheritance entry}}
984 or more other interfaces, and a class may \doublequote{extend} another
985 class and/or \doublequote{implement} one or more interfaces. All of these
986 relationships may be described using the following. Note that
987 in \addtoindex{Java},
988 the distinction between extends and implements is
989 implied by the entities at the two ends of the relationship.}
991 A class type or interface type entry that describes a
992 derived, extended or implementing class or interface owns
993 \addtoindexx{implementing type (Java)|see{inheritance entry}}
994 debugging information entries describing each of the classes
995 or interfaces it is derived from, extending or implementing,
996 respectively, ordered as they were in the source program. Each
998 \addtoindexx{inheritance entry}
1000 tag \DWTAGinheritanceTARG.
1003 An inheritance entry
1004 \addtoindexx{type attribute}
1006 \addtoindexx{inheritance entry}
1008 \DWATtype{} attribute whose value is
1009 a reference to the debugging information entry describing the
1010 class or interface from which the parent class or structure
1011 of the inheritance entry is derived, extended or implementing.
1013 An\hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}{}
1014 inheritance entry\addtoindexx{inheritance entry}
1015 for a class that derives from or extends
1016 another class or struct also has a
1017 \DWATdatamemberlocationDEFN{} attribute,
1018 \addtoindexx{data member location attribute}
1019 whose value describes the location of the beginning
1020 of the inherited type relative to the beginning address of the
1021 instance of the derived class. If that value is a constant, it is the offset
1022 in bytes from the beginning of the class to the beginning of
1023 the instance of the inherited type. Otherwise, the value must be a location
1024 description. In this latter case, the beginning address of
1025 the instance of the derived class is pushed on the expression stack before
1026 the \addtoindex{location description}
1027 is evaluated and the result of the
1028 evaluation is the location of the instance of the inherited type.
1030 \textit{The interpretation of the value of this attribute for
1031 inherited types is the same as the interpretation for data
1033 (see Section \referfol{chap:datamemberentries}). }
1035 An\hypertarget{chap:DWATaccessibilitycppinheritedmembers}{}
1036 \addtoindexx{inheritance entry}
1037 inheritance entry may have a
1038 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1039 attribute.\addtoindexx{accessibility attribute}
1040 If no accessibility attribute is present, private access
1041 is assumed for an entry of a class and public access is
1042 assumed for an entry of a struct, union or interface.
1044 If the class referenced by the \addtoindex{inheritance entry}
1045 serves as a \addtoindex{C++} virtual base class, the
1046 inheritance entry has a
1047 \hyperlink{chap:DWATvirtualityvirtualityindication}{\DWATvirtualityNAME}
1050 \textit{For a \addtoindex{C++} virtual base, the
1051 \addtoindex{data member location attribute}
1052 will usually consist of a non-trivial
1053 \addtoindex{location description}.}
1055 \subsection{Access Declarations}
1056 \label{chap:accessdeclarations}
1058 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1059 change the accessibility of individual class members from the
1060 overall accessibility specified by the inheritance declaration.
1061 A single access declaration may refer to a set of overloaded
1064 If a derived class or structure contains access declarations,
1065 each such declaration may be represented by a debugging
1066 information entry with the tag \DWTAGaccessdeclarationTARG.
1067 \addtoindexx{access declaration entry}
1068 Each such entry is a child of the class or structure type entry.
1070 An access declaration entry has a \DWATname{} attribute,
1071 whose value is a null-terminated string representing the name
1072 used in the declaration,
1073 including any class or structure qualifiers.
1075 An\hypertarget{chap:DWATaccessdeclaration}{}
1076 access declaration entry also has a
1077 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1078 \addtoindexx{accessibility attribute}
1079 attribute describing the declared accessibility of the named entities.
1083 \subsection{Friends}
1084 \label{chap:friends}
1086 Each\hypertarget{chap:DWATfriendfriendrelationship}{}
1087 friend\addtoindexx{friend entry}
1088 declared by a structure, union or class
1089 type may be represented by a debugging information entry
1090 that is a child of the structure, union or class type entry;
1091 the friend entry has the tag \DWTAGfriendTARG.
1093 A friend entry has a \DWATfriendDEFN{} attribute,
1094 \addtoindexx{friend attribute} whose value is
1095 a reference to the debugging information entry describing
1096 the declaration of the friend.
1099 \subsection{Data Member Entries}
1100 \label{chap:datamemberentries}
1102 A data member (as opposed to a member function) is
1103 represented by a debugging information entry with the
1104 tag \DWTAGmemberTARG.
1106 \addtoindexx{member entry (data)}
1107 member entry for a named member has
1108 a \DWATname{} attribute
1109 \addtoindexx{name attribute}
1110 whose value is a null\dash terminated
1111 string containing the member name.
1112 If the member entry describes an
1113 \addtoindex{anonymous union},
1114 the name attribute is omitted or the value of the attribute
1115 consists of a single zero byte.
1117 The data member entry has a
1118 \DWATtype{} attribute\addtoindexx{type attribute} to denote
1119 \addtoindexx{member entry (data)} the type of that member.
1121 A data member entry may have a
1122 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1123 attribute.\addtoindexx{accessibility attribute}
1124 If no accessibility attribute is present, private
1125 access is assumed for an member of a class and public access
1126 is assumed for an member of a structure, union, or interface.
1128 A\hypertarget{chap:DWATmutablemutablepropertyofmemberdata}{}
1129 data member entry \addtoindexx{member entry (data)}
1131 \addtoindexx{mutable attribute}
1132 \DWATmutableDEFN{} attribute,
1133 which is a \livelink{chap:classflag}{flag}.
1134 This attribute indicates whether the data
1135 member was declared with the mutable storage class specifier.
1137 The beginning of a data member
1138 \addtoindexx{beginning of a data member}
1139 is described relative to
1140 \addtoindexx{beginning of an object}
1141 the beginning of the object in which it is immediately
1142 contained. In general, the beginning is characterized by
1143 both an address and a bit offset within the byte at that
1144 address. When the storage for an entity includes all of
1145 the bits in the beginning byte, the beginning bit offset is
1148 The\hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}{}
1149 member\hypertarget{chap:DWATdatamemberlocationdatamemberlocation}{}
1150 entry \addtoindexx{member entry (data)}
1151 corresponding to a data member that is defined
1152 in a structure, union or class may have either a
1153 \DWATdatamemberlocationDEFN{} attribute
1154 \addtoindexx{data member location attribute}
1155 or a \DWATdatabitoffsetDEFN{} attribute.
1156 \addtoindexx{data bit offset attribute}
1157 If the beginning of the data member is the same as
1158 the beginning of the containing entity then neither attribute
1162 For a \DWATdatamemberlocation{} attribute
1163 \addtoindexx{data member location attribute}
1164 there are two cases:
1165 \begin{enumerate}[1. ]
1166 \item If the value is an
1167 \livelink{chap:classconstant}{integer constant},
1169 in bytes from the beginning of the containing entity. If
1170 the beginning of the containing entity has a non-zero bit
1171 offset then the beginning of the member entry has that same
1174 \item Otherwise, the value must be a \addtoindex{location description}.
1176 this case, the beginning of the containing entity must be byte
1177 aligned. The beginning address is pushed on the DWARF stack
1178 before the \addtoindex{location} description is evaluated; the result of
1179 the evaluation is the base address of the member entry.
1181 \textit{The push on the DWARF expression stack of the base address of
1182 the containing construct is equivalent to execution of the
1183 \DWOPpushobjectaddress{} operation
1184 (see Section \refersec{chap:stackoperations});
1185 \DWOPpushobjectaddress{} therefore
1186 is not needed at the
1187 beginning of a \addtoindex{location description} for a data member.
1189 result of the evaluation is a location---either an address or
1190 the name of a register, not an offset to the member.}
1192 \textit{A \DWATdatamemberlocation{}
1194 \addtoindexx{data member location attribute}
1195 that has the form of a
1196 \addtoindex{location description} is not valid for a data member contained
1197 in an entity that is not byte aligned because DWARF operations
1198 do not allow for manipulating or computing bit offsets.}
1203 For a \DWATdatabitoffset{} attribute,
1204 the value is an \livelink{chap:classconstant}{integer constant}
1205 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1206 that specifies the number of bits
1207 from the beginning of the containing entity to the beginning
1208 of the data member. This value must be greater than or equal
1209 to zero, but is not limited to less than the number of bits
1212 If the size of a data member is not the same as the size
1213 of the type given for the data member, the data member has
1214 either a \DWATbytesize\addtoindexx{byte size attribute}
1215 or a \DWATbitsize{} attribute\addtoindexx{bit size attribute} whose
1216 \livelink{chap:classconstant}{integer constant} value
1217 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1219 of storage needed to hold the value of the data member.
1221 \textit{For showing nested and packed records and arrays,
1222 see Appendix \refersec{app:pascalexample} and
1223 \refersec{app:ccppbitfieldexamples}.}
1226 \subsection{Member Function Entries}
1227 \label{chap:memberfunctionentries}
1229 A member function is represented by a
1230 \addtoindexx{member function entry}
1231 debugging information entry
1233 \addtoindexx{subprogram entry!as member function}
1234 tag \DWTAGsubprogram.
1235 The member function entry
1236 may contain the same attributes and follows the same rules
1237 as non-member global subroutine entries
1238 (see Section \refersec{chap:subroutineandentrypointentries}).
1241 \textit{In particular, if the member function entry is an
1242 instantiation of a member function template, it follows the
1243 same rules as function template instantiations (see Section
1244 \refersec{chap:functiontemplateinstantiations}).
1247 A member function entry may have a
1248 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1249 \addtoindexx{accessibility attribute}
1250 attribute. If no accessibility attribute is present, private
1251 access is assumed for an entry of a class and public access
1252 is assumed for an entry of a structure, union or interface.
1254 If the member function entry describes a virtual function,
1255 then that entry has a
1256 \hyperlink{chap:DWATvirtualityvirtualityindication}{\DWATvirtualityNAME}
1259 If\hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}{}
1260 the member function entry describes an explicit member
1261 function, then that entry has a
1262 \addtoindexx{explicit attribute}
1263 \DWATexplicitDEFN{} attribute.
1265 An\hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{}
1266 entry for a virtual function also has a
1267 \DWATvtableelemlocationDEFN{}
1268 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1269 a \addtoindex{location description}
1270 yielding the address of the slot
1271 for the function within the virtual function table for the
1272 enclosing class. The address of an object of the enclosing
1273 type is pushed onto the expression stack before the location
1274 description is evaluated.
1276 If\hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{}
1277 the member function entry describes a non-static member
1278 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1279 function, then that entry
1280 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1282 \addtoindexx{object pointer attribute}
1283 a \DWATobjectpointerDEFN{} attribute
1284 whose value is a \livelink{chap:classreference}{reference}
1285 to the formal parameter entry
1286 that corresponds to the object for which the function is
1287 called. The name attribute of that formal parameter is defined
1288 by the current language (for example,
1289 \texttt{this} for \addtoindex{C++} or \texttt{self}
1290 for \addtoindex{Objective C}
1291 and some other languages). That parameter
1292 also has a \DWATartificial{} attribute whose value is true.
1294 Conversely, if the member function entry describes a static
1295 member function, the entry does not have a
1296 \addtoindexx{object pointer attribute}
1297 \DWATobjectpointer{} attribute.
1299 \textit{In \addtoindex{C++}, non-static member functions can have const-volatile
1300 qualifiers, which affect the type of the first formal parameter (the
1301 \doublequote{\texttt{this}}-pointer).}
1303 If the member function entry describes a non-static member
1304 function that has a const\dash volatile qualification, then
1305 the entry describes a non-static member function whose
1306 object formal parameter has a type that has an equivalent
1307 const-volatile qualification.
1309 \textit{Beginning in \addtoindex{C++11}, non-static member
1310 functions can also have one of the ref-qualifiers, \& and \&\&.
1311 These do not change the type of the
1312 \doublequote{\texttt{this}}-pointer, but they do affect the types of
1313 object values on which the function can be invoked.}
1316 The member function entry may have an \DWATreferenceDEFN{} attribute
1317 \livetarg{chap:DWATreferenceofnonstaticmember}{}
1318 to indicate a non-static member function that can only be called on
1319 lvalue objects, or the \DWATrvaluereferenceDEFN{} attribute
1320 \livetarg{chap:DWATrvaluereferenceofnonstaticmember}{}
1321 to indicate that it can only be called on prvalues and xvalues.
1323 \textit{The lvalue, prvalue and xvalue concepts are defined in the
1324 \addtoindex{C++11} and later standards.}
1326 If a subroutine entry represents the defining declaration
1327 of a member function and that definition appears outside of
1328 the body of the enclosing class declaration, the subroutine
1330 \DWATspecification{} attribute,
1331 \addtoindexx{specification attribute}
1333 a reference to the debugging information entry representing
1334 the declaration of this function member. The referenced entry
1335 will be a child of some class (or structure) type entry.
1338 Subroutine entries containing the
1339 \DWATspecification{} attribute
1340 \addtoindexx{specification attribute}
1341 do not need to duplicate information provided
1342 by the declaration entry referenced by the specification
1343 attribute. In particular, such entries do not need to contain
1344 a name attribute giving the name of the function member whose
1345 definition they represent.
1346 Similarly, such entries do not need to contain a return type
1347 attribute, unless the return type on the declaration was
1348 unspecified (for example, the declaration used the
1349 \addtoindex{C++} \autoreturntype{} specifier).
1351 \textit{In \addtoindex{C++}, a member function may be declared
1352 as deleted. This prevents the compiler from generating a default
1353 implementation of a special member function such as a
1354 constructor or destructor, and can affect overload resolution
1355 when used on other member functions.}
1357 If the member function entry has been declared as deleted,
1358 then that entry has a \DWATdeletedDEFN{}\livetarg{chap:DWATdeleteddef}{}
1359 attribute.\addtoindexx{deleted attribute}
1361 \textit{In \addtoindex{C++}, a special member function may be
1362 declared as defaulted, which explicitly declares a default
1363 compiler-generated implementation of the function. The
1364 declaration may have different effects on the calling
1365 convention used for objects of its class, depending on
1366 whether the default declaration is made inside or outside the
1369 If the member function has been declared as defaulted,
1370 then the entry has a \DWATdefaultedDEFN{}\livetarg{chap:DWATdefaulteddef}{}
1371 attribute\addtoindexx{defaulted attribute}
1372 whose integer constant value indicates whether, and if so,
1373 how, that member is defaulted. The possible values and
1374 their meanings are shown in
1375 Table \referfol{tab:defaultedattributevaluenames}.
1379 \setlength{\extrarowheight}{0.1cm}
1380 \begin{longtable}{l|l}
1381 \caption{Defaulted attribute names} \label{tab:defaultedattributevaluenames} \\
1382 \hline \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1384 \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1386 \hline \emph{Continued on next page}
1389 \DWDEFAULTEDnoTARG & Not declared default \\
1390 \DWDEFAULTEDinclassTARG & Defaulted within the class \\
1391 \DWDEFAULTEDoutofclassTARG& Defaulted outside of the class \\
1396 \textit{An artificial member function (that is, a compiler-generated
1397 copy that does not appear in the source) does not have a
1398 \DWATdefaultedNAME{} attribute.}
1401 \subsection{Class Template Instantiations}
1402 \label{chap:classtemplateinstantiations}
1404 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1405 type that may be instantiated when an instance of the class
1406 is declared or defined. The generic description of the class may include
1407 parameterized types, parameterized compile-time constant
1408 values, and/or parameterized run-time constant addresses.
1409 DWARF does not represent the generic template
1410 definition, but does represent each instantiation.}
1412 A class template instantiation is represented by a
1413 debugging information entry with the tag \DWTAGclasstype,
1414 \DWTAGstructuretype{} or
1415 \DWTAGuniontype. With the following
1416 exceptions, such an entry will contain the same attributes
1417 and have the same types of child entries as would an entry
1418 for a class type defined explicitly using the instantiation
1419 types and values. The exceptions are:
1421 \begin{enumerate}[1. ]
1422 \item Template parameters are described and referenced as
1423 specified in Section \refersec{chap:templateparameters}.
1426 \item If the compiler has generated a special compilation unit to
1428 \addtoindexx{template instantiation!and special compilation unit}
1429 template instantiation and that special compilation
1430 unit has a different name from the compilation unit containing
1431 the template definition, the name attribute for the debugging
1432 information entry representing the special compilation unit
1439 \item If the class type entry representing the template
1440 instantiation or any of its child entries contains declaration
1441 coordinate attributes, those attributes
1444 the source for the template definition, not to any source
1445 generated artificially by the compiler.
1449 \subsection{Variant Entries}
1450 \label{chap:variantentries}
1452 A variant part of a structure is represented by a debugging
1453 information entry\addtoindexx{variant part entry} with the
1454 tag \DWTAGvariantpartTARG{} and is
1455 owned by the corresponding structure type entry.
1457 If the variant part has a discriminant, the discriminant
1458 is\hypertarget{chap:DWATdiscrdiscriminantofvariantpart}{}
1459 represented by a \addtoindexx{discriminant (entry)}
1460 separate debugging information entry which
1461 is a child of the variant part entry. This entry has the form
1462 of a \addtoindexx{member entry (data)!as discriminant}
1463 structure data member entry. The variant part entry will
1465 \DWATdiscrDEFN{} attribute \addtoindexx{discriminant attribute}
1466 whose value is a \livelink{chap:classreference}{reference} to
1467 the member entry for the discriminant.
1469 If the variant part does not have a discriminant (tag field),
1470 the variant part entry has \addtoindexx{type attribute}
1471 a \DWATtype{} attribute to represent
1474 Each variant of a particular variant part is represented
1475 by\hypertarget{chap:DWATdiscrvaluediscriminantvalue}{}
1476 a debugging information entry\addtoindexx{variant entry} with the
1477 tag \DWTAGvariantTARG{}
1478 and is a child of the variant part entry. The value that
1479 selects a given variant may be represented in one of three
1480 ways. The variant entry may have a \DWATdiscrvalueDEFN{}
1481 attribute\addtoindexx{discriminant value attribute}
1482 whose value represents the discriminant value selecting
1483 this variant. The value of this
1484 attribute is encoded as an LEB128 number. The number is signed
1485 if the tag type for the variant part containing this variant
1486 is a signed type. The number is unsigned if the tag type is
1490 Alternatively,\hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}{}
1491 the variant entry may contain a
1492 \addtoindexx{discriminant list attribute}
1493 \DWATdiscrlistDEFN{}
1494 attribute, whose value represents a list of discriminant
1495 values. This list is represented by any of the
1496 \livelink{chap:classblock}{block} forms and may contain a
1497 mixture of discriminant values and discriminant ranges.
1498 Each item on the list is prefixed with a discriminant value
1499 descriptor that determines whether the list item represents
1500 a single label or a label range. A single case label is
1501 represented as an LEB128 number as defined above for the
1502 \addtoindexx{discriminant value attribute}
1504 attribute. A label range is represented by
1505 two LEB128 numbers, the low value of the range followed by the
1506 high value. Both values follow the rules for signedness just
1507 described. The discriminant value descriptor is an integer
1508 constant that may have one of the values given in
1509 Table \refersec{tab:discriminantdescriptorvalues}.
1511 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1512 \DWDSClabelTARG{} \\
1513 \DWDSCrangeTARG{} \\
1514 \end{simplenametable}
1517 If a variant entry has neither a \DWATdiscrvalue{}
1518 attribute nor a \DWATdiscrlist{} attribute, or if it has
1519 a \DWATdiscrlist{} attribute with 0 size, the variant is a
1522 The components selected by a particular variant are represented
1523 by debugging information entries owned by the corresponding
1524 variant entry and appear in the same order as the corresponding
1525 declarations in the source program.
1528 \section{Condition Entries}
1529 \label{chap:conditionentries}
1531 \textit{COBOL has the notion of
1532 \addtoindexx{level-88 condition, COBOL}
1533 a \doublequote{level\dash 88 condition} that
1534 associates a data item, called the conditional variable, with
1535 a set of one or more constant values and/or value ranges.
1536 % Note: the {} after \textquoteright (twice) is necessary to assure a following space separator
1537 Semantically, the condition is \textquoteleft true\textquoteright{}
1539 variable's value matches any of the described constants,
1540 and the condition is \textquoteleft false\textquoteright{} otherwise.}
1542 The \DWTAGconditionTARG{}
1543 debugging information entry\addtoindexx{condition entry}
1545 logical condition that tests whether a given data item\textquoteright s
1546 value matches one of a set of constant values. If a name
1547 has been given to the condition, the condition entry has a
1548 \DWATname{} attribute
1549 \addtoindexx{name attribute}
1550 whose value is a null\dash terminated string
1551 giving the condition name.
1554 The condition entry's parent entry describes the conditional
1555 variable; normally this will be a \DWTAGvariable,
1557 \DWTAGformalparameter{} entry.
1559 \addtoindexx{formal parameter entry}
1561 entry has an array type, the condition can test any individual
1562 element, but not the array as a whole. The condition entry
1563 implicitly specifies a \doublequote{comparison type} that is the
1564 type of an array element if the parent has an array type;
1565 otherwise it is the type of the parent entry.
1568 The condition entry owns \DWTAGconstant{} and/or
1569 \DWTAGsubrangetype{} entries that describe the constant
1570 values associated with the condition. If any child entry
1571 \addtoindexx{type attribute}
1572 has a \DWATtype{} attribute, that attribute
1576 a type compatible with the comparison type (according to the
1577 source language); otherwise the child\textquoteright{}s type
1578 is the same as the comparison type.
1580 \textit{For conditional variables with alphanumeric types, COBOL
1581 permits a source program to provide ranges of alphanumeric
1582 constants in the condition. Normally a subrange type entry
1583 does not describe ranges of strings; however, this can be
1584 represented using bounds attributes that are references to
1585 constant entries describing strings. A subrange type entry may
1586 refer to constant entries that are siblings of the subrange
1590 \section{Enumeration Type Entries}
1591 \label{chap:enumerationtypeentries}
1593 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1594 a fixed number of symbolic values.}
1596 An enumeration type is represented by a debugging information
1598 \DWTAGenumerationtypeTARG.
1600 If a name has been given to the enumeration type in the source
1601 program, then the corresponding enumeration type entry has
1602 a \DWATname{} attribute
1603 \addtoindexx{name attribute}
1604 whose value is a null\dash terminated
1605 string containing the enumeration type name.
1607 The \addtoindex{enumeration type entry}
1609 \addtoindexx{type attribute}
1610 a \DWATtype{} attribute
1611 which refers to the underlying data type used to implement
1612 the enumeration. The entry also may have a
1613 \DWATbytesize{} attribute or
1615 attribute, whose value
1616 (see Section \refersec{chap:byteandbitsizes})
1617 is the amount of storage
1618 required to hold an instance of the enumeration. If no
1619 \DWATbytesize{} or \DWATbitsize{}
1620 attribute is present, the size for holding an instance of the
1621 enumeration is given by the size of the underlying data type.
1624 If an enumeration type has type safe
1625 \addtoindexx{type safe enumeration types}
1628 \begin{enumerate}[1. ]
1629 \item Enumerators are contained in the scope of the enumeration type, and/or
1631 \item Enumerators are not implicitly converted to another type
1634 then the \addtoindex{enumeration type entry} may
1635 \addtoindexx{enum class|see{type-safe enumeration}}
1636 have a \DWATenumclassDEFN{}
1637 attribute, which is a \livelink{chap:classflag}{flag}.
1638 In a language that offers only
1639 one kind of enumeration declaration, this attribute is not
1642 \textit{In \addtoindex{C} or \addtoindex{C++},
1643 the underlying type will be the appropriate
1644 integral type determined by the compiler from the properties
1645 of\hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}{}
1646 the enumeration literal values.
1647 A \addtoindex{C++} type declaration written
1648 using enum class declares a strongly typed enumeration and
1649 is represented using \DWTAGenumerationtype{}
1650 in combination with \DWATenumclass.}
1652 Each enumeration literal is represented by a debugging
1653 \addtoindexx{enumeration literal|see{enumeration entry}}
1654 information entry with the
1655 tag \DWTAGenumeratorTARG.
1657 such entry is a child of the
1658 \addtoindex{enumeration type entry}, and the
1659 enumerator entries appear in the same order as the declarations
1660 of the enumeration literals in the source program.
1663 Each \addtoindex{enumerator entry} has a \DWATname{} attribute, whose
1664 \addtoindexx{name attribute}
1665 value is a null-terminated string containing the name of
1666 the\hypertarget{chap:DWATconstvalueenumerationliteralvalue}{}
1667 enumeration literal.
1668 Each enumerator entry also has a
1669 \DWATconstvalueDEFN{} attribute,
1670 \addtoindexx{constant value attribute}
1671 whose value is the actual numeric value of the enumerator as
1672 represented on the target system.
1675 If the enumeration type occurs as the description of a
1676 \addtoindexx{enumeration type entry!as array dimension}
1677 dimension of an array type, and the stride for that
1678 dimension\hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}{}
1679 is different than what would otherwise be determined,
1680 then\hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}{}
1681 the enumeration type entry has either a
1682 \addtoindexx{byte stride attribute}
1683 \DWATbytestrideDEFN{} or
1684 \addtoindexx{bit stride attribute}
1685 \DWATbitstrideDEFN{} attribute which specifies the separation
1686 between successive elements along the dimension as described
1687 in Section \refersec{chap:staticanddynamicvaluesofattributes}.
1688 The value of the \DWATbitstride{} attribute
1689 is interpreted as bits and
1690 the value of the \DWATbytestride{} attribute is interpreted
1694 \section{Subroutine Type Entries}
1695 \label{chap:subroutinetypeentries}
1697 \textit{It is possible in \addtoindex{C}
1698 to declare pointers to subroutines
1699 that return a value of a specific type. In both
1700 \addtoindex{C} and \addtoindex{C++},
1701 it is possible to declare pointers to subroutines that not
1702 only return a value of a specific type, but accept only
1703 arguments of specific types. The type of such pointers would
1704 be described with a \doublequote{pointer to} modifier applied to a
1705 user\dash defined type.}
1708 A subroutine type is represented by a debugging information
1710 \addtoindexx{subroutine type entry}
1711 tag \DWTAGsubroutinetypeTARG.
1713 been given to the subroutine type in the source program,
1714 then the corresponding subroutine type entry has
1715 a \DWATname{} attribute
1716 \addtoindexx{name attribute}
1717 whose value is a null\dash terminated string containing
1718 the subroutine type name.
1720 If the subroutine type describes a function that returns
1721 a value, then the subroutine type entry has a
1722 \addtoindexx{type attribute}
1724 attribute to denote the type returned by the subroutine. If
1725 the types of the arguments are necessary to describe the
1726 subroutine type, then the corresponding subroutine type
1727 entry owns debugging information entries that describe the
1728 arguments. These debugging information entries appear in the
1729 order that the corresponding argument types appear in the
1732 \textit{In \addtoindex{C} there
1733 is a difference between the types of functions
1734 declared using function prototype style declarations and
1735 those declared using non-prototype declarations.}
1738 \hypertarget{chap:DWATprototypedsubroutineprototype}{}
1739 subroutine entry declared with a function prototype style
1740 declaration may have
1741 \addtoindexx{prototyped attribute}
1743 \DWATprototypedDEFN{} attribute, which is
1744 a \livelink{chap:classflag}{flag}.
1747 Each debugging information entry owned by a subroutine
1748 type entry corresponds to either a formal parameter or the sequence of
1749 unspecified parameters of the subprogram type:
1751 \begin{enumerate}[1. ]
1752 \item A formal parameter of a parameter list (that has a
1753 specific type) is represented by a debugging information entry
1754 with the tag \DWTAGformalparameter.
1755 Each formal parameter
1757 \addtoindexx{type attribute}
1758 a \DWATtype{} attribute that refers to the type of
1759 the formal parameter.
1761 \item The unspecified parameters of a variable parameter list
1762 \addtoindexx{unspecified parameters entry}
1764 \addtoindexx{\texttt{...} parameters|see{unspecified parameters entry}}
1765 represented by a debugging information entry with the
1766 tag \DWTAGunspecifiedparameters.
1769 \textit{\addtoindex{C++} const-volatile qualifiers are encoded as
1770 part of the type of the \doublequote{\texttt{this}}-pointer.
1771 \addtoindex{C++11} reference and rvalue-reference qualifiers are
1772 encoded using the \DWATreference{} and \DWATrvaluereference{} attributes,
1774 See also Section \refersec{chap:memberfunctionentries}.}
1777 A subroutine type entry may have the \DWATreference{} or
1778 \DWATrvaluereference{} attribute to indicate that it describes the
1779 type of a member function with reference or rvalue-reference
1780 semantics, respectively.
1783 \section{String Type Entries}
1784 \label{chap:stringtypeentries}
1786 \textit{A \doublequote{string} is a sequence of characters that have specific
1787 \addtoindexx{string type entry}
1788 semantics and operations that distinguish them from arrays of
1790 \addtoindex{Fortran} is one of the languages that has a string
1791 type. Note that \doublequote{string} in this context refers to a target
1792 machine concept, not the class string as used in this document
1793 (except for the name attribute).}
1795 A string type is represented by a debugging information entry
1796 with the tag \DWTAGstringtypeTARG.
1797 If a name has been given to
1798 the string type in the source program, then the corresponding
1799 string type entry has a
1800 \DWATname{} attribute
1801 \addtoindexx{name attribute}
1802 whose value is a null-terminated string containing the string type name.
1804 A string type entry may have a \DWATtypeDEFN{}
1805 \livetargi{chap:DWAATtypeofstringtype}{attribute}{type attribute!of string type entry}
1806 describing how each character is encoded and is to be interpreted.
1807 The value of this attribute is a \CLASSreference{} to a
1808 \DWTAGbasetype{} base type entry. If the attribute is absent,
1809 then the character is encoded using the system default.
1812 \addtoindex{Fortran 2003} language standard allows string
1813 types that are composed of different types of (same sized) characters.
1814 While there is no standard list of character kinds, the kinds
1815 \texttt{ASCII}\index{ASCII@\texttt{ASCII} (Fortran string kind)} (see \DWATEASCII),
1816 \texttt{ISO\_10646}\index{ISO\_10646@\texttt{ISO\_10646} (Fortran string kind)}
1817 \addtoindexx{ISO 10646 character set standard}
1819 \texttt{DEFAULT}\index{DEFAULT@\texttt{DEFAULT} (Fortran string kind)}
1823 The string type entry may have a
1824 \DWATbytesize{} attribute or
1826 attribute, whose value
1827 (see Section \refersec{chap:byteandbitsizes})
1829 storage needed to hold a value of the string type.
1831 The\hypertarget{chap:DWATstringlengthstringlengthofstringtype}{}
1832 string type entry may also have a
1833 \DWATstringlengthDEFN{} attribute
1835 \addtoindexx{string length attribute}
1837 \addtoindex{location description} yielding the location
1838 where the length of the string is stored in the program.
1839 If the \DWATstringlengthNAME{} attribute is not present, the size
1840 of the string is assumed to be the amount of storage that is
1841 allocated for the string (as specified by the \DWATbytesize{}
1842 or \DWATbitsize{} attribute).
1844 The string type entry may also have a
1845 \DWATstringlengthbytesizeDEFN{} or
1846 \DWATstringlengthbitsizeDEFN{} attribute,
1847 \addtoindexx{string length size attribute}
1848 \addtoindexx{string length attribute!size of length data}
1849 whose value (see Section \refersec{chap:byteandbitsizes})
1850 is the size of the data to be retrieved from the location
1851 referenced by the \DWATstringlength{} attribute. If no byte or bit
1852 size attribute is present, the size of the data to be retrieved
1854 \addtoindex{size of an address} on the target machine.
1857 \addtoindexx{DWARF Version 5} % Avoid italics
1858 \textit{Prior to DWARF Version 5, the meaning of a
1859 \DWATbytesize{} attribute depended on the presence of the
1860 \DWATstringlength{} attribute:
1862 \item If \DWATstringlength{} was present, \DWATbytesize{}
1863 specified the size of the length data to be retrieved
1864 from the location specified by the \DWATstringlength{} attribute.
1865 \item If \DWATstringlength{} was not present, \DWATbytesize{}
1866 specified the amount of storage allocated for objects
1869 In \DWARFVersionV{}, \DWATbytesize{} always specifies the amount of storage
1870 allocated for objects of the string type.}
1873 \section{Set Type Entries}
1874 \label{chap:settypeentries}
1876 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1877 a group of values of ordinal type.}
1879 A set is represented by a debugging information entry with
1880 the tag \DWTAGsettypeTARG.
1881 \addtoindexx{set type entry}
1882 If a name has been given to the
1883 set type, then the set type entry has
1884 a \DWATname{} attribute
1885 \addtoindexx{name attribute}
1886 whose value is a null\dash terminated string containing the
1889 The set type entry has a
1890 \addtoindexx{type attribute}
1891 \DWATtype{} attribute to denote the
1892 type of an element of the set.
1895 If the amount of storage allocated to hold each element of an
1896 object of the given set type is different from the amount of
1897 storage that is normally allocated to hold an individual object
1898 of the indicated element type, then the set type entry has
1899 either a \DWATbytesize{} attribute, or
1900 \DWATbitsize{} attribute
1901 whose value (see Section \refersec{chap:byteandbitsizes}) is
1902 the amount of storage needed to hold a value of the set type.
1905 \section{Subrange Type Entries}
1906 \label{chap:subrangetypeentries}
1908 \textit{Several languages support the concept of a \doublequote{subrange}
1909 type. Objects of the subrange type can represent only a contiguous
1910 subset (range) of values from the type on which the subrange is defined.
1911 Subrange types may also be used to represent the bounds of array dimensions.}
1913 A subrange type is represented by a debugging information
1915 \DWTAGsubrangetypeTARG.\addtoindexx{subrange type entry}
1916 If a name has been given to the subrange type, then the
1917 subrange type entry has a
1918 \DWATname{} attribute\addtoindexx{name attribute}
1919 whose value is a null-terminated
1920 string containing the subrange type name.
1922 The tag \DWTAGgenericsubrange{}
1923 is used to describe arrays with a dynamic rank. See Section
1924 \refersec{chap:DWTAGgenericsubrange}.
1926 The subrange entry may have a
1927 \DWATtype{} attribute\addtoindexx{type attribute} to describe
1928 the type of object, called the basis type, of whose values
1929 this subrange is a subset.
1931 If the amount of storage allocated to hold each element of an
1932 object of the given subrange type is different from the amount
1933 of storage that is normally allocated to hold an individual
1934 object of the indicated element type, then the subrange
1936 \DWATbytesize{} attribute or
1938 attribute, whose value
1939 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1940 is the amount of storage needed to hold a value of the subrange type.
1942 The\hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{}
1943 subrange entry may have a
1944 \DWATthreadsscaledDEFN{} attribute\addtoindexx{threads scaled attribute},
1945 which is a \livelink{chap:classflag}{flag}.
1946 If present, this attribute indicates whether
1947 this subrange represents a \addtoindex{UPC} array bound which is scaled
1948 by the runtime \texttt{THREADS} value (the number of \addtoindex{UPC} threads in
1949 this execution of the program).
1951 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
1953 \begin{lstlisting}[numbers=none]
1954 int shared foo[34*THREADS][10][20];
1958 The\hypertarget{chap:DWATlowerboundlowerboundofsubrange}{}
1959 subrange\hypertarget{chap:DWATupperboundupperboundofsubrange}{}
1960 entry may have the attributes
1961 \DWATlowerboundDEFN{}
1962 \addtoindexx{lower bound attribute}
1963 and \DWATupperboundDEFN{}
1964 \addtoindexx{upper bound attribute} to specify, respectively, the lower
1965 and upper bound values of the subrange. The
1966 \DWATupperboundNAME{}
1967 attribute\hypertarget{chap:DWATcountelementsofsubrangetype}{}
1968 may be replaced by a
1969 \addtoindexx{count attribute!default}
1970 \addtoindexx{count attribute}
1971 \DWATcountDEFN{} attribute,
1972 whose value describes the number of elements in the subrange
1973 rather than the value of the last element. The value of each
1974 of these attributes is determined as described in
1975 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1977 If the lower bound value is missing, the value is assumed to
1978 be a language-dependent default constant as defined in
1979 Table \refersec{tab:languageencodings}.
1980 \addtoindexx{lower bound attribute!default}
1982 If the upper bound and count are missing, then the upper bound value is
1983 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
1985 If the subrange entry has no type attribute describing the
1986 basis type, the basis type is determined as follows:
1987 \begin{enumerate}[1. ]
1989 If there is a lower bound attribute that references an object,
1990 the basis type is assumed to be the same as the type of that object.
1992 Otherwise, if there is an upper bound or count attribute that references
1993 an object, the basis type is assumed to be the same as the type of that object.
1995 Otherwise, the type is
1996 assumed to be the same type, in the source language of the
1997 compilation unit containing the subrange entry, as a signed
1998 integer with the same size as an address on the target machine.
2001 If the subrange type occurs as the description of a dimension
2002 of an array type, and the stride for that dimension
2003 is\hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}{}
2004 different than what would otherwise be determined,
2005 then\hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}{}
2006 the subrange type entry has either a
2007 \addtoindexx{byte stride attribute}
2008 \DWATbytestrideDEFN{} or
2009 \DWATbitstrideDEFN{} attribute
2010 \addtoindexx{bit stride attribute}
2011 which specifies the separation
2012 between successive elements along the dimension as described in
2013 Section \refersec{chap:byteandbitsizes}.
2015 \textit{Note that the stride can be negative.}
2018 \section{Pointer to Member Type Entries}
2019 \label{chap:pointertomembertypeentries}
2021 \textit{In \addtoindex{C++}, a
2022 pointer to a data or function member of a class or
2023 structure is a unique type.}
2025 A debugging information entry representing the type of an
2026 object that is a pointer to a structure or class member has
2027 the tag \DWTAGptrtomembertypeTARG.
2029 If the \addtoindex{pointer to member type} has a name, the
2030 \addtoindexx{pointer to member type entry}
2031 pointer to member entry has a
2032 \DWATname{} attribute,
2033 \addtoindexx{name attribute}
2035 null\dash terminated string containing the type name.
2037 The \addtoindex{pointer to member} entry
2039 \addtoindexx{type attribute}
2040 a \DWATtype{} attribute to
2041 describe the type of the class or structure member to which
2042 objects of this type may point.
2044 The \addtoindexx{pointer to member} entry
2045 also\hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{}
2046 has a \DWATcontainingtypeDEFN{} attribute,
2047 \addtoindexx{containing type (of pointer) attribute}
2048 whose value is a \livelink{chap:classreference}{reference} to a debugging
2049 information entry for the class or structure to whose members
2050 objects of this type may point.
2052 The\hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}{}
2053 \addtoindex{pointer to member entry} has a
2054 \DWATuselocationDEFN{} attribute
2055 \addtoindexx{use location attribute}
2057 \addtoindex{location description} that computes the
2058 address of the member of the class to which the pointer to
2059 member entry points.
2062 \textit{The method used to find the address of a given member of a
2063 class or structure is common to any instance of that class
2064 or structure and to any instance of the pointer or member
2065 type. The method is thus associated with the type entry,
2066 rather than with each instance of the type.}
2068 The \DWATuselocation{} description is used in conjunction
2069 with the location descriptions for a particular object of the
2070 given \addtoindex{pointer to member type} and for a particular structure or
2071 class instance. The \DWATuselocation{}
2072 attribute expects two values to be
2073 \addtoindexi{pushed}{address!implicit push for member operator}
2074 onto the DWARF expression stack before
2075 the \DWATuselocation{} description is evaluated.
2077 \addtoindexi{pushed}{address!implicit push for member operator}
2078 is the value of the \addtoindex{pointer to member} object
2079 itself. The second value
2080 \addtoindexi{pushed}{address!implicit push for member operator}
2081 is the base address of the
2082 entire structure or union instance containing the member
2083 whose address is being calculated.
2086 \textit{For an expression such as}
2088 \begin{lstlisting}[numbers=none]
2091 \textit{where \texttt{mbr\_ptr} has some \addtoindex{pointer to member type}, a debugger should:}
2092 \begin{enumerate}[1. ]
2093 \item \textit{Push the value of \texttt{mbr\_ptr} onto the DWARF expression stack.}
2094 \item \textit{Push the base address of \texttt{object} onto the DWARF expression stack.}
2095 \item \textit{Evaluate the \DWATuselocation{} description
2096 given in the type of \texttt{mbr\_ptr}.}
2100 \section{File Type Entries}
2101 \label{chap:filetypeentries}
2103 \textit{Some languages, such as \addtoindex{Pascal},
2104 provide a data type to represent
2107 A file type is represented by a debugging information entry
2109 \addtoindexx{file type entry}
2112 If the file type has a name,
2113 the file type entry has a \DWATname{} attribute,
2114 \addtoindexx{name attribute}
2116 is a null\dash terminated string containing the type name.
2118 The file type entry has
2119 \addtoindexx{type attribute}
2120 a \DWATtype{} attribute describing
2121 the type of the objects contained in the file.
2123 The file type entry also has a
2124 \DWATbytesize{}\addtoindexx{byte size attribute} or
2125 \DWATbitsize{}\addtoindexx{bit size attribute} attribute, whose value
2126 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2127 is the amount of storage need to hold a value of the file type.
2129 \section{Dynamic Type Entries}
2130 \label{chap:dynamictypeentries}
2131 \textit{Some languages such as
2132 \addtoindex{Fortran 90}, provide types whose values
2133 may be dynamically allocated or associated with a variable
2134 under explicit program control. However, unlike the
2135 pointer type in \addtoindex{C} or
2136 \addtoindex{C++}, the indirection involved in accessing
2137 the value of the variable is generally implicit, that is, not
2138 indicated as part of the program source.}
2140 A dynamic type entry is used to declare a dynamic type that is
2141 \doublequote{just like} another non-dynamic type without needing to
2142 replicate the full description of that other type.
2144 A dynamic type is represented by a debugging information entry
2145 with the tag \DWTAGdynamictypeTARG. If a name has been given to the
2146 dynamic type, then the dynamic type has a \DWATname{} attribute
2147 whose value is a null-terminated string containing the dynamic
2150 A dynamic type entry has a \DWATtype{} attribute whose value is a
2151 reference to the type of the entities that are dynamically allocated.
2153 A dynamic type entry also has a \DWATdatalocation, and may also
2154 have \DWATallocated{} and/or \DWATassociated{} attributes as
2155 described in Section \refersec{chap:dynamicpropertiesoftypes}.
2156 A \DWATdatalocation, \DWATallocated{} or \DWATassociated{} attribute
2157 may not occur on a dynamic type entry if the same kind of attribute
2158 already occurs on the type referenced by the \DWATtype{} attribute.
2162 \section{Template Alias Entries}
2163 \label{chap:templatealiasentries}
2165 \textit{In \addtoindex{C++}, a template alias is a form of typedef that has template
2166 parameters. DWARF does not represent the template alias definition
2167 but does represent instantiations of the alias.}
2169 A type named using a template alias is represented
2170 by a debugging information entry
2171 \addtoindexx{template alias entry}
2173 \DWTAGtemplatealiasTARG.
2174 The template alias entry has a
2175 \DWATname{} attribute
2176 \addtoindexx{name attribute}
2177 whose value is a null\dash terminated string
2178 containing the name of the template alias.
2179 The template alias entry has child entries describing the template
2180 actual parameters (see Section \refersec{chap:templateparameters}).
2183 \section{Dynamic Properties of Types}
2184 \label{chap:dynamicpropertiesoftypes}
2185 \textit{The \DWATdatalocation, \DWATallocated{} and \DWATassociated{}
2186 attributes described in this section are motivated for use with
2187 \DWTAGdynamictype{} entries but can be used for any other type as well.}
2190 \subsection{Data Location}
2191 \label{chap:datalocation}
2193 \textit{Some languages may represent objects using descriptors to hold
2194 information, including a location and/or run\dash time parameters,
2195 about the data that represents the value for that object.}
2197 The\hypertarget{chap:DWATdatalocationindirectiontoactualdata}{}
2198 \DWATdatalocationDEFN{} attribute
2199 \addtoindexx{data (indirect) location attribute}
2200 may be used with any type that provides one or more levels of
2201 \addtoindexx{hidden indirection|see{data location attribute}}
2203 and/or run-time parameters in its representation. Its value
2204 is a \addtoindex{location description}.
2205 The result of evaluating this
2206 description yields the location of the data for an object.
2207 When this attribute is omitted, the address of the data is
2208 the same as the address of the object.
2211 \textit{This location description will typically begin with
2212 \DWOPpushobjectaddress{}
2213 which loads the address of the
2214 object which can then serve as a descriptor in subsequent
2215 calculation. For an example using
2217 for a \addtoindex{Fortran 90 array}, see
2218 Appendix \refersec{app:fortranarrayexample}.}
2220 \subsection{Allocation and Association Status}
2221 \label{chap:allocationandassociationstatus}
2223 \textit{Some languages, such as \addtoindex{Fortran 90},
2224 provide types whose values
2225 may be dynamically allocated or associated with a variable
2226 under explicit program control.}
2228 The\hypertarget{chap:DWATallocatedallocationstatusoftypes}{}
2229 \DWATallocatedDEFN{} attribute\addtoindexx{allocated attribute}
2230 may be used with any
2231 type for which objects of the type can be explicitly allocated
2232 and deallocated. The presence of the attribute indicates that
2233 objects of the type are allocatable and deallocatable. The
2234 integer value of the attribute (see below) specifies whether
2235 an object of the type is currently allocated or not.
2238 The\hypertarget{chap:DWATassociatedassociationstatusoftypes}{}
2239 \DWATassociatedDEFN{} attribute
2241 \addtoindexx{associated attribute}
2242 optionally be used with
2243 any type for which objects of the type can be dynamically
2244 associated with other objects. The presence of the attribute
2245 indicates that objects of the type can be associated. The
2246 integer value of the attribute (see below) indicates whether
2247 an object of the type is currently associated or not.
2249 The value of these attributes is determined as described in
2250 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2251 A non-zero value is interpreted as allocated or associated,
2252 and zero is interpreted as not allocated or not associated.
2254 \textit{For \addtoindex{Fortran 90},
2255 if the \DWATassociated{}
2256 attribute is present,
2257 the type has the POINTER property where either the parent
2258 variable is never associated with a dynamic object or the
2259 implementation does not track whether the associated object
2260 is static or dynamic. If the \DWATallocated{} attribute is
2261 present and the \DWATassociated{} attribute is not, the type
2262 has the ALLOCATABLE property. If both attributes are present,
2263 then the type should be assumed to have the POINTER property
2264 (and not ALLOCATABLE); the \DWATallocated{} attribute may then
2265 be used to indicate that the association status of the object
2266 resulted from execution of an ALLOCATE statement rather than
2267 pointer assignment.}
2269 \textit{For examples using
2270 \DWATallocated{} for \addtoindex{Ada} and
2271 \addtoindex{Fortran 90}
2273 see Appendix \refersec{app:aggregateexamples}.}
2275 \subsection{Array Rank}
2276 \label{chap:DWATrank}
2277 \addtoindexx{array!assumed-rank}
2278 \addtoindexx{assumed-rank array|see{array, assumed-rank}}
2279 \textit{The Fortran language supports \doublequote{assumed-rank arrays}. The
2280 rank (the number of dimensions) of an assumed-rank array is unknown
2281 at compile time. The Fortran runtime stores the rank in an array
2285 the\hypertarget{chap:DWATrankofdynamicarray}{\DWATrankINDX}
2286 attribute indicates that an array's rank
2287 (number of dimensions) is dynamic, and therefore unknown at compile
2288 time. The value of the \DWATrankDEFN{} attribute is either an integer constant
2289 or a DWARF expression whose evaluation yields the dynamic rank.
2291 The bounds of an array with dynamic rank are described using a
2292 \DWTAGgenericsubrange{} entry, which
2293 is the dynamic rank array equivalent of
2294 \DWTAGsubrangetype. The
2295 difference is that a \DWTAGgenericsubrange{} entry contains generic
2296 lower/upper bound and stride expressions that need to be evaluated for
2297 each dimension. Before any expression contained in a
2298 \DWTAGgenericsubrange{} can be evaluated, the dimension for which the
2299 expression is to be evaluated needs to be pushed onto the stack. The
2300 expression will use it to find the offset of the respective field in
2301 the array descriptor metadata.
2303 \textit{A producer is free to choose any layout for the
2304 array descriptor. In particular, the upper and lower bounds and
2305 stride values do not need to be bundled into a structure or record,
2306 but could be laid end to end in the containing descriptor, pointed
2307 to by the descriptor, or even allocated independently of the
2310 Dimensions are enumerated $0$ to $\mathit{rank}-1$ in source program
2313 \textit{For an example in Fortran 2008, see
2314 Section~\refersec{app:assumedrankexample}.}