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.
317 If the edited base type entry describes an edited numeric
318 data type, the edited type entry has a \DWATdigitcount{} and a
319 \DWATdecimalscale{} attribute.\addtoindexx{decimal scale attribute}
320 These attributes have the same
321 interpretation as described for the
322 \DWATEpackeddecimal{} and
323 \DWATEnumericstring{} base
324 types. If the edited type entry
325 describes an edited alphanumeric data type, the edited type
326 entry does not have these attributes.
328 \textit{The presence or absence of the \DWATdigitcount{} and
329 \DWATdecimalscale{} attributes\addtoindexx{decimal scale attribute}
330 allows a debugger to easily
331 distinguish edited numeric from edited alphanumeric, although
332 in principle the digit count and scale are derivable by
333 interpreting the picture string.}
336 \section{Unspecified Type Entries}
337 \label{chap:unspecifiedtypeentries}
338 \addtoindexx{unspecified type entry}
339 \addtoindexx{void type|see{unspecified type entry}}
340 Some languages have constructs in which a type
341 may be left unspecified or the absence of a type
342 may be explicitly indicated.
344 An unspecified (implicit, unknown, ambiguous or nonexistent)
345 type is represented by a debugging information entry with
346 the tag \DWTAGunspecifiedtypeTARG.
347 If a name has been given
348 to the type, then the corresponding unspecified type entry
349 has a \DWATname{} attribute
350 \addtoindexx{name attribute}
352 a null\dash terminated
353 string containing the name.
355 \textit{The interpretation of this debugging information entry is
356 intentionally left flexible to allow it to be interpreted
357 appropriately in different languages. For example, in
358 \addtoindex{C} and \addtoindex{C++}
359 the language implementation can provide an unspecified type
360 entry with the name \doublequote{void} which can be referenced by the
361 type attribute of pointer types and typedef declarations for
363 Sections \refersec{chap:typemodifierentries} and
364 %The following reference was valid, so the following is probably correct.
365 Section \refersec{chap:typedefentries},
366 respectively). As another
367 example, in \addtoindex{Ada} such an unspecified type entry can be referred
368 to by the type attribute of an access type where the denoted
369 \addtoindexx{incomplete type (Ada)}
370 type is incomplete (the name is declared as a type but the
371 definition is deferred to a separate compilation unit).}
373 \textit{\addtoindex{C++} permits using the
374 \autoreturntype{} specifier for the return type of a member function declaration.
375 The actual return type is deduced based on the definition of the
376 function, so it may not be known when the function is declared. The language
377 implementation can provide an unspecified type entry with the name \texttt{auto} which
378 can be referenced by the return type attribute of a function declaration entry.
379 When the function is later defined, the \DWTAGsubprogram{} entry for the definition
380 includes a reference to the actual return type.}
383 \section{Type Modifier Entries}
384 \label{chap:typemodifierentries}
385 \addtoindexx{type modifier entry}
386 \addtoindexx{type modifier|see{atomic type entry}}
387 \addtoindexx{type modifier|see{constant type entry}}
388 \addtoindexx{type modifier|see{reference type entry}}
389 \addtoindexx{type modifier|see{restricted type entry}}
390 \addtoindexx{type modifier|see{packed type entry}}
391 \addtoindexx{type modifier|see{pointer type entry}}
392 \addtoindexx{type modifier|see{shared type entry}}
393 \addtoindexx{type modifier|see{volatile type entry}}
394 A base or user\dash defined type may be modified in different ways
395 in different languages. A type modifier is represented in
396 DWARF by a debugging information entry with one of the tags
397 given in Table \refersec{tab:typemodifiertags}.
400 \caption{Type modifier tags}
401 \label{tab:typemodifiertags}
403 \begin{tabular}{l|P{9cm}}
405 Name&Meaning\\ \hline
406 \DWTAGatomictypeTARG{} &
407 atomic qualified type
409 \addtoindexx{atomic qualified type entry} \addtoindexx{C} \\
410 \DWTAGconsttypeTARG{} &
412 (for example in C, C++)
413 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
414 \DWTAGimmutabletypeTARG &
416 (for example, in \addtoindex{D})
417 \addtoindexx{immutable type} \\
418 \DWTAGpackedtypeTARG &
419 packed type\addtoindexx{packed type entry}
420 (for example in Ada, Pascal)
421 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
422 \DWTAGpointertypeTARG{} &
423 pointer to an object of the type being modified
424 \addtoindexx{pointer qualified type entry} \\
425 \DWTAGreferencetypeTARG &
426 reference to (lvalue of) an object of the type \mbox{being} modified
427 \addtoindexx{reference type entry}
428 \addtoindexx{reference qualified type entry} \\
429 \DWTAGrestricttypeTARG &
430 restrict qualified type
431 \addtoindexx{restricted type entry}
432 \addtoindexx{restrict qualified type} \addtoindexx{C} \\
433 \DWTAGrvaluereferencetypeTARG{} &
434 rvalue reference to an object of the type \mbox{being} modified
435 (for example, in \addtoindex{C++})
436 \addtoindexx{rvalue reference type entry}
437 \addtoindexx{restricted type entry}
438 \addtoindexx{rvalue reference qualified type entry} \\
439 \DWTAGsharedtypeTARG &
440 shared qualified type
441 (for example, in \addtoindex{UPC})
442 \addtoindexx{shared qualified type entry} \\
443 \DWTAGvolatiletypeTARG &
444 volatile qualified type
445 (for example, in \addtoindex{C}, \addtoindex{C++})
446 \addtoindexx{volatile qualified type entry} \\
451 If a name has been given to the modified type in the source
452 program, then the corresponding modified type entry has
453 a \DWATname{} attribute\addtoindexx{name attribute}
454 whose value is a null-terminated string containing
455 the name of the modified type.
457 Each of the type modifier entries has a
458 \DWATtype{} attribute\addtoindexx{type attribute},
459 whose value is a \livelink{chap:classreference}{reference}
460 to a debugging information entry
461 describing a base type, a user-defined type or another type
464 A modified type entry describing a
465 \addtoindexx{pointer type entry}
466 pointer or \addtoindex{reference type}
467 (using \DWTAGpointertype,
468 \DWTAGreferencetype{} or
469 \DWTAGrvaluereferencetype)
470 % Another instance of no-good-place-to-put-index entry.
472 a\hypertarget{chap:DWATadressclasspointerorreferencetypes}{}
473 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
474 attribute to describe how objects having the given pointer
475 or reference type are dereferenced.
477 A modified type entry describing a \addtoindex{UPC} shared qualified type
478 (using \DWTAGsharedtype) may have a
479 \DWATcount{} attribute
480 \addtoindexx{count attribute}
481 whose value is a constant expressing the (explicit or implied) blocksize specified for the
482 type in the source. If no count attribute is present, then the \doublequote{infinite}
483 blocksize is assumed.
485 When multiple type modifiers are chained together to modify
486 a base or user-defined type, the tree ordering reflects the
488 \addtoindexx{reference type entry, lvalue|see{reference type entry}}
490 \addtoindexx{reference type entry, rvalue|see{rvalue reference type entry}}
492 \addtoindexx{parameter|see{macro formal parameter list}}
494 \addtoindexx{parameter|see{\textit{this} parameter}}
496 \addtoindexx{parameter|see{variable parameter attribute}}
498 \addtoindexx{parameter|see{optional parameter attribute}}
500 \addtoindexx{parameter|see{unspecified parameters entry}}
502 \addtoindexx{parameter|see{template value parameter entry}}
504 \addtoindexx{parameter|see{template type parameter entry}}
506 \addtoindexx{parameter|see{formal parameter entry}}
510 Examples of modified types are shown in Figure \refersec{fig:typemidifierexamples}.
514 \textit{As examples of how type modifiers are ordered, consider the following
515 \addtoindex{C} declarations:}
516 \par % Needed to end paragraph before listing so that it gets a line number
518 const unsigned char * volatile p;
521 \textit{This represents a volatile pointer to a constant
522 character. It is encoded in DWARF as}
523 \par % Needed to end paragraph before listing so that it gets a line number
527 \DWTAGvariable(p) -->
528 \DWTAGvolatiletype -->
529 \DWTAGpointertype -->
531 \DWTAGbasetype(unsigned char)
535 \textit{On the other hand}
537 volatile unsigned char * const restrict p;
539 \textit{represents a restricted constant
540 pointer to a volatile character. This is encoded as}
543 \DWTAGvariable(p) -->
544 \DWTAGrestricttype -->
546 \DWTAGpointertype -->
547 \DWTAGvolatiletype -->
548 \DWTAGbasetype(unsigned char)
552 \caption{Type modifier examples}
553 \label{fig:typemidifierexamples}
556 \section{Typedef Entries}
557 \label{chap:typedefentries}
558 A named type that is defined in terms of another type
559 definition is represented by a debugging information entry with
560 \addtoindexx{typedef entry}
561 the tag \DWTAGtypedefTARG.
562 The typedef entry has a \DWATname{} attribute
563 \addtoindexx{name attribute}
564 whose value is a null\dash terminated string containing
565 the name of the typedef.
567 The typedef entry may also contain
568 \addtoindexx{type attribute}
570 \DWATtype{} attribute whose
571 value is a \livelink{chap:classreference}{reference}
572 to the type named by the typedef. If
573 the debugging information entry for a typedef represents
574 a declaration of the type that is not also a definition,
575 it does not contain a type attribute.
578 \textit{Depending on the language, a named type that is defined in
579 terms of another type may be called a type alias, a subtype,
580 a constrained type and other terms. A type name declared with
581 no defining details may be termed an
582 \addtoindexx{incomplete type}
583 incomplete, forward or hidden type.
584 While the DWARF \DWTAGtypedef{} entry was
585 originally inspired by the like named construct in
586 \addtoindex{C} and \addtoindex{C++},
587 it is broadly suitable for similar constructs (by whatever
588 source syntax) in other languages.}
590 \section{Array Type Entries}
591 \label{chap:arraytypeentries}
592 \label{chap:DWTAGgenericsubrange}
594 \textit{Many languages share the concept of an \doublequote{array,} which is
595 \addtoindexx{array type entry}
596 a table of components of identical type.}
598 An array type is represented by a debugging information entry
599 with the tag \DWTAGarraytypeTARG.
600 If a name has been given to
601 \addtoindexx{array!declaration of type}
602 the array type in the source program, then the corresponding
603 array type entry has a \DWATname{} attribute
604 \addtoindexx{name attribute}
606 null-terminated string containing the array type name.
608 The\hypertarget{chap:DWATorderingarrayrowcolumnordering}{}
609 array type entry describing a multidimensional array may
610 \addtoindexx{array!element ordering}
611 have a \DWATorderingDEFN{} attribute whose
612 \livelink{chap:classconstant}{integer constant} value is
613 interpreted to mean either row-major or column-major ordering
614 of array elements. The set of values and their meanings
615 for the ordering attribute are listed in
616 Table \referfol{tab:arrayordering}.
618 ordering attribute is present, the default ordering for the
619 source language (which is indicated by the
622 \addtoindexx{language attribute}
623 of the enclosing compilation unit entry) is assumed.
625 \begin{simplenametable}[1.8in]{Array ordering}{tab:arrayordering}
626 \DWORDcolmajorTARG{} \\
627 \DWORDrowmajorTARG{} \\
628 \end{simplenametable}
630 An array type entry has
631 \addtoindexx{type attribute}
632 a \DWATtype{} attribute
634 \addtoindexx{array!element type}
635 the type of each element of the array.
637 If the amount of storage allocated to hold each element of an
638 object of the given array type is different from the amount
639 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
640 of storage that is normally allocated to hold an individual object
641 of\hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}{}
642 the\hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}{}
643 indicated element type, then the array type entry has either a
644 \addtoindexx{byte stride attribute}
645 \DWATbytestrideDEFN{}
647 \addtoindexx{bit stride attribute}
649 attribute, whose value
650 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
652 element of the array.
654 The array type entry may have either a \DWATbytesize{} or a
655 \DWATbitsize{} attribute
656 (see Section \refersec{chap:byteandbitsizes}),
658 amount of storage needed to hold an instance of the array type.
660 \textit{If the size of the array can be determined statically at
661 compile time, this value can usually be computed by multiplying
662 the number of array elements by the size of each element.}
664 Each array dimension is described by a debugging information
665 entry with either the
666 \addtoindexx{subrange type entry!as array dimension}
667 tag \DWTAGsubrangetype{} or the
668 \addtoindexx{enumeration type entry!as array dimension}
670 \DWTAGenumerationtype. These entries are
672 array type entry and are ordered to reflect the appearance of
673 the dimensions in the source program (that is, leftmost dimension
674 first, next to leftmost second, and so on).
676 \textit{In languages that have no concept of a
677 \doublequote{multidimensional array} (for example,
678 \addtoindex{C}), an array of arrays may
679 be represented by a debugging information entry for a
680 multidimensional array.}
682 Alternatively, for an array with dynamic rank the array dimensions
683 are described by a debugging information entry with the tag
684 \DWTAGgenericsubrangeTARG.
685 This entry has the same attributes as a
686 \DWTAGsubrangetype{} entry; however,
687 there is just one \DWTAGgenericsubrangeNAME{} entry and it describes all of the
688 dimensions of the array.
689 If \DWTAGgenericsubrangeNAME{}
690 is used, the number of dimensions must be specified using a
691 \DWATrank{} attribute. See also Section
692 \refersec{chap:DWATrank}.
695 Other attributes especially applicable to arrays are
697 \DWATassociated{} and
699 which are described in
700 Section \refersec{chap:dynamicpropertiesoftypes}.
701 For relevant examples, see also Appendix \refersec{app:fortranarrayexample}.
703 \section{Coarray Type Entries}
704 \label{chap:coarraytypeentries}
705 \addtoindexx{coarray}
706 \textit{In Fortran, a \doublequote{coarray} is an array whose
707 elements are located in different processes rather than in the
708 memory of one process. The individual elements
709 of a coarray can be scalars or arrays.
710 Similar to arrays, coarrays have \doublequote{codimensions} that are
711 indexed using a \doublequote{coindex} or multiple \doublequote{coindices}.
712 \addtoindexx{codimension|see{coarray}}
713 \addtoindexx{coindex|see{coarray}}
716 A coarray type is represented by a debugging information entry
717 with the tag \DWTAGcoarraytypeTARG.
718 If a name has been given to the
719 coarray type in the source, then the corresponding coarray type
720 entry has a \DWATname{} attribute whose value is a null-terminated
721 string containing the array type name.
724 A coarray entry has one or more \DWTAGsubrangetype{} child entries,
725 one for each codimension. It also has a \DWATtype{} attribute
726 describing the type of each element of the coarray.
728 \textit{In a coarray application, the run-time number of processes in the application
729 is part of the coindex calculation. It is represented in the Fortran source by
730 a coindex which is declared with a \doublequote{*} as the upper bound. To express this
731 concept in DWARF, the \DWTAGsubrangetype{} child entry for that index has
732 only a lower bound and no upper bound.}
734 \textit{How coarray elements are located and how coindices are
735 converted to process specifications is implementation-defined.}
738 \section{Structure, Union, Class and Interface Type Entries}
739 \label{chap:structureunionclassandinterfacetypeentries}
741 \textit{The languages
743 \addtoindex{C++}, and
744 \addtoindex{Pascal}, among others, allow the
745 programmer to define types that are collections of related
746 \addtoindexx{structure type entry}
748 In \addtoindex{C} and \addtoindex{C++}, these collections are called
749 \doublequote{structures.}
750 In \addtoindex{Pascal}, they are called \doublequote{records.}
751 The components may be of different types. The components are
752 called \doublequote{members} in \addtoindex{C} and
753 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
755 \textit{The components of these collections each exist in their
756 own space in computer memory. The components of a \addtoindex{C} or \addtoindex{C++}
757 \doublequote{union} all coexist in the same memory.}
759 \textit{\addtoindex{Pascal} and
760 other languages have a \doublequote{discriminated union,}
761 \addtoindexx{discriminated union|see {variant entry}}
762 also called a \doublequote{variant record.} Here, selection of a
763 number of alternative substructures (\doublequote{variants}) is based
764 on the value of a component that is not part of any of those
765 substructures (the \doublequote{discriminant}).}
767 \textit{\addtoindex{C++} and
768 \addtoindex{Java} have the notion of \doublequote{class,} which is in some
769 ways similar to a structure. A class may have \doublequote{member
770 functions} which are subroutines that are within the scope
771 of a class or structure.}
773 \textit{The \addtoindex{C++} notion of
774 structure is more general than in \addtoindex{C}, being
775 equivalent to a class with minor differences. Accordingly,
776 in the following discussion, statements about
777 \addtoindex{C++} classes may
778 be understood to apply to \addtoindex{C++} structures as well.}
781 \subsection{Structure, Union and Class Type Entries}
782 \label{chap:structureunionandclasstypeentries}
783 Structure, union, and class types are represented by debugging
784 \addtoindexx{structure type entry}
786 \addtoindexx{union type entry}
788 \addtoindexx{class type entry}
790 \DWTAGstructuretypeTARG,
792 and \DWTAGclasstypeTARG,
793 respectively. If a name has been given to the structure,
794 union, or class in the source program, then the corresponding
795 structure type, union type, or class type entry has a
796 \DWATname{} attribute
797 \addtoindexx{name attribute}
798 whose value is a null\dash terminated string
799 containing the type name.
801 The members of a structure, union, or class are represented
802 by debugging information entries that are owned by the
803 corresponding structure type, union type, or class type entry
804 and appear in the same order as the corresponding declarations
805 in the source program.
807 A structure, union, or class type may have a \DWATexportsymbolsDEFN{}
808 attribute\addtoindexx{export symbols (of structure, class or union) attribute}
809 \livetarg{chap:DWATexportsymbolsofstructunionclass}{}
810 which indicates that all member names defined within
811 the structure, union, or class may be referenced as if they were
812 defined within the containing structure, union, or class.
814 \textit{This may be used to describe anonymous structures, unions
815 and classes in \addtoindex{C} or \addtoindex{C++}}.
817 A\hypertarget{chap:DWATbitsizedatamemberbitsize}{}
818 structure type, union type or class type entry may have
819 either a \DWATbytesize{} or a \DWATbitsize{} attribute
820 (see Section \refersec{chap:byteandbitsizes}),
821 whose value is the amount of storage needed
822 to hold an instance of the structure, union or class type,
823 including any padding.
825 An incomplete structure, union or class type
826 \addtoindexx{incomplete structure/union/class}
827 \addtoindexx{incomplete type}
828 is represented by a structure, union or class
829 entry that does not have a byte size attribute and that has
830 \addtoindexx{declaration attribute}
831 a \DWATdeclaration{} attribute.
833 If the complete declaration of a type has been placed
834 in\hypertarget{chap:DWATsignaturetypesignature}{}
835 a separate \addtoindex{type unit}
836 (see Section \refersec{chap:typeunitentries}),
837 an incomplete declaration
838 \addtoindexx{incomplete type}
839 of that type in the compilation unit may provide
840 the unique 8-byte signature of the type using a
841 \addtoindexx{type signature}
842 \DWATsignatureDEFN{} attribute.
844 If a structure, union or class entry represents the definition
845 of a structure, union or class member corresponding to a prior
846 incomplete structure, union or class, the entry may have a
847 \DWATspecification{} attribute
848 \addtoindexx{specification attribute}
849 whose value is a \livelink{chap:classreference}{reference} to
850 the debugging information entry representing that incomplete
853 Structure, union and class entries containing the
854 \DWATspecification{} attribute
855 \addtoindexx{specification attribute}
856 do not need to duplicate
857 information provided by the declaration entry referenced by the
858 specification attribute. In particular, such entries do not
859 need to contain an attribute for the name of the structure,
860 union or class they represent if such information is already
861 provided in the declaration.
863 \textit{For \addtoindex{C} and \addtoindex{C++},
865 \addtoindexx{data member|see {member entry (data)}}
866 member declarations occurring within
867 the declaration of a structure, union or class type are
868 considered to be \doublequote{definitions} of those members, with
869 the exception of \doublequote{static} data members, whose definitions
870 appear outside of the declaration of the enclosing structure,
871 union or class type. Function member declarations appearing
872 within a structure, union or class type declaration are
873 definitions only if the body of the function also appears
874 within the type declaration.}
876 If the definition for a given member of the structure, union
877 or class does not appear within the body of the declaration,
878 that member also has a debugging information entry describing
879 its definition. That latter entry has a
880 \DWATspecification{} attribute
881 \addtoindexx{specification attribute}
882 referencing the debugging information entry
883 owned by the body of the structure, union or class entry and
884 representing a non-defining declaration of the data, function
885 or type member. The referenced entry will not have information
886 about the location of that member (low and high PC attributes
887 for function members, location descriptions for data members)
888 and will have a \DWATdeclaration{} attribute.
891 \textit{Consider a nested class whose
892 definition occurs outside of the containing class definition, as in:}
901 \textit{The two different structs can be described in
902 different compilation units to
903 facilitate DWARF space compression
904 (see Appendix \refersec{app:usingcompilationunits}).}
907 A structure type, union type or class type entry may have a
908 \DWATcallingconventionDEFN{} attribute,
909 \addtoindexx{calling convention attribute!for types}
910 whose value indicates whether a value of the type
911 is passed by reference
912 or passed by value. The set of calling convention codes for use with types
913 \addtoindexx{calling convention codes!for types}
914 is\hypertarget{chap:DWATcallingconventionfortypes}{}
915 given in Table \referfol{tab:callingconventioncodesfortypes}.
917 \begin{simplenametable}[2.2in]{Calling convention codes for types}{tab:callingconventioncodesfortypes}
919 \DWCCpassbyvalueTARG \\
920 \DWCCpassbyreferenceTARG \\
921 \end{simplenametable}
923 If this attribute is not present, or its value is
924 \DWCCnormalNAME, the convention to be used for an object of the
925 given type is assumed to be unspecified.
927 \textit{Note that \DWCCnormalNAME{} is also used as a calling convention
928 code for certain subprograms
929 (see Table \refersec{tab:callingconventioncodesforsubroutines}).}
931 \textit{If unspecified, a consumer may be able to deduce the calling
932 convention based on knowledge of the type and the ABI.}
935 \subsection{Interface Type Entries}
936 \label{chap:interfacetypeentries}
938 \textit{The \addtoindex{Java} language defines \doublequote{interface} types.
940 \addtoindexx{interface type entry}
941 in \addtoindex{Java} is similar to a \addtoindex{C++} or
942 \addtoindex{Java} class with only abstract
943 methods and constant data members.}
946 \addtoindexx{interface type entry}
947 are represented by debugging information
949 tag \DWTAGinterfacetypeTARG.
951 An interface type entry has
952 a \DWATname{} attribute,
953 \addtoindexx{name attribute}
954 whose value is a null\dash terminated string containing the
957 The members of an interface are represented by debugging
958 information entries that are owned by the interface type
959 entry and that appear in the same order as the corresponding
960 declarations in the source program.
962 \subsection{Derived or Extended Structures, Classes and Interfaces}
963 \label{chap:derivedorextendedstructsclasesandinterfaces}
965 \textit{In \addtoindex{C++}, a class (or struct)
967 \addtoindexx{derived type (C++)|see{inheritance entry}}
968 be \doublequote{derived from} or be a
969 \doublequote{subclass of} another class.
970 In \addtoindex{Java}, an interface may \doublequote{extend}
971 \addtoindexx{extended type (Java)|see{inheritance entry}}
973 \addtoindexx{implementing type (Java)|see{inheritance entry}}
974 or more other interfaces, and a class may \doublequote{extend} another
975 class and/or \doublequote{implement} one or more interfaces. All of these
976 relationships may be described using the following. Note that
977 in \addtoindex{Java},
978 the distinction between extends and implements is
979 implied by the entities at the two ends of the relationship.}
981 A class type or interface type entry that describes a
982 derived, extended or implementing class or interface owns
983 \addtoindexx{implementing type (Java)|see{inheritance entry}}
984 debugging information entries describing each of the classes
985 or interfaces it is derived from, extending or implementing,
986 respectively, ordered as they were in the source program. Each
988 \addtoindexx{inheritance entry}
990 tag \DWTAGinheritanceTARG.
994 \addtoindexx{type attribute}
996 \addtoindexx{inheritance entry}
998 \DWATtype{} attribute whose value is
999 a reference to the debugging information entry describing the
1000 class or interface from which the parent class or structure
1001 of the inheritance entry is derived, extended or implementing.
1003 An\hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}{}
1004 inheritance entry\addtoindexx{inheritance entry}
1005 for a class that derives from or extends
1006 another class or struct also has a
1007 \DWATdatamemberlocationDEFN{} attribute,
1008 \addtoindexx{data member location attribute}
1009 whose value describes the location of the beginning
1010 of the inherited type relative to the beginning address of the
1011 instance of the derived class. If that value is a constant, it is the offset
1012 in bytes from the beginning of the class to the beginning of
1013 the instance of the inherited type. Otherwise, the value must be a location
1014 description. In this latter case, the beginning address of
1015 the instance of the derived class is pushed on the expression stack before
1016 the \addtoindex{location description}
1017 is evaluated and the result of the
1018 evaluation is the location of the instance of the inherited type.
1020 \textit{The interpretation of the value of this attribute for
1021 inherited types is the same as the interpretation for data
1023 (see Section \referfol{chap:datamemberentries}). }
1025 An\hypertarget{chap:DWATaccessibilitycppinheritedmembers}{}
1026 \addtoindexx{inheritance entry}
1027 inheritance entry may have a
1028 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1029 attribute.\addtoindexx{accessibility attribute}
1030 If no accessibility attribute is present, private access
1031 is assumed for an entry of a class and public access is
1032 assumed for an entry of a struct, union or interface.
1034 If the class referenced by the \addtoindex{inheritance entry}
1035 serves as a \addtoindex{C++} virtual base class, the
1036 inheritance entry has a
1037 \hyperlink{chap:DWATvirtualityvirtualityindication}{\DWATvirtualityNAME}
1040 \textit{For a \addtoindex{C++} virtual base, the
1041 \addtoindex{data member location attribute}
1042 will usually consist of a non-trivial
1043 \addtoindex{location description}.}
1045 \subsection{Access Declarations}
1046 \label{chap:accessdeclarations}
1048 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1049 change the accessibility of individual class members from the
1050 overall accessibility specified by the inheritance declaration.
1051 A single access declaration may refer to a set of overloaded
1054 If a derived class or structure contains access declarations,
1055 each such declaration may be represented by a debugging
1056 information entry with the tag \DWTAGaccessdeclarationTARG.
1057 \addtoindexx{access declaration entry}
1058 Each such entry is a child of the class or structure type entry.
1060 An access declaration entry has a \DWATname{} attribute,
1061 whose value is a null-terminated string representing the name
1062 used in the declaration,
1063 including any class or structure qualifiers.
1065 An\hypertarget{chap:DWATaccessdeclaration}{}
1066 access declaration entry also has a
1067 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1068 \addtoindexx{accessibility attribute}
1069 attribute describing the declared accessibility of the named entities.
1073 \subsection{Friends}
1074 \label{chap:friends}
1076 Each\hypertarget{chap:DWATfriendfriendrelationship}{}
1077 friend\addtoindexx{friend entry}
1078 declared by a structure, union or class
1079 type may be represented by a debugging information entry
1080 that is a child of the structure, union or class type entry;
1081 the friend entry has the tag \DWTAGfriendTARG.
1083 A friend entry has a \DWATfriendDEFN{} attribute,
1084 \addtoindexx{friend attribute} whose value is
1085 a reference to the debugging information entry describing
1086 the declaration of the friend.
1089 \subsection{Data Member Entries}
1090 \label{chap:datamemberentries}
1092 A data member (as opposed to a member function) is
1093 represented by a debugging information entry with the
1094 tag \DWTAGmemberTARG.
1096 \addtoindexx{member entry (data)}
1097 member entry for a named member has
1098 a \DWATname{} attribute
1099 \addtoindexx{name attribute}
1100 whose value is a null\dash terminated
1101 string containing the member name.
1102 If the member entry describes an
1103 \addtoindex{anonymous union},
1104 the name attribute is omitted or the value of the attribute
1105 consists of a single zero byte.
1107 The data member entry has a
1108 \DWATtype{} attribute\addtoindexx{type attribute} to denote
1109 \addtoindexx{member entry (data)} the type of that member.
1111 A data member entry may have a
1112 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1113 attribute.\addtoindexx{accessibility attribute}
1114 If no accessibility attribute is present, private
1115 access is assumed for an member of a class and public access
1116 is assumed for an member of a structure, union, or interface.
1118 A\hypertarget{chap:DWATmutablemutablepropertyofmemberdata}{}
1119 data member entry \addtoindexx{member entry (data)}
1121 \addtoindexx{mutable attribute}
1122 \DWATmutableDEFN{} attribute,
1123 which is a \livelink{chap:classflag}{flag}.
1124 This attribute indicates whether the data
1125 member was declared with the mutable storage class specifier.
1127 The beginning of a data member
1128 \addtoindexx{beginning of a data member}
1129 is described relative to
1130 \addtoindexx{beginning of an object}
1131 the beginning of the object in which it is immediately
1132 contained. In general, the beginning is characterized by
1133 both an address and a bit offset within the byte at that
1134 address. When the storage for an entity includes all of
1135 the bits in the beginning byte, the beginning bit offset is
1138 The\hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}{}
1139 member\hypertarget{chap:DWATdatamemberlocationdatamemberlocation}{}
1140 entry \addtoindexx{member entry (data)}
1141 corresponding to a data member that is defined
1142 in a structure, union or class may have either a
1143 \DWATdatamemberlocationDEFN{} attribute
1144 \addtoindexx{data member location attribute}
1145 or a \DWATdatabitoffsetDEFN{} attribute.
1146 \addtoindexx{data bit offset attribute}
1147 If the beginning of the data member is the same as
1148 the beginning of the containing entity then neither attribute
1152 For a \DWATdatamemberlocation{} attribute
1153 \addtoindexx{data member location attribute}
1154 there are two cases:
1155 \begin{enumerate}[1. ]
1156 \item If the value is an
1157 \livelink{chap:classconstant}{integer constant},
1159 in bytes from the beginning of the containing entity. If
1160 the beginning of the containing entity has a non-zero bit
1161 offset then the beginning of the member entry has that same
1164 \item Otherwise, the value must be a \addtoindex{location description}.
1166 this case, the beginning of the containing entity must be byte
1167 aligned. The beginning address is pushed on the DWARF stack
1168 before the \addtoindex{location} description is evaluated; the result of
1169 the evaluation is the base address of the member entry.
1171 \textit{The push on the DWARF expression stack of the base address of
1172 the containing construct is equivalent to execution of the
1173 \DWOPpushobjectaddress{} operation
1174 (see Section \refersec{chap:stackoperations});
1175 \DWOPpushobjectaddress{} therefore
1176 is not needed at the
1177 beginning of a \addtoindex{location description} for a data member.
1179 result of the evaluation is a location---either an address or
1180 the name of a register, not an offset to the member.}
1182 \textit{A \DWATdatamemberlocation{}
1184 \addtoindexx{data member location attribute}
1185 that has the form of a
1186 \addtoindex{location description} is not valid for a data member contained
1187 in an entity that is not byte aligned because DWARF operations
1188 do not allow for manipulating or computing bit offsets.}
1193 For a \DWATdatabitoffset{} attribute,
1194 the value is an \livelink{chap:classconstant}{integer constant}
1195 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1196 that specifies the number of bits
1197 from the beginning of the containing entity to the beginning
1198 of the data member. This value must be greater than or equal
1199 to zero, but is not limited to less than the number of bits
1202 If the size of a data member is not the same as the size
1203 of the type given for the data member, the data member has
1204 either a \DWATbytesize\addtoindexx{byte size attribute}
1205 or a \DWATbitsize{} attribute\addtoindexx{bit size attribute} whose
1206 \livelink{chap:classconstant}{integer constant} value
1207 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1209 of storage needed to hold the value of the data member.
1211 \textit{For showing nested and packed records and arrays,
1212 see Appendix \refersec{app:pascalexample} and
1213 \refersec{app:ccppbitfieldexamples}.}
1216 \subsection{Class Variable Entries}
1217 \label{chap:classvariableentries}
1218 \addtoindexx{class variable entry}
1219 A class variable (\doublequote{static data member} in
1220 \addtoindex{C++}) is a variable shared by all instances
1221 of a class. It is represented by a
1222 debugging information entry with the tag \DWTAGvariable.
1224 The class variable entry
1225 may contain the same attributes and follows the same rules
1226 as non-member global variable entries
1227 (see Section \refersec{chap:dataobjectentries}).
1229 A class variable entry may have a
1230 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1231 \addtoindexx{accessibility attribute}
1232 attribute. If no accessibility attribute is present, private
1233 access is assumed for an entry of a class and public access
1234 is assumed for an entry of a structure, union or interface.
1238 \subsection{Member Function Entries}
1239 \label{chap:memberfunctionentries}
1241 A member function is represented by a
1242 \addtoindexx{member function entry}
1243 debugging information entry
1245 \addtoindexx{subprogram entry!as member function}
1246 tag \DWTAGsubprogram.
1247 The member function entry
1248 may contain the same attributes and follows the same rules
1249 as non-member global subroutine entries
1250 (see Section \refersec{chap:subroutineandentrypointentries}).
1253 \textit{In particular, if the member function entry is an
1254 instantiation of a member function template, it follows the
1255 same rules as function template instantiations (see Section
1256 \refersec{chap:functiontemplateinstantiations}).
1259 A member function entry may have a
1260 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1261 \addtoindexx{accessibility attribute}
1262 attribute. If no accessibility attribute is present, private
1263 access is assumed for an entry of a class and public access
1264 is assumed for an entry of a structure, union or interface.
1266 If the member function entry describes a virtual function,
1267 then that entry has a
1268 \hyperlink{chap:DWATvirtualityvirtualityindication}{\DWATvirtualityNAME}
1271 If\hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}{}
1272 the member function entry describes an explicit member
1273 function, then that entry has a
1274 \addtoindexx{explicit attribute}
1275 \DWATexplicitDEFN{} attribute.
1277 An\hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{}
1278 entry for a virtual function also has a
1279 \DWATvtableelemlocationDEFN{}
1280 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1281 a \addtoindex{location description}
1282 yielding the address of the slot
1283 for the function within the virtual function table for the
1284 enclosing class. The address of an object of the enclosing
1285 type is pushed onto the expression stack before the location
1286 description is evaluated.
1288 If\hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{}
1289 the member function entry describes a non-static member
1290 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1291 function, then that entry
1292 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1294 \addtoindexx{object pointer attribute}
1295 a \DWATobjectpointerDEFN{} attribute
1296 whose value is a \livelink{chap:classreference}{reference}
1297 to the formal parameter entry
1298 that corresponds to the object for which the function is
1299 called. The name attribute of that formal parameter is defined
1300 by the current language (for example,
1301 \texttt{this} for \addtoindex{C++} or \texttt{self}
1302 for \addtoindex{Objective C}
1303 and some other languages). That parameter
1304 also has a \DWATartificial{} attribute whose value is true.
1306 Conversely, if the member function entry describes a static
1307 member function, the entry does not have a
1308 \addtoindexx{object pointer attribute}
1309 \DWATobjectpointer{} attribute.
1311 \textit{In \addtoindex{C++}, non-static member functions can have const-volatile
1312 qualifiers, which affect the type of the first formal parameter (the
1313 \doublequote{\texttt{this}}-pointer).}
1315 If the member function entry describes a non-static member
1316 function that has a const\dash volatile qualification, then
1317 the entry describes a non-static member function whose
1318 object formal parameter has a type that has an equivalent
1319 const-volatile qualification.
1321 \textit{Beginning in \addtoindex{C++11}, non-static member
1322 functions can also have one of the ref-qualifiers, \& and \&\&.
1323 These do not change the type of the
1324 \doublequote{\texttt{this}}-pointer, but they do affect the types of
1325 object values on which the function can be invoked.}
1328 The member function entry may have an \DWATreferenceDEFN{} attribute
1329 \livetarg{chap:DWATreferenceofnonstaticmember}{}
1330 to indicate a non-static member function that can only be called on
1331 lvalue objects, or the \DWATrvaluereferenceDEFN{} attribute
1332 \livetarg{chap:DWATrvaluereferenceofnonstaticmember}{}
1333 to indicate that it can only be called on prvalues and xvalues.
1335 \textit{The lvalue, prvalue and xvalue concepts are defined in the
1336 \addtoindex{C++11} and later standards.}
1338 If a subroutine entry represents the defining declaration
1339 of a member function and that definition appears outside of
1340 the body of the enclosing class declaration, the subroutine
1342 \DWATspecification{} attribute,
1343 \addtoindexx{specification attribute}
1345 a reference to the debugging information entry representing
1346 the declaration of this function member. The referenced entry
1347 will be a child of some class (or structure) type entry.
1350 Subroutine entries containing the
1351 \DWATspecification{} attribute
1352 \addtoindexx{specification attribute}
1353 do not need to duplicate information provided
1354 by the declaration entry referenced by the specification
1355 attribute. In particular, such entries do not need to contain
1356 a name attribute giving the name of the function member whose
1357 definition they represent.
1358 Similarly, such entries do not need to contain a return type
1359 attribute, unless the return type on the declaration was
1360 unspecified (for example, the declaration used the
1361 \addtoindex{C++} \autoreturntype{} specifier).
1363 \textit{In \addtoindex{C++}, a member function may be declared
1364 as deleted. This prevents the compiler from generating a default
1365 implementation of a special member function such as a
1366 constructor or destructor, and can affect overload resolution
1367 when used on other member functions.}
1369 If the member function entry has been declared as deleted,
1370 then that entry has a \DWATdeletedDEFN{}\livetarg{chap:DWATdeleteddef}{}
1371 attribute.\addtoindexx{deleted attribute}
1373 \textit{In \addtoindex{C++}, a special member function may be
1374 declared as defaulted, which explicitly declares a default
1375 compiler-generated implementation of the function. The
1376 declaration may have different effects on the calling
1377 convention used for objects of its class, depending on
1378 whether the default declaration is made inside or outside the
1381 If the member function has been declared as defaulted,
1382 then the entry has a \DWATdefaultedDEFN{}\livetarg{chap:DWATdefaulteddef}{}
1383 attribute\addtoindexx{defaulted attribute}
1384 whose integer constant value indicates whether, and if so,
1385 how, that member is defaulted. The possible values and
1386 their meanings are shown in
1387 Table \referfol{tab:defaultedattributevaluenames}.
1391 \setlength{\extrarowheight}{0.1cm}
1392 \begin{longtable}{l|l}
1393 \caption{Defaulted attribute names} \label{tab:defaultedattributevaluenames} \\
1394 \hline \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1396 \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1398 \hline \emph{Continued on next page}
1401 \DWDEFAULTEDnoTARG & Not declared default \\
1402 \DWDEFAULTEDinclassTARG & Defaulted within the class \\
1403 \DWDEFAULTEDoutofclassTARG& Defaulted outside of the class \\
1408 \textit{An artificial member function (that is, a compiler-generated
1409 copy that does not appear in the source) does not have a
1410 \DWATdefaultedNAME{} attribute.}
1413 \subsection{Class Template Instantiations}
1414 \label{chap:classtemplateinstantiations}
1416 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1417 type that may be instantiated when an instance of the class
1418 is declared or defined. The generic description of the class may include
1419 parameterized types, parameterized compile-time constant
1420 values, and/or parameterized run-time constant addresses.
1421 DWARF does not represent the generic template
1422 definition, but does represent each instantiation.}
1424 A class template instantiation is represented by a
1425 debugging information entry with the tag \DWTAGclasstype,
1426 \DWTAGstructuretype{} or
1427 \DWTAGuniontype. With the following
1428 exceptions, such an entry will contain the same attributes
1429 and have the same types of child entries as would an entry
1430 for a class type defined explicitly using the instantiation
1431 types and values. The exceptions are:
1433 \begin{enumerate}[1. ]
1434 \item Template parameters are described and referenced as
1435 specified in Section \refersec{chap:templateparameters}.
1438 \item If the compiler has generated a special compilation unit to
1440 \addtoindexx{template instantiation!and special compilation unit}
1441 template instantiation and that special compilation
1442 unit has a different name from the compilation unit containing
1443 the template definition, the name attribute for the debugging
1444 information entry representing the special compilation unit
1445 is empty or omitted.
1448 \item If the class type entry representing the template
1449 instantiation or any of its child entries contains declaration
1450 coordinate attributes, those attributes refer to
1451 the source for the template definition, not to any source
1452 generated artificially by the compiler.
1456 \subsection{Variant Entries}
1457 \label{chap:variantentries}
1459 A variant part of a structure is represented by a debugging
1460 information entry\addtoindexx{variant part entry} with the
1461 tag \DWTAGvariantpartTARG{} and is
1462 owned by the corresponding structure type entry.
1464 If the variant part has a discriminant, the discriminant
1465 is\hypertarget{chap:DWATdiscrdiscriminantofvariantpart}{}
1466 represented by a \addtoindexx{discriminant (entry)}
1467 separate debugging information entry which
1468 is a child of the variant part entry. This entry has the form
1469 of a \addtoindexx{member entry (data)!as discriminant}
1470 structure data member entry. The variant part entry will
1472 \DWATdiscrDEFN{} attribute \addtoindexx{discriminant attribute}
1473 whose value is a \livelink{chap:classreference}{reference} to
1474 the member entry for the discriminant.
1476 If the variant part does not have a discriminant (tag field),
1477 the variant part entry has \addtoindexx{type attribute}
1478 a \DWATtype{} attribute to represent
1481 Each variant of a particular variant part is represented
1482 by\hypertarget{chap:DWATdiscrvaluediscriminantvalue}{}
1483 a debugging information entry\addtoindexx{variant entry} with the
1484 tag \DWTAGvariantTARG{}
1485 and is a child of the variant part entry. The value that
1486 selects a given variant may be represented in one of three
1487 ways. The variant entry may have a \DWATdiscrvalueDEFN{}
1488 attribute\addtoindexx{discriminant value attribute}
1489 whose value represents the discriminant value selecting
1490 this variant. The value of this
1491 attribute is encoded as an LEB128 number. The number is signed
1492 if the tag type for the variant part containing this variant
1493 is a signed type. The number is unsigned if the tag type is
1497 Alternatively,\hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}{}
1498 the variant entry may contain a
1499 \addtoindexx{discriminant list attribute}
1500 \DWATdiscrlistDEFN{}
1501 attribute, whose value represents a list of discriminant
1502 values. This list is represented by any of the
1503 \livelink{chap:classblock}{block} forms and may contain a
1504 mixture of discriminant values and discriminant ranges.
1505 Each item on the list is prefixed with a discriminant value
1506 descriptor that determines whether the list item represents
1507 a single label or a label range. A single case label is
1508 represented as an LEB128 number as defined above for the
1509 \addtoindexx{discriminant value attribute}
1511 attribute. A label range is represented by
1512 two LEB128 numbers, the low value of the range followed by the
1513 high value. Both values follow the rules for signedness just
1514 described. The discriminant value descriptor is an integer
1515 constant that may have one of the values given in
1516 Table \refersec{tab:discriminantdescriptorvalues}.
1518 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1519 \DWDSClabelTARG{} \\
1520 \DWDSCrangeTARG{} \\
1521 \end{simplenametable}
1524 If a variant entry has neither a \DWATdiscrvalue{}
1525 attribute nor a \DWATdiscrlist{} attribute, or if it has
1526 a \DWATdiscrlist{} attribute with 0 size, the variant is a
1529 The components selected by a particular variant are represented
1530 by debugging information entries owned by the corresponding
1531 variant entry and appear in the same order as the corresponding
1532 declarations in the source program.
1535 \section{Condition Entries}
1536 \label{chap:conditionentries}
1538 \textit{COBOL has the notion of
1539 \addtoindexx{level-88 condition, COBOL}
1540 a \doublequote{level\dash 88 condition} that
1541 associates a data item, called the conditional variable, with
1542 a set of one or more constant values and/or value ranges.
1543 % Note: the {} after \textquoteright (twice) is necessary to assure a following space separator
1544 Semantically, the condition is \textquoteleft true\textquoteright{}
1546 variable's value matches any of the described constants,
1547 and the condition is \textquoteleft false\textquoteright{} otherwise.}
1549 The \DWTAGconditionTARG{}
1550 debugging information entry\addtoindexx{condition entry}
1552 logical condition that tests whether a given data item\textquoteright s
1553 value matches one of a set of constant values. If a name
1554 has been given to the condition, the condition entry has a
1555 \DWATname{} attribute
1556 \addtoindexx{name attribute}
1557 whose value is a null\dash terminated string
1558 giving the condition name.
1561 The condition entry's parent entry describes the conditional
1562 variable; normally this will be a \DWTAGvariable,
1564 \DWTAGformalparameter{} entry.
1566 \addtoindexx{formal parameter entry}
1568 entry has an array type, the condition can test any individual
1569 element, but not the array as a whole. The condition entry
1570 implicitly specifies a \doublequote{comparison type} that is the
1571 type of an array element if the parent has an array type;
1572 otherwise it is the type of the parent entry.
1575 The condition entry owns \DWTAGconstant{} and/or
1576 \DWTAGsubrangetype{} entries that describe the constant
1577 values associated with the condition. If any child entry
1578 \addtoindexx{type attribute}
1579 has a \DWATtype{} attribute, that attribute describes
1580 a type compatible with the comparison type (according to the
1581 source language); otherwise the child\textquoteright{}s type
1582 is the same as the comparison type.
1584 \textit{For conditional variables with alphanumeric types, COBOL
1585 permits a source program to provide ranges of alphanumeric
1586 constants in the condition. Normally a subrange type entry
1587 does not describe ranges of strings; however, this can be
1588 represented using bounds attributes that are references to
1589 constant entries describing strings. A subrange type entry may
1590 refer to constant entries that are siblings of the subrange
1594 \section{Enumeration Type Entries}
1595 \label{chap:enumerationtypeentries}
1597 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1598 a fixed number of symbolic values.}
1600 An enumeration type is represented by a debugging information
1602 \DWTAGenumerationtypeTARG.
1604 If a name has been given to the enumeration type in the source
1605 program, then the corresponding enumeration type entry has
1606 a \DWATname{} attribute
1607 \addtoindexx{name attribute}
1608 whose value is a null\dash terminated
1609 string containing the enumeration type name.
1611 The \addtoindex{enumeration type entry}
1613 \addtoindexx{type attribute}
1614 a \DWATtype{} attribute
1615 which refers to the underlying data type used to implement
1616 the enumeration. The entry also may have a
1617 \DWATbytesize{} attribute or
1619 attribute, whose value
1620 (see Section \refersec{chap:byteandbitsizes})
1621 is the amount of storage
1622 required to hold an instance of the enumeration. If no
1623 \DWATbytesize{} or \DWATbitsize{}
1624 attribute is present, the size for holding an instance of the
1625 enumeration is given by the size of the underlying data type.
1628 If an enumeration type has type safe
1629 \addtoindexx{type safe enumeration types}
1632 \begin{enumerate}[1. ]
1633 \item Enumerators are contained in the scope of the enumeration type, and/or
1635 \item Enumerators are not implicitly converted to another type
1638 then the \addtoindex{enumeration type entry} may
1639 \addtoindexx{enum class|see{type-safe enumeration}}
1640 have a \DWATenumclassDEFN{}
1641 attribute, which is a \livelink{chap:classflag}{flag}.
1642 In a language that offers only
1643 one kind of enumeration declaration, this attribute is not
1646 \textit{In \addtoindex{C} or \addtoindex{C++},
1647 the underlying type will be the appropriate
1648 integral type determined by the compiler from the properties
1649 of\hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}{}
1650 the enumeration literal values.
1651 A \addtoindex{C++} type declaration written
1652 using enum class declares a strongly typed enumeration and
1653 is represented using \DWTAGenumerationtype{}
1654 in combination with \DWATenumclass.}
1656 Each enumeration literal is represented by a debugging
1657 \addtoindexx{enumeration literal|see{enumeration entry}}
1658 information entry with the
1659 tag \DWTAGenumeratorTARG.
1661 such entry is a child of the
1662 \addtoindex{enumeration type entry}, and the
1663 enumerator entries appear in the same order as the declarations
1664 of the enumeration literals in the source program.
1667 Each \addtoindex{enumerator entry} has a \DWATname{} attribute, whose
1668 \addtoindexx{name attribute}
1669 value is a null-terminated string containing the name of
1670 the\hypertarget{chap:DWATconstvalueenumerationliteralvalue}{}
1671 enumeration literal.
1672 Each enumerator entry also has a
1673 \DWATconstvalueDEFN{} attribute,
1674 \addtoindexx{constant value attribute}
1675 whose value is the actual numeric value of the enumerator as
1676 represented on the target system.
1679 If the enumeration type occurs as the description of a
1680 \addtoindexx{enumeration type entry!as array dimension}
1681 dimension of an array type, and the stride for that
1682 dimension\hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}{}
1683 is different than what would otherwise be determined,
1684 then\hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}{}
1685 the enumeration type entry has either a
1686 \addtoindexx{byte stride attribute}
1687 \DWATbytestrideDEFN{} or
1688 \addtoindexx{bit stride attribute}
1689 \DWATbitstrideDEFN{} attribute which specifies the separation
1690 between successive elements along the dimension as described
1691 in Section \refersec{chap:staticanddynamicvaluesofattributes}.
1692 The value of the \DWATbitstride{} attribute
1693 is interpreted as bits and
1694 the value of the \DWATbytestride{} attribute is interpreted
1698 \section{Subroutine Type Entries}
1699 \label{chap:subroutinetypeentries}
1701 \textit{It is possible in \addtoindex{C}
1702 to declare pointers to subroutines
1703 that return a value of a specific type. In both
1704 \addtoindex{C} and \addtoindex{C++},
1705 it is possible to declare pointers to subroutines that not
1706 only return a value of a specific type, but accept only
1707 arguments of specific types. The type of such pointers would
1708 be described with a \doublequote{pointer to} modifier applied to a
1709 user\dash defined type.}
1712 A subroutine type is represented by a debugging information
1714 \addtoindexx{subroutine type entry}
1715 tag \DWTAGsubroutinetypeTARG.
1717 been given to the subroutine type in the source program,
1718 then the corresponding subroutine type entry has
1719 a \DWATname{} attribute
1720 \addtoindexx{name attribute}
1721 whose value is a null\dash terminated string containing
1722 the subroutine type name.
1724 If the subroutine type describes a function that returns
1725 a value, then the subroutine type entry has a
1726 \addtoindexx{type attribute}
1728 attribute to denote the type returned by the subroutine. If
1729 the types of the arguments are necessary to describe the
1730 subroutine type, then the corresponding subroutine type
1731 entry owns debugging information entries that describe the
1732 arguments. These debugging information entries appear in the
1733 order that the corresponding argument types appear in the
1736 \textit{In \addtoindex{C} there
1737 is a difference between the types of functions
1738 declared using function prototype style declarations and
1739 those declared using non-prototype declarations.}
1742 \hypertarget{chap:DWATprototypedsubroutineprototype}{}
1743 subroutine entry declared with a function prototype style
1744 declaration may have
1745 \addtoindexx{prototyped attribute}
1747 \DWATprototypedDEFN{} attribute, which is
1748 a \livelink{chap:classflag}{flag}.
1751 Each debugging information entry owned by a subroutine
1752 type entry corresponds to either a formal parameter or the sequence of
1753 unspecified parameters of the subprogram type:
1755 \begin{enumerate}[1. ]
1756 \item A formal parameter of a parameter list (that has a
1757 specific type) is represented by a debugging information entry
1758 with the tag \DWTAGformalparameter.
1759 Each formal parameter
1761 \addtoindexx{type attribute}
1762 a \DWATtype{} attribute that refers to the type of
1763 the formal parameter.
1765 \item The unspecified parameters of a variable parameter list
1766 \addtoindexx{unspecified parameters entry}
1768 \addtoindexx{\texttt{...} parameters|see{unspecified parameters entry}}
1769 represented by a debugging information entry with the
1770 tag \DWTAGunspecifiedparameters.
1773 \textit{\addtoindex{C++} const-volatile qualifiers are encoded as
1774 part of the type of the \doublequote{\texttt{this}}-pointer.
1775 \addtoindex{C++11} reference and rvalue-reference qualifiers are
1776 encoded using the \DWATreference{} and \DWATrvaluereference{} attributes,
1778 See also Section \refersec{chap:memberfunctionentries}.}
1781 A subroutine type entry may have the \DWATreference{} or
1782 \DWATrvaluereference{} attribute to indicate that it describes the
1783 type of a member function with reference or rvalue-reference
1784 semantics, respectively.
1787 \section{String Type Entries}
1788 \label{chap:stringtypeentries}
1790 \textit{A \doublequote{string} is a sequence of characters that have specific
1791 \addtoindexx{string type entry}
1792 semantics and operations that distinguish them from arrays of
1794 \addtoindex{Fortran} is one of the languages that has a string
1795 type. Note that \doublequote{string} in this context refers to a target
1796 machine concept, not the class string as used in this document
1797 (except for the name attribute).}
1799 A string type is represented by a debugging information entry
1800 with the tag \DWTAGstringtypeTARG.
1801 If a name has been given to
1802 the string type in the source program, then the corresponding
1803 string type entry has a
1804 \DWATname{} attribute
1805 \addtoindexx{name attribute}
1806 whose value is a null-terminated string containing the string type name.
1808 A string type entry may have a \DWATtypeDEFN{}
1809 \livetargi{chap:DWAATtypeofstringtype}{attribute}{type attribute!of string type entry}
1810 describing how each character is encoded and is to be interpreted.
1811 The value of this attribute is a \CLASSreference{} to a
1812 \DWTAGbasetype{} base type entry. If the attribute is absent,
1813 then the character is encoded using the system default.
1816 \addtoindex{Fortran 2003} language standard allows string
1817 types that are composed of different types of (same sized) characters.
1818 While there is no standard list of character kinds, the kinds
1819 \texttt{ASCII}\index{ASCII@\texttt{ASCII} (Fortran string kind)} (see \DWATEASCII),
1820 \texttt{ISO\_10646}\index{ISO\_10646@\texttt{ISO\_10646} (Fortran string kind)}
1821 \addtoindexx{ISO 10646 character set standard}
1823 \texttt{DEFAULT}\index{DEFAULT@\texttt{DEFAULT} (Fortran string kind)}
1827 The string type entry may have a
1828 \DWATbytesize{} attribute or
1830 attribute, whose value
1831 (see Section \refersec{chap:byteandbitsizes})
1833 storage needed to hold a value of the string type.
1835 The\hypertarget{chap:DWATstringlengthstringlengthofstringtype}{}
1836 string type entry may also have a
1837 \DWATstringlengthDEFN{} attribute\addtoindexx{string length attribute}
1840 either a \livelink{chap:classreference}{reference}
1841 (see Section \ref{chap:staticanddynamicvaluesofattributes})
1842 yielding the length of the string
1843 or a \addtoindex{location description} yielding the location
1845 where the length of the string is stored in the program.
1846 If the \DWATstringlengthNAME{} attribute is not present, the size
1847 of the string is assumed to be the amount of storage that is
1848 allocated for the string (as specified by the \DWATbytesize{}
1849 or \DWATbitsize{} attribute).
1851 The string type entry may also have a
1852 \DWATstringlengthbytesizeDEFN{} or
1853 \DWATstringlengthbitsizeDEFN{} attribute,
1854 \addtoindexx{string length size attribute}
1855 \addtoindexx{string length attribute!size of length data}
1856 whose value (see Section \refersec{chap:byteandbitsizes})
1857 is the size of the data to be retrieved from the location
1858 referenced by the \DWATstringlength{} attribute. If no byte or bit
1859 size attribute is present, the size of the data to be retrieved
1861 \addtoindex{size of an address} on the target machine.
1864 \addtoindexx{DWARF Version 5} % Avoid italics
1865 \textit{Prior to DWARF Version 5, the meaning of a
1866 \DWATbytesize{} attribute depended on the presence of the
1867 \DWATstringlength{} attribute:
1869 \item If \DWATstringlength{} was present, \DWATbytesize{}
1870 specified the size of the length data to be retrieved
1871 from the location specified by the \DWATstringlength{} attribute.
1872 \item If \DWATstringlength{} was not present, \DWATbytesize{}
1873 specified the amount of storage allocated for objects
1876 In \DWARFVersionV{}, \DWATbytesize{} always specifies the amount of storage
1877 allocated for objects of the string type.}
1880 \section{Set Type Entries}
1881 \label{chap:settypeentries}
1883 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1884 a group of values of ordinal type.}
1886 A set is represented by a debugging information entry with
1887 the tag \DWTAGsettypeTARG.
1888 \addtoindexx{set type entry}
1889 If a name has been given to the
1890 set type, then the set type entry has
1891 a \DWATname{} attribute
1892 \addtoindexx{name attribute}
1893 whose value is a null\dash terminated string containing the
1896 The set type entry has a
1897 \addtoindexx{type attribute}
1898 \DWATtype{} attribute to denote the
1899 type of an element of the set.
1902 If the amount of storage allocated to hold each element of an
1903 object of the given set type is different from the amount of
1904 storage that is normally allocated to hold an individual object
1905 of the indicated element type, then the set type entry has
1906 either a \DWATbytesize{} attribute, or
1907 \DWATbitsize{} attribute
1908 whose value (see Section \refersec{chap:byteandbitsizes}) is
1909 the amount of storage needed to hold a value of the set type.
1912 \section{Subrange Type Entries}
1913 \label{chap:subrangetypeentries}
1915 \textit{Several languages support the concept of a \doublequote{subrange}
1916 type. Objects of the subrange type can represent only a contiguous
1917 subset (range) of values from the type on which the subrange is defined.
1918 Subrange types may also be used to represent the bounds of array dimensions.}
1920 A subrange type is represented by a debugging information
1922 \DWTAGsubrangetypeTARG.\addtoindexx{subrange type entry}
1923 If a name has been given to the subrange type, then the
1924 subrange type entry has a
1925 \DWATname{} attribute\addtoindexx{name attribute}
1926 whose value is a null-terminated
1927 string containing the subrange type name.
1929 The tag \DWTAGgenericsubrange{}
1930 is used to describe arrays with a dynamic rank. See Section
1931 \refersec{chap:DWTAGgenericsubrange}.
1933 The subrange entry may have a
1934 \DWATtype{} attribute\addtoindexx{type attribute} to describe
1935 the type of object, called the basis type, of whose values
1936 this subrange is a subset.
1938 If the amount of storage allocated to hold each element of an
1939 object of the given subrange type is different from the amount
1940 of storage that is normally allocated to hold an individual
1941 object of the indicated element type, then the subrange
1943 \DWATbytesize{} attribute or
1945 attribute, whose value
1946 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1947 is the amount of storage needed to hold a value of the subrange type.
1949 The\hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{}
1950 subrange entry may have a
1951 \DWATthreadsscaledDEFN{} attribute\addtoindexx{threads scaled attribute},
1952 which is a \livelink{chap:classflag}{flag}.
1953 If present, this attribute indicates whether
1954 this subrange represents a \addtoindex{UPC} array bound which is scaled
1955 by the runtime \texttt{THREADS} value (the number of \addtoindex{UPC} threads in
1956 this execution of the program).
1958 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
1961 int shared foo[34*THREADS][10][20];
1965 The\hypertarget{chap:DWATlowerboundlowerboundofsubrange}{}
1966 subrange\hypertarget{chap:DWATupperboundupperboundofsubrange}{}
1967 entry may have the attributes
1968 \DWATlowerboundDEFN{}
1969 \addtoindexx{lower bound attribute}
1970 and \DWATupperboundDEFN{}
1971 \addtoindexx{upper bound attribute} to specify, respectively, the lower
1972 and upper bound values of the subrange. The
1973 \DWATupperboundNAME{}
1974 attribute\hypertarget{chap:DWATcountelementsofsubrangetype}{}
1975 may be replaced by a
1976 \addtoindexx{count attribute!default}
1977 \addtoindexx{count attribute}
1978 \DWATcountDEFN{} attribute,
1979 whose value describes the number of elements in the subrange
1980 rather than the value of the last element. The value of each
1981 of these attributes is determined as described in
1982 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1984 If the lower bound value is missing, the value is assumed to
1985 be a language-dependent default constant as defined in
1986 Table \refersec{tab:languageencodings}.
1987 \addtoindexx{lower bound attribute!default}
1989 If the upper bound and count are missing, then the upper bound value is
1990 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
1992 If the subrange entry has no type attribute describing the
1993 basis type, the basis type is determined as follows:
1994 \begin{enumerate}[1. ]
1996 If there is a lower bound attribute that references an object,
1997 the basis type is assumed to be the same as the type of that object.
1999 Otherwise, if there is an upper bound or count attribute that references
2000 an object, the basis type is assumed to be the same as the type of that object.
2002 Otherwise, the type is
2003 assumed to be the same type, in the source language of the
2004 compilation unit containing the subrange entry, as a signed
2005 integer with the same size as an address on the target machine.
2008 If the subrange type occurs as the description of a dimension
2009 of an array type, and the stride for that dimension
2010 is\hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}{}
2011 different than what would otherwise be determined,
2012 then\hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}{}
2013 the subrange type entry has either a
2014 \addtoindexx{byte stride attribute}
2015 \DWATbytestrideDEFN{} or
2016 \DWATbitstrideDEFN{} attribute
2017 \addtoindexx{bit stride attribute}
2018 which specifies the separation
2019 between successive elements along the dimension as described in
2020 Section \refersec{chap:byteandbitsizes}.
2022 \textit{Note that the stride can be negative.}
2025 \section{Pointer to Member Type Entries}
2026 \label{chap:pointertomembertypeentries}
2028 \textit{In \addtoindex{C++}, a
2029 pointer to a data or function member of a class or
2030 structure is a unique type.}
2032 A debugging information entry representing the type of an
2033 object that is a pointer to a structure or class member has
2034 the tag \DWTAGptrtomembertypeTARG.
2036 If the \addtoindex{pointer to member type} has a name, the
2037 \addtoindexx{pointer to member type entry}
2038 pointer to member entry has a
2039 \DWATname{} attribute,
2040 \addtoindexx{name attribute}
2042 null\dash terminated string containing the type name.
2044 The \addtoindex{pointer to member} entry
2046 \addtoindexx{type attribute}
2047 a \DWATtype{} attribute to
2048 describe the type of the class or structure member to which
2049 objects of this type may point.
2051 The \addtoindexx{pointer to member} entry
2052 also\hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{}
2053 has a \DWATcontainingtypeDEFN{} attribute,
2054 \addtoindexx{containing type (of pointer) attribute}
2055 whose value is a \livelink{chap:classreference}{reference} to a debugging
2056 information entry for the class or structure to whose members
2057 objects of this type may point.
2059 The\hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}{}
2060 \addtoindex{pointer to member entry} has a
2061 \DWATuselocationDEFN{} attribute
2062 \addtoindexx{use location attribute}
2064 \addtoindex{location description} that computes the
2065 address of the member of the class to which the pointer to
2066 member entry points.
2069 \textit{The method used to find the address of a given member of a
2070 class or structure is common to any instance of that class
2071 or structure and to any instance of the pointer or member
2072 type. The method is thus associated with the type entry,
2073 rather than with each instance of the type.}
2075 The \DWATuselocation{} description is used in conjunction
2076 with the location descriptions for a particular object of the
2077 given \addtoindex{pointer to member type} and for a particular structure or
2078 class instance. The \DWATuselocation{}
2079 attribute expects two values to be
2080 \addtoindexi{pushed}{address!implicit push for member operator}
2081 onto the DWARF expression stack before
2082 the \DWATuselocation{} description is evaluated.
2084 \addtoindexi{pushed}{address!implicit push for member operator}
2085 is the value of the \addtoindex{pointer to member} object
2086 itself. The second value
2087 \addtoindexi{pushed}{address!implicit push for member operator}
2088 is the base address of the
2089 entire structure or union instance containing the member
2090 whose address is being calculated.
2093 \textit{For an expression such as}
2098 \textit{where \texttt{mbr\_ptr} has some \addtoindex{pointer to member type}, a debugger should:}
2099 \begin{enumerate}[1. ]
2100 \item \textit{Push the value of \texttt{mbr\_ptr} onto the DWARF expression stack.}
2101 \item \textit{Push the base address of \texttt{object} onto the DWARF expression stack.}
2102 \item \textit{Evaluate the \DWATuselocation{} description
2103 given in the type of \texttt{mbr\_ptr}.}
2107 \section{File Type Entries}
2108 \label{chap:filetypeentries}
2110 \textit{Some languages, such as \addtoindex{Pascal},
2111 provide a data type to represent
2114 A file type is represented by a debugging information entry
2116 \addtoindexx{file type entry}
2119 If the file type has a name,
2120 the file type entry has a \DWATname{} attribute,
2121 \addtoindexx{name attribute}
2123 is a null\dash terminated string containing the type name.
2125 The file type entry has
2126 \addtoindexx{type attribute}
2127 a \DWATtype{} attribute describing
2128 the type of the objects contained in the file.
2130 The file type entry also has a
2131 \DWATbytesize{}\addtoindexx{byte size attribute} or
2132 \DWATbitsize{}\addtoindexx{bit size attribute} attribute, whose value
2133 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2134 is the amount of storage need to hold a value of the file type.
2136 \section{Dynamic Type Entries}
2137 \label{chap:dynamictypeentries}
2138 \textit{Some languages such as
2139 \addtoindex{Fortran 90}, provide types whose values
2140 may be dynamically allocated or associated with a variable
2141 under explicit program control. However, unlike the
2142 pointer type in \addtoindex{C} or
2143 \addtoindex{C++}, the indirection involved in accessing
2144 the value of the variable is generally implicit, that is, not
2145 indicated as part of the program source.}
2147 A dynamic type entry is used to declare a dynamic type that is
2148 \doublequote{just like} another non-dynamic type without needing to
2149 replicate the full description of that other type.
2151 A dynamic type is represented by a debugging information entry
2152 with the tag \DWTAGdynamictypeTARG. If a name has been given to the
2153 dynamic type, then the dynamic type has a \DWATname{} attribute
2154 whose value is a null-terminated string containing the dynamic
2157 A dynamic type entry has a \DWATtype{} attribute whose value is a
2158 reference to the type of the entities that are dynamically allocated.
2160 A dynamic type entry also has a \DWATdatalocation, and may also
2161 have \DWATallocated{} and/or \DWATassociated{} attributes as
2162 described in Section \refersec{chap:dynamicpropertiesoftypes}.
2163 A \DWATdatalocation, \DWATallocated{} or \DWATassociated{} attribute
2164 may not occur on a dynamic type entry if the same kind of attribute
2165 already occurs on the type referenced by the \DWATtype{} attribute.
2169 \section{Template Alias Entries}
2170 \label{chap:templatealiasentries}
2172 \textit{In \addtoindex{C++}, a template alias is a form of typedef that has template
2173 parameters. DWARF does not represent the template alias definition
2174 but does represent instantiations of the alias.}
2176 A type named using a template alias is represented
2177 by a debugging information entry
2178 \addtoindexx{template alias entry}
2180 \DWTAGtemplatealiasTARG.
2181 The template alias entry has a
2182 \DWATname{} attribute
2183 \addtoindexx{name attribute}
2184 whose value is a null\dash terminated string
2185 containing the name of the template alias.
2186 The template alias entry has child entries describing the template
2187 actual parameters (see Section \refersec{chap:templateparameters}).
2190 \section{Dynamic Properties of Types}
2191 \label{chap:dynamicpropertiesoftypes}
2192 \textit{The \DWATdatalocation, \DWATallocated{} and \DWATassociated{}
2193 attributes described in this section are motivated for use with
2194 \DWTAGdynamictype{} entries but can be used for any other type as well.}
2197 \subsection{Data Location}
2198 \label{chap:datalocation}
2200 \textit{Some languages may represent objects using descriptors to hold
2201 information, including a location and/or run\dash time parameters,
2202 about the data that represents the value for that object.}
2204 The\hypertarget{chap:DWATdatalocationindirectiontoactualdata}{}
2205 \DWATdatalocationDEFN{} attribute
2206 \addtoindexx{data (indirect) location attribute}
2207 may be used with any type that provides one or more levels of
2208 \addtoindexx{hidden indirection|see{data location attribute}}
2210 and/or run-time parameters in its representation. Its value
2211 is a \addtoindex{location description}.
2212 The result of evaluating this
2213 description yields the location of the data for an object.
2214 When this attribute is omitted, the address of the data is
2215 the same as the address of the object.
2218 \textit{This location description will typically begin with
2219 \DWOPpushobjectaddress{}
2220 which loads the address of the
2221 object which can then serve as a descriptor in subsequent
2222 calculation. For an example using
2224 for a \addtoindex{Fortran 90 array}, see
2225 Appendix \refersec{app:fortranarrayexample}.}
2227 \subsection{Allocation and Association Status}
2228 \label{chap:allocationandassociationstatus}
2230 \textit{Some languages, such as \addtoindex{Fortran 90},
2231 provide types whose values
2232 may be dynamically allocated or associated with a variable
2233 under explicit program control.}
2235 The\hypertarget{chap:DWATallocatedallocationstatusoftypes}{}
2236 \DWATallocatedDEFN{} attribute\addtoindexx{allocated attribute}
2237 may be used with any
2238 type for which objects of the type can be explicitly allocated
2239 and deallocated. The presence of the attribute indicates that
2240 objects of the type are allocatable and deallocatable. The
2241 integer value of the attribute (see below) specifies whether
2242 an object of the type is currently allocated or not.
2245 The\hypertarget{chap:DWATassociatedassociationstatusoftypes}{}
2246 \DWATassociatedDEFN{} attribute
2248 \addtoindexx{associated attribute}
2249 optionally be used with
2250 any type for which objects of the type can be dynamically
2251 associated with other objects. The presence of the attribute
2252 indicates that objects of the type can be associated. The
2253 integer value of the attribute (see below) indicates whether
2254 an object of the type is currently associated or not.
2256 The value of these attributes is determined as described in
2257 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2258 A non-zero value is interpreted as allocated or associated,
2259 and zero is interpreted as not allocated or not associated.
2261 \textit{For \addtoindex{Fortran 90},
2262 if the \DWATassociated{}
2263 attribute is present,
2264 the type has the POINTER property where either the parent
2265 variable is never associated with a dynamic object or the
2266 implementation does not track whether the associated object
2267 is static or dynamic. If the \DWATallocated{} attribute is
2268 present and the \DWATassociated{} attribute is not, the type
2269 has the ALLOCATABLE property. If both attributes are present,
2270 then the type should be assumed to have the POINTER property
2271 (and not ALLOCATABLE); the \DWATallocated{} attribute may then
2272 be used to indicate that the association status of the object
2273 resulted from execution of an ALLOCATE statement rather than
2274 pointer assignment.}
2276 \textit{For examples using
2277 \DWATallocated{} for \addtoindex{Ada} and
2278 \addtoindex{Fortran 90}
2280 see Appendix \refersec{app:aggregateexamples}.}
2282 \subsection{Array Rank}
2283 \label{chap:DWATrank}
2284 \addtoindexx{array!assumed-rank}
2285 \addtoindexx{assumed-rank array|see{array, assumed-rank}}
2286 \textit{The Fortran language supports \doublequote{assumed-rank arrays}. The
2287 rank (the number of dimensions) of an assumed-rank array is unknown
2288 at compile time. The Fortran runtime stores the rank in an array
2292 the\hypertarget{chap:DWATrankofdynamicarray}{\DWATrankINDX}
2293 attribute indicates that an array's rank
2294 (number of dimensions) is dynamic, and therefore unknown at compile
2295 time. The value of the \DWATrankDEFN{} attribute is either an integer constant
2296 or a DWARF expression whose evaluation yields the dynamic rank.
2298 The bounds of an array with dynamic rank are described using a
2299 \DWTAGgenericsubrange{} entry, which
2300 is the dynamic rank array equivalent of
2301 \DWTAGsubrangetype. The
2302 difference is that a \DWTAGgenericsubrange{} entry contains generic
2303 lower/upper bound and stride expressions that need to be evaluated for
2304 each dimension. Before any expression contained in a
2305 \DWTAGgenericsubrange{} can be evaluated, the dimension for which the
2306 expression is to be evaluated needs to be pushed onto the stack. The
2307 expression will use it to find the offset of the respective field in
2308 the array descriptor metadata.
2310 \textit{A producer is free to choose any layout for the
2311 array descriptor. In particular, the upper and lower bounds and
2312 stride values do not need to be bundled into a structure or record,
2313 but could be laid end to end in the containing descriptor, pointed
2314 to by the descriptor, or even allocated independently of the
2317 Dimensions are enumerated $0$ to $\mathit{rank}-1$ in source program
2320 \textit{For an example in Fortran 2008, see
2321 Section~\refersec{app:assumedrankexample}.}