2 \label{chap:typeentries}
3 This section presents the debugging information entries
4 that describe program types: base types, modified types and
5 user\dash defined types.
7 If the scope of the declaration of a named type begins after
8 \hypertarget{chap:DWATstartscopetypedeclaration}
9 the low pc value for the scope most closely enclosing the
10 declaration, the declaration may have a
11 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}
12 attribute as described for objects in
13 Section \refersec{chap:dataobjectentries}.
15 \section{Base Type Entries}
16 \label{chap:basetypeentries}
18 \textit{A base type is a data type that is not defined in terms of
20 \addtoindexx{fundamental type|see{base type entry}}
21 Each programming language has a set of base
22 types that are considered to be built into that language.}
24 A base type is represented by a debugging information entry
26 \livetarg{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}.
28 A \addtoindex{base type entry}
29 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
31 \addtoindexx{name attribute}
33 a null\dash terminated string containing the name of the base type
34 as recognized by the programming language of the compilation
35 unit containing the base type entry.
38 \addtoindexx{encoding attribute}
39 a \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding} attribute describing
40 how the base type is encoded and is to be interpreted. The
41 value of this attribute is an integer constant. The set of
42 values and their meanings for the
43 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding} attribute
45 Table \refersec{tab:encodingattributevalues}
49 may have a \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute
50 \addtoindexx{endianity attribute}
52 Section \refersec{chap:dataobjectentries}.
53 If omitted, the encoding assumes the representation that
54 is the default for the target architecture.
57 \hypertarget{chap:DWATbytesizedataobjectordatatypesize}
58 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
59 \hypertarget{chap:DWATbitsizebasetypebitsize}
60 or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
61 \addtoindex{bit size attribute}
62 whose integer constant value
63 (see Section \refersec{chap:byteandbitsizes})
64 is the amount of storage needed to hold
67 \textit{For example, the
68 \addtoindex{C} type int on a machine that uses 32\dash bit
69 integers is represented by a base type entry with a name
70 attribute whose value is \doublequote{int}, an encoding attribute
71 whose value is \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed}
72 and a byte size attribute whose value is 4.}
74 If the value of an object of the given type does not fully
75 occupy the storage described by a byte size attribute,
76 \hypertarget{chap:DWATdatabitoffsetbasetypebitlocation}
77 the base type entry may also have
78 \addtoindexx{bit size attribute}
80 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and a
81 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute,
83 \addtoindexx{data bit offset attribute}
85 integer constant values (
86 see Section \refersec{chap:staticanddynamicvaluesofattributes}).
88 attribute describes the actual size in bits used to represent
89 values of the given type. The data bit offset attribute is the
90 offset in bits from the beginning of the containing storage to
91 the beginning of the value. Bits that are part of the offset
92 are padding. The data bit offset uses the bit numbering and
93 direction conventions that are appropriate to the current
95 target system to locate the beginning of the storage and
96 value. If this attribute is omitted a default data bit offset
100 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
102 \addtoindexx{bit offset attribute}
104 \addtoindexx{data bit offset attribute}
106 \addtoindex{DWARF Version 4} and
107 is also used for bit field members
108 (see Section \refersec{chap:datamemberentries}).
110 \hypertarget{chap:DWATbitoffsetbasetypebitlocation}
111 replaces the attribute
112 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
114 \addtoindexx{bit offset attribute (V3)}
115 types as defined in DWARF V3 and earlier. The earlier attribute
116 is defined in a manner suitable for bit field members on
117 big\dash endian architectures but which is wasteful for use on
118 little\dash endian architectures.}
120 \textit{The attribute \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} is
122 \addtoindex{DWARF Version 4}
123 for use in base types, but implementations may continue to
124 support its use for compatibility.}
127 \addtoindex{DWARF Version 3}
128 definition of these attributes is as follows.}
129 \begin{myindentpara}{1cm}
130 \textit{A base type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
131 attribute, whose value
132 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
133 is the size in bytes of the storage unit
134 used to represent an object of the given type.}
136 \textit{If the value of an object of the given type does not fully
137 occupy the storage unit described by the byte size attribute,
138 the base type entry may have a
139 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
140 \addtoindexx{bit size attribute (V3)}
142 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute, both of whose values
143 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
144 are integers. The bit size attribute describes the actual
145 size in bits used to represent a value of the given type.
146 The bit offset attribute describes the offset in bits of the
147 high order bit of a value of the given type from the high
148 order bit of the storage unit used to contain that value.}
154 \addtoindexx{DWARF Version 3}
156 \addtoindexx{DWARF Version 4} and 4, note that DWARF V4
157 defines the following combinations of attributes:}
160 \item \textit{DW\-\_AT\-\_byte\-\_size}
161 \item \textit{DW\-\_AT\-\_bit\-\_size}
162 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
163 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
164 and optionally \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}}
166 \textit{DWARF V3 defines the following combinations:}
167 \addtoindexx{DWARF Version 3}
168 % FIXME: the figure below interferes with the following
169 % bullet list, which looks horrible as a result.
171 \item \textit{DW\-\_AT\-\_byte\-\_size}
172 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
173 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
174 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}}
178 \caption{Encoding attribute values}
179 \label{tab:encodingattributevalues}
181 \begin{tabular}{l|p{8cm}}
183 Name&Meaning\\ \hline
184 \livetarg{chap:DWATEaddress}{DW\-\_ATE\-\_address} & linear machine address (for segmented\break
186 Section \refersec{chap:segmentedaddresses}) \\
187 \livetarg{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}& true or false \\
189 \livetarg{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}& complex binary
190 floating\dash point number \\
191 \livetarg{chap:DWATEfloat}{DW\-\_ATE\-\_float} & binary floating\dash point number \\
192 \livetarg{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}& imaginary binary
193 floating\dash point number \\
194 \livetarg{chap:DWATEsigned}{DW\-\_ATE\-\_signed}& signed binary integer \\
195 \livetarg{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}& signed character \\
196 \livetarg{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned} & unsigned binary integer \\
197 \livetarg{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char} & unsigned character \\
198 \livetarg{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} & packed decimal \\
199 \livetarg{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}& numeric string \\
200 \livetarg{chap:DWATEedited}{DW\-\_ATE\-\_edited} & edited string \\
201 \livetarg{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} & signed fixed\dash point scaled integer \\
202 \livetarg{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}& unsigned fixed\dash point scaled integer \\
203 \livetarg{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & decimal floating\dash point number \\
204 \livetarg{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} & \addtoindex{Unicode} character \\
209 \textit{The \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} encoding is intended for
210 floating\dash point representations that have a power\dash of\dash ten
211 exponent, such as that specified in IEEE 754R.}
213 \textit{The \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} encoding is intended for \addtoindex{Unicode}
214 string encodings (see the Universal Character Set standard,
215 ISO/IEC 10646\dash 1:1993). For example, the
216 \addtoindex{C++} type char16\_t is
217 represented by a base type entry with a name attribute whose
218 value is \doublequote{char16\_t}, an encoding attribute whose value
219 is \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} and a byte size attribute whose value is 2.}
222 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
224 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}
226 represent packed and unpacked decimal string numeric data
227 types, respectively, either of which may be
229 \addtoindexx{decimal scale attribute}
231 \addtoindexx{decimal sign attribute}
233 \addtoindexx{digit count attribute}
235 \hypertarget{chap:DWATdecimalsigndecimalsignrepresentation}
237 \hypertarget{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
238 base types are used in combination with
239 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign},
240 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
241 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
244 A \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute
245 \addtoindexx{decimal sign attribute}
246 is an integer constant that
247 conveys the representation of the sign of the decimal type
248 (see Figure \refersec{tab:decimalsignattributevalues}).
249 Its integer constant value is interpreted to
250 mean that the type has a leading overpunch, trailing overpunch,
251 leading separate or trailing separate sign representation or,
252 alternatively, no sign at all.
255 \caption{Decimal sign attribute values}
256 \label{tab:decimalsignattributevalues}
258 \begin{tabular}{l|p{9cm}}
262 \livetarg{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & Unsigned \\
263 \livetarg{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & Sign
264 is encoded in the most significant digit in a target\dash dependent manner \\
265 \livetarg{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & Sign
266 is encoded in the least significant digit in a target\dash dependent manner \\
267 \livetarg{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate}
268 & Decimal type: Sign is a ``+'' or ``-'' character
269 to the left of the most significant digit. \\
270 \livetarg{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate}
271 & Decimal type: Sign is a ``+'' or ``-'' character
272 to the right of the least significant digit. \\
273 &Packed decimal type: Least significant nibble contains
274 a target\dash dependent value
275 indicating positive or negative. \\
281 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
283 \addtoindexx{digit count attribute}
284 is an integer constant
285 value that represents the number of digits in an instance of
288 \hypertarget{chap:DWATdecimalscaledecimalscalefactor}
289 The \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
291 \addtoindexx{decimal scale attribute}
292 is an integer constant value
293 that represents the exponent of the base ten scale factor to
294 be applied to an instance of the type. A scale of zero puts the
295 decimal point immediately to the right of the least significant
296 digit. Positive scale moves the decimal point to the right
297 and implies that additional zero digits on the right are not
298 stored in an instance of the type. Negative scale moves the
299 decimal point to the left; if the absolute value of the scale
300 is larger than the digit count, this implies additional zero
301 digits on the left are not stored in an instance of the type.
303 The \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}
305 \hypertarget{chap:DWATpicturestringpicturestringfornumericstringtype}
306 type is used to represent an edited
307 numeric or alphanumeric data type. It is used in combination
308 with an \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string} attribute whose value is a
309 null\dash terminated string containing the target\dash dependent picture
310 string associated with the type.
312 If the edited base type entry describes an edited numeric
313 data type, the edited type entry has a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and a
314 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute.
315 \addtoindexx{decimal scale attribute}
316 These attributes have the same
317 interpretation as described for the
318 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and
319 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base
320 types. If the edited type entry
321 describes an edited alphanumeric data type, the edited type
322 entry does not have these attributes.
325 \textit{The presence or absence of the \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
326 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attributes
327 \addtoindexx{decimal scale attribute}
328 allows a debugger to easily
329 distinguish edited numeric from edited alphanumeric, although
330 in principle the digit count and scale are derivable by
331 interpreting the picture string.}
333 The \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} and \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed} entries
334 describe signed and unsigned fixed\dash point binary data types,
337 The fixed binary type entries have
338 \addtoindexx{digit count attribute}
340 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
341 attribute with the same interpretation as described for the
342 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
344 For a data type with a decimal scale factor, the fixed binary
346 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute
347 \addtoindexx{decimal scale attribute}
349 interpretation as described for the
350 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
351 and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
353 \hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
354 For a data type with a binary scale factor, the fixed
355 \addtoindexx{binary scale attribute}
356 binary type entry has a
357 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute.
359 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute
360 is an integer constant value
361 that represents the exponent of the base two scale factor to
362 be applied to an instance of the type. Zero scale puts the
363 binary point immediately to the right of the least significant
364 bit. Positive scale moves the binary point to the right and
365 implies that additional zero bits on the right are not stored
366 in an instance of the type. Negative scale moves the binary
367 point to the left; if the absolute value of the scale is
368 larger than the number of bits, this implies additional zero
369 bits on the left are not stored in an instance of the type.
372 \hypertarget{chap:DWATsmallscalefactorforfixedpointtype}
373 a data type with a non\dash decimal and non\dash binary scale factor,
374 the fixed binary type entry has a
375 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute which
376 \addtoindexx{small attribute}
378 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The scale factor value
379 is interpreted in accordance with the value defined by the
380 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The value represented is the product
381 of the integer value in memory and the associated constant
384 \textit{The \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute
385 is defined with the \addtoindex{Ada} small
388 \section{Unspecified Type Entries}
389 \label{chap:unspecifiedtypeentries}
390 \addtoindexx{unspecified type entry}
391 \addtoindexx{void type|see{unspecified type entry}}
392 Some languages have constructs in which a type
393 may be left unspecified or the absence of a type
394 may be explicitly indicated.
396 An unspecified (implicit, unknown, ambiguous or nonexistent)
397 type is represented by a debugging information entry with
398 the tag \livetarg{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}.
399 If a name has been given
400 to the type, then the corresponding unspecified type entry
401 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
402 \addtoindexx{name attribute}
404 a null\dash terminated
405 string containing the name as it appears in the source program.
407 The interpretation of this debugging information entry is
408 intentionally left flexible to allow it to be interpreted
409 appropriately in different languages. For example, in
410 \addtoindex{C} and \addtoindex{C++}
411 the language implementation can provide an unspecified type
412 entry with the name \doublequote{void} which can be referenced by the
413 type attribute of pointer types and typedef declarations for
415 % FIXME: the following reference was wrong in DW4 so DavidA guessed
417 Sections \refersec{chap:unspecifiedtypeentries} and
418 %The following reference was valid, so the following is probably correct.
419 Section \refersec{chap:typedefentries},
420 respectively). As another
421 example, in \addtoindex{Ada} such an unspecified type entry can be referred
422 to by the type attribute of an access type where the denoted
423 \addtoindexx{incomplete type (Ada)}
424 type is incomplete (the name is declared as a type but the
425 definition is deferred to a separate compilation unit).
427 \section{Type Modifier Entries}
428 \label{chap:typemodifierentries}
429 \addtoindexx{type modifier entry}
431 A base or user\dash defined type may be modified in different ways
432 in different languages. A type modifier is represented in
433 DWARF by a debugging information entry with one of the tags
434 given in Table \refersec{tab:typemodifiertags}.
435 \addtoindexx{type modifier|see{constant type entry}}
436 \addtoindexx{type modifier|see{reference type entry}}
437 \addtoindexx{type modifier|see{restricted type entry}}
438 \addtoindexx{type modifier|see{packed type entry}}
439 \addtoindexx{type modifier|see{pointer type entry}}
440 \addtoindexx{type modifier|see{shared type entry}}
441 \addtoindexx{type modifier|see{volatile type entry}}
443 If a name has been given to the modified type in the source
444 program, then the corresponding modified type entry has
445 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
446 \addtoindexx{name attribute}
447 whose value is a null\dash terminated
448 string containing the modified type name as it appears in
451 Each of the type modifier entries has
452 \addtoindexx{type attribute}
454 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
455 whose value is a reference to a debugging information entry
456 describing a base type, a user-defined type or another type
459 A modified type entry describing a
460 \addtoindexx{pointer type entry}
461 pointer or \addtoindex{reference type}
462 (using \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
463 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type} or
464 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type})
465 % Another instance of no-good-place-to-put-index entry.
467 \addtoindexx{address class!attribute}
469 \hypertarget{chap:DWATadressclasspointerorreferencetypes}
471 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
472 attribute to describe how objects having the given pointer
473 or reference type ought to be dereferenced.
475 A modified type entry describing a shared qualified type
476 (using \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}) may have a
477 \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute
478 \addtoindexx{count attribute}
479 whose value is a constant expressing the blocksize of the
480 type. If no count attribute is present, then the \doublequote{infinite}
481 blocksize is assumed.
483 When multiple type modifiers are chained together to modify
484 a base or user-defined type, the tree ordering reflects the
486 \addtoindexx{reference type entry, lvalue|see{reference type entry}}
488 \addtoindexx{reference type entry, rvalue|see{rvalue reference type entry}}
490 \addtoindexx{parameter|see{macro formal parameter list}}
492 \addtoindexx{parameter|see{\textit{this} parameter}}
494 \addtoindexx{parameter|see{variable parameter attribute}}
496 \addtoindexx{parameter|see{optional parameter attribute}}
498 \addtoindexx{parameter|see{unspecified parameters entry}}
500 \addtoindexx{parameter|see{template value parameter entry}}
502 \addtoindexx{parameter|see{template type parameter entry}}
504 \addtoindexx{parameter|see{formal parameter entry}}
508 \caption{Type modifier tags}
509 \label{tab:typemodifiertags}
511 \begin{tabular}{l|p{9cm}}
513 Name&Meaning\\ \hline
514 \livetarg{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} & C or C++ const qualified type
515 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
516 \livetarg{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}& \addtoindex{Pascal} or Ada packed type\addtoindexx{packed type entry}
517 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
518 \livetarg{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} & Pointer to an object of
519 the type being modified \addtoindexx{pointer qualified type entry} \\
520 \livetarg{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}& C++ (lvalue) reference
521 to an object of the type
522 \addtoindexx{reference type entry}
524 \addtoindexx{reference qualified type entry} \\
525 \livetarg{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}& \addtoindex{C}
527 \addtoindexx{restricted type entry}
529 \addtoindexx{restrict qualified type} \\
530 \livetarg{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} & C++
531 \addtoindexx{rvalue reference type entry}
533 \addtoindexx{restricted type entry}
534 reference to an object of the type being modified
535 \addtoindexx{rvalue reference qualified type entry} \\
536 \livetarg{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&\addtoindex{UPC} shared qualified type
537 \addtoindexx{shared qualified type entry} \\
538 \livetarg{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&C or C++ volatile qualified type
539 \addtoindex{volatile qualified type entry} \\
544 %The following clearpage prevents splitting the example across pages.
545 \textit{As examples of how type modifiers are ordered, consider the following
546 \addtoindex{C} declarations:}
547 \begin{lstlisting}[numbers=none]
548 const unsigned char * volatile p;
550 \textit{which represents a volatile pointer to a constant
551 character. This is encoded in DWARF as:}
555 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
556 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
557 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
558 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
559 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
564 \textit{On the other hand}
565 \begin{lstlisting}[numbers=none]
566 volatile unsigned char * const restrict p;
568 \textit{represents a restricted constant
569 pointer to a volatile character. This is encoded as:}
573 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
574 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type} -->
575 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
576 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
577 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
578 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
582 \section{Typedef Entries}
583 \label{chap:typedefentries}
584 A named type that is defined in terms of another type
585 definition is represented by a debugging information entry with
586 \addtoindexx{typedef entry}
587 the tag \livetarg{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}.
588 The typedef entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
589 \addtoindexx{name attribute}
590 whose value is a null\dash terminated string containing
591 the name of the typedef as it appears in the source program.
593 The typedef entry may also contain
594 \addtoindexx{type attribute}
596 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose
597 value is a reference to the type named by the typedef. If
598 the debugging information entry for a typedef represents
599 a declaration of the type that is not also a definition,
600 it does not contain a type attribute.
602 \textit{Depending on the language, a named type that is defined in
603 terms of another type may be called a type alias, a subtype,
604 a constrained type and other terms. A type name declared with
605 no defining details may be termed an
606 \addtoindexx{incomplete type}
607 incomplete, forward or hidden type.
608 While the DWARF \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef} entry was
609 originally inspired by the like named construct in
610 \addtoindex{C} and \addtoindex{C++},
611 it is broadly suitable for similar constructs (by whatever
612 source syntax) in other languages.}
614 \section{Array Type Entries}
615 \label{chap:arraytypeentries}
617 \textit{Many languages share the concept of an ``array,'' which is
618 \addtoindexx{array type entry}
619 a table of components of identical type.}
621 An array type is represented by a debugging information entry
622 with the tag \livetarg{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}.
623 If a name has been given to
624 \addtoindexx{array!declaration of type}
625 the array type in the source program, then the corresponding
626 array type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
627 \addtoindexx{name attribute}
629 null\dash terminated string containing the array type name as it
630 appears in the source program.
633 \hypertarget{chap:DWATorderingarrayrowcolumnordering}
634 array type entry describing a multidimensional array may
635 \addtoindexx{array!element ordering}
636 have a \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute whose integer constant value is
637 interpreted to mean either row-major or column-major ordering
638 of array elements. The set of values and their meanings
639 for the ordering attribute are listed in
640 Table \refersec{tab:arrayordering}.
642 ordering attribute is present, the default ordering for the
643 source language (which is indicated by the
644 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
646 \addtoindexx{language attribute}
647 of the enclosing compilation unit entry) is assumed.
649 \begin{simplenametable}[1.6in]{Array ordering}{tab:arrayordering}
650 \livetarg{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major} \\
651 \livetarg{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major} \\
652 \end{simplenametable}
654 The ordering attribute may optionally appear on one-dimensional
655 arrays; it will be ignored.
657 An array type entry has
658 \addtoindexx{type attribute}
659 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
661 \addtoindexx{array!element type}
662 the type of each element of the array.
664 If the amount of storage allocated to hold each element of an
665 object of the given array type is different from the amount
666 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
667 of storage that is normally allocated to hold an individual
668 \hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}
670 \hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}
671 indicated element type, then the array type
672 \addtoindexx{bit stride attribute}
674 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
676 \addtoindexx{byte stride attribute}
677 a \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
679 \addtoindexx{bit stride attribute}
681 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
683 element of the array.
685 The array type entry may have either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
686 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
687 (see Section \refersec{chap:byteandbitsizes}),
689 amount of storage needed to hold an instance of the array type.
691 \textit{If the size of the array can be determined statically at
692 compile time, this value can usually be computed by multiplying
693 the number of array elements by the size of each element.}
696 Each array dimension is described by a debugging information
697 entry with either the
698 \addtoindexx{subrange type entry!as array dimension}
699 tag \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} or the
700 \addtoindexx{enumeration type entry!as array dimension}
702 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}. These entries are
704 array type entry and are ordered to reflect the appearance of
705 the dimensions in the source program (i.e., leftmost dimension
706 first, next to leftmost second, and so on).
708 \textit{In languages, such as C, in which there is no concept of
709 a \doublequote{multidimensional array}, an array of arrays may
710 be represented by a debugging information entry for a
711 multidimensional array.}
713 Other attributes especially applicable to arrays are
714 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated},
715 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} and
716 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location},
717 which are described in
718 Section \refersec{chap:dynamictypeproperties}.
719 For relevant examples, see also Appendix \refersec{app:fortran90example}.
721 \section{ Structure, Union, Class and Interface Type Entries}
722 \label{chap:structureunionclassandinterfacetypeentries}
724 \textit{The languages
726 \addtoindex{C++}, and
727 \addtoindex{Pascal}, among others, allow the
728 programmer to define types that are collections of related
729 \addtoindexx{structure type entry}
731 In \addtoindex{C} and \addtoindex{C++}, these collections are called
732 \doublequote{structures.}
733 In \addtoindex{Pascal}, they are called \doublequote{records.}
734 The components may be of different types. The components are
735 called \doublequote{members} in \addtoindex{C} and
736 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
738 \textit{The components of these collections each exist in their
739 own space in computer memory. The components of a C or C++
740 \doublequote{union} all coexist in the same memory.}
742 \textit{\addtoindex{Pascal} and
743 other languages have a \doublequote{discriminated union,}
744 \addtoindex{discriminated union|see {variant entry}}
745 also called a \doublequote{variant record.} Here, selection of a
746 number of alternative substructures (\doublequote{variants}) is based
747 on the value of a component that is not part of any of those
748 substructures (the \doublequote{discriminant}).}
750 \textit{\addtoindex{C++} and
751 \addtoindex{Java} have the notion of ``class'', which is in some
752 ways similar to a structure. A class may have \doublequote{member
753 functions} which are subroutines that are within the scope
754 of a class or structure.}
756 \textit{The \addtoindex{C++} notion of
757 structure is more general than in \addtoindex{C}, being
758 equivalent to a class with minor differences. Accordingly,
759 in the following discussion statements about
760 \addtoindex{C++} classes may
761 be understood to apply to \addtoindex{C++} structures as well.}
763 \subsection{Structure, Union and Class Type Entries}
764 \label{chap:structureunionandclasstypeentries}
767 Structure, union, and class types are represented by debugging
768 \addtoindexx{structure type entry}
770 \addtoindexx{union type entry}
772 \addtoindexx{class type entry}
774 \livetarg{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type},
775 \livetarg{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type},
776 and \livetarg{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
777 respectively. If a name has been given to the structure,
778 union, or class in the source program, then the corresponding
779 structure type, union type, or class type entry has a
780 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
781 \addtoindexx{name attribute}
782 whose value is a null\dash terminated string
783 containing the type name as it appears in the source program.
785 The members of a structure, union, or class are represented
786 by debugging information entries that are owned by the
787 corresponding structure type, union type, or class type entry
788 and appear in the same order as the corresponding declarations
789 in the source program.
791 A structure type, union type or class type entry may have
792 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
793 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
794 \hypertarget{chap:DWATbitsizedatamemberbitsize}
795 (see Section \refersec{chap:byteandbitsizes}),
796 whose value is the amount of storage needed
797 to hold an instance of the structure, union or class type,
798 including any padding.
800 An incomplete structure, union or class type
801 \addtoindexx{incomplete structure/union/class}
803 \addtoindexx{incomplete type}
804 represented by a structure, union or class
805 entry that does not have a byte size attribute and that has
806 \addtoindexx{declaration attribute}
807 a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
809 If the complete declaration of a type has been placed in
810 \hypertarget{chap:DWATsignaturetypesignature}
811 a separate \addtoindex{type unit}
812 (see Section \refersec{chap:separatetypeunitentries}),
813 an incomplete declaration
814 \addtoindexx{incomplete type}
815 of that type in the compilation unit may provide
816 the unique 64\dash bit signature of the type using
817 \addtoindexx{type signature}
818 a \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature}
821 If a structure, union or class entry represents the definition
822 of a structure, class or union member corresponding to a prior
823 incomplete structure, class or union, the entry may have a
824 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
825 \addtoindexx{specification attribute}
826 whose value is a reference to
827 the debugging information entry representing that incomplete
830 Structure, union and class entries containing the
831 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
832 \addtoindexx{specification attribute}
833 do not need to duplicate
834 information provided by the declaration entry referenced by the
835 specification attribute. In particular, such entries do not
836 need to contain an attribute for the name of the structure,
837 class or union they represent if such information is already
838 provided in the declaration.
840 \textit{For \addtoindex{C} and \addtoindex{C++},
842 \addtoindexx{data member|see {member entry (data)}}
843 member declarations occurring within
844 the declaration of a structure, union or class type are
845 considered to be \doublequote{definitions} of those members, with
846 the exception of \doublequote{static} data members, whose definitions
847 appear outside of the declaration of the enclosing structure,
848 union or class type. Function member declarations appearing
849 within a structure, union or class type declaration are
850 definitions only if the body of the function also appears
851 within the type declaration.}
853 If the definition for a given member of the structure, union
854 or class does not appear within the body of the declaration,
855 that member also has a debugging information entry describing
856 its definition. That latter entry has a
857 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
858 \addtoindexx{specification attribute}
859 referencing the debugging information entry
860 owned by the body of the structure, union or class entry and
861 representing a non\dash defining declaration of the data, function
862 or type member. The referenced entry will not have information
863 about the location of that member (low and high pc attributes
864 for function members, location descriptions for data members)
865 and will have a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
867 \textit{Consider a nested class whose
868 definition occurs outside of the containing class definition, as in:}
870 \begin{lstlisting}[numbers=none]
877 \textit{The two different structs can be described in
878 different compilation units to
879 facilitate DWARF space compression
880 (see Appendix \refersec{app:usingcompilationunits}).}
882 \subsection{Interface Type Entries}
883 \label{chap:interfacetypeentries}
885 \textit{The \addtoindex{Java} language defines ``interface'' types.
887 \addtoindex{interface type entry}
888 in \addtoindex{Java} is similar to a \addtoindex{C++} or
889 \addtoindex{Java} class with only abstract
890 methods and constant data members.}
893 \addtoindexx{interface type entry}
894 are represented by debugging information
896 tag \livetarg{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}.
898 An interface type entry has
899 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
900 \addtoindexx{name attribute}
902 value is a null\dash terminated string containing the type name
903 as it appears in the source program.
905 The members of an interface are represented by debugging
906 information entries that are owned by the interface type
907 entry and that appear in the same order as the corresponding
908 declarations in the source program.
910 \subsection{Derived or Extended Structs, Classes and Interfaces}
911 \label{chap:derivedorextendedstructsclasesandinterfaces}
913 \textit{In \addtoindex{C++}, a class (or struct)
915 \addtoindexx{derived type (C++)|see{inheritance entry}}
916 be ``derived from'' or be a
917 ``subclass of'' another class.
918 In \addtoindex{Java}, an interface may ``extend''
919 \addtoindexx{extended type (Java)|see{inheritance entry}}
921 \addtoindexx{implementing type (Java)|see{inheritance entry}}
922 or more other interfaces, and a class may ``extend'' another
923 class and/or ``implement'' one or more interfaces. All of these
924 relationships may be described using the following. Note that
925 in \addtoindex{Java},
926 the distinction between extends and implements is
927 implied by the entities at the two ends of the relationship.}
929 A class type or interface type entry that describes a
930 derived, extended or implementing class or interface owns
931 \addtoindexx{implementing type (Java)|see{inheritance entry}}
932 debugging information entries describing each of the classes
933 or interfaces it is derived from, extending or implementing,
934 respectively, ordered as they were in the source program. Each
936 \addtoindexx{inheritance entry}
938 tag \livetarg{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}.
941 \addtoindexx{type attribute}
943 \addtoindexx{inheritance entry}
945 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is
946 a reference to the debugging information entry describing the
947 class or interface from which the parent class or structure
948 of the inheritance entry is derived, extended or implementing.
951 \addtoindexx{inheritance entry}
952 for a class that derives from or extends
953 \hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}
954 another class or struct also has
955 \addtoindexx{data member location attribute}
957 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
958 attribute, whose value describes the location of the beginning
959 of the inherited type relative to the beginning address of the
960 derived class. If that value is a constant, it is the offset
961 in bytes from the beginning of the class to the beginning of
962 the inherited type. Otherwise, the value must be a location
963 description. In this latter case, the beginning address of
964 the derived class is pushed on the expression stack before
965 the \addtoindex{location description}
966 is evaluated and the result of the
967 evaluation is the location of the inherited type.
969 \textit{The interpretation of the value of this attribute for
970 inherited types is the same as the interpretation for data
972 (see Section \refersec{chap:datamemberentries}). }
975 \addtoindexx{inheritance entry}
977 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}
979 \addtoindexx{accessibility attribute}
981 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
983 If no accessibility attribute
984 is present, private access is assumed for an entry of a class
985 and public access is assumed for an entry of an interface,
989 \hypertarget{chap:DWATvirtualityvirtualityofbaseclass}
990 the class referenced by the
991 \addtoindexx{inheritance entry}
992 inheritance entry serves
993 as a \addtoindex{C++} virtual base class, the inheritance entry has a
994 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
996 \textit{For a \addtoindex{C++} virtual base, the
997 \addtoindex{data member location attribute}
998 will usually consist of a non-trivial
999 \addtoindex{location description}.}
1001 \subsection{Access Declarations}
1002 \label{chap:accessdeclarations}
1004 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1005 \addtoindex{access declaration entry}
1006 change the accessibility of individual class members from the
1007 overall accessibility specified by the inheritance declaration.
1008 A single access declaration may refer to a set of overloaded
1011 If a derived class or structure contains access declarations,
1012 each such declaration may be represented by a debugging
1013 information entry with the tag
1014 \livetarg{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}.
1016 such entry is a child of the class or structure type entry.
1018 An access declaration entry has
1019 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1020 \addtoindexx{name attribute}
1022 value is a null\dash terminated string representing the name used
1023 in the declaration in the source program, including any class
1024 or structure qualifiers.
1026 An access declaration entry
1027 \hypertarget{chap:DWATaccessibilitycppbaseclasses}
1030 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1031 attribute describing the declared accessibility of the named
1035 \subsection{Friends}
1036 \label{chap:friends}
1039 \addtoindexx{friend entry}
1040 declared by a structure, union or class
1041 \hypertarget{chap:DWATfriendfriendrelationship}
1042 type may be represented by a debugging information entry
1043 that is a child of the structure, union or class type entry;
1044 the friend entry has the
1045 tag \livetarg{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}.
1048 \addtoindexx{friend attribute}
1049 a \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute, whose value is
1050 a reference to the debugging information entry describing
1051 the declaration of the friend.
1054 \subsection{Data Member Entries}
1055 \label{chap:datamemberentries}
1057 A data member (as opposed to a member function) is
1058 represented by a debugging information entry with the
1059 tag \livetarg{chap:DWTAGmember}{DW\-\_TAG\-\_member}.
1061 \addtoindexx{member entry (data)}
1062 member entry for a named member has
1063 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1064 \addtoindexx{name attribute}
1065 whose value is a null\dash terminated
1066 string containing the member name as it appears in the source
1067 program. If the member entry describes an
1068 \addtoindex{anonymous union},
1070 name attribute is omitted or consists of a single zero byte.
1072 The data member entry has
1073 \addtoindexx{type attribute}
1075 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote
1076 \addtoindexx{member entry (data)}
1077 the type of that member.
1079 A data member entry may
1080 \addtoindexx{accessibility attribute}
1082 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1083 attribute. If no accessibility attribute is present, private
1084 access is assumed for an entry of a class and public access
1085 is assumed for an entry of a structure, union, or interface.
1088 \hypertarget{chap:DWATmutablemutablepropertyofmemberdata}
1090 \addtoindexx{member entry (data)}
1092 \addtoindexx{mutable attribute}
1093 have a \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable} attribute,
1094 which is a \livelink{chap:flag}{flag}.
1095 This attribute indicates whether the data
1096 member was declared with the mutable storage class specifier.
1098 The beginning of a data member
1099 \addtoindex{beginning of a data member}
1100 is described relative to
1101 \addtoindexx{beginning of an object}
1102 the beginning of the object in which it is immediately
1103 contained. In general, the beginning is characterized by
1104 both an address and a bit offset within the byte at that
1105 address. When the storage for an entity includes all of
1106 the bits in the beginning byte, the beginning bit offset is
1109 Bit offsets in DWARF use the bit numbering and direction
1110 conventions that are appropriate to the current language on
1114 \addtoindexx{member entry (data)}
1115 corresponding to a data member that is
1116 \hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}
1118 \hypertarget{chap:DWATdatamemberlocationdatamemberlocation}
1119 in a structure, union or class may have either
1120 \addtoindexx{data member location attribute}
1122 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute or a
1123 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
1124 attribute. If the beginning of the data member is the same as
1125 the beginning of the containing entity then neither attribute
1129 For a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute
1130 \addtoindexx{data member location attribute}
1131 there are two cases:
1132 \begin{enumerate}[1.]
1133 \item If the value is an integer constant, it is the offset
1134 in bytes from the beginning of the containing entity. If
1135 the beginning of the containing entity has a non-zero bit
1136 offset then the beginning of the member entry has that same
1139 \item Otherwise, the value must be a \addtoindex{location description}.
1141 this case, the beginning of the containing entity must be byte
1142 aligned. The beginning address is pushed on the DWARF stack
1143 before the \addtoindex{location} description is evaluated; the result of
1144 the evaluation is the base address of the member entry.
1146 \textit{The push on the DWARF expression stack of the base address of
1147 the containing construct is equivalent to execution of the
1148 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} operation
1149 (see Section \refersec{chap:stackoperations});
1150 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} therefore
1151 is not needed at the
1152 beginning of a \addtoindex{location description} for a data member.
1154 result of the evaluation is a location--either an address or
1155 the name of a register, not an offset to the member.}
1157 \textit{A \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
1159 \addtoindexx{data member location attribute}
1160 that has the form of a
1161 \addtoindex{location description} is not valid for a data member contained
1162 in an entity that is not byte aligned because DWARF operations
1163 do not allow for manipulating or computing bit offsets.}
1167 For a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute,
1168 the value is an integer constant
1169 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1170 that specifies the number of bits
1171 from the beginning of the containing entity to the beginning
1172 of the data member. This value must be greater than or equal
1173 to zero, but is not limited to less than the number of bits
1176 If the size of a data member is not the same as the size
1177 of the type given for the data member, the data member has
1178 \addtoindexx{bit size attribute}
1179 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1180 or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose
1181 integer constant value
1182 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1184 of storage needed to hold the value of the data member.
1186 \textit{\addtoindex{C} and \addtoindex{C++}
1188 \addtoindex{bit fields}
1190 \addtoindexx{data bit offset}
1192 \addtoindexx{data bit size}
1194 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and
1195 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
1197 \textit{This Standard uses the following bit numbering and direction
1198 conventions in examples. These conventions are for illustrative
1199 purposes and other conventions may apply on particular
1204 \item \textit{For big\dash endian architectures, bit offsets are
1205 counted from high-order to low\dash order bits within a byte (or
1206 larger storage unit); in this case, the bit offset identifies
1207 the high\dash order bit of the object.}
1209 \item \textit{For little\dash endian architectures, bit offsets are
1210 counted from low\dash order to high\dash order bits within a byte (or
1211 larger storage unit); in this case, the bit offset identifies
1212 the low\dash order bit of the object.}
1216 \textit{In either case, the bit so identified is defined as the
1217 \addtoindexx{beginning of an object}
1218 beginning of the object.}
1220 \textit{For example, take one possible representation of the following
1221 \addtoindex{C} structure definition
1222 in both big\dash and little\dash endian byte orders:}
1233 \textit{Figures \referfol{fig:bigendiandatabitoffsets} and
1234 \refersec{fig:littleendiandatabitoffsets}
1235 show the structure layout
1236 and data bit offsets for example big\dash\ and little\dash endian
1237 architectures, respectively. Both diagrams show a structure
1238 that begins at address A and whose size is four bytes. Also,
1239 high order bits are to the left and low order bits are to
1249 Addresses increase ->
1250 | A | A + 1 | A + 2 | A + 3 |
1252 Data bit offsets increase ->
1253 +---------------+---------------+---------------+---------------+
1254 |0 4|5 10|11 15|16 23|24 31|
1255 | j | k | m | n | <pad> |
1257 +---------------------------------------------------------------+
1259 \caption{Big-endian data bit offsets}
1260 \label{fig:bigendiandatabitoffsets}
1269 <- Addresses increase
1270 | A | A + 1 | A + 2 | A + 3 |
1272 <- Data bit offsets increase
1273 +---------------+---------------+---------------+---------------+
1274 |31 24|23 16|15 11|10 5|4 0|
1275 | <pad> | n | m | k | j |
1277 +---------------------------------------------------------------+
1279 \caption{Little-endian data bit offsets}
1280 \label{fig:littleendiandatabitoffsets}
1283 \textit{Note that data member bit offsets in this example are the
1284 same for both big\dash\ and little\dash endian architectures even
1285 though the fields are allocated in different directions
1286 (high\dash order to low-order versus low\dash order to high\dash order);
1287 the bit naming conventions for memory and/or registers of
1288 the target architecture may or may not make this seem natural.}
1290 \textit{For a more extensive example showing nested and packed records
1292 Appendix \refersec{app:pascalexample}.}
1294 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
1296 \addtoindex{DWARF Version 4}
1297 and is also used for base types
1299 \refersec{chap:basetypeentries}).
1301 \livetarg{chap:DWATbitoffsetdatamemberbitlocation}
1302 attributes \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} and
1303 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} when used to
1304 identify the beginning of bit field data members as defined
1305 in DWARF V3 and earlier. The earlier attributes are defined
1306 in a manner suitable for bit field members on big-endian
1307 architectures but which is either awkward or incomplete for
1308 use on little-endian architectures.
1309 (\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} also
1310 has other uses that are not affected by this change.)}
1312 \textit{The \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
1313 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
1314 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1315 attribute combination is deprecated for data members in DWARF
1316 Version 4, but implementations may continue to support this
1317 use for compatibility.}
1320 \addtoindex{DWARF Version 3}
1321 definitions of these attributes are
1323 \begin{myindentpara}{1cm}
1324 \textit{If the data member entry describes a bit field, then that
1325 entry has the following attributes:}
1328 \item \textit{A \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1329 attribute whose value
1330 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1331 is the number of bytes that contain an instance of the
1332 bit field and any padding bits.}
1334 \textit{The byte size attribute may be omitted if the size of the
1335 object containing the bit field can be inferred from the type
1336 attribute of the data member containing the bit field.}
1338 \item \textit{A \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1340 \addtoindexx{bit offset attribute (V3)}
1342 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1343 is the number of bits to the left of the leftmost
1344 (most significant) bit of the bit field value.}
1346 \item \textit{A \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1348 \addtoindexx{bit size attribute (V3)}
1350 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1351 is the number of bits occupied by the bit field value.}
1356 \addtoindex{location description} for a bit field calculates the address
1357 of an anonymous object containing the bit field. The address
1358 is relative to the structure, union, or class that most closely
1359 encloses the bit field declaration. The number of bytes in this
1360 anonymous object is the value of the byte size attribute of
1361 the bit field. The offset (in bits) from the most significant
1362 bit of the anonymous object to the most significant bit of
1363 the bit field is the value of the bit offset attribute.}
1367 \textit{Diagrams similar to the above that show the use of the
1368 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
1369 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
1370 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute
1371 combination may be found in the
1372 \addtoindex{DWARF Version 3} Standard.}
1374 \textit{In comparing
1376 \addtoindexx{DWARF Version 3}
1378 \addtoindexx{DWARF Version 4}
1379 4, note that DWARF V4
1380 defines the following combinations of attributes:}
1383 \item \textit{either \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
1385 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
1386 (to specify the beginning of the data member)}
1388 % FIXME: the indentation of the following line is suspect.
1389 \textit{optionally together with}
1391 \item \textit{either \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1392 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} (to
1393 specify the size of the data member)}
1397 \textit{DWARF V3 defines the following combinations}
1400 \item \textit{\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
1401 (to specify the beginning
1402 of the data member, except this specification is only partial
1403 in the case of a bit field) }
1405 % FIXME: the indentation of the following line is suspect.
1406 \textit{optionally together with}
1408 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
1409 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
1410 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1411 (to further specify the beginning of a bit field data member
1412 as well as specify the size of the data member) }
1415 \subsection{Member Function Entries}
1416 \label{chap:memberfunctionentries}
1418 A member function is represented by a
1419 \addtoindexx{member function entry}
1420 debugging information entry
1422 \addtoindexx{subprogram entry!as member function}
1423 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1424 The member function entry
1425 may contain the same attributes and follows the same rules
1426 as non\dash member global subroutine entries
1427 (see Section \refersec{chap:subroutineandentrypointentries}).
1430 \addtoindexx{accessibility attribute}
1431 member function entry may have a
1432 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1433 attribute. If no accessibility attribute is present, private
1434 access is assumed for an entry of a class and public access
1435 is assumed for an entry of a structure, union or interface.
1438 \hypertarget{chap:DWATvirtualityvirtualityoffunction}
1439 the member function entry describes a virtual function,
1440 then that entry has a
1441 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
1444 \hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}
1445 the member function entry describes an explicit member
1446 function, then that entry has
1447 \addtoindexx{explicit attribute}
1449 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1452 \hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
1453 entry for a virtual function also has a
1454 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}
1455 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1456 a \addtoindex{location description}
1457 yielding the address of the slot
1458 for the function within the virtual function table for the
1459 enclosing class. The address of an object of the enclosing
1460 type is pushed onto the expression stack before the location
1461 description is evaluated.
1464 \hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
1465 the member function entry describes a non\dash static member
1466 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1467 function, then that entry
1468 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1470 \addtoindexx{object pointer attribute}
1471 a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1473 whose value is a reference to the formal parameter entry
1474 that corresponds to the object for which the function is
1475 called. The name attribute of that formal parameter is defined
1476 by the current language (for example,
1477 this for \addtoindex{C++} or self
1478 for \addtoindex{Objective C}
1479 and some other languages). That parameter
1480 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1482 Conversely, if the member function entry describes a static
1483 member function, the entry does not have
1484 \addtoindexx{object pointer attribute}
1486 \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1489 If the member function entry describes a non\dash static member
1490 function that has a const\dash volatile qualification, then
1491 the entry describes a non\dash static member function whose
1492 object formal parameter has a type that has an equivalent
1493 const\dash volatile qualification.
1495 If a subroutine entry represents the defining declaration
1496 of a member function and that definition appears outside of
1497 the body of the enclosing class declaration, the subroutine
1499 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute,
1500 \addtoindexx{specification attribute}
1502 a reference to the debugging information entry representing
1503 the declaration of this function member. The referenced entry
1504 will be a child of some class (or structure) type entry.
1506 Subroutine entries containing the
1507 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
1508 \addtoindexx{specification attribute}
1509 do not need to duplicate information provided
1510 by the declaration entry referenced by the specification
1511 attribute. In particular, such entries do not need to contain
1512 attributes for the name or return type of the function member
1513 whose definition they represent.
1515 \subsection{Class Template Instantiations}
1516 \label{chap:classtemplateinstantiations}
1518 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1519 type that may be instantiated when an instance of the class
1520 is declared or defined. The generic description of the
1521 class may include both parameterized types and parameterized
1522 constant values. DWARF does not represent the generic template
1523 definition, but does represent each instantiation.}
1525 A class template instantiation is represented by a
1526 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1527 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or
1528 \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1529 exceptions, such an entry will contain the same attributes
1530 and have the same types of child entries as would an entry
1531 for a class type defined explicitly using the instantiation
1532 types and values. The exceptions are:
1534 \begin{enumerate}[1.]
1535 \item Each formal parameterized type declaration appearing in the
1536 template definition is represented by a debugging information
1538 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1539 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1540 \addtoindexx{name attribute}
1542 a null\dash terminated string containing the name of the formal
1543 type parameter as it appears in the source program. The
1544 template type parameter entry also has
1545 \addtoindexx{type attribute}
1547 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1548 describing the actual type by which the formal is replaced
1549 for this instantiation.
1551 \item Each formal parameterized value declaration appearing in the
1552 template definition is represented by a
1553 debugging information entry with the
1554 \addtoindexx{template value parameter entry}
1555 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1557 such entry may have a
1558 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1559 \addtoindexx{name attribute}
1561 a null\dash terminated string containing the name of the formal
1562 value parameter as it appears in the source program.
1564 \hypertarget{chap:DWATconstvaluetemplatevalueparameter}
1565 template value parameter entry
1566 \addtoindexx{template value parameter entry}
1568 \addtoindexx{type attribute}
1570 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1571 describing the type of the parameterized value. Finally,
1572 the template value parameter entry has a
1573 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1574 attribute, whose value is the actual constant value of the
1575 value parameter for this instantiation as represented on the
1576 target architecture.
1578 \item The class type entry and each of its child entries references
1579 a \addtoindex{template type parameter entry} in any circumstance where the
1580 source template definition references a formal parameterized
1582 Similarly, the class type entry and each of its child
1583 entries references a template value parameter entry in any
1584 circumstance where the source template definition references
1585 a formal parameterized value.
1587 \item If the compiler has generated a special compilation unit to
1589 \addtoindexx{template instantiation!and special compilation unit}
1590 template instantiation and that special compilation
1591 unit has a different name from the compilation unit containing
1592 the template definition, the name attribute for the debugging
1593 information entry representing the special compilation unit
1594 should be empty or omitted.
1596 \item If the class type entry representing the template
1597 instantiation or any of its child entries contains declaration
1598 coordinate attributes, those attributes should refer to
1599 the source for the template definition, not to any source
1600 generated artificially by the compiler.
1604 \subsection{Variant Entries}
1605 \label{chap:variantentries}
1607 A variant part of a structure is represented by a debugging
1608 information entry\addtoindexx{variant part entry} with the
1609 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1610 owned by the corresponding structure type entry.
1612 If the variant part has a discriminant, the discriminant is
1613 \hypertarget{chap:DWATdiscrdiscriminantofvariantpart}
1615 \addtoindexx{discriminant (entry)}
1616 separate debugging information entry which
1617 is a child of the variant part entry. This entry has the form
1619 \addtoindexx{member entry (data)!as discriminant}
1620 structure data member entry. The variant part entry will
1621 \addtoindexx{discriminant attribute}
1623 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute
1624 whose value is a reference to
1625 the member entry for the discriminant.
1627 If the variant part does not have a discriminant (tag field),
1628 the variant part entry has
1629 \addtoindexx{type attribute}
1631 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1634 Each variant of a particular variant part is represented by
1635 \hypertarget{chap:DWATdiscrvaluediscriminantvalue}
1636 a debugging information entry\addtoindexx{variant entry} with the
1637 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1638 and is a child of the variant part entry. The value that
1639 selects a given variant may be represented in one of three
1640 ways. The variant entry may have a
1641 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1642 whose value represents a single case label. The value of this
1643 attribute is encoded as an LEB128 number. The number is signed
1644 if the tag type for the variant part containing this variant
1645 is a signed type. The number is unsigned if the tag type is
1649 \hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}
1650 the variant entry may contain
1651 \addtoindexx{discriminant list attribute}
1653 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1654 attribute, whose value represents a list of discriminant
1655 values. This list is represented by any of the
1656 \livelink{chap:block}{block} forms and
1657 may contain a mixture of case labels and label ranges. Each
1658 item on the list is prefixed with a discriminant value
1659 descriptor that determines whether the list item represents
1660 a single label or a label range. A single case label is
1661 represented as an LEB128 number as defined above for
1662 \addtoindexx{discriminant value attribute}
1664 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1665 attribute. A label range is represented by
1666 two LEB128 numbers, the low value of the range followed by the
1667 high value. Both values follow the rules for signedness just
1668 described. The discriminant value descriptor is an integer
1669 constant that may have one of the values given in
1670 Table \refersec{tab:discriminantdescriptorvalues}.
1672 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1673 \addtoindex{DW\-\_DSC\-\_label} \\
1674 \addtoindex{DW\-\_DSC\-\_range} \\
1675 \end{simplenametable}
1677 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1678 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1679 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1682 The components selected by a particular variant are represented
1683 by debugging information entries owned by the corresponding
1684 variant entry and appear in the same order as the corresponding
1685 declarations in the source program.
1687 \section{Condition Entries}
1688 \label{chap:conditionentries}
1690 \textit{COBOL has the notion of
1691 \addtoindexx{level-88 condition, COBOL}
1692 a ``level\dash 88 condition'' that
1693 associates a data item, called the conditional variable, with
1694 a set of one or more constant values and/or value ranges.
1695 Semantically, the condition is \textquoteleft true\textquoteright if the conditional
1696 variable's value matches any of the described constants,
1697 and the condition is \textquoteleft false\textquoteright otherwise.}
1699 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition}
1700 debugging information entry\addtoindexx{condition entry}
1702 logical condition that tests whether a given data item\textquoteright s
1703 value matches one of a set of constant values. If a name
1704 has been given to the condition, the condition entry has a
1705 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1706 \addtoindexx{name attribute}
1707 whose value is a null\dash terminated string
1708 giving the condition name as it appears in the source program.
1710 The condition entry's parent entry describes the conditional
1711 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1712 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or
1713 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry.
1715 \addtoindexx{formal parameter entry}
1717 entry has an array type, the condition can test any individual
1718 element, but not the array as a whole. The condition entry
1719 implicitly specifies a \doublequote{comparison type} that is the
1720 type of an array element if the parent has an array type;
1721 otherwise it is the type of the parent entry.
1723 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1724 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1725 values associated with the condition. If any child entry
1726 \addtoindexx{type attribute}
1728 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
1729 that attribute should describe a type
1730 compatible with the comparison type (according to the source
1731 language); otherwise the child\textquoteright s type is the same as the
1734 \textit{For conditional variables with alphanumeric types, COBOL
1735 permits a source program to provide ranges of alphanumeric
1736 constants in the condition. Normally a subrange type entry
1737 does not describe ranges of strings; however, this can be
1738 represented using bounds attributes that are references to
1739 constant entries describing strings. A subrange type entry may
1740 refer to constant entries that are siblings of the subrange
1744 \section{Enumeration Type Entries}
1745 \label{chap:enumerationtypeentries}
1747 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1748 a fixed number of symbolic values.}
1750 An enumeration type is represented by a debugging information
1752 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1754 If a name has been given to the enumeration type in the source
1755 program, then the corresponding enumeration type entry has
1756 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1757 \addtoindexx{name attribute}
1758 whose value is a null\dash terminated
1759 string containing the enumeration type name as it appears
1760 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1761 attribute whose integer constant value is the number of bytes
1762 required to hold an instance of the enumeration.
1764 The \addtoindex{enumeration type entry}
1766 \addtoindexx{type attribute}
1767 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1768 which refers to the underlying data type used to implement
1771 If an enumeration type has type safe
1772 \addtoindexx{type safe enumeration types}
1775 \begin{enumerate}[1.]
1776 \item Enumerators are contained in the scope of the enumeration type, and/or
1778 \item Enumerators are not implicitly converted to another type
1781 then the \addtoindex{enumeration type entry} may
1782 \addtoindexx{enum class|see{type-safe enumeration}}
1783 have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1784 attribute, which is a \livelink{chap:flag}{flag}.
1785 In a language that offers only
1786 one kind of enumeration declaration, this attribute is not
1789 \textit{In \addtoindex{C} or \addtoindex{C++},
1790 the underlying type will be the appropriate
1791 integral type determined by the compiler from the properties of
1792 \hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}
1793 the enumeration literal values.
1794 A \addtoindex{C++} type declaration written
1795 using enum class declares a strongly typed enumeration and
1796 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}
1797 in combination with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1799 Each enumeration literal is represented by a debugging
1800 \addtoindexx{enumeration literal|see{enumeration entry}}
1801 information entry with the
1802 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1804 such entry is a child of the
1805 \addtoindex{enumeration type entry}, and the
1806 enumerator entries appear in the same order as the declarations
1807 of the enumeration literals in the source program.
1809 Each \addtoindex{enumerator entry} has a
1810 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1811 \addtoindexx{name attribute}
1812 value is a null\dash terminated string containing the name of the
1813 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}
1814 enumeration literal as it appears in the source program.
1815 Each enumerator entry also has a
1816 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1817 whose value is the actual numeric value of the enumerator as
1818 represented on the target system.
1821 If the enumeration type occurs as the description of a
1822 \addtoindexx{enumeration type endry!as array dimension}
1823 dimension of an array type, and the stride for that dimension
1824 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}
1825 is different than what would otherwise be determined, then
1826 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}
1827 the enumeration type entry has either a
1828 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1829 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1830 \addtoindexx{bit stride attribute}
1831 which specifies the separation
1832 between successive elements along the dimension as described
1834 Section \refersec{chap:visibilityofdeclarations}.
1836 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1837 \addtoindexx{bit stride attribute}
1838 is interpreted as bits and the value of
1839 \addtoindexx{byte stride attribute}
1841 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1842 attribute is interpreted as bytes.
1845 \section{Subroutine Type Entries}
1846 \label{chap:subroutinetypeentries}
1848 \textit{It is possible in \addtoindex{C}
1849 to declare pointers to subroutines
1850 that return a value of a specific type. In both
1851 \addtoindex{C} and \addtoindex{C++},
1852 it is possible to declare pointers to subroutines that not
1853 only return a value of a specific type, but accept only
1854 arguments of specific types. The type of such pointers would
1855 be described with a ``pointer to'' modifier applied to a
1856 user\dash defined type.}
1858 A subroutine type is represented by a debugging information
1860 \addtoindexx{subroutine type entry}
1861 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1863 been given to the subroutine type in the source program,
1864 then the corresponding subroutine type entry has
1865 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1866 \addtoindexx{name attribute}
1867 whose value is a null\dash terminated string containing
1868 the subroutine type name as it appears in the source program.
1870 If the subroutine type describes a function that returns
1871 a value, then the subroutine type entry has
1872 \addtoindexx{type attribute}
1873 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1874 attribute to denote the type returned by the subroutine. If
1875 the types of the arguments are necessary to describe the
1876 subroutine type, then the corresponding subroutine type
1877 entry owns debugging information entries that describe the
1878 arguments. These debugging information entries appear in the
1879 order that the corresponding argument types appear in the
1882 \textit{In \addtoindex{C} there
1883 is a difference between the types of functions
1884 declared using function prototype style declarations and
1885 those declared using non\dash prototype declarations.}
1888 \hypertarget{chap:DWATprototypedsubroutineprototype}
1889 subroutine entry declared with a function prototype style
1890 declaration may have
1891 \addtoindexx{prototyped attribute}
1893 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1894 a \livelink{chap:flag}{flag}.
1896 Each debugging information entry owned by a subroutine
1897 type entry has a tag whose value has one of two possible
1900 \begin{enumerate}[1.]
1901 \item The formal parameters of a parameter list (that have a
1902 specific type) are represented by a debugging information entry
1903 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}.
1904 Each formal parameter
1906 \addtoindexx{type attribute}
1907 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1908 the formal parameter.
1910 \item The unspecified parameters of a variable parameter list
1911 \addtoindexx{unspecified parameters entry}
1913 \addtoindexx{... parameters|see{unspecified parameters entry}}
1914 represented by a debugging information entry with the
1915 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1920 \section{String Type Entries}
1921 \label{chap:stringtypeentries}
1923 \textit{A ``string'' is a sequence of characters that have specific
1924 \addtoindexx{string type entry}
1925 semantics and operations that separate them from arrays of
1927 \addtoindex{Fortran} is one of the languages that has a string
1928 type. Note that ``string'' in this context refers to a target
1929 machine concept, not the class string as used in this document
1930 (except for the name attribute).}
1932 A string type is represented by a debugging information entry
1933 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1934 If a name has been given to
1935 the string type in the source program, then the corresponding
1936 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1937 \addtoindexx{name attribute}
1939 a null\dash terminated string containing the string type name as
1940 it appears in the source program.
1943 \hypertarget{chap:DWATstringlengthstringlengthofstringtype}
1944 string type entry may have a
1945 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1947 \addtoindexx{string length attribute}
1949 \addtoindex{location description} yielding the location
1950 where the length of the string is stored in the program. The
1951 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1952 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1953 (see Section \refersec{chap:byteandbitsizes})
1954 is the size of the data to be retrieved from the location
1955 referenced by the string length attribute. If no (byte or bit)
1956 size attribute is present, the size of the data to be retrieved
1958 \addtoindex{size of an address} on the target machine.
1960 If no string length attribute is present, the string type
1961 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or
1962 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1963 attribute, whose value
1964 (see Section \refersec{chap:byteandbitsizes})
1966 storage needed to hold a value of the string type.
1969 \section{Set Type Entries}
1970 \label{chap:settypeentries}
1972 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1973 a group of values of ordinal type.}
1975 A set is represented by a debugging information entry with
1976 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1977 \addtoindexx{set type entry}
1978 If a name has been given to the
1979 set type, then the set type entry has
1980 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1981 \addtoindexx{name attribute}
1982 whose value is a null\dash terminated string containing the
1983 set type name as it appears in the source program.
1985 The set type entry has
1986 \addtoindexx{type attribute}
1987 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1988 type of an element of the set.
1990 If the amount of storage allocated to hold each element of an
1991 object of the given set type is different from the amount of
1992 storage that is normally allocated to hold an individual object
1993 of the indicated element type, then the set type entry has
1994 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or
1995 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1996 whose value (see Section \refersec{chap:byteandbitsizes}) is
1997 the amount of storage needed to hold a value of the set type.
2000 \section{Subrange Type Entries}
2001 \label{chap:subrangetypeentries}
2003 \textit{Several languages support the concept of a ``subrange''
2004 type object. These objects can represent a subset of the
2005 values that an object of the basis type for the subrange can
2007 Subrange type entries may also be used to represent
2008 the bounds of array dimensions.}
2010 A subrange type is represented by a debugging information
2012 \addtoindexx{subrange type entry}
2013 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
2015 given to the subrange type, then the subrange type entry
2016 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
2017 \addtoindexx{name attribute}
2018 whose value is a null\dash terminated
2019 string containing the subrange type name as it appears in
2022 The subrange entry may have
2023 \addtoindexx{type attribute}
2024 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
2025 the type of object, called the basis type, of whose values
2026 this subrange is a subset.
2028 If the amount of storage allocated to hold each element of an
2029 object of the given subrange type is different from the amount
2030 of storage that is normally allocated to hold an individual
2031 object of the indicated element type, then the subrange
2033 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or
2034 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
2035 attribute, whose value
2036 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2038 storage needed to hold a value of the subrange type.
2041 \hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
2042 subrange entry may have
2043 \addtoindexx{threads scaled attribute}
2045 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
2046 which is a \livelink{chap:flag}{flag}.
2047 If present, this attribute indicates whether
2048 this subrange represents a \addtoindex{UPC} array bound which is scaled
2049 by the runtime THREADS value (the number of UPC threads in
2050 this execution of the program).
2052 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
2054 \begin{lstlisting}[numbers=none]
2055 int shared foo[34*THREADS][10][20];
2059 \hypertarget{chap:DWATlowerboundlowerboundofsubrange}
2061 \hypertarget{chap:DWATupperboundupperboundofsubrange}
2062 entry may have the attributes
2063 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
2064 \addtoindexx{lower bound attribute}
2065 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2066 \addtoindexx{upper bound attribute} to specify, respectively, the lower
2067 and upper bound values of the subrange. The
2068 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2070 \hypertarget{chap:DWATcountelementsofsubrangetype}
2072 % FIXME: The following matches DWARF4: odd as there is no default count.
2073 \addtoindexx{count attribute!default}
2075 \addtoindexx{count attribute}
2077 \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute,
2079 value describes the number of elements in the subrange rather
2080 than the value of the last element. The value of each of
2081 these attributes is determined as described in
2082 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2084 If the lower bound value is missing, the value is assumed to
2085 be a language\dash dependent default constant.
2086 \addtoindexx{lower bound attribute!default}
2087 The default lower bound is 0 for
2088 \addtoindex{C}, \addtoindex{C++},
2091 \addtoindex{Objective C},
2092 \addtoindex{Objective C++},
2093 \addtoindex{Python}, and
2095 The default lower bound is 1 for
2096 \addtoindex{Ada}, \addtoindex{COBOL},
2097 \addtoindex{Fortran},
2098 \addtoindex{Modula-2},
2099 \addtoindex{Pascal} and
2102 \textit{No other default lower bound values are currently defined.}
2104 If the upper bound and count are missing, then the upper bound value is
2105 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
2107 If the subrange entry has no type attribute describing the
2108 basis type, the basis type is assumed to be the same as
2109 the object described by the lower bound attribute (if it
2110 references an object). If there is no lower bound attribute,
2111 or that attribute does not reference an object, the basis type
2112 is the type of the upper bound or \addtoindex{count attribute}
2114 of them references an object). If there is no upper bound or
2115 count attribute, or neither references an object, the type is
2116 assumed to be the same type, in the source language of the
2117 compilation unit containing the subrange entry, as a signed
2118 integer with the same size as an address on the target machine.
2120 If the subrange type occurs as the description of a dimension
2121 of an array type, and the stride for that dimension is
2122 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}
2123 different than what would otherwise be determined, then
2124 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}
2125 the subrange type entry has either
2126 \addtoindexx{byte stride attribute}
2128 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
2129 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
2130 \addtoindexx{bit stride attribute}
2131 which specifies the separation
2132 between successive elements along the dimension as described
2134 Section \refersec{chap:byteandbitsizes}.
2136 \textit{Note that the stride can be negative.}
2138 \section{Pointer to Member Type Entries}
2139 \label{chap:pointertomembertypeentries}
2141 \textit{In \addtoindex{C++}, a
2142 pointer to a data or function member of a class or
2143 structure is a unique type.}
2145 A debugging information entry representing the type of an
2146 object that is a pointer to a structure or class member has
2147 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
2149 If the \addtoindex{pointer to member type} has a name, the
2150 \addtoindexx{pointer to member type entry}
2151 pointer to member entry has a
2152 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2153 \addtoindexx{name attribute}
2155 null\dash terminated string containing the type name as it appears
2156 in the source program.
2158 The \addtoindex{pointer to member} entry
2160 \addtoindexx{type attribute}
2161 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
2162 describe the type of the class or structure member to which
2163 objects of this type may point.
2165 The \addtoindex{pointer to member} entry also
2166 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
2168 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
2169 attribute, whose value is a reference to a debugging
2170 information entry for the class or structure to whose members
2171 objects of this type may point.
2174 \hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}
2176 \addtoindex{pointer to member entry}
2178 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
2179 \addtoindexx{use location attribute}
2181 \addtoindex{location description} that computes the
2182 address of the member of the class to which the pointer to
2183 member entry points.
2185 \textit{The method used to find the address of a given member of a
2186 class or structure is common to any instance of that class
2187 or structure and to any instance of the pointer or member
2188 type. The method is thus associated with the type entry,
2189 rather than with each instance of the type.}
2191 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
2192 with the location descriptions for a particular object of the
2193 given \addtoindex{pointer to member type} and for a particular structure or
2194 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}
2195 attribute expects two values to be
2196 \addtoindexi{pushed}{address!implicit push for member operator}
2197 onto the DWARF expression stack before
2198 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated.
2200 \addtoindexi{pushed}{address!implicit push for member operator}
2201 is the value of the \addtoindex{pointer to member} object
2202 itself. The second value
2203 \addtoindexi{pushed}{address!implicit push for member operator}
2204 is the base address of the
2205 entire structure or union instance containing the member
2206 whose address is being calculated.
2208 \textit{For an expression such as}
2210 \begin{lstlisting}[numbers=none]
2213 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
2214 \textit{where mbr\_ptr has some \addtoindex{pointer to member type}, a debugger should:}
2216 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
2218 \textit{2. Push the base address of object onto the DWARF expression stack.}
2220 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
2221 given in the type of mbr\_ptr.}
2223 \section{File Type Entries}
2224 \label{chap:filetypeentries}
2226 \textit{Some languages, such as \addtoindex{Pascal},
2227 provide a data type to represent
2230 A file type is represented by a debugging information entry
2232 \addtoindexx{file type entry}
2234 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
2235 If the file type has a name,
2236 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2237 \addtoindexx{name attribute}
2239 is a null\dash terminated string containing the type name as it
2240 appears in the source program.
2242 The file type entry has
2243 \addtoindexx{type attribute}
2244 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
2245 the type of the objects contained in the file.
2247 The file type entry also
2248 \addtoindexx{byte size}
2250 \addtoindexx{bit size}
2252 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
2253 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
2254 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2255 is the amount of storage need to hold a value of the file type.
2257 \section{Dynamic Type Properties}
2258 \label{chap:dynamictypeproperties}
2259 \subsection{Data Location}
2260 \label{chap:datalocation}
2262 \textit{Some languages may represent objects using descriptors to hold
2263 information, including a location and/or run\dash time parameters,
2264 about the data that represents the value for that object.}
2266 \hypertarget{chap:DWATdatalocationindirectiontoactualdata}
2267 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2268 attribute may be used with any
2269 \addtoindexx{data location attribute}
2270 type that provides one or more levels of
2271 \addtoindexx{hidden indirection|see{data location attribute}}
2273 and/or run\dash time parameters in its representation. Its value
2274 is a \addtoindex{location description}.
2275 The result of evaluating this
2276 description yields the location of the data for an object.
2277 When this attribute is omitted, the address of the data is
2278 the same as the address of the object.
2280 \textit{This location description will typically begin with
2281 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
2282 which loads the address of the
2283 object which can then serve as a descriptor in subsequent
2284 calculation. For an example using
2285 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2286 for a \addtoindex{Fortran 90 array}, see
2287 Appendix \refersec{app:fortran90example}.}
2289 \subsection{Allocation and Association Status}
2290 \label{chap:allocationandassociationstatus}
2292 \textit{Some languages, such as \addtoindex{Fortran 90},
2293 provide types whose values
2294 may be dynamically allocated or associated with a variable
2295 under explicit program control.}
2297 \hypertarget{chap:DWATallocatedallocationstatusoftypes}
2299 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
2301 \addtoindexx{allocated attribute}
2302 may optionally be used with any
2303 type for which objects of the type can be explicitly allocated
2304 and deallocated. The presence of the attribute indicates that
2305 objects of the type are allocatable and deallocatable. The
2306 integer value of the attribute (see below) specifies whether
2307 an object of the type is
2308 currently allocated or not.
2310 \hypertarget{chap:DWATassociatedassociationstatusoftypes}
2312 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute
2314 \addtoindexx{associated attribute}
2315 optionally be used with
2316 any type for which objects of the type can be dynamically
2317 associated with other objects. The presence of the attribute
2318 indicates that objects of the type can be associated. The
2319 integer value of the attribute (see below) indicates whether
2320 an object of the type is currently associated or not.
2322 \textit{While these attributes are defined specifically with
2323 \addtoindex{Fortran 90} ALLOCATABLE and POINTER types
2324 in mind, usage is not limited
2325 to just that language.}
2327 The value of these attributes is determined as described in
2328 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2330 A non\dash zero value is interpreted as allocated or associated,
2331 and zero is interpreted as not allocated or not associated.
2333 \textit{For \addtoindex{Fortran 90},
2334 if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}
2335 attribute is present,
2336 the type has the POINTER property where either the parent
2337 variable is never associated with a dynamic object or the
2338 implementation does not track whether the associated object
2339 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
2340 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
2341 has the ALLOCATABLE property. If both attributes are present,
2342 then the type should be assumed to have the POINTER property
2343 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
2344 be used to indicate that the association status of the object
2345 resulted from execution of an ALLOCATE statement rather than
2346 pointer assignment.}
2348 \textit{For examples using
2349 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for \addtoindex{Ada} and
2350 \addtoindex{Fortran 90}
2352 see Appendix \refersec{app:aggregateexamples}.}
2356 \section{Template Alias Entries}
2357 \label{chap:templatealiasentries}
2359 A type named using a template alias is represented
2360 by a debugging information entry
2361 \addtoindexx{template alias entry}
2363 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
2364 The template alias entry has a
2365 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
2366 \addtoindexx{name attribute}
2367 whose value is a null\dash terminated string
2368 containing the name of the template alias as it appears in
2369 the source program. The template alias entry also contains
2370 \addtoindexx{type attribute}
2372 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
2373 whose value is a reference to the type
2374 named by the template alias.
2377 The template alias entry has the following child entries:
2378 \begin{enumerate}[1.]
2379 \item Each formal parameterized type declaration appearing
2380 in the template alias declaration is represented
2381 by a debugging information entry with the tag
2382 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}.
2383 Each such entry may have
2384 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2385 \addtoindexx{name attribute}
2386 whose value is a null\dash terminated
2387 string containing the name of the formal type parameter as it
2388 appears in the source program. The template type parameter
2390 \addtoindexx{type attribute}
2391 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
2392 describing the actual
2393 type by which the formal is replaced for this instantiation.
2395 \item Each formal parameterized value declaration
2396 appearing in the template alias declaration is
2397 represented by a debugging information entry with the tag
2398 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
2399 Each such entry may have
2400 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2401 \addtoindexx{name attribute}
2402 whose value is a null\dash terminated
2403 string containing the name of the formal value parameter
2404 as it appears in the source program. The template value
2405 parameter entry also has
2406 \addtoindexx{type attribute}
2407 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
2408 the type of the parameterized value. Finally, the template
2409 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
2410 attribute, whose value is the actual constant value of the value parameter for
2411 this instantiation as represented on the target architecture.