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{Member Variable Entries}
1217 \label{chap:membervariableentries}
1219 A member variable (\doublequote{static data member} in
1220 \addtoindex{C++}) is represented by a
1221 debugging information entry with the tag \DWTAGvariable.
1223 The member variable entry
1224 may contain the same attributes and follows the same rules
1225 as non-member global variable entries
1226 (see Section \refersec{chap:dataobjectentries}).
1228 A member variable entry may have a
1229 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1230 \addtoindexx{accessibility attribute}
1231 attribute. If no accessibility attribute is present, private
1232 access is assumed for an entry of a class and public access
1233 is assumed for an entry of a structure, union or interface.
1236 \subsection{Member Function Entries}
1237 \label{chap:memberfunctionentries}
1239 A member function is represented by a
1240 \addtoindexx{member function entry}
1241 debugging information entry
1243 \addtoindexx{subprogram entry!as member function}
1244 tag \DWTAGsubprogram.
1245 The member function entry
1246 may contain the same attributes and follows the same rules
1247 as non-member global subroutine entries
1248 (see Section \refersec{chap:subroutineandentrypointentries}).
1251 \textit{In particular, if the member function entry is an
1252 instantiation of a member function template, it follows the
1253 same rules as function template instantiations (see Section
1254 \refersec{chap:functiontemplateinstantiations}).
1257 A member function entry may have a
1258 \hyperlink{chap:DWATaccessibilityattribute}{\DWATaccessibilityNAME}
1259 \addtoindexx{accessibility attribute}
1260 attribute. If no accessibility attribute is present, private
1261 access is assumed for an entry of a class and public access
1262 is assumed for an entry of a structure, union or interface.
1264 If the member function entry describes a virtual function,
1265 then that entry has a
1266 \hyperlink{chap:DWATvirtualityvirtualityindication}{\DWATvirtualityNAME}
1269 If\hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}{}
1270 the member function entry describes an explicit member
1271 function, then that entry has a
1272 \addtoindexx{explicit attribute}
1273 \DWATexplicitDEFN{} attribute.
1275 An\hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}{}
1276 entry for a virtual function also has a
1277 \DWATvtableelemlocationDEFN{}
1278 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1279 a \addtoindex{location description}
1280 yielding the address of the slot
1281 for the function within the virtual function table for the
1282 enclosing class. The address of an object of the enclosing
1283 type is pushed onto the expression stack before the location
1284 description is evaluated.
1286 If\hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}{}
1287 the member function entry describes a non-static member
1288 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1289 function, then that entry
1290 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1292 \addtoindexx{object pointer attribute}
1293 a \DWATobjectpointerDEFN{} attribute
1294 whose value is a \livelink{chap:classreference}{reference}
1295 to the formal parameter entry
1296 that corresponds to the object for which the function is
1297 called. The name attribute of that formal parameter is defined
1298 by the current language (for example,
1299 \texttt{this} for \addtoindex{C++} or \texttt{self}
1300 for \addtoindex{Objective C}
1301 and some other languages). That parameter
1302 also has a \DWATartificial{} attribute whose value is true.
1304 Conversely, if the member function entry describes a static
1305 member function, the entry does not have a
1306 \addtoindexx{object pointer attribute}
1307 \DWATobjectpointer{} attribute.
1309 \textit{In \addtoindex{C++}, non-static member functions can have const-volatile
1310 qualifiers, which affect the type of the first formal parameter (the
1311 \doublequote{\texttt{this}}-pointer).}
1313 If the member function entry describes a non-static member
1314 function that has a const\dash volatile qualification, then
1315 the entry describes a non-static member function whose
1316 object formal parameter has a type that has an equivalent
1317 const-volatile qualification.
1319 \textit{Beginning in \addtoindex{C++11}, non-static member
1320 functions can also have one of the ref-qualifiers, \& and \&\&.
1321 These do not change the type of the
1322 \doublequote{\texttt{this}}-pointer, but they do affect the types of
1323 object values on which the function can be invoked.}
1326 The member function entry may have an \DWATreferenceDEFN{} attribute
1327 \livetarg{chap:DWATreferenceofnonstaticmember}{}
1328 to indicate a non-static member function that can only be called on
1329 lvalue objects, or the \DWATrvaluereferenceDEFN{} attribute
1330 \livetarg{chap:DWATrvaluereferenceofnonstaticmember}{}
1331 to indicate that it can only be called on prvalues and xvalues.
1333 \textit{The lvalue, prvalue and xvalue concepts are defined in the
1334 \addtoindex{C++11} and later standards.}
1336 If a subroutine entry represents the defining declaration
1337 of a member function and that definition appears outside of
1338 the body of the enclosing class declaration, the subroutine
1340 \DWATspecification{} attribute,
1341 \addtoindexx{specification attribute}
1343 a reference to the debugging information entry representing
1344 the declaration of this function member. The referenced entry
1345 will be a child of some class (or structure) type entry.
1348 Subroutine entries containing the
1349 \DWATspecification{} attribute
1350 \addtoindexx{specification attribute}
1351 do not need to duplicate information provided
1352 by the declaration entry referenced by the specification
1353 attribute. In particular, such entries do not need to contain
1354 a name attribute giving the name of the function member whose
1355 definition they represent.
1356 Similarly, such entries do not need to contain a return type
1357 attribute, unless the return type on the declaration was
1358 unspecified (for example, the declaration used the
1359 \addtoindex{C++} \autoreturntype{} specifier).
1361 \textit{In \addtoindex{C++}, a member function may be declared
1362 as deleted. This prevents the compiler from generating a default
1363 implementation of a special member function such as a
1364 constructor or destructor, and can affect overload resolution
1365 when used on other member functions.}
1367 If the member function entry has been declared as deleted,
1368 then that entry has a \DWATdeletedDEFN{}\livetarg{chap:DWATdeleteddef}{}
1369 attribute.\addtoindexx{deleted attribute}
1371 \textit{In \addtoindex{C++}, a special member function may be
1372 declared as defaulted, which explicitly declares a default
1373 compiler-generated implementation of the function. The
1374 declaration may have different effects on the calling
1375 convention used for objects of its class, depending on
1376 whether the default declaration is made inside or outside the
1379 If the member function has been declared as defaulted,
1380 then the entry has a \DWATdefaultedDEFN{}\livetarg{chap:DWATdefaulteddef}{}
1381 attribute\addtoindexx{defaulted attribute}
1382 whose integer constant value indicates whether, and if so,
1383 how, that member is defaulted. The possible values and
1384 their meanings are shown in
1385 Table \referfol{tab:defaultedattributevaluenames}.
1389 \setlength{\extrarowheight}{0.1cm}
1390 \begin{longtable}{l|l}
1391 \caption{Defaulted attribute names} \label{tab:defaultedattributevaluenames} \\
1392 \hline \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1394 \bfseries Defaulted attribute name & \bfseries Meaning \\ \hline
1396 \hline \emph{Continued on next page}
1399 \DWDEFAULTEDnoTARG & Not declared default \\
1400 \DWDEFAULTEDinclassTARG & Defaulted within the class \\
1401 \DWDEFAULTEDoutofclassTARG& Defaulted outside of the class \\
1406 \textit{An artificial member function (that is, a compiler-generated
1407 copy that does not appear in the source) does not have a
1408 \DWATdefaultedNAME{} attribute.}
1411 \subsection{Class Template Instantiations}
1412 \label{chap:classtemplateinstantiations}
1414 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1415 type that may be instantiated when an instance of the class
1416 is declared or defined. The generic description of the class may include
1417 parameterized types, parameterized compile-time constant
1418 values, and/or parameterized run-time constant addresses.
1419 DWARF does not represent the generic template
1420 definition, but does represent each instantiation.}
1422 A class template instantiation is represented by a
1423 debugging information entry with the tag \DWTAGclasstype,
1424 \DWTAGstructuretype{} or
1425 \DWTAGuniontype. With the following
1426 exceptions, such an entry will contain the same attributes
1427 and have the same types of child entries as would an entry
1428 for a class type defined explicitly using the instantiation
1429 types and values. The exceptions are:
1431 \begin{enumerate}[1. ]
1432 \item Template parameters are described and referenced as
1433 specified in Section \refersec{chap:templateparameters}.
1436 \item If the compiler has generated a special compilation unit to
1438 \addtoindexx{template instantiation!and special compilation unit}
1439 template instantiation and that special compilation
1440 unit has a different name from the compilation unit containing
1441 the template definition, the name attribute for the debugging
1442 information entry representing the special compilation unit
1443 is empty or omitted.
1446 \item If the class type entry representing the template
1447 instantiation or any of its child entries contains declaration
1448 coordinate attributes, those attributes refer to
1449 the source for the template definition, not to any source
1450 generated artificially by the compiler.
1454 \subsection{Variant Entries}
1455 \label{chap:variantentries}
1457 A variant part of a structure is represented by a debugging
1458 information entry\addtoindexx{variant part entry} with the
1459 tag \DWTAGvariantpartTARG{} and is
1460 owned by the corresponding structure type entry.
1462 If the variant part has a discriminant, the discriminant
1463 is\hypertarget{chap:DWATdiscrdiscriminantofvariantpart}{}
1464 represented by a \addtoindexx{discriminant (entry)}
1465 separate debugging information entry which
1466 is a child of the variant part entry. This entry has the form
1467 of a \addtoindexx{member entry (data)!as discriminant}
1468 structure data member entry. The variant part entry will
1470 \DWATdiscrDEFN{} attribute \addtoindexx{discriminant attribute}
1471 whose value is a \livelink{chap:classreference}{reference} to
1472 the member entry for the discriminant.
1474 If the variant part does not have a discriminant (tag field),
1475 the variant part entry has \addtoindexx{type attribute}
1476 a \DWATtype{} attribute to represent
1479 Each variant of a particular variant part is represented
1480 by\hypertarget{chap:DWATdiscrvaluediscriminantvalue}{}
1481 a debugging information entry\addtoindexx{variant entry} with the
1482 tag \DWTAGvariantTARG{}
1483 and is a child of the variant part entry. The value that
1484 selects a given variant may be represented in one of three
1485 ways. The variant entry may have a \DWATdiscrvalueDEFN{}
1486 attribute\addtoindexx{discriminant value attribute}
1487 whose value represents the discriminant value selecting
1488 this variant. The value of this
1489 attribute is encoded as an LEB128 number. The number is signed
1490 if the tag type for the variant part containing this variant
1491 is a signed type. The number is unsigned if the tag type is
1495 Alternatively,\hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}{}
1496 the variant entry may contain a
1497 \addtoindexx{discriminant list attribute}
1498 \DWATdiscrlistDEFN{}
1499 attribute, whose value represents a list of discriminant
1500 values. This list is represented by any of the
1501 \livelink{chap:classblock}{block} forms and may contain a
1502 mixture of discriminant values and discriminant ranges.
1503 Each item on the list is prefixed with a discriminant value
1504 descriptor that determines whether the list item represents
1505 a single label or a label range. A single case label is
1506 represented as an LEB128 number as defined above for the
1507 \addtoindexx{discriminant value attribute}
1509 attribute. A label range is represented by
1510 two LEB128 numbers, the low value of the range followed by the
1511 high value. Both values follow the rules for signedness just
1512 described. The discriminant value descriptor is an integer
1513 constant that may have one of the values given in
1514 Table \refersec{tab:discriminantdescriptorvalues}.
1516 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1517 \DWDSClabelTARG{} \\
1518 \DWDSCrangeTARG{} \\
1519 \end{simplenametable}
1522 If a variant entry has neither a \DWATdiscrvalue{}
1523 attribute nor a \DWATdiscrlist{} attribute, or if it has
1524 a \DWATdiscrlist{} attribute with 0 size, the variant is a
1527 The components selected by a particular variant are represented
1528 by debugging information entries owned by the corresponding
1529 variant entry and appear in the same order as the corresponding
1530 declarations in the source program.
1533 \section{Condition Entries}
1534 \label{chap:conditionentries}
1536 \textit{COBOL has the notion of
1537 \addtoindexx{level-88 condition, COBOL}
1538 a \doublequote{level\dash 88 condition} that
1539 associates a data item, called the conditional variable, with
1540 a set of one or more constant values and/or value ranges.
1541 % Note: the {} after \textquoteright (twice) is necessary to assure a following space separator
1542 Semantically, the condition is \textquoteleft true\textquoteright{}
1544 variable's value matches any of the described constants,
1545 and the condition is \textquoteleft false\textquoteright{} otherwise.}
1547 The \DWTAGconditionTARG{}
1548 debugging information entry\addtoindexx{condition entry}
1550 logical condition that tests whether a given data item\textquoteright s
1551 value matches one of a set of constant values. If a name
1552 has been given to the condition, the condition entry has a
1553 \DWATname{} attribute
1554 \addtoindexx{name attribute}
1555 whose value is a null\dash terminated string
1556 giving the condition name.
1559 The condition entry's parent entry describes the conditional
1560 variable; normally this will be a \DWTAGvariable,
1562 \DWTAGformalparameter{} entry.
1564 \addtoindexx{formal parameter entry}
1566 entry has an array type, the condition can test any individual
1567 element, but not the array as a whole. The condition entry
1568 implicitly specifies a \doublequote{comparison type} that is the
1569 type of an array element if the parent has an array type;
1570 otherwise it is the type of the parent entry.
1573 The condition entry owns \DWTAGconstant{} and/or
1574 \DWTAGsubrangetype{} entries that describe the constant
1575 values associated with the condition. If any child entry
1576 \addtoindexx{type attribute}
1577 has a \DWATtype{} attribute, that attribute describes
1578 a type compatible with the comparison type (according to the
1579 source language); otherwise the child\textquoteright{}s type
1580 is the same as the comparison type.
1582 \textit{For conditional variables with alphanumeric types, COBOL
1583 permits a source program to provide ranges of alphanumeric
1584 constants in the condition. Normally a subrange type entry
1585 does not describe ranges of strings; however, this can be
1586 represented using bounds attributes that are references to
1587 constant entries describing strings. A subrange type entry may
1588 refer to constant entries that are siblings of the subrange
1592 \section{Enumeration Type Entries}
1593 \label{chap:enumerationtypeentries}
1595 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1596 a fixed number of symbolic values.}
1598 An enumeration type is represented by a debugging information
1600 \DWTAGenumerationtypeTARG.
1602 If a name has been given to the enumeration type in the source
1603 program, then the corresponding enumeration type entry has
1604 a \DWATname{} attribute
1605 \addtoindexx{name attribute}
1606 whose value is a null\dash terminated
1607 string containing the enumeration type name.
1609 The \addtoindex{enumeration type entry}
1611 \addtoindexx{type attribute}
1612 a \DWATtype{} attribute
1613 which refers to the underlying data type used to implement
1614 the enumeration. The entry also may have a
1615 \DWATbytesize{} attribute or
1617 attribute, whose value
1618 (see Section \refersec{chap:byteandbitsizes})
1619 is the amount of storage
1620 required to hold an instance of the enumeration. If no
1621 \DWATbytesize{} or \DWATbitsize{}
1622 attribute is present, the size for holding an instance of the
1623 enumeration is given by the size of the underlying data type.
1626 If an enumeration type has type safe
1627 \addtoindexx{type safe enumeration types}
1630 \begin{enumerate}[1. ]
1631 \item Enumerators are contained in the scope of the enumeration type, and/or
1633 \item Enumerators are not implicitly converted to another type
1636 then the \addtoindex{enumeration type entry} may
1637 \addtoindexx{enum class|see{type-safe enumeration}}
1638 have a \DWATenumclassDEFN{}
1639 attribute, which is a \livelink{chap:classflag}{flag}.
1640 In a language that offers only
1641 one kind of enumeration declaration, this attribute is not
1644 \textit{In \addtoindex{C} or \addtoindex{C++},
1645 the underlying type will be the appropriate
1646 integral type determined by the compiler from the properties
1647 of\hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}{}
1648 the enumeration literal values.
1649 A \addtoindex{C++} type declaration written
1650 using enum class declares a strongly typed enumeration and
1651 is represented using \DWTAGenumerationtype{}
1652 in combination with \DWATenumclass.}
1654 Each enumeration literal is represented by a debugging
1655 \addtoindexx{enumeration literal|see{enumeration entry}}
1656 information entry with the
1657 tag \DWTAGenumeratorTARG.
1659 such entry is a child of the
1660 \addtoindex{enumeration type entry}, and the
1661 enumerator entries appear in the same order as the declarations
1662 of the enumeration literals in the source program.
1665 Each \addtoindex{enumerator entry} has a \DWATname{} attribute, whose
1666 \addtoindexx{name attribute}
1667 value is a null-terminated string containing the name of
1668 the\hypertarget{chap:DWATconstvalueenumerationliteralvalue}{}
1669 enumeration literal.
1670 Each enumerator entry also has a
1671 \DWATconstvalueDEFN{} attribute,
1672 \addtoindexx{constant value attribute}
1673 whose value is the actual numeric value of the enumerator as
1674 represented on the target system.
1677 If the enumeration type occurs as the description of a
1678 \addtoindexx{enumeration type entry!as array dimension}
1679 dimension of an array type, and the stride for that
1680 dimension\hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}{}
1681 is different than what would otherwise be determined,
1682 then\hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}{}
1683 the enumeration type entry has either a
1684 \addtoindexx{byte stride attribute}
1685 \DWATbytestrideDEFN{} or
1686 \addtoindexx{bit stride attribute}
1687 \DWATbitstrideDEFN{} attribute which specifies the separation
1688 between successive elements along the dimension as described
1689 in Section \refersec{chap:staticanddynamicvaluesofattributes}.
1690 The value of the \DWATbitstride{} attribute
1691 is interpreted as bits and
1692 the value of the \DWATbytestride{} attribute is interpreted
1696 \section{Subroutine Type Entries}
1697 \label{chap:subroutinetypeentries}
1699 \textit{It is possible in \addtoindex{C}
1700 to declare pointers to subroutines
1701 that return a value of a specific type. In both
1702 \addtoindex{C} and \addtoindex{C++},
1703 it is possible to declare pointers to subroutines that not
1704 only return a value of a specific type, but accept only
1705 arguments of specific types. The type of such pointers would
1706 be described with a \doublequote{pointer to} modifier applied to a
1707 user\dash defined type.}
1710 A subroutine type is represented by a debugging information
1712 \addtoindexx{subroutine type entry}
1713 tag \DWTAGsubroutinetypeTARG.
1715 been given to the subroutine type in the source program,
1716 then the corresponding subroutine type entry has
1717 a \DWATname{} attribute
1718 \addtoindexx{name attribute}
1719 whose value is a null\dash terminated string containing
1720 the subroutine type name.
1722 If the subroutine type describes a function that returns
1723 a value, then the subroutine type entry has a
1724 \addtoindexx{type attribute}
1726 attribute to denote the type returned by the subroutine. If
1727 the types of the arguments are necessary to describe the
1728 subroutine type, then the corresponding subroutine type
1729 entry owns debugging information entries that describe the
1730 arguments. These debugging information entries appear in the
1731 order that the corresponding argument types appear in the
1734 \textit{In \addtoindex{C} there
1735 is a difference between the types of functions
1736 declared using function prototype style declarations and
1737 those declared using non-prototype declarations.}
1740 \hypertarget{chap:DWATprototypedsubroutineprototype}{}
1741 subroutine entry declared with a function prototype style
1742 declaration may have
1743 \addtoindexx{prototyped attribute}
1745 \DWATprototypedDEFN{} attribute, which is
1746 a \livelink{chap:classflag}{flag}.
1749 Each debugging information entry owned by a subroutine
1750 type entry corresponds to either a formal parameter or the sequence of
1751 unspecified parameters of the subprogram type:
1753 \begin{enumerate}[1. ]
1754 \item A formal parameter of a parameter list (that has a
1755 specific type) is represented by a debugging information entry
1756 with the tag \DWTAGformalparameter.
1757 Each formal parameter
1759 \addtoindexx{type attribute}
1760 a \DWATtype{} attribute that refers to the type of
1761 the formal parameter.
1763 \item The unspecified parameters of a variable parameter list
1764 \addtoindexx{unspecified parameters entry}
1766 \addtoindexx{\texttt{...} parameters|see{unspecified parameters entry}}
1767 represented by a debugging information entry with the
1768 tag \DWTAGunspecifiedparameters.
1771 \textit{\addtoindex{C++} const-volatile qualifiers are encoded as
1772 part of the type of the \doublequote{\texttt{this}}-pointer.
1773 \addtoindex{C++11} reference and rvalue-reference qualifiers are
1774 encoded using the \DWATreference{} and \DWATrvaluereference{} attributes,
1776 See also Section \refersec{chap:memberfunctionentries}.}
1779 A subroutine type entry may have the \DWATreference{} or
1780 \DWATrvaluereference{} attribute to indicate that it describes the
1781 type of a member function with reference or rvalue-reference
1782 semantics, respectively.
1785 \section{String Type Entries}
1786 \label{chap:stringtypeentries}
1788 \textit{A \doublequote{string} is a sequence of characters that have specific
1789 \addtoindexx{string type entry}
1790 semantics and operations that distinguish them from arrays of
1792 \addtoindex{Fortran} is one of the languages that has a string
1793 type. Note that \doublequote{string} in this context refers to a target
1794 machine concept, not the class string as used in this document
1795 (except for the name attribute).}
1797 A string type is represented by a debugging information entry
1798 with the tag \DWTAGstringtypeTARG.
1799 If a name has been given to
1800 the string type in the source program, then the corresponding
1801 string type entry has a
1802 \DWATname{} attribute
1803 \addtoindexx{name attribute}
1804 whose value is a null-terminated string containing the string type name.
1806 A string type entry may have a \DWATtypeDEFN{}
1807 \livetargi{chap:DWAATtypeofstringtype}{attribute}{type attribute!of string type entry}
1808 describing how each character is encoded and is to be interpreted.
1809 The value of this attribute is a \CLASSreference{} to a
1810 \DWTAGbasetype{} base type entry. If the attribute is absent,
1811 then the character is encoded using the system default.
1814 \addtoindex{Fortran 2003} language standard allows string
1815 types that are composed of different types of (same sized) characters.
1816 While there is no standard list of character kinds, the kinds
1817 \texttt{ASCII}\index{ASCII@\texttt{ASCII} (Fortran string kind)} (see \DWATEASCII),
1818 \texttt{ISO\_10646}\index{ISO\_10646@\texttt{ISO\_10646} (Fortran string kind)}
1819 \addtoindexx{ISO 10646 character set standard}
1821 \texttt{DEFAULT}\index{DEFAULT@\texttt{DEFAULT} (Fortran string kind)}
1825 The string type entry may have a
1826 \DWATbytesize{} attribute or
1828 attribute, whose value
1829 (see Section \refersec{chap:byteandbitsizes})
1831 storage needed to hold a value of the string type.
1833 The\hypertarget{chap:DWATstringlengthstringlengthofstringtype}{}
1834 string type entry may also have a
1835 \DWATstringlengthDEFN{} attribute\addtoindexx{string length attribute}
1838 either a \livelink{chap:classreference}{reference}
1839 (see Section \ref{chap:staticanddynamicvaluesofattributes})
1840 yielding the length of the string
1841 or a \addtoindex{location description} yielding the location
1843 where the length of the string is stored in the program.
1844 If the \DWATstringlengthNAME{} attribute is not present, the size
1845 of the string is assumed to be the amount of storage that is
1846 allocated for the string (as specified by the \DWATbytesize{}
1847 or \DWATbitsize{} attribute).
1849 The string type entry may also have a
1850 \DWATstringlengthbytesizeDEFN{} or
1851 \DWATstringlengthbitsizeDEFN{} attribute,
1852 \addtoindexx{string length size attribute}
1853 \addtoindexx{string length attribute!size of length data}
1854 whose value (see Section \refersec{chap:byteandbitsizes})
1855 is the size of the data to be retrieved from the location
1856 referenced by the \DWATstringlength{} attribute. If no byte or bit
1857 size attribute is present, the size of the data to be retrieved
1859 \addtoindex{size of an address} on the target machine.
1862 \addtoindexx{DWARF Version 5} % Avoid italics
1863 \textit{Prior to DWARF Version 5, the meaning of a
1864 \DWATbytesize{} attribute depended on the presence of the
1865 \DWATstringlength{} attribute:
1867 \item If \DWATstringlength{} was present, \DWATbytesize{}
1868 specified the size of the length data to be retrieved
1869 from the location specified by the \DWATstringlength{} attribute.
1870 \item If \DWATstringlength{} was not present, \DWATbytesize{}
1871 specified the amount of storage allocated for objects
1874 In \DWARFVersionV{}, \DWATbytesize{} always specifies the amount of storage
1875 allocated for objects of the string type.}
1878 \section{Set Type Entries}
1879 \label{chap:settypeentries}
1881 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1882 a group of values of ordinal type.}
1884 A set is represented by a debugging information entry with
1885 the tag \DWTAGsettypeTARG.
1886 \addtoindexx{set type entry}
1887 If a name has been given to the
1888 set type, then the set type entry has
1889 a \DWATname{} attribute
1890 \addtoindexx{name attribute}
1891 whose value is a null\dash terminated string containing the
1894 The set type entry has a
1895 \addtoindexx{type attribute}
1896 \DWATtype{} attribute to denote the
1897 type of an element of the set.
1900 If the amount of storage allocated to hold each element of an
1901 object of the given set type is different from the amount of
1902 storage that is normally allocated to hold an individual object
1903 of the indicated element type, then the set type entry has
1904 either a \DWATbytesize{} attribute, or
1905 \DWATbitsize{} attribute
1906 whose value (see Section \refersec{chap:byteandbitsizes}) is
1907 the amount of storage needed to hold a value of the set type.
1910 \section{Subrange Type Entries}
1911 \label{chap:subrangetypeentries}
1913 \textit{Several languages support the concept of a \doublequote{subrange}
1914 type. Objects of the subrange type can represent only a contiguous
1915 subset (range) of values from the type on which the subrange is defined.
1916 Subrange types may also be used to represent the bounds of array dimensions.}
1918 A subrange type is represented by a debugging information
1920 \DWTAGsubrangetypeTARG.\addtoindexx{subrange type entry}
1921 If a name has been given to the subrange type, then the
1922 subrange type entry has a
1923 \DWATname{} attribute\addtoindexx{name attribute}
1924 whose value is a null-terminated
1925 string containing the subrange type name.
1927 The tag \DWTAGgenericsubrange{}
1928 is used to describe arrays with a dynamic rank. See Section
1929 \refersec{chap:DWTAGgenericsubrange}.
1931 The subrange entry may have a
1932 \DWATtype{} attribute\addtoindexx{type attribute} to describe
1933 the type of object, called the basis type, of whose values
1934 this subrange is a subset.
1936 If the amount of storage allocated to hold each element of an
1937 object of the given subrange type is different from the amount
1938 of storage that is normally allocated to hold an individual
1939 object of the indicated element type, then the subrange
1941 \DWATbytesize{} attribute or
1943 attribute, whose value
1944 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1945 is the amount of storage needed to hold a value of the subrange type.
1947 The\hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}{}
1948 subrange entry may have a
1949 \DWATthreadsscaledDEFN{} attribute\addtoindexx{threads scaled attribute},
1950 which is a \livelink{chap:classflag}{flag}.
1951 If present, this attribute indicates whether
1952 this subrange represents a \addtoindex{UPC} array bound which is scaled
1953 by the runtime \texttt{THREADS} value (the number of \addtoindex{UPC} threads in
1954 this execution of the program).
1956 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
1959 int shared foo[34*THREADS][10][20];
1963 The\hypertarget{chap:DWATlowerboundlowerboundofsubrange}{}
1964 subrange\hypertarget{chap:DWATupperboundupperboundofsubrange}{}
1965 entry may have the attributes
1966 \DWATlowerboundDEFN{}
1967 \addtoindexx{lower bound attribute}
1968 and \DWATupperboundDEFN{}
1969 \addtoindexx{upper bound attribute} to specify, respectively, the lower
1970 and upper bound values of the subrange. The
1971 \DWATupperboundNAME{}
1972 attribute\hypertarget{chap:DWATcountelementsofsubrangetype}{}
1973 may be replaced by a
1974 \addtoindexx{count attribute!default}
1975 \addtoindexx{count attribute}
1976 \DWATcountDEFN{} attribute,
1977 whose value describes the number of elements in the subrange
1978 rather than the value of the last element. The value of each
1979 of these attributes is determined as described in
1980 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1982 If the lower bound value is missing, the value is assumed to
1983 be a language-dependent default constant as defined in
1984 Table \refersec{tab:languageencodings}.
1985 \addtoindexx{lower bound attribute!default}
1987 If the upper bound and count are missing, then the upper bound value is
1988 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
1990 If the subrange entry has no type attribute describing the
1991 basis type, the basis type is determined as follows:
1992 \begin{enumerate}[1. ]
1994 If there is a lower bound attribute that references an object,
1995 the basis type is assumed to be the same as the type of that object.
1997 Otherwise, if there is an upper bound or count attribute that references
1998 an object, the basis type is assumed to be the same as the type of that object.
2000 Otherwise, the type is
2001 assumed to be the same type, in the source language of the
2002 compilation unit containing the subrange entry, as a signed
2003 integer with the same size as an address on the target machine.
2006 If the subrange type occurs as the description of a dimension
2007 of an array type, and the stride for that dimension
2008 is\hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}{}
2009 different than what would otherwise be determined,
2010 then\hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}{}
2011 the subrange type entry has either a
2012 \addtoindexx{byte stride attribute}
2013 \DWATbytestrideDEFN{} or
2014 \DWATbitstrideDEFN{} attribute
2015 \addtoindexx{bit stride attribute}
2016 which specifies the separation
2017 between successive elements along the dimension as described in
2018 Section \refersec{chap:byteandbitsizes}.
2020 \textit{Note that the stride can be negative.}
2023 \section{Pointer to Member Type Entries}
2024 \label{chap:pointertomembertypeentries}
2026 \textit{In \addtoindex{C++}, a
2027 pointer to a data or function member of a class or
2028 structure is a unique type.}
2030 A debugging information entry representing the type of an
2031 object that is a pointer to a structure or class member has
2032 the tag \DWTAGptrtomembertypeTARG.
2034 If the \addtoindex{pointer to member type} has a name, the
2035 \addtoindexx{pointer to member type entry}
2036 pointer to member entry has a
2037 \DWATname{} attribute,
2038 \addtoindexx{name attribute}
2040 null\dash terminated string containing the type name.
2042 The \addtoindex{pointer to member} entry
2044 \addtoindexx{type attribute}
2045 a \DWATtype{} attribute to
2046 describe the type of the class or structure member to which
2047 objects of this type may point.
2049 The \addtoindexx{pointer to member} entry
2050 also\hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}{}
2051 has a \DWATcontainingtypeDEFN{} attribute,
2052 \addtoindexx{containing type (of pointer) attribute}
2053 whose value is a \livelink{chap:classreference}{reference} to a debugging
2054 information entry for the class or structure to whose members
2055 objects of this type may point.
2057 The\hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}{}
2058 \addtoindex{pointer to member entry} has a
2059 \DWATuselocationDEFN{} attribute
2060 \addtoindexx{use location attribute}
2062 \addtoindex{location description} that computes the
2063 address of the member of the class to which the pointer to
2064 member entry points.
2067 \textit{The method used to find the address of a given member of a
2068 class or structure is common to any instance of that class
2069 or structure and to any instance of the pointer or member
2070 type. The method is thus associated with the type entry,
2071 rather than with each instance of the type.}
2073 The \DWATuselocation{} description is used in conjunction
2074 with the location descriptions for a particular object of the
2075 given \addtoindex{pointer to member type} and for a particular structure or
2076 class instance. The \DWATuselocation{}
2077 attribute expects two values to be
2078 \addtoindexi{pushed}{address!implicit push for member operator}
2079 onto the DWARF expression stack before
2080 the \DWATuselocation{} description is evaluated.
2082 \addtoindexi{pushed}{address!implicit push for member operator}
2083 is the value of the \addtoindex{pointer to member} object
2084 itself. The second value
2085 \addtoindexi{pushed}{address!implicit push for member operator}
2086 is the base address of the
2087 entire structure or union instance containing the member
2088 whose address is being calculated.
2091 \textit{For an expression such as}
2096 \textit{where \texttt{mbr\_ptr} has some \addtoindex{pointer to member type}, a debugger should:}
2097 \begin{enumerate}[1. ]
2098 \item \textit{Push the value of \texttt{mbr\_ptr} onto the DWARF expression stack.}
2099 \item \textit{Push the base address of \texttt{object} onto the DWARF expression stack.}
2100 \item \textit{Evaluate the \DWATuselocation{} description
2101 given in the type of \texttt{mbr\_ptr}.}
2105 \section{File Type Entries}
2106 \label{chap:filetypeentries}
2108 \textit{Some languages, such as \addtoindex{Pascal},
2109 provide a data type to represent
2112 A file type is represented by a debugging information entry
2114 \addtoindexx{file type entry}
2117 If the file type has a name,
2118 the file type entry has a \DWATname{} attribute,
2119 \addtoindexx{name attribute}
2121 is a null\dash terminated string containing the type name.
2123 The file type entry has
2124 \addtoindexx{type attribute}
2125 a \DWATtype{} attribute describing
2126 the type of the objects contained in the file.
2128 The file type entry also has a
2129 \DWATbytesize{}\addtoindexx{byte size attribute} or
2130 \DWATbitsize{}\addtoindexx{bit size attribute} attribute, whose value
2131 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2132 is the amount of storage need to hold a value of the file type.
2134 \section{Dynamic Type Entries}
2135 \label{chap:dynamictypeentries}
2136 \textit{Some languages such as
2137 \addtoindex{Fortran 90}, provide types whose values
2138 may be dynamically allocated or associated with a variable
2139 under explicit program control. However, unlike the
2140 pointer type in \addtoindex{C} or
2141 \addtoindex{C++}, the indirection involved in accessing
2142 the value of the variable is generally implicit, that is, not
2143 indicated as part of the program source.}
2145 A dynamic type entry is used to declare a dynamic type that is
2146 \doublequote{just like} another non-dynamic type without needing to
2147 replicate the full description of that other type.
2149 A dynamic type is represented by a debugging information entry
2150 with the tag \DWTAGdynamictypeTARG. If a name has been given to the
2151 dynamic type, then the dynamic type has a \DWATname{} attribute
2152 whose value is a null-terminated string containing the dynamic
2155 A dynamic type entry has a \DWATtype{} attribute whose value is a
2156 reference to the type of the entities that are dynamically allocated.
2158 A dynamic type entry also has a \DWATdatalocation, and may also
2159 have \DWATallocated{} and/or \DWATassociated{} attributes as
2160 described in Section \refersec{chap:dynamicpropertiesoftypes}.
2161 A \DWATdatalocation, \DWATallocated{} or \DWATassociated{} attribute
2162 may not occur on a dynamic type entry if the same kind of attribute
2163 already occurs on the type referenced by the \DWATtype{} attribute.
2167 \section{Template Alias Entries}
2168 \label{chap:templatealiasentries}
2170 \textit{In \addtoindex{C++}, a template alias is a form of typedef that has template
2171 parameters. DWARF does not represent the template alias definition
2172 but does represent instantiations of the alias.}
2174 A type named using a template alias is represented
2175 by a debugging information entry
2176 \addtoindexx{template alias entry}
2178 \DWTAGtemplatealiasTARG.
2179 The template alias entry has a
2180 \DWATname{} attribute
2181 \addtoindexx{name attribute}
2182 whose value is a null\dash terminated string
2183 containing the name of the template alias.
2184 The template alias entry has child entries describing the template
2185 actual parameters (see Section \refersec{chap:templateparameters}).
2188 \section{Dynamic Properties of Types}
2189 \label{chap:dynamicpropertiesoftypes}
2190 \textit{The \DWATdatalocation, \DWATallocated{} and \DWATassociated{}
2191 attributes described in this section are motivated for use with
2192 \DWTAGdynamictype{} entries but can be used for any other type as well.}
2195 \subsection{Data Location}
2196 \label{chap:datalocation}
2198 \textit{Some languages may represent objects using descriptors to hold
2199 information, including a location and/or run\dash time parameters,
2200 about the data that represents the value for that object.}
2202 The\hypertarget{chap:DWATdatalocationindirectiontoactualdata}{}
2203 \DWATdatalocationDEFN{} attribute
2204 \addtoindexx{data (indirect) location attribute}
2205 may be used with any type that provides one or more levels of
2206 \addtoindexx{hidden indirection|see{data location attribute}}
2208 and/or run-time parameters in its representation. Its value
2209 is a \addtoindex{location description}.
2210 The result of evaluating this
2211 description yields the location of the data for an object.
2212 When this attribute is omitted, the address of the data is
2213 the same as the address of the object.
2216 \textit{This location description will typically begin with
2217 \DWOPpushobjectaddress{}
2218 which loads the address of the
2219 object which can then serve as a descriptor in subsequent
2220 calculation. For an example using
2222 for a \addtoindex{Fortran 90 array}, see
2223 Appendix \refersec{app:fortranarrayexample}.}
2225 \subsection{Allocation and Association Status}
2226 \label{chap:allocationandassociationstatus}
2228 \textit{Some languages, such as \addtoindex{Fortran 90},
2229 provide types whose values
2230 may be dynamically allocated or associated with a variable
2231 under explicit program control.}
2233 The\hypertarget{chap:DWATallocatedallocationstatusoftypes}{}
2234 \DWATallocatedDEFN{} attribute\addtoindexx{allocated attribute}
2235 may be used with any
2236 type for which objects of the type can be explicitly allocated
2237 and deallocated. The presence of the attribute indicates that
2238 objects of the type are allocatable and deallocatable. The
2239 integer value of the attribute (see below) specifies whether
2240 an object of the type is currently allocated or not.
2243 The\hypertarget{chap:DWATassociatedassociationstatusoftypes}{}
2244 \DWATassociatedDEFN{} attribute
2246 \addtoindexx{associated attribute}
2247 optionally be used with
2248 any type for which objects of the type can be dynamically
2249 associated with other objects. The presence of the attribute
2250 indicates that objects of the type can be associated. The
2251 integer value of the attribute (see below) indicates whether
2252 an object of the type is currently associated or not.
2254 The value of these attributes is determined as described in
2255 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2256 A non-zero value is interpreted as allocated or associated,
2257 and zero is interpreted as not allocated or not associated.
2259 \textit{For \addtoindex{Fortran 90},
2260 if the \DWATassociated{}
2261 attribute is present,
2262 the type has the POINTER property where either the parent
2263 variable is never associated with a dynamic object or the
2264 implementation does not track whether the associated object
2265 is static or dynamic. If the \DWATallocated{} attribute is
2266 present and the \DWATassociated{} attribute is not, the type
2267 has the ALLOCATABLE property. If both attributes are present,
2268 then the type should be assumed to have the POINTER property
2269 (and not ALLOCATABLE); the \DWATallocated{} attribute may then
2270 be used to indicate that the association status of the object
2271 resulted from execution of an ALLOCATE statement rather than
2272 pointer assignment.}
2274 \textit{For examples using
2275 \DWATallocated{} for \addtoindex{Ada} and
2276 \addtoindex{Fortran 90}
2278 see Appendix \refersec{app:aggregateexamples}.}
2280 \subsection{Array Rank}
2281 \label{chap:DWATrank}
2282 \addtoindexx{array!assumed-rank}
2283 \addtoindexx{assumed-rank array|see{array, assumed-rank}}
2284 \textit{The Fortran language supports \doublequote{assumed-rank arrays}. The
2285 rank (the number of dimensions) of an assumed-rank array is unknown
2286 at compile time. The Fortran runtime stores the rank in an array
2290 the\hypertarget{chap:DWATrankofdynamicarray}{\DWATrankINDX}
2291 attribute indicates that an array's rank
2292 (number of dimensions) is dynamic, and therefore unknown at compile
2293 time. The value of the \DWATrankDEFN{} attribute is either an integer constant
2294 or a DWARF expression whose evaluation yields the dynamic rank.
2296 The bounds of an array with dynamic rank are described using a
2297 \DWTAGgenericsubrange{} entry, which
2298 is the dynamic rank array equivalent of
2299 \DWTAGsubrangetype. The
2300 difference is that a \DWTAGgenericsubrange{} entry contains generic
2301 lower/upper bound and stride expressions that need to be evaluated for
2302 each dimension. Before any expression contained in a
2303 \DWTAGgenericsubrange{} can be evaluated, the dimension for which the
2304 expression is to be evaluated needs to be pushed onto the stack. The
2305 expression will use it to find the offset of the respective field in
2306 the array descriptor metadata.
2308 \textit{A producer is free to choose any layout for the
2309 array descriptor. In particular, the upper and lower bounds and
2310 stride values do not need to be bundled into a structure or record,
2311 but could be laid end to end in the containing descriptor, pointed
2312 to by the descriptor, or even allocated independently of the
2315 Dimensions are enumerated $0$ to $\mathit{rank}-1$ in source program
2318 \textit{For an example in Fortran 2008, see
2319 Section~\refersec{app:assumedrankexample}.}