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{} & C \addtoindex{\_Atomic} qualified type \\
467 \DWTAGconsttypeTARG{} & C or C++ const qualified type
468 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
469 \DWTAGpackedtypeTARG& \addtoindex{Pascal} or Ada packed type\addtoindexx{packed type entry}
470 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
471 \DWTAGpointertypeTARG{} & Pointer to an object of
472 the type being modified \addtoindexx{pointer qualified type entry} \\
473 \DWTAGreferencetypeTARG& \addtoindex{C++} (lvalue) reference
474 to an object of the type
475 \addtoindexx{reference type entry}
476 \mbox{being} modified
477 \addtoindexx{reference qualified type entry} \\
478 \DWTAGrestricttypeTARG& \addtoindex{C}
480 \addtoindexx{restricted type entry}
482 \addtoindexx{restrict qualified type} \\
483 \DWTAGrvaluereferencetypeTARG{} & \addtoindex{C++}
484 \addtoindexx{rvalue reference type entry}
486 \addtoindexx{restricted type entry}
487 reference to an object of the type \mbox{being} modified
488 \addtoindexx{rvalue reference qualified type entry} \\
489 \DWTAGsharedtypeTARG&\addtoindex{UPC} shared qualified type
490 \addtoindexx{shared qualified type entry} \\
491 \DWTAGvolatiletypeTARG&\addtoindex{C} or \addtoindex{C++} volatile qualified type
492 \addtoindexx{volatile qualified type entry} \\
498 \textit{As examples of how type modifiers are ordered, consider the following
499 \addtoindex{C} declarations:}
500 \begin{lstlisting}[numbers=none]
501 const unsigned char * volatile p;
503 \textit{which represents a volatile pointer to a constant
504 character. This is encoded in DWARF as:}
508 \DWTAGvariable(p) -->
509 \DWTAGvolatiletype -->
510 \DWTAGpointertype -->
512 \DWTAGbasetype(unsigned char)
517 \textit{On the other hand}
518 \begin{lstlisting}[numbers=none]
519 volatile unsigned char * const restrict p;
521 \textit{represents a restricted constant
522 pointer to a volatile character. This is encoded as:}
526 \DWTAGvariable(p) -->
527 \DWTAGrestricttype -->
529 \DWTAGpointertype -->
530 \DWTAGvolatiletype -->
531 \DWTAGbasetype(unsigned char)
535 \section{Typedef Entries}
536 \label{chap:typedefentries}
537 A named type that is defined in terms of another type
538 definition is represented by a debugging information entry with
539 \addtoindexx{typedef entry}
540 the tag \DWTAGtypedefTARG.
541 The typedef entry has a \DWATname{} attribute
542 \addtoindexx{name attribute}
543 whose value is a null\dash terminated string containing
544 the name of the typedef.
546 The typedef entry may also contain
547 \addtoindexx{type attribute}
549 \DWATtype{} attribute whose
550 value is a \livelink{chap:classreference}{reference}
551 to the type named by the typedef. If
552 the debugging information entry for a typedef represents
553 a declaration of the type that is not also a definition,
554 it does not contain a type attribute.
556 \textit{Depending on the language, a named type that is defined in
557 terms of another type may be called a type alias, a subtype,
558 a constrained type and other terms. A type name declared with
559 no defining details may be termed an
560 \addtoindexx{incomplete type}
561 incomplete, forward or hidden type.
562 While the DWARF \DWTAGtypedef{} entry was
563 originally inspired by the like named construct in
564 \addtoindex{C} and \addtoindex{C++},
565 it is broadly suitable for similar constructs (by whatever
566 source syntax) in other languages.}
568 \section{Array Type Entries}
569 \label{chap:arraytypeentries}
570 \label{chap:DWTAGgenericsubrange}
572 \textit{Many languages share the concept of an \doublequote{array,} which is
573 \addtoindexx{array type entry}
574 a table of components of identical type.}
576 An array type is represented by a debugging information entry
577 with the tag \DWTAGarraytypeTARG.
578 If a name has been given to
579 \addtoindexx{array!declaration of type}
580 the array type in the source program, then the corresponding
581 array type entry has a \DWATname{} attribute
582 \addtoindexx{name attribute}
584 null-terminated string containing the array type name.
586 The\hypertarget{chap:DWATorderingarrayrowcolumnordering}{}
587 array type entry describing a multidimensional array may
588 \addtoindexx{array!element ordering}
589 have a \DWATorderingDEFN{} attribute whose
590 \livelink{chap:classconstant}{integer constant} value is
591 interpreted to mean either row-major or column-major ordering
592 of array elements. The set of values and their meanings
593 for the ordering attribute are listed in
594 Table \referfol{tab:arrayordering}.
596 ordering attribute is present, the default ordering for the
597 source language (which is indicated by the
600 \addtoindexx{language attribute}
601 of the enclosing compilation unit entry) is assumed.
603 \begin{simplenametable}[1.8in]{Array ordering}{tab:arrayordering}
604 \DWORDcolmajorTARG{} \\
605 \DWORDrowmajorTARG{} \\
606 \end{simplenametable}
608 An array type entry has
609 \addtoindexx{type attribute}
610 a \DWATtype{} attribute
612 \addtoindexx{array!element type}
613 the type of each element of the array.
615 If the amount of storage allocated to hold each element of an
616 object of the given array type is different from the amount
617 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
618 of storage that is normally allocated to hold an individual object
619 of\hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}{}
620 the\hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}{}
621 indicated element type, then the array type entry has either a
622 \addtoindexx{byte stride attribute}
623 \DWATbytestrideDEFN{}
625 \addtoindexx{bit stride attribute}
627 attribute, whose value
628 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
630 element of the array.
632 The array type entry may have either a \DWATbytesize{} or a
633 \DWATbitsize{} attribute
634 (see Section \refersec{chap:byteandbitsizes}),
636 amount of storage needed to hold an instance of the array type.
638 \textit{If the size of the array can be determined statically at
639 compile time, this value can usually be computed by multiplying
640 the number of array elements by the size of each element.}
643 Each array dimension is described by a debugging information
644 entry with either the
645 \addtoindexx{subrange type entry!as array dimension}
646 tag \DWTAGsubrangetype{} or the
647 \addtoindexx{enumeration type entry!as array dimension}
649 \DWTAGenumerationtype. These entries are
651 array type entry and are ordered to reflect the appearance of
652 the dimensions in the source program (that is, leftmost dimension
653 first, next to leftmost second, and so on).
655 \textit{In languages that have no concept of a
656 \doublequote{multidimensional array} (for example,
657 \addtoindex{C}), an array of arrays may
658 be represented by a debugging information entry for a
659 multidimensional array.}
661 Alternatively, for an array with dynamic rank the array dimensions
662 are described by a debugging information entry with the tag
663 \DWTAGgenericsubrangeTARG.
664 This entry has the same attributes as a
665 \DWTAGsubrangetype{} entry; however,
666 there is just one \DWTAGgenericsubrangeNAME{} entry and it describes all of the
667 dimensions of the array.
668 If \DWTAGgenericsubrangeNAME{}
669 is used, the number of dimensions must be specified using a
670 \DWATrank{} attribute. See also Section
671 \refersec{chap:DWATrank}.
674 Other attributes especially applicable to arrays are
676 \DWATassociated{} and
678 which are described in
679 Section \refersec{chap:dynamicpropertiesoftypes}.
680 For relevant examples, see also Appendix \refersec{app:fortranarrayexample}.
682 \section{Coarray Type Entries}
683 \label{chap:coarraytypeentries}
684 \addtoindexx{coarray}
685 \textit{In Fortran, a \doublequote{coarray} is an array whose
686 elements are located in different processes rather than in the
687 memory of one process. The individual elements
688 of a coarray can be scalars or arrays.
689 Similar to arrays, coarrays have \doublequote{codimensions} that are
690 indexed using a \doublequote{coindex} or multiple \doublequote{coindices}.
691 \addtoindexx{codimension|see{coarray}}
692 \addtoindexx{coindex|see{coarray}}
695 A coarray type is represented by a debugging information entry
696 with the tag \DWTAGcoarraytypeTARG.
697 If a name has been given to the
698 coarray type in the source, then the corresponding coarray type
699 entry has a \DWATname{} attribute whose value is a null-terminated
700 string containing the array type name.
702 A coarray entry has one or more \DWTAGsubrangetype{} child entries,
703 one for each codimension. It also has a \DWATtype{} attribute
704 describing the type of each element of the coarray.
706 \textit{In a coarray application, the run-time number of processes in the application
707 is part of the coindex calculation. It is represented in the Fortran source by
708 a coindex which is declared with a \doublequote{*} as the upper bound. To express this
709 concept in DWARF, the \DWTAGsubrangetype{} child entry for that index has
710 only a lower bound and no upper bound.}
712 \textit{How coarray elements are located and how coindices are
713 converted to process specifications is implementation-defined.}
716 \section{Structure, Union, Class and Interface Type Entries}
717 \label{chap:structureunionclassandinterfacetypeentries}
719 \textit{The languages
721 \addtoindex{C++}, and
722 \addtoindex{Pascal}, among others, allow the
723 programmer to define types that are collections of related
724 \addtoindexx{structure type entry}
726 In \addtoindex{C} and \addtoindex{C++}, these collections are called
727 \doublequote{structures.}
728 In \addtoindex{Pascal}, they are called \doublequote{records.}
729 The components may be of different types. The components are
730 called \doublequote{members} in \addtoindex{C} and
731 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
733 \textit{The components of these collections each exist in their
734 own space in computer memory. The components of a \addtoindex{C} or \addtoindex{C++}
735 \doublequote{union} all coexist in the same memory.}
737 \textit{\addtoindex{Pascal} and
738 other languages have a \doublequote{discriminated union,}
739 \addtoindexx{discriminated union|see {variant entry}}
740 also called a \doublequote{variant record.} Here, selection of a
741 number of alternative substructures (\doublequote{variants}) is based
742 on the value of a component that is not part of any of those
743 substructures (the \doublequote{discriminant}).}
745 \textit{\addtoindex{C++} and
746 \addtoindex{Java} have the notion of \doublequote{class,} which is in some
747 ways similar to a structure. A class may have \doublequote{member
748 functions} which are subroutines that are within the scope
749 of a class or structure.}
751 \textit{The \addtoindex{C++} notion of
752 structure is more general than in \addtoindex{C}, being
753 equivalent to a class with minor differences. Accordingly,
754 in the following discussion, statements about
755 \addtoindex{C++} classes may
756 be understood to apply to \addtoindex{C++} structures as well.}
758 \subsection{Structure, Union and Class Type Entries}
759 \label{chap:structureunionandclasstypeentries}
760 Structure, union, and class types are represented by debugging
761 \addtoindexx{structure type entry}
763 \addtoindexx{union type entry}
765 \addtoindexx{class type entry}
767 \DWTAGstructuretypeTARG,
769 and \DWTAGclasstypeTARG,
770 respectively. If a name has been given to the structure,
771 union, or class in the source program, then the corresponding
772 structure type, union type, or class type entry has a
773 \DWATname{} attribute
774 \addtoindexx{name attribute}
775 whose value is a null\dash terminated string
776 containing the type name.
778 The members of a structure, union, or class are represented
779 by debugging information entries that are owned by the
780 corresponding structure type, union type, or class type entry
781 and appear in the same order as the corresponding declarations
782 in the source program.
784 A structure, union, or class type may have a \DWATexportsymbolsDEFN{}
785 attribute\addtoindexx{export symbols (of structure, class or union) attribute}
786 \livetarg{chap:DWATexportsymbolsofstructunionclass}{}
787 which indicates that all member names defined within
788 the structure, union, or class may be referenced as if they were
789 defined within the containing structure, union, or class.
791 \textit{This may be used to describe anonymous structures, unions
792 and classes in \addtoindex{C} or \addtoindex{C++}}.
794 A\hypertarget{chap:DWATbitsizedatamemberbitsize}{}
795 structure type, union type or class type entry may have
796 either a \DWATbytesize{} or a \DWATbitsize{} attribute
797 (see Section \refersec{chap:byteandbitsizes}),
798 whose value is the amount of storage needed
799 to hold an instance of the structure, union or class type,
800 including any padding.
802 An incomplete structure, union or class type
803 \addtoindexx{incomplete structure/union/class}
804 \addtoindexx{incomplete type}
805 is represented by a structure, union or class
806 entry that does not have a byte size attribute and that has
807 \addtoindexx{declaration attribute}
808 a \DWATdeclaration{} attribute.
810 If the complete declaration of a type has been placed
811 in\hypertarget{chap:DWATsignaturetypesignature}{}
812 a separate \addtoindex{type unit}
813 (see Section \refersec{chap:typeunitentries}),
814 an incomplete declaration
815 \addtoindexx{incomplete type}
816 of that type in the compilation unit may provide
817 the unique 8-byte signature of the type using a
818 \addtoindexx{type signature}
819 \DWATsignatureDEFN{} attribute.
821 If a structure, union or class entry represents the definition
822 of a structure, union or class member corresponding to a prior
823 incomplete structure, union or class, the entry may have a
824 \DWATspecification{} attribute
825 \addtoindexx{specification attribute}
826 whose value is a \livelink{chap:classreference}{reference} to
827 the debugging information entry representing that incomplete
830 Structure, union and class entries containing the
831 \DWATspecification{} attribute
832 \addtoindexx{specification attribute}
833 do not need to duplicate
834 information provided by the declaration entry referenced by the
835 specification attribute. In particular, such entries do not
836 need to contain an attribute for the name of the structure,
837 union or class they represent if such information is already
838 provided in the declaration.
840 \textit{For \addtoindex{C} and \addtoindex{C++},
842 \addtoindexx{data member|see {member entry (data)}}
843 member declarations occurring within
844 the declaration of a structure, union or class type are
845 considered to be \doublequote{definitions} of those members, with
846 the exception of \doublequote{static} data members, whose definitions
847 appear outside of the declaration of the enclosing structure,
848 union or class type. Function member declarations appearing
849 within a structure, union or class type declaration are
850 definitions only if the body of the function also appears
851 within the type declaration.}
853 If the definition for a given member of the structure, union
854 or class does not appear within the body of the declaration,
855 that member also has a debugging information entry describing
856 its definition. That latter entry has a
857 \DWATspecification{} attribute
858 \addtoindexx{specification attribute}
859 referencing the debugging information entry
860 owned by the body of the structure, union or class entry and
861 representing a non-defining declaration of the data, function
862 or type member. The referenced entry will not have information
863 about the location of that member (low and high PC attributes
864 for function members, location descriptions for data members)
865 and will have a \DWATdeclaration{} attribute.
868 \textit{Consider a nested class whose
869 definition occurs outside of the containing class definition, as in:}
871 \begin{lstlisting}[numbers=none]
878 \textit{The two different structs can be described in
879 different compilation units to
880 facilitate DWARF space compression
881 (see Appendix \refersec{app:usingcompilationunits}).}
884 A structure type, union type or class type entry may have a
885 \DWATcallingconventionDEFN{} attribute,
886 \addtoindexx{calling convention attribute!for types}
887 whose value indicates whether a value of the type should be passed by reference
888 or passed by value. The set of calling convention codes for use with types
889 \addtoindexx{calling convention codes!for types}
890 is\hypertarget{chap:DWATcallingconventionfortypes}{}
891 given in Table \referfol{tab:callingconventioncodesfortypes}.
893 \begin{simplenametable}[2.2in]{Calling convention codes for types}{tab:callingconventioncodesfortypes}
895 \DWCCpassbyvalueTARG \\
896 \DWCCpassbyreferenceTARG \\
897 \end{simplenametable}
899 If this attribute is not present, or its value is
900 \DWCCnormalNAME, the convention to be used for an object of the
901 given type is assumed to be unspecified.
903 \textit{Note that \DWCCnormalNAME{} is also used as a calling convention
904 code for certain subprograms
905 (see Table \refersec{tab:callingconventioncodesforsubroutines}).}
907 \textit{If unspecified, a consumer may be able to deduce the calling
908 convention based on knowledge of the type and the ABI.}
911 \subsection{Interface Type Entries}
912 \label{chap:interfacetypeentries}
914 \textit{The \addtoindex{Java} language defines \doublequote{interface} types.
916 \addtoindexx{interface type entry}
917 in \addtoindex{Java} is similar to a \addtoindex{C++} or
918 \addtoindex{Java} class with only abstract
919 methods and constant data members.}
922 \addtoindexx{interface type entry}
923 are represented by debugging information
925 tag \DWTAGinterfacetypeTARG.
927 An interface type entry has
928 a \DWATname{} attribute,
929 \addtoindexx{name attribute}
930 whose value is a null\dash terminated string containing the
933 The members of an interface are represented by debugging
934 information entries that are owned by the interface type
935 entry and that appear in the same order as the corresponding
936 declarations in the source program.
938 \subsection{Derived or Extended Structures, Classes and Interfaces}
939 \label{chap:derivedorextendedstructsclasesandinterfaces}
941 \textit{In \addtoindex{C++}, a class (or struct)
943 \addtoindexx{derived type (C++)|see{inheritance entry}}
944 be \doublequote{derived from} or be a
945 \doublequote{subclass of} another class.
946 In \addtoindex{Java}, an interface may \doublequote{extend}
947 \addtoindexx{extended type (Java)|see{inheritance entry}}
949 \addtoindexx{implementing type (Java)|see{inheritance entry}}
950 or more other interfaces, and a class may \doublequote{extend} another
951 class and/or \doublequote{implement} one or more interfaces. All of these
952 relationships may be described using the following. Note that
953 in \addtoindex{Java},
954 the distinction between extends and implements is
955 implied by the entities at the two ends of the relationship.}
957 A class type or interface type entry that describes a
958 derived, extended or implementing class or interface owns
959 \addtoindexx{implementing type (Java)|see{inheritance entry}}
960 debugging information entries describing each of the classes
961 or interfaces it is derived from, extending or implementing,
962 respectively, ordered as they were in the source program. Each
964 \addtoindexx{inheritance entry}
966 tag \DWTAGinheritanceTARG.
970 \addtoindexx{type attribute}
972 \addtoindexx{inheritance entry}
974 \DWATtype{} attribute whose value is
975 a reference to the debugging information entry describing the
976 class or interface from which the parent class or structure
977 of the inheritance entry is derived, extended or implementing.
979 An\hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}{}
980 inheritance entry\addtoindexx{inheritance entry}
981 for a class that derives from or extends
982 another class or struct also has a
983 \DWATdatamemberlocationDEFN{} attribute,
984 \addtoindexx{data member location attribute}
985 whose value describes the location of the beginning
986 of the inherited type relative to the beginning address of the
987 instance of the derived class. If that value is a constant, it is the offset
988 in bytes from the beginning of the class to the beginning of
989 the instance of the inherited type. Otherwise, the value must be a location
990 description. In this latter case, the beginning address of
991 the instance of the derived class is pushed on the expression stack before
992 the \addtoindex{location description}
993 is evaluated and the result of the
994 evaluation is the location of the instance of the inherited type.
996 \textit{The interpretation of the value of this attribute for
997 inherited types is the same as the interpretation for data
999 (see Section \referfol{chap:datamemberentries}). }
1001 An\hypertarget{chap:DWATaccessibilitycppinheritedmembers}{}
1002 \addtoindexx{inheritance entry}
1003 inheritance entry may have a
1004 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1005 attribute.\addtoindexx{accessibility attribute}
1006 If no accessibility attribute is present, private access
1007 is assumed for an entry of a class and public access is
1008 assumed for an entry of a struct, union or interface.
1010 If the class referenced by the \addtoindex{inheritance entry}
1011 serves as a \addtoindex{C++} virtual base class, the
1012 inheritance entry has a
1013 \hyperlink{chap:DWATvirtualityvirtualityindication}{\DWATvirtualityNAME}
1016 \textit{For a \addtoindex{C++} virtual base, the
1017 \addtoindex{data member location attribute}
1018 will usually consist of a non-trivial
1019 \addtoindex{location description}.}
1021 \subsection{Access Declarations}
1022 \label{chap:accessdeclarations}
1024 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1025 change the accessibility of individual class members from the
1026 overall accessibility specified by the inheritance declaration.
1027 A single access declaration may refer to a set of overloaded
1030 If a derived class or structure contains access declarations,
1031 each such declaration may be represented by a debugging
1032 information entry with the tag \DWTAGaccessdeclarationTARG.
1033 \addtoindexx{access declaration entry}
1034 Each such entry is a child of the class or structure type entry.
1036 An access declaration entry has a \DWATname{} attribute,
1037 whose value is a null-terminated string representing the name
1038 used in the declaration,
1039 including any class or structure qualifiers.
1041 An\hypertarget{chap:DWATaccessdeclaration}{}
1042 access declaration entry also has a
1043 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1044 \addtoindexx{accessibility attribute}
1045 attribute describing the declared accessibility of the named entities.
1049 \subsection{Friends}
1050 \label{chap:friends}
1052 Each\hypertarget{chap:DWATfriendfriendrelationship}{}
1053 friend\addtoindexx{friend entry}
1054 declared by a structure, union or class
1055 type may be represented by a debugging information entry
1056 that is a child of the structure, union or class type entry;
1057 the friend entry has the tag \DWTAGfriendTARG.
1059 A friend entry has a \DWATfriendDEFN{} attribute,
1060 \addtoindexx{friend attribute} whose value is
1061 a reference to the debugging information entry describing
1062 the declaration of the friend.
1065 \subsection{Data Member Entries}
1066 \label{chap:datamemberentries}
1068 A data member (as opposed to a member function) is
1069 represented by a debugging information entry with the
1070 tag \DWTAGmemberTARG.
1072 \addtoindexx{member entry (data)}
1073 member entry for a named member has
1074 a \DWATname{} attribute
1075 \addtoindexx{name attribute}
1076 whose value is a null\dash terminated
1077 string containing the member name.
1078 If the member entry describes an
1079 \addtoindex{anonymous union},
1080 the name attribute is omitted or the value of the attribute
1081 consists of a single zero byte.
1083 The data member entry has a
1084 \DWATtype{} attribute\addtoindexx{type attribute} to denote
1085 \addtoindexx{member entry (data)} the type of that member.
1087 A data member entry may have a
1088 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1089 attribute.\addtoindexx{accessibility attribute}
1090 If no accessibility attribute is present, private
1091 access is assumed for an member of a class and public access
1092 is assumed for an member of a structure, union, or interface.
1094 A\hypertarget{chap:DWATmutablemutablepropertyofmemberdata}{}
1095 data member entry \addtoindexx{member entry (data)}
1097 \addtoindexx{mutable attribute}
1098 \DWATmutableDEFN{} attribute,
1099 which is a \livelink{chap:classflag}{flag}.
1100 This attribute indicates whether the data
1101 member was declared with the mutable storage class specifier.
1103 The beginning of a data member
1104 \addtoindexx{beginning of a data member}
1105 is described relative to
1106 \addtoindexx{beginning of an object}
1107 the beginning of the object in which it is immediately
1108 contained. In general, the beginning is characterized by
1109 both an address and a bit offset within the byte at that
1110 address. When the storage for an entity includes all of
1111 the bits in the beginning byte, the beginning bit offset is
1114 The\hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}{}
1115 member\hypertarget{chap:DWATdatamemberlocationdatamemberlocation}{}
1116 entry \addtoindexx{member entry (data)}
1117 corresponding to a data member that is defined
1118 in a structure, union or class may have either a
1119 \DWATdatamemberlocationDEFN{} attribute
1120 \addtoindexx{data member location attribute}
1121 or a \DWATdatabitoffsetDEFN{} attribute.
1122 \addtoindexx{data bit offset attribute}
1123 If the beginning of the data member is the same as
1124 the beginning of the containing entity then neither attribute
1128 For a \DWATdatamemberlocation{} attribute
1129 \addtoindexx{data member location attribute}
1130 there are two cases:
1131 \begin{enumerate}[1. ]
1132 \item If the value is an
1133 \livelink{chap:classconstant}{integer constant},
1135 in bytes from the beginning of the containing entity. If
1136 the beginning of the containing entity has a non-zero bit
1137 offset then the beginning of the member entry has that same
1140 \item Otherwise, the value must be a \addtoindex{location description}.
1142 this case, the beginning of the containing entity must be byte
1143 aligned. The beginning address is pushed on the DWARF stack
1144 before the \addtoindex{location} description is evaluated; the result of
1145 the evaluation is the base address of the member entry.
1147 \textit{The push on the DWARF expression stack of the base address of
1148 the containing construct is equivalent to execution of the
1149 \DWOPpushobjectaddress{} operation
1150 (see Section \refersec{chap:stackoperations});
1151 \DWOPpushobjectaddress{} therefore
1152 is not needed at the
1153 beginning of a \addtoindex{location description} for a data member.
1155 result of the evaluation is a location---either an address or
1156 the name of a register, not an offset to the member.}
1158 \textit{A \DWATdatamemberlocation{}
1160 \addtoindexx{data member location attribute}
1161 that has the form of a
1162 \addtoindex{location description} is not valid for a data member contained
1163 in an entity that is not byte aligned because DWARF operations
1164 do not allow for manipulating or computing bit offsets.}
1169 For a \DWATdatabitoffset{} attribute,
1170 the value is an \livelink{chap:classconstant}{integer constant}
1171 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1172 that specifies the number of bits
1173 from the beginning of the containing entity to the beginning
1174 of the data member. This value must be greater than or equal
1175 to zero, but is not limited to less than the number of bits
1178 If the size of a data member is not the same as the size
1179 of the type given for the data member, the data member has
1180 either a \DWATbytesize\addtoindexx{byte size attribute}
1181 or a \DWATbitsize{} attribute\addtoindexx{bit size attribute} whose
1182 \livelink{chap:classconstant}{integer constant} value
1183 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1185 of storage needed to hold the value of the data member.
1187 \textit{For showing nested and packed records and arrays,
1188 see Appendix \refersec{app:pascalexample} and
1189 \refersec{app:ccppbitfieldexamples}.}
1192 \subsection{Member Function Entries}
1193 \label{chap:memberfunctionentries}
1195 A member function is represented by a
1196 \addtoindexx{member function entry}
1197 debugging information entry
1199 \addtoindexx{subprogram entry!as member function}
1200 tag \DWTAGsubprogram.
1201 The member function entry
1202 may contain the same attributes and follows the same rules
1203 as non-member global subroutine entries
1204 (see Section \refersec{chap:subroutineandentrypointentries}).
1207 \textit{In particular, if the member function entry is an
1208 instantiation of a member function template, it follows the
1209 same rules as function template instantiations (see Section
1210 \refersec{chap:functiontemplateinstantiations}).
1213 A member function entry may have a
1214 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1215 \addtoindexx{accessibility attribute}
1216 attribute. If no accessibility attribute is present, private
1217 access is assumed for an entry of a class and public access
1218 is assumed for an entry of a structure, union or interface.
1220 If the member function entry describes a virtual function,
1221 then that entry has a
1222 \hyperlink{chap:DWATvirtualityvirtualityindication}{\DWATvirtualityNAME}
1225 If\hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}{}
1226 the member function entry describes an explicit member
1227 function, then that entry has a
1228 \addtoindexx{explicit attribute}
1229 \DWATexplicitDEFN{} attribute.
1231 An\hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{}
1232 entry for a virtual function also has a
1233 \DWATvtableelemlocationDEFN{}
1234 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1235 a \addtoindex{location description}
1236 yielding the address of the slot
1237 for the function within the virtual function table for the
1238 enclosing class. The address of an object of the enclosing
1239 type is pushed onto the expression stack before the location
1240 description is evaluated.
1242 If\hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{}
1243 the member function entry describes a non-static member
1244 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1245 function, then that entry
1246 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1248 \addtoindexx{object pointer attribute}
1249 a \DWATobjectpointerDEFN{} attribute
1250 whose value is a \livelink{chap:classreference}{reference}
1251 to the formal parameter entry
1252 that corresponds to the object for which the function is
1253 called. The name attribute of that formal parameter is defined
1254 by the current language (for example,
1255 \texttt{this} for \addtoindex{C++} or \texttt{self}
1256 for \addtoindex{Objective C}
1257 and some other languages). That parameter
1258 also has a \DWATartificial{} attribute whose value is true.
1260 Conversely, if the member function entry describes a static
1261 member function, the entry does not have a
1262 \addtoindexx{object pointer attribute}
1263 \DWATobjectpointer{} attribute.
1265 \textit{In \addtoindex{C++}, non-static member functions can have const-volatile
1266 qualifiers, which affect the type of the first formal parameter (the
1267 \doublequote{\texttt{this}}-pointer).}
1269 If the member function entry describes a non-static member
1270 function that has a const\dash volatile qualification, then
1271 the entry describes a non-static member function whose
1272 object formal parameter has a type that has an equivalent
1273 const-volatile qualification.
1275 \textit{Beginning in \addtoindex{C++11}, non-static member
1276 functions can also have one of the ref-qualifiers, \& and \&\&.
1277 These do not change the type of the
1278 \doublequote{\texttt{this}}-pointer, but they do affect the types of
1279 object values on which the function can be invoked.}
1282 The member function entry may have an \DWATreferenceDEFN{} attribute
1283 \livetarg{chap:DWATreferenceofnonstaticmember}{}
1284 to indicate a non-static member function that can only be called on
1285 lvalue objects, or the \DWATrvaluereferenceDEFN{} attribute
1286 \livetarg{chap:DWATrvaluereferenceofnonstaticmember}{}
1287 to indicate that it can only be called on prvalues and xvalues.
1289 \textit{The lvalue, prvalue and xvalue concepts are defined in the
1290 \addtoindex{C++11} and later standards.}
1292 If a subroutine entry represents the defining declaration
1293 of a member function and that definition appears outside of
1294 the body of the enclosing class declaration, the subroutine
1296 \DWATspecification{} attribute,
1297 \addtoindexx{specification attribute}
1299 a reference to the debugging information entry representing
1300 the declaration of this function member. The referenced entry
1301 will be a child of some class (or structure) type entry.
1304 Subroutine entries containing the
1305 \DWATspecification{} attribute
1306 \addtoindexx{specification attribute}
1307 do not need to duplicate information provided
1308 by the declaration entry referenced by the specification
1309 attribute. In particular, such entries do not need to contain
1310 a name attribute giving the name of the function member whose
1311 definition they represent.
1312 Similarly, such entries do not need to contain a return type
1313 attribute, unless the return type on the declaration was
1314 unspecified (for example, the declaration used the
1315 \addtoindex{C++} \autoreturntype{} specifier).
1317 \textit{In \addtoindex{C++}, a member function may be declared
1318 as deleted. This prevents the compiler from generating a default
1319 implementation of a special member function such as a
1320 constructor or destructor, and can affect overload resolution
1321 when used on other member functions.}
1323 If the member function entry has been declared as deleted,
1324 then that entry has a \DWATdeletedDEFN{}\livetarg{chap:DWATdeleteddef}{}
1325 attribute.\addtoindexx{deleted attribute}
1327 \textit{In \addtoindex{C++}, a special member function may be
1328 declared as defaulted, which explicitly declares a default
1329 compiler-generated implementation of the function. The
1330 declaration may have different effects on the calling
1331 convention used for objects of its class, depending on
1332 whether the default declaration is made inside or outside the
1335 If the member function has been declared as defaulted,
1336 then the entry has a \DWATdefaultedDEFN{}\livetarg{chap:DWATdefaulteddef}{}
1337 attribute\addtoindexx{defaulted attribute}
1338 whose integer constant value indicates whether, and if so,
1339 how, that member is defaulted. The possible values and
1340 their meanings are shown in
1341 Table \referfol{tab:defaultedattributevaluenames}.
1345 \setlength{\extrarowheight}{0.1cm}
1346 \begin{longtable}{l|l}
1347 \caption{Defaulted attribute names} \label{tab:defaultedattributevaluenames} \\
1348 \hline \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1350 \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1352 \hline \emph{Continued on next page}
1355 \DWDEFAULTEDnoTARG & Not declared default \\
1356 \DWDEFAULTEDinclassTARG & Defaulted within the class \\
1357 \DWDEFAULTEDoutofclassTARG& Defaulted outside of the class \\
1362 \textit{An artificial member function (that is, a compiler-generated
1363 copy that does not appear in the source) does not have a
1364 \DWATdefaultedNAME{} attribute.}
1367 \subsection{Class Template Instantiations}
1368 \label{chap:classtemplateinstantiations}
1370 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1371 type that may be instantiated when an instance of the class
1372 is declared or defined. The generic description of the class may include
1373 parameterized types, parameterized compile-time constant
1374 values, and/or parameterized run-time constant addresses.
1375 DWARF does not represent the generic template
1376 definition, but does represent each instantiation.}
1378 A class template instantiation is represented by a
1379 debugging information entry with the tag \DWTAGclasstype,
1380 \DWTAGstructuretype{} or
1381 \DWTAGuniontype. With the following
1382 exceptions, such an entry will contain the same attributes
1383 and have the same types of child entries as would an entry
1384 for a class type defined explicitly using the instantiation
1385 types and values. The exceptions are:
1387 \begin{enumerate}[1. ]
1388 \item Template parameters are described and referenced as
1389 specified in Section \refersec{chap:templateparameters}.
1392 \item If the compiler has generated a special compilation unit to
1394 \addtoindexx{template instantiation!and special compilation unit}
1395 template instantiation and that special compilation
1396 unit has a different name from the compilation unit containing
1397 the template definition, the name attribute for the debugging
1398 information entry representing the special compilation unit
1399 should be empty or omitted.
1402 \item If the class type entry representing the template
1403 instantiation or any of its child entries contains declaration
1404 coordinate attributes, those attributes should refer to
1405 the source for the template definition, not to any source
1406 generated artificially by the compiler.
1410 \subsection{Variant Entries}
1411 \label{chap:variantentries}
1413 A variant part of a structure is represented by a debugging
1414 information entry\addtoindexx{variant part entry} with the
1415 tag \DWTAGvariantpartTARG{} and is
1416 owned by the corresponding structure type entry.
1418 If the variant part has a discriminant, the discriminant
1419 is\hypertarget{chap:DWATdiscrdiscriminantofvariantpart}{}
1420 represented by a \addtoindexx{discriminant (entry)}
1421 separate debugging information entry which
1422 is a child of the variant part entry. This entry has the form
1423 of a \addtoindexx{member entry (data)!as discriminant}
1424 structure data member entry. The variant part entry will
1426 \DWATdiscrDEFN{} attribute \addtoindexx{discriminant attribute}
1427 whose value is a \livelink{chap:classreference}{reference} to
1428 the member entry for the discriminant.
1430 If the variant part does not have a discriminant (tag field),
1431 the variant part entry has \addtoindexx{type attribute}
1432 a \DWATtype{} attribute to represent
1435 Each variant of a particular variant part is represented
1436 by\hypertarget{chap:DWATdiscrvaluediscriminantvalue}{}
1437 a debugging information entry\addtoindexx{variant entry} with the
1438 tag \DWTAGvariantTARG{}
1439 and is a child of the variant part entry. The value that
1440 selects a given variant may be represented in one of three
1441 ways. The variant entry may have a \DWATdiscrvalueDEFN{}
1442 attribute\addtoindexx{discriminant value attribute}
1443 whose value represents the discriminant value selecting
1444 this variant. The value of this
1445 attribute is encoded as an LEB128 number. The number is signed
1446 if the tag type for the variant part containing this variant
1447 is a signed type. The number is unsigned if the tag type is
1451 Alternatively,\hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}{}
1452 the variant entry may contain a
1453 \addtoindexx{discriminant list attribute}
1454 \DWATdiscrlistDEFN{}
1455 attribute, whose value represents a list of discriminant
1456 values. This list is represented by any of the
1457 \livelink{chap:classblock}{block} forms and may contain a
1458 mixture of discriminant values and discriminant ranges.
1459 Each item on the list is prefixed with a discriminant value
1460 descriptor that determines whether the list item represents
1461 a single label or a label range. A single case label is
1462 represented as an LEB128 number as defined above for the
1463 \addtoindexx{discriminant value attribute}
1465 attribute. A label range is represented by
1466 two LEB128 numbers, the low value of the range followed by the
1467 high value. Both values follow the rules for signedness just
1468 described. The discriminant value descriptor is an integer
1469 constant that may have one of the values given in
1470 Table \refersec{tab:discriminantdescriptorvalues}.
1472 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1473 \DWDSClabelTARG{} \\
1474 \DWDSCrangeTARG{} \\
1475 \end{simplenametable}
1478 If a variant entry has neither a \DWATdiscrvalue{}
1479 attribute nor a \DWATdiscrlist{} attribute, or if it has
1480 a \DWATdiscrlist{} attribute with 0 size, the variant is a
1483 The components selected by a particular variant are represented
1484 by debugging information entries owned by the corresponding
1485 variant entry and appear in the same order as the corresponding
1486 declarations in the source program.
1489 \section{Condition Entries}
1490 \label{chap:conditionentries}
1492 \textit{COBOL has the notion of
1493 \addtoindexx{level-88 condition, COBOL}
1494 a \doublequote{level\dash 88 condition} that
1495 associates a data item, called the conditional variable, with
1496 a set of one or more constant values and/or value ranges.
1497 % Note: the {} after \textquoteright (twice) is necessary to assure a following space separator
1498 Semantically, the condition is \textquoteleft true\textquoteright{}
1500 variable's value matches any of the described constants,
1501 and the condition is \textquoteleft false\textquoteright{} otherwise.}
1503 The \DWTAGconditionTARG{}
1504 debugging information entry\addtoindexx{condition entry}
1506 logical condition that tests whether a given data item\textquoteright s
1507 value matches one of a set of constant values. If a name
1508 has been given to the condition, the condition entry has a
1509 \DWATname{} attribute
1510 \addtoindexx{name attribute}
1511 whose value is a null\dash terminated string
1512 giving the condition name.
1515 The condition entry's parent entry describes the conditional
1516 variable; normally this will be a \DWTAGvariable,
1518 \DWTAGformalparameter{} entry.
1520 \addtoindexx{formal parameter entry}
1522 entry has an array type, the condition can test any individual
1523 element, but not the array as a whole. The condition entry
1524 implicitly specifies a \doublequote{comparison type} that is the
1525 type of an array element if the parent has an array type;
1526 otherwise it is the type of the parent entry.
1529 The condition entry owns \DWTAGconstant{} and/or
1530 \DWTAGsubrangetype{} entries that describe the constant
1531 values associated with the condition. If any child entry
1532 \addtoindexx{type attribute}
1534 a \DWATtype{} attribute,
1535 that attribute should describe a type
1536 compatible with the comparison type (according to the source
1537 language); otherwise the child\textquoteright s type is the same as the
1540 \textit{For conditional variables with alphanumeric types, COBOL
1541 permits a source program to provide ranges of alphanumeric
1542 constants in the condition. Normally a subrange type entry
1543 does not describe ranges of strings; however, this can be
1544 represented using bounds attributes that are references to
1545 constant entries describing strings. A subrange type entry may
1546 refer to constant entries that are siblings of the subrange
1550 \section{Enumeration Type Entries}
1551 \label{chap:enumerationtypeentries}
1553 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1554 a fixed number of symbolic values.}
1556 An enumeration type is represented by a debugging information
1558 \DWTAGenumerationtypeTARG.
1560 If a name has been given to the enumeration type in the source
1561 program, then the corresponding enumeration type entry has
1562 a \DWATname{} attribute
1563 \addtoindexx{name attribute}
1564 whose value is a null\dash terminated
1565 string containing the enumeration type name.
1567 The \addtoindex{enumeration type entry}
1569 \addtoindexx{type attribute}
1570 a \DWATtype{} attribute
1571 which refers to the underlying data type used to implement
1572 the enumeration. The entry also may have a
1573 \DWATbytesize{} attribute or
1575 attribute, whose value
1576 (see Section \refersec{chap:byteandbitsizes})
1577 is the amount of storage
1578 required to hold an instance of the enumeration. If no
1579 \DWATbytesize{} or \DWATbitsize{}
1580 attribute is present, the size for holding an instance of the
1581 enumeration is given by the size of the underlying data type.
1584 If an enumeration type has type safe
1585 \addtoindexx{type safe enumeration types}
1588 \begin{enumerate}[1. ]
1589 \item Enumerators are contained in the scope of the enumeration type, and/or
1591 \item Enumerators are not implicitly converted to another type
1594 then the \addtoindex{enumeration type entry} may
1595 \addtoindexx{enum class|see{type-safe enumeration}}
1596 have a \DWATenumclassDEFN{}
1597 attribute, which is a \livelink{chap:classflag}{flag}.
1598 In a language that offers only
1599 one kind of enumeration declaration, this attribute is not
1602 \textit{In \addtoindex{C} or \addtoindex{C++},
1603 the underlying type will be the appropriate
1604 integral type determined by the compiler from the properties
1605 of\hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}{}
1606 the enumeration literal values.
1607 A \addtoindex{C++} type declaration written
1608 using enum class declares a strongly typed enumeration and
1609 is represented using \DWTAGenumerationtype{}
1610 in combination with \DWATenumclass.}
1612 Each enumeration literal is represented by a debugging
1613 \addtoindexx{enumeration literal|see{enumeration entry}}
1614 information entry with the
1615 tag \DWTAGenumeratorTARG.
1617 such entry is a child of the
1618 \addtoindex{enumeration type entry}, and the
1619 enumerator entries appear in the same order as the declarations
1620 of the enumeration literals in the source program.
1623 Each \addtoindex{enumerator entry} has a \DWATname{} attribute, whose
1624 \addtoindexx{name attribute}
1625 value is a null-terminated string containing the name of
1626 the\hypertarget{chap:DWATconstvalueenumerationliteralvalue}{}
1627 enumeration literal.
1628 Each enumerator entry also has a
1629 \DWATconstvalueDEFN{} attribute,
1630 \addtoindexx{constant value attribute}
1631 whose value is the actual numeric value of the enumerator as
1632 represented on the target system.
1635 If the enumeration type occurs as the description of a
1636 \addtoindexx{enumeration type entry!as array dimension}
1637 dimension of an array type, and the stride for that
1638 dimension\hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}{}
1639 is different than what would otherwise be determined,
1640 then\hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}{}
1641 the enumeration type entry has either a
1642 \addtoindexx{byte stride attribute}
1643 \DWATbytestrideDEFN{} or
1644 \addtoindexx{bit stride attribute}
1645 \DWATbitstrideDEFN{} attribute which specifies the separation
1646 between successive elements along the dimension as described
1647 in Section \refersec{chap:staticanddynamicvaluesofattributes}.
1648 The value of the \DWATbitstride{} attribute
1649 is interpreted as bits and
1650 the value of the \DWATbytestride{} attribute is interpreted
1654 \section{Subroutine Type Entries}
1655 \label{chap:subroutinetypeentries}
1657 \textit{It is possible in \addtoindex{C}
1658 to declare pointers to subroutines
1659 that return a value of a specific type. In both
1660 \addtoindex{C} and \addtoindex{C++},
1661 it is possible to declare pointers to subroutines that not
1662 only return a value of a specific type, but accept only
1663 arguments of specific types. The type of such pointers would
1664 be described with a \doublequote{pointer to} modifier applied to a
1665 user\dash defined type.}
1668 A subroutine type is represented by a debugging information
1670 \addtoindexx{subroutine type entry}
1671 tag \DWTAGsubroutinetypeTARG.
1673 been given to the subroutine type in the source program,
1674 then the corresponding subroutine type entry has
1675 a \DWATname{} attribute
1676 \addtoindexx{name attribute}
1677 whose value is a null\dash terminated string containing
1678 the subroutine type name.
1680 If the subroutine type describes a function that returns
1681 a value, then the subroutine type entry has a
1682 \addtoindexx{type attribute}
1684 attribute to denote the type returned by the subroutine. If
1685 the types of the arguments are necessary to describe the
1686 subroutine type, then the corresponding subroutine type
1687 entry owns debugging information entries that describe the
1688 arguments. These debugging information entries appear in the
1689 order that the corresponding argument types appear in the
1692 \textit{In \addtoindex{C} there
1693 is a difference between the types of functions
1694 declared using function prototype style declarations and
1695 those declared using non-prototype declarations.}
1698 \hypertarget{chap:DWATprototypedsubroutineprototype}{}
1699 subroutine entry declared with a function prototype style
1700 declaration may have
1701 \addtoindexx{prototyped attribute}
1703 \DWATprototypedDEFN{} attribute, which is
1704 a \livelink{chap:classflag}{flag}.
1707 Each debugging information entry owned by a subroutine
1708 type entry corresponds to either a formal parameter or the sequence of
1709 unspecified parameters of the subprogram type:
1711 \begin{enumerate}[1. ]
1712 \item A formal parameter of a parameter list (that has a
1713 specific type) is represented by a debugging information entry
1714 with the tag \DWTAGformalparameter.
1715 Each formal parameter
1717 \addtoindexx{type attribute}
1718 a \DWATtype{} attribute that refers to the type of
1719 the formal parameter.
1721 \item The unspecified parameters of a variable parameter list
1722 \addtoindexx{unspecified parameters entry}
1724 \addtoindexx{\texttt{...} parameters|see{unspecified parameters entry}}
1725 represented by a debugging information entry with the
1726 tag \DWTAGunspecifiedparameters.
1729 \textit{\addtoindex{C++} const-volatile qualifiers are encoded as
1730 part of the type of the \doublequote{\texttt{this}}-pointer.
1731 \addtoindex{C++11} reference and rvalue-reference qualifiers are
1732 encoded using the \DWATreference{} and \DWATrvaluereference{} attributes,
1734 See also Section \refersec{chap:memberfunctionentries}.}
1737 A subroutine type entry may have the \DWATreference{} or
1738 \DWATrvaluereference{} attribute to indicate that it describes the
1739 type of a member function with reference or rvalue-reference
1740 semantics, respectively.
1743 \section{String Type Entries}
1744 \label{chap:stringtypeentries}
1746 \textit{A \doublequote{string} is a sequence of characters that have specific
1747 \addtoindexx{string type entry}
1748 semantics and operations that distinguish them from arrays of
1750 \addtoindex{Fortran} is one of the languages that has a string
1751 type. Note that \doublequote{string} in this context refers to a target
1752 machine concept, not the class string as used in this document
1753 (except for the name attribute).}
1755 A string type is represented by a debugging information entry
1756 with the tag \DWTAGstringtypeTARG.
1757 If a name has been given to
1758 the string type in the source program, then the corresponding
1759 string type entry has a
1760 \DWATname{} attribute
1761 \addtoindexx{name attribute}
1762 whose value is a null-terminated string containing the string type name.
1764 A string type entry may have a \DWATtypeDEFN{}
1765 \livetargi{chap:DWAATtypeofstringtype}{attribute}{type attribute!of string type entry}
1766 describing how each character is encoded and is to be interpreted.
1767 The value of this attribute is a \CLASSreference{} to a
1768 \DWTAGbasetype{} base type entry. If the attribute is absent,
1769 then the character is encoded using the system default.
1772 \addtoindex{Fortran 2003} language standard allows string
1773 types that are composed of different types of (same sized) characters.
1774 While there is no standard list of character kinds, the kinds
1775 \texttt{ASCII}\index{ASCII@\texttt{ASCII} (Fortran string kind)} (see \DWATEASCII),
1776 \texttt{ISO\_10646}\index{ISO\_10646@\texttt{ISO\_10646} (Fortran string kind)}
1777 \addtoindexx{ISO 10646 character set standard}
1779 \texttt{DEFAULT}\index{DEFAULT@\texttt{DEFAULT} (Fortran string kind)}
1783 The string type entry may have a
1784 \DWATbytesize{} attribute or
1786 attribute, whose value
1787 (see Section \refersec{chap:byteandbitsizes})
1789 storage needed to hold a value of the string type.
1791 The\hypertarget{chap:DWATstringlengthstringlengthofstringtype}{}
1792 string type entry may also have a
1793 \DWATstringlengthDEFN{} attribute
1795 \addtoindexx{string length attribute}
1797 \addtoindex{location description} yielding the location
1798 where the length of the string is stored in the program.
1799 If the \DWATstringlengthNAME{} attribute is not present, the size
1800 of the string is assumed to be the amount of storage that is
1801 allocated for the string (as specified by the \DWATbytesize{}
1802 or \DWATbitsize{} attribute).
1804 The string type entry may also have a
1805 \DWATstringlengthbytesizeDEFN{} or
1806 \DWATstringlengthbitsizeDEFN{} attribute,
1807 \addtoindexx{string length size attribute}
1808 \addtoindexx{string length attribute!size of length data}
1809 whose value (see Section \refersec{chap:byteandbitsizes})
1810 is the size of the data to be retrieved from the location
1811 referenced by the \DWATstringlength{} attribute. If no byte or bit
1812 size attribute is present, the size of the data to be retrieved
1814 \addtoindex{size of an address} on the target machine.
1817 \addtoindexx{DWARF Version 5} % Avoid italics
1818 \textit{Prior to DWARF Version 5, the meaning of a
1819 \DWATbytesize{} attribute depended on the presence of the
1820 \DWATstringlength{} attribute:
1822 \item If \DWATstringlength{} was present, \DWATbytesize{}
1823 specified the size of the length data to be retrieved
1824 from the location specified by the \DWATstringlength{} attribute.
1825 \item If \DWATstringlength{} was not present, \DWATbytesize{}
1826 specified the amount of storage allocated for objects
1829 In \DWARFVersionV{}, \DWATbytesize{} always specifies the amount of storage
1830 allocated for objects of the string type.}
1833 \section{Set Type Entries}
1834 \label{chap:settypeentries}
1836 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1837 a group of values of ordinal type.}
1839 A set is represented by a debugging information entry with
1840 the tag \DWTAGsettypeTARG.
1841 \addtoindexx{set type entry}
1842 If a name has been given to the
1843 set type, then the set type entry has
1844 a \DWATname{} attribute
1845 \addtoindexx{name attribute}
1846 whose value is a null\dash terminated string containing the
1849 The set type entry has a
1850 \addtoindexx{type attribute}
1851 \DWATtype{} attribute to denote the
1852 type of an element of the set.
1855 If the amount of storage allocated to hold each element of an
1856 object of the given set type is different from the amount of
1857 storage that is normally allocated to hold an individual object
1858 of the indicated element type, then the set type entry has
1859 either a \DWATbytesize{} attribute, or
1860 \DWATbitsize{} attribute
1861 whose value (see Section \refersec{chap:byteandbitsizes}) is
1862 the amount of storage needed to hold a value of the set type.
1865 \section{Subrange Type Entries}
1866 \label{chap:subrangetypeentries}
1868 \textit{Several languages support the concept of a \doublequote{subrange}
1869 type. Objects of the subrange type can represent only a contiguous
1870 subset (range) of values from the type on which the subrange is defined.
1871 Subrange types may also be used to represent the bounds of array dimensions.}
1873 A subrange type is represented by a debugging information
1875 \DWTAGsubrangetypeTARG.\addtoindexx{subrange type entry}
1876 If a name has been given to the subrange type, then the
1877 subrange type entry has a
1878 \DWATname{} attribute\addtoindexx{name attribute}
1879 whose value is a null-terminated
1880 string containing the subrange type name.
1882 The tag \DWTAGgenericsubrange{}
1883 is used to describe arrays with a dynamic rank. See Section
1884 \refersec{chap:DWTAGgenericsubrange}.
1886 The subrange entry may have a
1887 \DWATtype{} attribute\addtoindexx{type attribute} to describe
1888 the type of object, called the basis type, of whose values
1889 this subrange is a subset.
1891 If the amount of storage allocated to hold each element of an
1892 object of the given subrange type is different from the amount
1893 of storage that is normally allocated to hold an individual
1894 object of the indicated element type, then the subrange
1896 \DWATbytesize{} attribute or
1898 attribute, whose value
1899 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1900 is the amount of storage needed to hold a value of the subrange type.
1902 The\hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{}
1903 subrange entry may have a
1904 \DWATthreadsscaledDEFN{} attribute\addtoindexx{threads scaled attribute},
1905 which is a \livelink{chap:classflag}{flag}.
1906 If present, this attribute indicates whether
1907 this subrange represents a \addtoindex{UPC} array bound which is scaled
1908 by the runtime \texttt{THREADS} value (the number of \addtoindex{UPC} threads in
1909 this execution of the program).
1911 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
1913 \begin{lstlisting}[numbers=none]
1914 int shared foo[34*THREADS][10][20];
1918 The\hypertarget{chap:DWATlowerboundlowerboundofsubrange}{}
1919 subrange\hypertarget{chap:DWATupperboundupperboundofsubrange}{}
1920 entry may have the attributes
1921 \DWATlowerboundDEFN{}
1922 \addtoindexx{lower bound attribute}
1923 and \DWATupperboundDEFN{}
1924 \addtoindexx{upper bound attribute} to specify, respectively, the lower
1925 and upper bound values of the subrange. The
1926 \DWATupperboundNAME{}
1927 attribute\hypertarget{chap:DWATcountelementsofsubrangetype}{}
1928 may be replaced by a
1929 \addtoindexx{count attribute!default}
1930 \addtoindexx{count attribute}
1931 \DWATcountDEFN{} attribute,
1932 whose value describes the number of elements in the subrange
1933 rather than the value of the last element. The value of each
1934 of these attributes is determined as described in
1935 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1937 If the lower bound value is missing, the value is assumed to
1938 be a language-dependent default constant as defined in
1939 Table \refersec{tab:languageencodings}.
1940 \addtoindexx{lower bound attribute!default}
1942 If the upper bound and count are missing, then the upper bound value is
1943 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
1945 If the subrange entry has no type attribute describing the
1946 basis type, the basis type is determined as follows:
1947 \begin{enumerate}[1. ]
1949 If there is a lower bound attribute that references an object,
1950 the basis type is assumed to be the same as the type of that object.
1952 Otherwise, if there is an upper bound or count attribute that references
1953 an object, the basis type is assumed to be the same as the type of that object.
1955 Otherwise, the type is
1956 assumed to be the same type, in the source language of the
1957 compilation unit containing the subrange entry, as a signed
1958 integer with the same size as an address on the target machine.
1961 If the subrange type occurs as the description of a dimension
1962 of an array type, and the stride for that dimension
1963 is\hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}{}
1964 different than what would otherwise be determined,
1965 then\hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}{}
1966 the subrange type entry has either a
1967 \addtoindexx{byte stride attribute}
1968 \DWATbytestrideDEFN{} or
1969 \DWATbitstrideDEFN{} attribute
1970 \addtoindexx{bit stride attribute}
1971 which specifies the separation
1972 between successive elements along the dimension as described in
1973 Section \refersec{chap:byteandbitsizes}.
1975 \textit{Note that the stride can be negative.}
1978 \section{Pointer to Member Type Entries}
1979 \label{chap:pointertomembertypeentries}
1981 \textit{In \addtoindex{C++}, a
1982 pointer to a data or function member of a class or
1983 structure is a unique type.}
1985 A debugging information entry representing the type of an
1986 object that is a pointer to a structure or class member has
1987 the tag \DWTAGptrtomembertypeTARG.
1989 If the \addtoindex{pointer to member type} has a name, the
1990 \addtoindexx{pointer to member type entry}
1991 pointer to member entry has a
1992 \DWATname{} attribute,
1993 \addtoindexx{name attribute}
1995 null\dash terminated string containing the type name.
1997 The \addtoindex{pointer to member} entry
1999 \addtoindexx{type attribute}
2000 a \DWATtype{} attribute to
2001 describe the type of the class or structure member to which
2002 objects of this type may point.
2004 The \addtoindexx{pointer to member} entry
2005 also\hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{}
2006 has a \DWATcontainingtypeDEFN{} attribute,
2007 \addtoindexx{containing type (of pointer) attribute}
2008 whose value is a \livelink{chap:classreference}{reference} to a debugging
2009 information entry for the class or structure to whose members
2010 objects of this type may point.
2012 The\hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}{}
2013 \addtoindex{pointer to member entry} has a
2014 \DWATuselocationDEFN{} attribute
2015 \addtoindexx{use location attribute}
2017 \addtoindex{location description} that computes the
2018 address of the member of the class to which the pointer to
2019 member entry points.
2022 \textit{The method used to find the address of a given member of a
2023 class or structure is common to any instance of that class
2024 or structure and to any instance of the pointer or member
2025 type. The method is thus associated with the type entry,
2026 rather than with each instance of the type.}
2028 The \DWATuselocation{} description is used in conjunction
2029 with the location descriptions for a particular object of the
2030 given \addtoindex{pointer to member type} and for a particular structure or
2031 class instance. The \DWATuselocation{}
2032 attribute expects two values to be
2033 \addtoindexi{pushed}{address!implicit push for member operator}
2034 onto the DWARF expression stack before
2035 the \DWATuselocation{} description is evaluated.
2037 \addtoindexi{pushed}{address!implicit push for member operator}
2038 is the value of the \addtoindex{pointer to member} object
2039 itself. The second value
2040 \addtoindexi{pushed}{address!implicit push for member operator}
2041 is the base address of the
2042 entire structure or union instance containing the member
2043 whose address is being calculated.
2046 \textit{For an expression such as}
2048 \begin{lstlisting}[numbers=none]
2051 \textit{where \texttt{mbr\_ptr} has some \addtoindex{pointer to member type}, a debugger should:}
2052 \begin{enumerate}[1. ]
2053 \item \textit{Push the value of \texttt{mbr\_ptr} onto the DWARF expression stack.}
2054 \item \textit{Push the base address of \texttt{object} onto the DWARF expression stack.}
2055 \item \textit{Evaluate the \DWATuselocation{} description
2056 given in the type of \texttt{mbr\_ptr}.}
2060 \section{File Type Entries}
2061 \label{chap:filetypeentries}
2063 \textit{Some languages, such as \addtoindex{Pascal},
2064 provide a data type to represent
2067 A file type is represented by a debugging information entry
2069 \addtoindexx{file type entry}
2072 If the file type has a name,
2073 the file type entry has a \DWATname{} attribute,
2074 \addtoindexx{name attribute}
2076 is a null\dash terminated string containing the type name.
2078 The file type entry has
2079 \addtoindexx{type attribute}
2080 a \DWATtype{} attribute describing
2081 the type of the objects contained in the file.
2083 The file type entry also has a
2084 \DWATbytesize{}\addtoindexx{byte size attribute} or
2085 \DWATbitsize{}\addtoindexx{bit size attribute} attribute, whose value
2086 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2087 is the amount of storage need to hold a value of the file type.
2089 \section{Dynamic Type Entries}
2090 \label{chap:dynamictypeentries}
2091 \textit{Some languages such as
2092 \addtoindex{Fortran 90}, provide types whose values
2093 may be dynamically allocated or associated with a variable
2094 under explicit program control. However, unlike the
2095 pointer type in \addtoindex{C} or
2096 \addtoindex{C++}, the indirection involved in accessing
2097 the value of the variable is generally implicit, that is, not
2098 indicated as part of the program source.}
2100 A dynamic type entry is used to declare a dynamic type that is
2101 \doublequote{just like} another non-dynamic type without needing to
2102 replicate the full description of that other type.
2104 A dynamic type is represented by a debugging information entry
2105 with the tag \DWTAGdynamictypeTARG. If a name has been given to the
2106 dynamic type, then the dynamic type has a \DWATname{} attribute
2107 whose value is a null-terminated string containing the dynamic
2110 A dynamic type entry has a \DWATtype{} attribute whose value is a
2111 reference to the type of the entities that are dynamically allocated.
2113 A dynamic type entry also has a \DWATdatalocation, and may also
2114 have \DWATallocated{} and/or \DWATassociated{} attributes as
2115 described in Section \refersec{chap:dynamicpropertiesoftypes}.
2116 A \DWATdatalocation, \DWATallocated{} or \DWATassociated{} attribute
2117 may not occur on a dynamic type entry if the same kind of attribute
2118 already occurs on the type referenced by the \DWATtype{} attribute.
2122 \section{Template Alias Entries}
2123 \label{chap:templatealiasentries}
2125 \textit{In \addtoindex{C++}, a template alias is a form of typedef that has template
2126 parameters. DWARF does not represent the template alias definition
2127 but does represent instantiations of the alias.}
2129 A type named using a template alias is represented
2130 by a debugging information entry
2131 \addtoindexx{template alias entry}
2133 \DWTAGtemplatealiasTARG.
2134 The template alias entry has a
2135 \DWATname{} attribute
2136 \addtoindexx{name attribute}
2137 whose value is a null\dash terminated string
2138 containing the name of the template alias.
2139 The template alias entry has child entries describing the template
2140 actual parameters (see Section \refersec{chap:templateparameters}).
2143 \section{Dynamic Properties of Types}
2144 \label{chap:dynamicpropertiesoftypes}
2145 \textit{The \DWATdatalocation, \DWATallocated{} and \DWATassociated{}
2146 attributes described in this section are motivated for use with
2147 \DWTAGdynamictype{} entries but can be used for any other type as well.}
2150 \subsection{Data Location}
2151 \label{chap:datalocation}
2153 \textit{Some languages may represent objects using descriptors to hold
2154 information, including a location and/or run\dash time parameters,
2155 about the data that represents the value for that object.}
2157 The\hypertarget{chap:DWATdatalocationindirectiontoactualdata}{}
2158 \DWATdatalocationDEFN{} attribute
2159 \addtoindexx{data (indirect) location attribute}
2160 may be used with any type that provides one or more levels of
2161 \addtoindexx{hidden indirection|see{data location attribute}}
2163 and/or run-time parameters in its representation. Its value
2164 is a \addtoindex{location description}.
2165 The result of evaluating this
2166 description yields the location of the data for an object.
2167 When this attribute is omitted, the address of the data is
2168 the same as the address of the object.
2171 \textit{This location description will typically begin with
2172 \DWOPpushobjectaddress{}
2173 which loads the address of the
2174 object which can then serve as a descriptor in subsequent
2175 calculation. For an example using
2177 for a \addtoindex{Fortran 90 array}, see
2178 Appendix \refersec{app:fortranarrayexample}.}
2180 \subsection{Allocation and Association Status}
2181 \label{chap:allocationandassociationstatus}
2183 \textit{Some languages, such as \addtoindex{Fortran 90},
2184 provide types whose values
2185 may be dynamically allocated or associated with a variable
2186 under explicit program control.}
2188 The\hypertarget{chap:DWATallocatedallocationstatusoftypes}{}
2189 \DWATallocatedDEFN{} attribute\addtoindexx{allocated attribute}
2190 may be used with any
2191 type for which objects of the type can be explicitly allocated
2192 and deallocated. The presence of the attribute indicates that
2193 objects of the type are allocatable and deallocatable. The
2194 integer value of the attribute (see below) specifies whether
2195 an object of the type is currently allocated or not.
2198 The\hypertarget{chap:DWATassociatedassociationstatusoftypes}{}
2199 \DWATassociatedDEFN{} attribute
2201 \addtoindexx{associated attribute}
2202 optionally be used with
2203 any type for which objects of the type can be dynamically
2204 associated with other objects. The presence of the attribute
2205 indicates that objects of the type can be associated. The
2206 integer value of the attribute (see below) indicates whether
2207 an object of the type is currently associated or not.
2209 The value of these attributes is determined as described in
2210 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2211 A non-zero value is interpreted as allocated or associated,
2212 and zero is interpreted as not allocated or not associated.
2214 \textit{For \addtoindex{Fortran 90},
2215 if the \DWATassociated{}
2216 attribute is present,
2217 the type has the POINTER property where either the parent
2218 variable is never associated with a dynamic object or the
2219 implementation does not track whether the associated object
2220 is static or dynamic. If the \DWATallocated{} attribute is
2221 present and the \DWATassociated{} attribute is not, the type
2222 has the ALLOCATABLE property. If both attributes are present,
2223 then the type should be assumed to have the POINTER property
2224 (and not ALLOCATABLE); the \DWATallocated{} attribute may then
2225 be used to indicate that the association status of the object
2226 resulted from execution of an ALLOCATE statement rather than
2227 pointer assignment.}
2229 \textit{For examples using
2230 \DWATallocated{} for \addtoindex{Ada} and
2231 \addtoindex{Fortran 90}
2233 see Appendix \refersec{app:aggregateexamples}.}
2235 \subsection{Array Rank}
2236 \label{chap:DWATrank}
2237 \addtoindexx{array!assumed-rank}
2238 \addtoindexx{assumed-rank array|see{array, assumed-rank}}
2239 \textit{The Fortran language supports \doublequote{assumed-rank arrays}. The
2240 rank (the number of dimensions) of an assumed-rank array is unknown
2241 at compile time. The Fortran runtime stores the rank in an array
2245 the\hypertarget{chap:DWATrankofdynamicarray}{\DWATrankINDX}
2246 attribute indicates that an array's rank
2247 (number of dimensions) is dynamic, and therefore unknown at compile
2248 time. The value of the \DWATrankDEFN{} attribute is either an integer constant
2249 or a DWARF expression whose evaluation yields the dynamic rank.
2251 The bounds of an array with dynamic rank are described using a
2252 \DWTAGgenericsubrange{} entry, which
2253 is the dynamic rank array equivalent of
2254 \DWTAGsubrangetype. The
2255 difference is that a \DWTAGgenericsubrange{} entry contains generic
2256 lower/upper bound and stride expressions that need to be evaluated for
2257 each dimension. Before any expression contained in a
2258 \DWTAGgenericsubrange{} can be evaluated, the dimension for which the
2259 expression is to be evaluated needs to be pushed onto the stack. The
2260 expression will use it to find the offset of the respective field in
2261 the array descriptor metadata.
2263 \textit{A producer is free to choose any layout for the
2264 array descriptor. In particular, the upper and lower bounds and
2265 stride values do not need to be bundled into a structure or record,
2266 but could be laid end to end in the containing descriptor, pointed
2267 to by the descriptor, or even allocated independently of the
2270 Dimensions are enumerated $0$ to $\mathit{rank}-1$ in source program
2273 \textit{For an example in Fortran 2008, see
2274 Section~\refersec{app:assumedrankexample}.}