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.}
153 \addtoindexx{DWARF Version 3}
155 \addtoindexx{DWARF Version 4} and 4, note that DWARF V4
156 defines the following combinations of attributes:}
159 \item \textit{DW\-\_AT\-\_byte\-\_size}
160 \item \textit{DW\-\_AT\-\_bit\-\_size}
161 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
162 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
163 and optionally \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}}
165 \textit{DWARF V3 defines the following combinations:}
166 \addtoindexx{DWARF Version 3}
167 % FIXME: the figure below interferes with the following
168 % bullet list, which looks horrible as a result.
170 \item \textit{DW\-\_AT\-\_byte\-\_size}
171 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
172 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
173 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}}
177 \caption{Encoding attribute values}
178 \label{tab:encodingattributevalues}
180 \begin{tabular}{l|p{8cm}}
182 Name&Meaning\\ \hline
183 \livetarg{chap:DWATEaddress}{DW\-\_ATE\-\_address} & linear machine address (for segmented\break
185 Section \refersec{chap:segmentedaddresses}) \\
186 \livetarg{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}& true or false \\
188 \livetarg{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}& complex binary
189 floating\dash point number \\
190 \livetarg{chap:DWATEfloat}{DW\-\_ATE\-\_float} & binary floating\dash point number \\
191 \livetarg{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}& imaginary binary
192 floating\dash point number \\
193 \livetarg{chap:DWATEsigned}{DW\-\_ATE\-\_signed}& signed binary integer \\
194 \livetarg{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}& signed character \\
195 \livetarg{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned} & unsigned binary integer \\
196 \livetarg{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char} & unsigned character \\
197 \livetarg{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} & packed decimal \\
198 \livetarg{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}& numeric string \\
199 \livetarg{chap:DWATEedited}{DW\-\_ATE\-\_edited} & edited string \\
200 \livetarg{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} & signed fixed\dash point scaled integer \\
201 \livetarg{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}& unsigned fixed\dash point scaled integer \\
202 \livetarg{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & decimal floating\dash point number \\
203 \livetarg{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} & \addtoindex{Unicode} character \\
208 \textit{The \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} encoding is intended for
209 floating\dash point representations that have a power\dash of\dash ten
210 exponent, such as that specified in IEEE 754R.}
212 \textit{The \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} encoding is intended for \addtoindex{Unicode}
213 string encodings (see the Universal Character Set standard,
214 ISO/IEC 10646\dash 1:1993). For example, the
215 \addtoindex{C++} type char16\_t is
216 represented by a base type entry with a name attribute whose
217 value is \doublequote{char16\_t}, an encoding attribute whose value
218 is \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} and a byte size attribute whose value is 2.}
221 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
223 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}
225 represent packed and unpacked decimal string numeric data
226 types, respectively, either of which may be
228 \addtoindexx{decimal scale attribute}
230 \addtoindexx{decimal sign attribute}
232 \addtoindexx{digit count attribute}
234 \hypertarget{chap:DWATdecimalsigndecimalsignrepresentation}
236 \hypertarget{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
237 base types are used in combination with
238 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign},
239 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
240 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
243 A \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute
244 \addtoindexx{decimal sign attribute}
245 is an integer constant that
246 conveys the representation of the sign of the decimal type
247 (see Figure \refersec{tab:decimalsignattributevalues}).
248 Its integer constant value is interpreted to
249 mean that the type has a leading overpunch, trailing overpunch,
250 leading separate or trailing separate sign representation or,
251 alternatively, no sign at all.
254 \caption{Decimal sign attribute values}
255 \label{tab:decimalsignattributevalues}
257 \begin{tabular}{l|p{9cm}}
261 \livetarg{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & Unsigned \\
262 \livetarg{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & Sign
263 is encoded in the most significant digit in a target\dash dependent manner \\
264 \livetarg{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & Sign
265 is encoded in the least significant digit in a target\dash dependent manner \\
266 \livetarg{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate}
267 & Decimal type: Sign is a ``+'' or ``-'' character
268 to the left of the most significant digit. \\
269 \livetarg{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate}
270 & Decimal type: Sign is a ``+'' or ``-'' character
271 to the right of the least significant digit. \\
272 &Packed decimal type: Least significant nibble contains
273 a target\dash dependent value
274 indicating positive or negative. \\
280 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
282 \addtoindexx{digit count attribute}
283 is an integer constant
284 value that represents the number of digits in an instance of
287 \hypertarget{chap:DWATdecimalscaledecimalscalefactor}
288 The \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
290 \addtoindexx{decimal scale attribute}
291 is an integer constant value
292 that represents the exponent of the base ten scale factor to
293 be applied to an instance of the type. A scale of zero puts the
294 decimal point immediately to the right of the least significant
295 digit. Positive scale moves the decimal point to the right
296 and implies that additional zero digits on the right are not
297 stored in an instance of the type. Negative scale moves the
298 decimal point to the left; if the absolute value of the scale
299 is larger than the digit count, this implies additional zero
300 digits on the left are not stored in an instance of the type.
302 The \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}
304 \hypertarget{chap:DWATpicturestringpicturestringfornumericstringtype}
305 type is used to represent an edited
306 numeric or alphanumeric data type. It is used in combination
307 with an \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string} attribute whose value is a
308 null\dash terminated string containing the target\dash dependent picture
309 string associated with the type.
311 If the edited base type entry describes an edited numeric
312 data type, the edited type entry has a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and a
313 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute.
314 \addtoindexx{decimal scale attribute}
315 These attributes have the same
316 interpretation as described for the
317 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and
318 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base
319 types. If the edited type entry
320 describes an edited alphanumeric data type, the edited type
321 entry does not have these attributes.
324 \textit{The presence or absence of the \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
325 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attributes
326 \addtoindexx{decimal scale attribute}
327 allows a debugger to easily
328 distinguish edited numeric from edited alphanumeric, although
329 in principle the digit count and scale are derivable by
330 interpreting the picture string.}
332 The \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} and \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed} entries
333 describe signed and unsigned fixed\dash point binary data types,
336 The fixed binary type entries have
337 \addtoindexx{digit count attribute}
339 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
340 attribute with the same interpretation as described for the
341 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
343 For a data type with a decimal scale factor, the fixed binary
345 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute
346 \addtoindexx{decimal scale attribute}
348 interpretation as described for the
349 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
350 and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
352 \hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
353 For a data type with a binary scale factor, the fixed
354 \addtoindexx{binary scale attribute}
355 binary type entry has a
356 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute.
358 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute
359 is an integer constant value
360 that represents the exponent of the base two scale factor to
361 be applied to an instance of the type. Zero scale puts the
362 binary point immediately to the right of the least significant
363 bit. Positive scale moves the binary point to the right and
364 implies that additional zero bits on the right are not stored
365 in an instance of the type. Negative scale moves the binary
366 point to the left; if the absolute value of the scale is
367 larger than the number of bits, this implies additional zero
368 bits on the left are not stored in an instance of the type.
371 \hypertarget{chap:DWATsmallscalefactorforfixedpointtype}
372 a data type with a non\dash decimal and non\dash binary scale factor,
373 the fixed binary type entry has a
374 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute which
375 \addtoindexx{small attribute}
377 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The scale factor value
378 is interpreted in accordance with the value defined by the
379 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The value represented is the product
380 of the integer value in memory and the associated constant
383 \textit{The \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute
384 is defined with the \addtoindex{Ada} small
387 \section{Unspecified Type Entries}
388 \label{chap:unspecifiedtypeentries}
389 \addtoindexx{unspecified type entry}
390 \addtoindexx{void type|see{unspecified type entry}}
391 Some languages have constructs in which a type
392 may be left unspecified or the absence of a type
393 may be explicitly indicated.
395 An unspecified (implicit, unknown, ambiguous or nonexistent)
396 type is represented by a debugging information entry with
397 the tag \livetarg{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}.
398 If a name has been given
399 to the type, then the corresponding unspecified type entry
400 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
401 \addtoindexx{name attribute}
403 a null\dash terminated
404 string containing the name as it appears in the source program.
406 The interpretation of this debugging information entry is
407 intentionally left flexible to allow it to be interpreted
408 appropriately in different languages. For example, in
409 \addtoindex{C} and \addtoindex{C++}
410 the language implementation can provide an unspecified type
411 entry with the name \doublequote{void} which can be referenced by the
412 type attribute of pointer types and typedef declarations for
414 % FIXME: the following reference was wrong in DW4 so DavidA guessed
416 Sections \refersec{chap:unspecifiedtypeentries} and
417 %The following reference was valid, so the following is probably correct.
418 Section \refersec{chap:typedefentries},
419 respectively). As another
420 example, in \addtoindex{Ada} such an unspecified type entry can be referred
421 to by the type attribute of an access type where the denoted
422 \addtoindexx{incomplete type (Ada)}
423 type is incomplete (the name is declared as a type but the
424 definition is deferred to a separate compilation unit).
426 \section{Type Modifier Entries}
427 \label{chap:typemodifierentries}
428 \addtoindexx{type modifier entry}
430 A base or user\dash defined type may be modified in different ways
431 in different languages. A type modifier is represented in
432 DWARF by a debugging information entry with one of the tags
433 given in Table \refersec{tab:typemodifiertags}.
434 \addtoindexx{type modifier|see{constant type entry}}
435 \addtoindexx{type modifier|see{reference type entry}}
436 \addtoindexx{type modifier|see{restricted type entry}}
437 \addtoindexx{type modifier|see{packed type entry}}
438 \addtoindexx{type modifier|see{pointer type entry}}
439 \addtoindexx{type modifier|see{shared type entry}}
440 \addtoindexx{type modifier|see{volatile type entry}}
442 If a name has been given to the modified type in the source
443 program, then the corresponding modified type entry has
444 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
445 \addtoindexx{name attribute}
446 whose value is a null\dash terminated
447 string containing the modified type name as it appears in
450 Each of the type modifier entries has
451 \addtoindexx{type attribute}
453 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
454 whose value is a reference to a debugging information entry
455 describing a base type, a user-defined type or another type
458 A modified type entry describing a
459 \addtoindexx{pointer type entry}
460 pointer or \addtoindex{reference type}
461 (using \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
462 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type} or
463 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type})
464 % Another instance of no-good-place-to-put-index entry.
466 \addtoindexx{address class!attribute}
468 \hypertarget{chap:DWATadressclasspointerorreferencetypes}
470 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
471 attribute to describe how objects having the given pointer
472 or reference type ought to be dereferenced.
474 A modified type entry describing a shared qualified type
475 (using \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}) may have a
476 \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute
477 \addtoindexx{count attribute}
478 whose value is a constant expressing the blocksize of the
479 type. If no count attribute is present, then the \doublequote{infinite}
480 blocksize is assumed.
482 When multiple type modifiers are chained together to modify
483 a base or user-defined type, the tree ordering reflects the
485 \addtoindexx{reference type entry, lvalue|see{reference type entry}}
487 \addtoindexx{reference type entry, rvalue|see{rvalue reference type entry}}
489 \addtoindexx{parameter|see{macro formal parameter list}}
491 \addtoindexx{parameter|see{\textit{this} parameter}}
493 \addtoindexx{parameter|see{variable parameter attribute}}
495 \addtoindexx{parameter|see{optional parameter attribute}}
497 \addtoindexx{parameter|see{unspecified parameters entry}}
499 \addtoindexx{parameter|see{template value parameter entry}}
501 \addtoindexx{parameter|see{template type parameter entry}}
503 \addtoindexx{parameter|see{formal parameter entry}}
507 \caption{Type modifier tags}
508 \label{tab:typemodifiertags}
510 \begin{tabular}{l|p{9cm}}
512 Name&Meaning\\ \hline
513 \livetarg{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} & C or C++ const qualified type
514 \addtoindexx{const qualified type entry} \addtoindexx{C} \addtoindexx{C++} \\
515 \livetarg{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}& \addtoindex{Pascal} or Ada packed type\addtoindexx{packed type entry}
516 \addtoindexx{packed qualified type entry} \addtoindexx{Ada} \addtoindexx{Pascal} \\
517 \livetarg{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} & Pointer to an object of
518 the type being modified \addtoindexx{pointer qualified type entry} \\
519 \livetarg{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}& C++ (lvalue) reference
520 to an object of the type
521 \addtoindexx{reference type entry}
523 \addtoindexx{reference qualified type entry} \\
524 \livetarg{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}& \addtoindex{C}
526 \addtoindexx{restricted type entry}
528 \addtoindexx{restrict qualified type} \\
529 \livetarg{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} & C++
530 \addtoindexx{rvalue reference type entry}
532 \addtoindexx{restricted type entry}
533 reference to an object of the type being modified
534 \addtoindexx{rvalue reference qualified type entry} \\
535 \livetarg{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&\addtoindex{UPC} shared qualified type
536 \addtoindexx{shared qualified type entry} \\
537 \livetarg{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&C or C++ volatile qualified type
538 \addtoindex{volatile qualified type entry} \\
543 %The following clearpage prevents splitting the example across pages.
544 \textit{As examples of how type modifiers are ordered, consider the following
545 \addtoindex{C} declarations:}
546 \begin{lstlisting}[numbers=none]
547 const unsigned char * volatile p;
549 \textit{which represents a volatile pointer to a constant
550 character. This is encoded in DWARF as:}
554 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
555 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
556 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
557 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
558 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
562 \textit{On the other hand}
563 \begin{lstlisting}[numbers=none]
564 volatile unsigned char * const restrict p;
566 \textit{represents a restricted constant
567 pointer to a volatile character. This is encoded as:}
571 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
572 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type} -->
573 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
574 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
575 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
576 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
580 \section{Typedef Entries}
581 \label{chap:typedefentries}
582 A named type that is defined in terms of another type
583 definition is represented by a debugging information entry with
584 \addtoindexx{typedef entry}
585 the tag \livetarg{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}.
586 The typedef entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
587 \addtoindexx{name attribute}
588 whose value is a null\dash terminated string containing
589 the name of the typedef as it appears in the source program.
591 The typedef entry may also contain
592 \addtoindexx{type attribute}
594 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose
595 value is a reference to the type named by the typedef. If
596 the debugging information entry for a typedef represents
597 a declaration of the type that is not also a definition,
598 it does not contain a type attribute.
600 \textit{Depending on the language, a named type that is defined in
601 terms of another type may be called a type alias, a subtype,
602 a constrained type and other terms. A type name declared with
603 no defining details may be termed an
604 \addtoindexx{incomplete type}
605 incomplete, forward or hidden type.
606 While the DWARF \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef} entry was
607 originally inspired by the like named construct in
608 \addtoindex{C} and \addtoindex{C++},
609 it is broadly suitable for similar constructs (by whatever
610 source syntax) in other languages.}
612 \section{Array Type Entries}
613 \label{chap:arraytypeentries}
615 \textit{Many languages share the concept of an ``array,'' which is
616 \addtoindexx{array type entry}
617 a table of components of identical type.}
619 An array type is represented by a debugging information entry
620 with the tag \livetarg{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}.
621 If a name has been given to
622 \addtoindexx{array!declaration of type}
623 the array type in the source program, then the corresponding
624 array type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
625 \addtoindexx{name attribute}
627 null\dash terminated string containing the array type name as it
628 appears in the source program.
631 \hypertarget{chap:DWATorderingarrayrowcolumnordering}
632 array type entry describing a multidimensional array may
633 \addtoindexx{array!element ordering}
634 have a \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute whose integer constant value is
635 interpreted to mean either row-major or column-major ordering
636 of array elements. The set of values and their meanings
637 for the ordering attribute are listed in
638 Table \refersec{tab:arrayordering}.
640 ordering attribute is present, the default ordering for the
641 source language (which is indicated by the
642 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
644 \addtoindexx{language attribute}
645 of the enclosing compilation unit entry) is assumed.
647 \begin{simplenametable}[1.6in]{Array ordering}{tab:arrayordering}
648 \livetarg{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major} \\
649 \livetarg{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major} \\
650 \end{simplenametable}
652 The ordering attribute may optionally appear on one-dimensional
653 arrays; it will be ignored.
655 An array type entry has
656 \addtoindexx{type attribute}
657 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
659 \addtoindexx{array!element type}
660 the type of each element of the array.
662 If the amount of storage allocated to hold each element of an
663 object of the given array type is different from the amount
664 \addtoindexx{stride attribute|see{bit stride attribute or byte stride attribute}}
665 of storage that is normally allocated to hold an individual
666 \hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}
668 \hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}
669 indicated element type, then the array type
670 \addtoindexx{bit stride attribute}
672 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
674 \addtoindexx{byte stride attribute}
675 a \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
677 \addtoindexx{bit stride attribute}
679 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
681 element of the array.
683 The array type entry may have either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
684 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
685 (see Section \refersec{chap:byteandbitsizes}),
687 amount of storage needed to hold an instance of the array type.
689 \textit{If the size of the array can be determined statically at
690 compile time, this value can usually be computed by multiplying
691 the number of array elements by the size of each element.}
694 Each array dimension is described by a debugging information
695 entry with either the
696 \addtoindexx{subrange type entry!as array dimension}
697 tag \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} or the
698 \addtoindexx{enumeration type entry!as array dimension}
700 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}. These entries are
702 array type entry and are ordered to reflect the appearance of
703 the dimensions in the source program (i.e., leftmost dimension
704 first, next to leftmost second, and so on).
706 \textit{In languages, such as C, in which there is no concept of
707 a \doublequote{multidimensional array}, an array of arrays may
708 be represented by a debugging information entry for a
709 multidimensional array.}
711 Other attributes especially applicable to arrays are
712 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated},
713 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} and
714 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location},
715 which are described in
716 Section \refersec{chap:dynamictypeproperties}.
717 For relevant examples, see also Appendix \refersec{app:fortran90example}.
719 \section{ Structure, Union, Class and Interface Type Entries}
720 \label{chap:structureunionclassandinterfacetypeentries}
722 \textit{The languages
724 \addtoindex{C++}, and
725 \addtoindex{Pascal}, among others, allow the
726 programmer to define types that are collections of related
727 \addtoindexx{structure type entry}
729 In \addtoindex{C} and \addtoindex{C++}, these collections are called
730 \doublequote{structures.}
731 In \addtoindex{Pascal}, they are called \doublequote{records.}
732 The components may be of different types. The components are
733 called \doublequote{members} in \addtoindex{C} and
734 \addtoindex{C++}, and \doublequote{fields} in \addtoindex{Pascal}.}
736 \textit{The components of these collections each exist in their
737 own space in computer memory. The components of a C or C++
738 \doublequote{union} all coexist in the same memory.}
740 \textit{\addtoindex{Pascal} and
741 other languages have a \doublequote{discriminated union,}
742 \addtoindex{discriminated union|see {variant entry}}
743 also called a \doublequote{variant record.} Here, selection of a
744 number of alternative substructures (\doublequote{variants}) is based
745 on the value of a component that is not part of any of those
746 substructures (the \doublequote{discriminant}).}
748 \textit{\addtoindex{C++} and
749 \addtoindex{Java} have the notion of ``class'', which is in some
750 ways similar to a structure. A class may have \doublequote{member
751 functions} which are subroutines that are within the scope
752 of a class or structure.}
754 \textit{The \addtoindex{C++} notion of
755 structure is more general than in \addtoindex{C}, being
756 equivalent to a class with minor differences. Accordingly,
757 in the following discussion statements about
758 \addtoindex{C++} classes may
759 be understood to apply to \addtoindex{C++} structures as well.}
761 \subsection{Structure, Union and Class Type Entries}
762 \label{chap:structureunionandclasstypeentries}
765 Structure, union, and class types are represented by debugging
766 \addtoindexx{structure type entry}
768 \addtoindexx{union type entry}
770 \addtoindexx{class type entry}
772 \livetarg{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type},
773 \livetarg{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type},
774 and \livetarg{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
775 respectively. If a name has been given to the structure,
776 union, or class in the source program, then the corresponding
777 structure type, union type, or class type entry has a
778 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
779 \addtoindexx{name attribute}
780 whose value is a null\dash terminated string
781 containing the type name as it appears in the source program.
783 The members of a structure, union, or class are represented
784 by debugging information entries that are owned by the
785 corresponding structure type, union type, or class type entry
786 and appear in the same order as the corresponding declarations
787 in the source program.
789 A structure type, union type or class type entry may have
790 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
791 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
792 \hypertarget{chap:DWATbitsizedatamemberbitsize}
793 (see Section \refersec{chap:byteandbitsizes}),
794 whose value is the amount of storage needed
795 to hold an instance of the structure, union or class type,
796 including any padding.
798 An incomplete structure, union or class type
799 \addtoindexx{incomplete structure/union/class}
801 \addtoindexx{incomplete type}
802 represented by a structure, union or class
803 entry that does not have a byte size attribute and that has
804 \addtoindexx{declaration attribute}
805 a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
807 If the complete declaration of a type has been placed in
808 \hypertarget{chap:DWATsignaturetypesignature}
809 a separate \addtoindex{type unit}
810 (see Section \refersec{chap:separatetypeunitentries}),
811 an incomplete declaration
812 \addtoindexx{incomplete type}
813 of that type in the compilation unit may provide
814 the unique 64\dash bit signature of the type using
815 \addtoindexx{type signature}
816 a \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature}
819 If a structure, union or class entry represents the definition
820 of a structure, class or union member corresponding to a prior
821 incomplete structure, class or union, the entry may have a
822 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
823 \addtoindexx{specification attribute}
824 whose value is a reference to
825 the debugging information entry representing that incomplete
828 Structure, union and class entries containing the
829 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
830 \addtoindexx{specification attribute}
831 do not need to duplicate
832 information provided by the declaration entry referenced by the
833 specification attribute. In particular, such entries do not
834 need to contain an attribute for the name of the structure,
835 class or union they represent if such information is already
836 provided in the declaration.
838 \textit{For \addtoindex{C} and \addtoindex{C++},
840 \addtoindexx{data member|see {member entry (data)}}
841 member declarations occurring within
842 the declaration of a structure, union or class type are
843 considered to be \doublequote{definitions} of those members, with
844 the exception of \doublequote{static} data members, whose definitions
845 appear outside of the declaration of the enclosing structure,
846 union or class type. Function member declarations appearing
847 within a structure, union or class type declaration are
848 definitions only if the body of the function also appears
849 within the type declaration.}
851 If the definition for a given member of the structure, union
852 or class does not appear within the body of the declaration,
853 that member also has a debugging information entry describing
854 its definition. That latter entry has a
855 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
856 \addtoindexx{specification attribute}
857 referencing the debugging information entry
858 owned by the body of the structure, union or class entry and
859 representing a non\dash defining declaration of the data, function
860 or type member. The referenced entry will not have information
861 about the location of that member (low and high pc attributes
862 for function members, location descriptions for data members)
863 and will have a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
865 \textit{Consider a nested class whose
866 definition occurs outside of the containing class definition, as in:}
868 \begin{lstlisting}[numbers=none]
875 \textit{The two different structs can be described in
876 different compilation units to
877 facilitate DWARF space compression
878 (see Appendix \refersec{app:usingcompilationunits}).}
880 \subsection{Interface Type Entries}
881 \label{chap:interfacetypeentries}
883 \textit{The \addtoindex{Java} language defines ``interface'' types.
885 \addtoindex{interface type entry}
886 in \addtoindex{Java} is similar to a \addtoindex{C++} or
887 \addtoindex{Java} class with only abstract
888 methods and constant data members.}
891 \addtoindexx{interface type entry}
892 are represented by debugging information
894 tag \livetarg{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}.
896 An interface type entry has
897 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
898 \addtoindexx{name attribute}
900 value is a null\dash terminated string containing the type name
901 as it appears in the source program.
903 The members of an interface are represented by debugging
904 information entries that are owned by the interface type
905 entry and that appear in the same order as the corresponding
906 declarations in the source program.
908 \subsection{Derived or Extended Structs, Classes and Interfaces}
909 \label{chap:derivedorextendedstructsclasesandinterfaces}
911 \textit{In \addtoindex{C++}, a class (or struct)
913 \addtoindexx{derived type (C++)|see{inheritance entry}}
914 be ``derived from'' or be a
915 ``subclass of'' another class.
916 In \addtoindex{Java}, an interface may ``extend''
917 \addtoindexx{extended type (Java)|see{inheritance entry}}
919 \addtoindexx{implementing type (Java)|see{inheritance entry}}
920 or more other interfaces, and a class may ``extend'' another
921 class and/or ``implement'' one or more interfaces. All of these
922 relationships may be described using the following. Note that
923 in \addtoindex{Java},
924 the distinction between extends and implements is
925 implied by the entities at the two ends of the relationship.}
927 A class type or interface type entry that describes a
928 derived, extended or implementing class or interface owns
929 \addtoindexx{implementing type (Java)|see{inheritance entry}}
930 debugging information entries describing each of the classes
931 or interfaces it is derived from, extending or implementing,
932 respectively, ordered as they were in the source program. Each
934 \addtoindexx{inheritance entry}
936 tag \livetarg{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}.
939 \addtoindexx{type attribute}
941 \addtoindexx{inheritance entry}
943 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is
944 a reference to the debugging information entry describing the
945 class or interface from which the parent class or structure
946 of the inheritance entry is derived, extended or implementing.
949 \addtoindexx{inheritance entry}
950 for a class that derives from or extends
951 \hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}
952 another class or struct also has
953 \addtoindexx{data member location attribute}
955 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
956 attribute, whose value describes the location of the beginning
957 of the inherited type relative to the beginning address of the
958 derived class. If that value is a constant, it is the offset
959 in bytes from the beginning of the class to the beginning of
960 the inherited type. Otherwise, the value must be a location
961 description. In this latter case, the beginning address of
962 the derived class is pushed on the expression stack before
963 the \addtoindex{location description}
964 is evaluated and the result of the
965 evaluation is the location of the inherited type.
967 \textit{The interpretation of the value of this attribute for
968 inherited types is the same as the interpretation for data
970 (see Section \refersec{chap:datamemberentries}). }
973 \addtoindexx{inheritance entry}
975 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}
977 \addtoindexx{accessibility attribute}
979 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
981 If no accessibility attribute
982 is present, private access is assumed for an entry of a class
983 and public access is assumed for an entry of an interface,
987 \hypertarget{chap:DWATvirtualityvirtualityofbaseclass}
988 the class referenced by the
989 \addtoindexx{inheritance entry}
990 inheritance entry serves
991 as a \addtoindex{C++} virtual base class, the inheritance entry has a
992 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
994 \textit{For a \addtoindex{C++} virtual base, the
995 \addtoindex{data member location attribute}
996 will usually consist of a non-trivial
997 \addtoindex{location description}.}
999 \subsection{Access Declarations}
1000 \label{chap:accessdeclarations}
1002 \textit{In \addtoindex{C++}, a derived class may contain access declarations that
1003 \addtoindex{access declaration entry}
1004 change the accessibility of individual class members from the
1005 overall accessibility specified by the inheritance declaration.
1006 A single access declaration may refer to a set of overloaded
1009 If a derived class or structure contains access declarations,
1010 each such declaration may be represented by a debugging
1011 information entry with the tag
1012 \livetarg{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}.
1014 such entry is a child of the class or structure type entry.
1016 An access declaration entry has
1017 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1018 \addtoindexx{name attribute}
1020 value is a null\dash terminated string representing the name used
1021 in the declaration in the source program, including any class
1022 or structure qualifiers.
1024 An access declaration entry
1025 \hypertarget{chap:DWATaccessibilitycppbaseclasses}
1028 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1029 attribute describing the declared accessibility of the named
1033 \subsection{Friends}
1034 \label{chap:friends}
1037 \addtoindexx{friend entry}
1038 declared by a structure, union or class
1039 \hypertarget{chap:DWATfriendfriendrelationship}
1040 type may be represented by a debugging information entry
1041 that is a child of the structure, union or class type entry;
1042 the friend entry has the
1043 tag \livetarg{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}.
1046 \addtoindexx{friend attribute}
1047 a \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute, whose value is
1048 a reference to the debugging information entry describing
1049 the declaration of the friend.
1052 \subsection{Data Member Entries}
1053 \label{chap:datamemberentries}
1055 A data member (as opposed to a member function) is
1056 represented by a debugging information entry with the
1057 tag \livetarg{chap:DWTAGmember}{DW\-\_TAG\-\_member}.
1059 \addtoindexx{member entry (data)}
1060 member entry for a named member has
1061 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1062 \addtoindexx{name attribute}
1063 whose value is a null\dash terminated
1064 string containing the member name as it appears in the source
1065 program. If the member entry describes an
1066 \addtoindex{anonymous union},
1068 name attribute is omitted or consists of a single zero byte.
1070 The data member entry has
1071 \addtoindexx{type attribute}
1073 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote
1074 \addtoindexx{member entry (data)}
1075 the type of that member.
1077 A data member entry may
1078 \addtoindexx{accessibility attribute}
1080 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1081 attribute. If no accessibility attribute is present, private
1082 access is assumed for an entry of a class and public access
1083 is assumed for an entry of a structure, union, or interface.
1086 \hypertarget{chap:DWATmutablemutablepropertyofmemberdata}
1088 \addtoindexx{member entry (data)}
1090 \addtoindexx{mutable attribute}
1091 have a \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable} attribute,
1092 which is a \livelink{chap:flag}{flag}.
1093 This attribute indicates whether the data
1094 member was declared with the mutable storage class specifier.
1096 The beginning of a data member
1097 \addtoindex{beginning of a data member}
1098 is described relative to
1099 \addtoindexx{beginning of an object}
1100 the beginning of the object in which it is immediately
1101 contained. In general, the beginning is characterized by
1102 both an address and a bit offset within the byte at that
1103 address. When the storage for an entity includes all of
1104 the bits in the beginning byte, the beginning bit offset is
1107 Bit offsets in DWARF use the bit numbering and direction
1108 conventions that are appropriate to the current language on
1112 \addtoindexx{member entry (data)}
1113 corresponding to a data member that is
1114 \hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}
1116 \hypertarget{chap:DWATdatamemberlocationdatamemberlocation}
1117 in a structure, union or class may have either
1118 \addtoindexx{data member location attribute}
1120 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute or a
1121 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
1122 attribute. If the beginning of the data member is the same as
1123 the beginning of the containing entity then neither attribute
1126 For a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute
1127 \addtoindexx{data member location attribute}
1128 there are two cases:
1130 \begin{enumerate}[1.]
1132 \item If the value is an integer constant, it is the offset
1133 in bytes from the beginning of the containing entity. If
1134 the beginning of the containing entity has a non-zero bit
1135 offset then the beginning of the member entry has that same
1138 \item Otherwise, the value must be a \addtoindex{location description}.
1140 this case, the beginning of the containing entity must be byte
1141 aligned. The beginning address is pushed on the DWARF stack
1142 before the \addtoindex{location} description is evaluated; the result of
1143 the evaluation is the base address of the member entry.
1145 \textit{The push on the DWARF expression stack of the base address of
1146 the containing construct is equivalent to execution of the
1147 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} operation
1148 (see Section \refersec{chap:stackoperations});
1149 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} therefore
1150 is not needed at the
1151 beginning of a \addtoindex{location description} for a data member.
1153 result of the evaluation is a location--either an address or
1154 the name of a register, not an offset to the member.}
1156 \textit{A \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
1158 \addtoindexx{data member location attribute}
1159 that has the form of a
1160 \addtoindex{location description} is not valid for a data member contained
1161 in an entity that is not byte aligned because DWARF operations
1162 do not allow for manipulating or computing bit offsets.}
1166 For a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute,
1167 the value is an integer constant
1168 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1169 that specifies the number of bits
1170 from the beginning of the containing entity to the beginning
1171 of the data member. This value must be greater than or equal
1172 to zero, but is not limited to less than the number of bits
1175 If the size of a data member is not the same as the size
1176 of the type given for the data member, the data member has
1177 \addtoindexx{bit size attribute}
1178 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1179 or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose
1180 integer constant value
1181 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1183 of storage needed to hold the value of the data member.
1185 \textit{\addtoindex{C} and \addtoindex{C++}
1187 \addtoindex{bit fields}
1189 \addtoindexx{data bit offset}
1191 \addtoindexx{data bit size}
1193 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and
1194 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
1196 \textit{This Standard uses the following bit numbering and direction
1197 conventions in examples. These conventions are for illustrative
1198 purposes and other conventions may apply on particular
1203 \item \textit{For big\dash endian architectures, bit offsets are
1204 counted from high-order to low\dash order bits within a byte (or
1205 larger storage unit); in this case, the bit offset identifies
1206 the high\dash order bit of the object.}
1208 \item \textit{For little\dash endian architectures, bit offsets are
1209 counted from low\dash order to high\dash order bits within a byte (or
1210 larger storage unit); in this case, the bit offset identifies
1211 the low\dash order bit of the object.}
1215 \textit{In either case, the bit so identified is defined as the
1216 \addtoindexx{beginning of an object}
1217 beginning of the object.}
1219 \textit{For example, take one possible representation of the following
1220 \addtoindex{C} structure definition
1221 in both big\dash and little\dash endian byte orders:}
1232 \textit{Figures \referfol{fig:bigendiandatabitoffsets} and
1233 \refersec{fig:littleendiandatabitoffsets}
1234 show the structure layout
1235 and data bit offsets for example big\dash\ and little\dash endian
1236 architectures, respectively. Both diagrams show a structure
1237 that begins at address A and whose size is four bytes. Also,
1238 high order bits are to the left and low order bits are to
1248 Addresses increase ->
1249 | A | A + 1 | A + 2 | A + 3 |
1251 Data bit offsets increase ->
1252 +---------------+---------------+---------------+---------------+
1253 |0 4|5 10|11 15|16 23|24 31|
1254 | j | k | m | n | <pad> |
1256 +---------------------------------------------------------------+
1258 \caption{Big-endian data bit offsets}
1259 \label{fig:bigendiandatabitoffsets}
1268 <- Addresses increase
1269 | A | A + 1 | A + 2 | A + 3 |
1271 <- Data bit offsets increase
1272 +---------------+---------------+---------------+---------------+
1273 |31 24|23 16|15 11|10 5|4 0|
1274 | <pad> | n | m | k | j |
1276 +---------------------------------------------------------------+
1278 \caption{Little-endian data bit offsets}
1279 \label{fig:littleendiandatabitoffsets}
1282 \textit{Note that data member bit offsets in this example are the
1283 same for both big\dash\ and little\dash endian architectures even
1284 though the fields are allocated in different directions
1285 (high\dash order to low-order versus low\dash order to high\dash order);
1286 the bit naming conventions for memory and/or registers of
1287 the target architecture may or may not make this seem natural.}
1289 \textit{For a more extensive example showing nested and packed records
1291 Appendix \refersec{app:pascalexample}.}
1293 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
1295 \addtoindex{DWARF Version 4}
1296 and is also used for base types
1298 \refersec{chap:basetypeentries}).
1300 \livetarg{chap:DWATbitoffsetdatamemberbitlocation}
1301 attributes \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} and
1302 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} when used to
1303 identify the beginning of bit field data members as defined
1304 in DWARF V3 and earlier. The earlier attributes are defined
1305 in a manner suitable for bit field members on big-endian
1306 architectures but which is either awkward or incomplete for
1307 use on little-endian architectures.
1308 (\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} also
1309 has other uses that are not affected by this change.)}
1311 \textit{The \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
1312 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
1313 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1314 attribute combination is deprecated for data members in DWARF
1315 Version 4, but implementations may continue to support this
1316 use for compatibility.}
1319 \addtoindex{DWARF Version 3}
1320 definitions of these attributes are
1322 \begin{myindentpara}{1cm}
1323 \textit{If the data member entry describes a bit field, then that
1324 entry has the following attributes:}
1327 \item \textit{A \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1328 attribute whose value
1329 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1330 is the number of bytes that contain an instance of the
1331 bit field and any padding bits.}
1333 \textit{The byte size attribute may be omitted if the size of the
1334 object containing the bit field can be inferred from the type
1335 attribute of the data member containing the bit field.}
1337 \item \textit{A \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1339 \addtoindexx{bit offset attribute (V3)}
1341 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1342 is the number of bits to the left of the leftmost
1343 (most significant) bit of the bit field value.}
1345 \item \textit{A \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1347 \addtoindexx{bit size attribute (V3)}
1349 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1350 is the number of bits occupied by the bit field value.}
1355 \addtoindex{location description} for a bit field calculates the address
1356 of an anonymous object containing the bit field. The address
1357 is relative to the structure, union, or class that most closely
1358 encloses the bit field declaration. The number of bytes in this
1359 anonymous object is the value of the byte size attribute of
1360 the bit field. The offset (in bits) from the most significant
1361 bit of the anonymous object to the most significant bit of
1362 the bit field is the value of the bit offset attribute.}
1366 \textit{Diagrams similar to the above that show the use of the
1367 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
1368 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
1369 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute
1370 combination may be found in the
1371 \addtoindex{DWARF Version 3} Standard.}
1373 \textit{In comparing
1375 \addtoindexx{DWARF Version 3}
1377 \addtoindexx{DWARF Version 4}
1378 4, note that DWARF V4
1379 defines the following combinations of attributes:}
1382 \item \textit{either \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
1384 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
1385 (to specify the beginning of the data member)}
1387 % FIXME: the indentation of the following line is suspect.
1388 \textit{optionally together with}
1390 \item \textit{either \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1391 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} (to
1392 specify the size of the data member)}
1396 \textit{DWARF V3 defines the following combinations}
1399 \item \textit{\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
1400 (to specify the beginning
1401 of the data member, except this specification is only partial
1402 in the case of a bit field) }
1404 % FIXME: the indentation of the following line is suspect.
1405 \textit{optionally together with}
1407 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
1408 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
1409 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1410 (to further specify the beginning of a bit field data member
1411 as well as specify the size of the data member) }
1414 \subsection{Member Function Entries}
1415 \label{chap:memberfunctionentries}
1417 A member function is represented by a
1418 \addtoindexx{member function entry}
1419 debugging information entry
1421 \addtoindexx{subprogram entry!as member function}
1422 tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}.
1423 The member function entry
1424 may contain the same attributes and follows the same rules
1425 as non\dash member global subroutine entries
1426 (see Section \refersec{chap:subroutineandentrypointentries}).
1429 \addtoindexx{accessibility attribute}
1430 member function entry may have a
1431 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1432 attribute. If no accessibility attribute is present, private
1433 access is assumed for an entry of a class and public access
1434 is assumed for an entry of a structure, union or interface.
1437 \hypertarget{chap:DWATvirtualityvirtualityoffunction}
1438 the member function entry describes a virtual function,
1439 then that entry has a
1440 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
1443 \hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}
1444 the member function entry describes an explicit member
1445 function, then that entry has
1446 \addtoindexx{explicit attribute}
1448 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1451 \hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
1452 entry for a virtual function also has a
1453 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}
1454 \addtoindexi{attribute}{vtable element location attribute} whose value contains
1455 a \addtoindex{location description}
1456 yielding the address of the slot
1457 for the function within the virtual function table for the
1458 enclosing class. The address of an object of the enclosing
1459 type is pushed onto the expression stack before the location
1460 description is evaluated.
1463 \hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
1464 the member function entry describes a non\dash static member
1465 \addtoindexx{this pointer attribute|see{object pointer attribute}}
1466 function, then that entry
1467 \addtoindexx{self pointer attribute|see{object pointer attribute}}
1469 \addtoindexx{object pointer attribute}
1470 a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1472 whose value is a reference to the formal parameter entry
1473 that corresponds to the object for which the function is
1474 called. The name attribute of that formal parameter is defined
1475 by the current language (for example,
1476 this for \addtoindex{C++} or self
1477 for \addtoindex{Objective C}
1478 and some other languages). That parameter
1479 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1481 Conversely, if the member function entry describes a static
1482 member function, the entry does not have
1483 \addtoindexx{object pointer attribute}
1485 \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1488 If the member function entry describes a non\dash static member
1489 function that has a const\dash volatile qualification, then
1490 the entry describes a non\dash static member function whose
1491 object formal parameter has a type that has an equivalent
1492 const\dash volatile qualification.
1494 If a subroutine entry represents the defining declaration
1495 of a member function and that definition appears outside of
1496 the body of the enclosing class declaration, the subroutine
1498 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute,
1499 \addtoindexx{specification attribute}
1501 a reference to the debugging information entry representing
1502 the declaration of this function member. The referenced entry
1503 will be a child of some class (or structure) type entry.
1505 Subroutine entries containing the
1506 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute
1507 \addtoindexx{specification attribute}
1508 do not need to duplicate information provided
1509 by the declaration entry referenced by the specification
1510 attribute. In particular, such entries do not need to contain
1511 attributes for the name or return type of the function member
1512 whose definition they represent.
1514 \subsection{Class Template Instantiations}
1515 \label{chap:classtemplateinstantiations}
1517 \textit{In \addtoindex{C++} a class template is a generic definition of a class
1518 type that may be instantiated when an instance of the class
1519 is declared or defined. The generic description of the
1520 class may include both parameterized types and parameterized
1521 constant values. DWARF does not represent the generic template
1522 definition, but does represent each instantiation.}
1524 A class template instantiation is represented by a
1525 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1526 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or
1527 \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1528 exceptions, such an entry will contain the same attributes
1529 and have the same types of child entries as would an entry
1530 for a class type defined explicitly using the instantiation
1531 types and values. The exceptions are:
1533 \begin{enumerate}[1.]
1534 \item Each formal parameterized type declaration appearing in the
1535 template definition is represented by a debugging information
1537 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1538 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1539 \addtoindexx{name attribute}
1541 a null\dash terminated string containing the name of the formal
1542 type parameter as it appears in the source program. The
1543 template type parameter entry also has
1544 \addtoindexx{type attribute}
1546 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1547 describing the actual type by which the formal is replaced
1548 for this instantiation.
1550 \item Each formal parameterized value declaration appearing in the
1551 template definition is represented by a
1552 debugging information entry with the
1553 \addtoindexx{template value parameter entry}
1554 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1556 such entry may have a
1557 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
1558 \addtoindexx{name attribute}
1560 a null\dash terminated string containing the name of the formal
1561 value parameter as it appears in the source program.
1563 \hypertarget{chap:DWATconstvaluetemplatevalueparameter}
1564 template value parameter entry
1565 \addtoindexx{template value parameter entry}
1567 \addtoindexx{type attribute}
1569 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1570 describing the type of the parameterized value. Finally,
1571 the template value parameter entry has a
1572 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1573 attribute, whose value is the actual constant value of the
1574 value parameter for this instantiation as represented on the
1575 target architecture.
1577 \item The class type entry and each of its child entries references
1578 a \addtoindex{template type parameter entry} in any circumstance where the
1579 source template definition references a formal parameterized
1581 Similarly, the class type entry and each of its child
1582 entries references a template value parameter entry in any
1583 circumstance where the source template definition references
1584 a formal parameterized value.
1586 \item If the compiler has generated a special compilation unit to
1588 \addtoindexx{template instantiation!and special compilation unit}
1589 template instantiation and that special compilation
1590 unit has a different name from the compilation unit containing
1591 the template definition, the name attribute for the debugging
1592 information entry representing the special compilation unit
1593 should be empty or omitted.
1595 \item If the class type entry representing the template
1596 instantiation or any of its child entries contains declaration
1597 coordinate attributes, those attributes should refer to
1598 the source for the template definition, not to any source
1599 generated artificially by the compiler.
1603 \subsection{Variant Entries}
1604 \label{chap:variantentries}
1606 A variant part of a structure is represented by a debugging
1607 information entry\addtoindexx{variant part entry} with the
1608 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1609 owned by the corresponding structure type entry.
1611 If the variant part has a discriminant, the discriminant is
1612 \hypertarget{chap:DWATdiscrdiscriminantofvariantpart}
1614 \addtoindexx{discriminant (entry)}
1615 separate debugging information entry which
1616 is a child of the variant part entry. This entry has the form
1618 \addtoindexx{member entry (data)!as discriminant}
1619 structure data member entry. The variant part entry will
1620 \addtoindexx{discriminant attribute}
1622 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute
1623 whose value is a reference to
1624 the member entry for the discriminant.
1626 If the variant part does not have a discriminant (tag field),
1627 the variant part entry has
1628 \addtoindexx{type attribute}
1630 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1633 Each variant of a particular variant part is represented by
1634 \hypertarget{chap:DWATdiscrvaluediscriminantvalue}
1635 a debugging information entry\addtoindexx{variant entry} with the
1636 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1637 and is a child of the variant part entry. The value that
1638 selects a given variant may be represented in one of three
1639 ways. The variant entry may have a
1640 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1641 whose value represents a single case label. The value of this
1642 attribute is encoded as an LEB128 number. The number is signed
1643 if the tag type for the variant part containing this variant
1644 is a signed type. The number is unsigned if the tag type is
1648 \hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}
1649 the variant entry may contain
1650 \addtoindexx{discriminant list attribute}
1652 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1653 attribute, whose value represents a list of discriminant
1654 values. This list is represented by any of the
1655 \livelink{chap:block}{block} forms and
1656 may contain a mixture of case labels and label ranges. Each
1657 item on the list is prefixed with a discriminant value
1658 descriptor that determines whether the list item represents
1659 a single label or a label range. A single case label is
1660 represented as an LEB128 number as defined above for
1661 \addtoindexx{discriminant value attribute}
1663 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1664 attribute. A label range is represented by
1665 two LEB128 numbers, the low value of the range followed by the
1666 high value. Both values follow the rules for signedness just
1667 described. The discriminant value descriptor is an integer
1668 constant that may have one of the values given in
1669 Table \refersec{tab:discriminantdescriptorvalues}.
1671 \begin{simplenametable}[1.4in]{Discriminant descriptor values}{tab:discriminantdescriptorvalues}
1672 \addtoindex{DW\-\_DSC\-\_label} \\
1673 \addtoindex{DW\-\_DSC\-\_range} \\
1674 \end{simplenametable}
1676 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1677 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1678 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1681 The components selected by a particular variant are represented
1682 by debugging information entries owned by the corresponding
1683 variant entry and appear in the same order as the corresponding
1684 declarations in the source program.
1686 \section{Condition Entries}
1687 \label{chap:conditionentries}
1689 \textit{COBOL has the notion of
1690 \addtoindexx{level-88 condition, COBOL}
1691 a ``level\dash 88 condition'' that
1692 associates a data item, called the conditional variable, with
1693 a set of one or more constant values and/or value ranges.
1694 Semantically, the condition is \textquoteleft true\textquoteright if the conditional
1695 variable's value matches any of the described constants,
1696 and the condition is \textquoteleft false\textquoteright otherwise.}
1698 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition}
1699 debugging information entry\addtoindexx{condition entry}
1701 logical condition that tests whether a given data item\textquoteright s
1702 value matches one of a set of constant values. If a name
1703 has been given to the condition, the condition entry has a
1704 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1705 \addtoindexx{name attribute}
1706 whose value is a null\dash terminated string
1707 giving the condition name as it appears in the source program.
1709 The condition entry's parent entry describes the conditional
1710 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1711 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or
1712 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry.
1714 \addtoindexx{formal parameter entry}
1716 entry has an array type, the condition can test any individual
1717 element, but not the array as a whole. The condition entry
1718 implicitly specifies a \doublequote{comparison type} that is the
1719 type of an array element if the parent has an array type;
1720 otherwise it is the type of the parent entry.
1722 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1723 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1724 values associated with the condition. If any child entry
1725 \addtoindexx{type attribute}
1727 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
1728 that attribute should describe a type
1729 compatible with the comparison type (according to the source
1730 language); otherwise the child\textquoteright s type is the same as the
1733 \textit{For conditional variables with alphanumeric types, COBOL
1734 permits a source program to provide ranges of alphanumeric
1735 constants in the condition. Normally a subrange type entry
1736 does not describe ranges of strings; however, this can be
1737 represented using bounds attributes that are references to
1738 constant entries describing strings. A subrange type entry may
1739 refer to constant entries that are siblings of the subrange
1743 \section{Enumeration Type Entries}
1744 \label{chap:enumerationtypeentries}
1746 \textit{An \doublequote{enumeration type} is a scalar that can assume one of
1747 a fixed number of symbolic values.}
1749 An enumeration type is represented by a debugging information
1751 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1753 If a name has been given to the enumeration type in the source
1754 program, then the corresponding enumeration type entry has
1755 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1756 \addtoindexx{name attribute}
1757 whose value is a null\dash terminated
1758 string containing the enumeration type name as it appears
1759 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1760 attribute whose integer constant value is the number of bytes
1761 required to hold an instance of the enumeration.
1763 The \addtoindex{enumeration type entry}
1765 \addtoindexx{type attribute}
1766 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1767 which refers to the underlying data type used to implement
1770 If an enumeration type has type safe
1771 \addtoindexx{type safe enumeration types}
1774 \begin{enumerate}[1.]
1775 \item Enumerators are contained in the scope of the enumeration type, and/or
1777 \item Enumerators are not implicitly converted to another type
1780 then the \addtoindex{enumeration type entry} may
1781 \addtoindexx{enum class|see{type-safe enumeration}}
1782 have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1783 attribute, which is a \livelink{chap:flag}{flag}.
1784 In a language that offers only
1785 one kind of enumeration declaration, this attribute is not
1788 \textit{In \addtoindex{C} or \addtoindex{C++},
1789 the underlying type will be the appropriate
1790 integral type determined by the compiler from the properties of
1791 \hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}
1792 the enumeration literal values.
1793 A \addtoindex{C++} type declaration written
1794 using enum class declares a strongly typed enumeration and
1795 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}
1796 in combination with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1798 Each enumeration literal is represented by a debugging
1799 \addtoindexx{enumeration literal|see{enumeration entry}}
1800 information entry with the
1801 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1803 such entry is a child of the
1804 \addtoindex{enumeration type entry}, and the
1805 enumerator entries appear in the same order as the declarations
1806 of the enumeration literals in the source program.
1808 Each \addtoindex{enumerator entry} has a
1809 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1810 \addtoindexx{name attribute}
1811 value is a null\dash terminated string containing the name of the
1812 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}
1813 enumeration literal as it appears in the source program.
1814 Each enumerator entry also has a
1815 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1816 whose value is the actual numeric value of the enumerator as
1817 represented on the target system.
1820 If the enumeration type occurs as the description of a
1821 \addtoindexx{enumeration type endry!as array dimension}
1822 dimension of an array type, and the stride for that dimension
1823 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}
1824 is different than what would otherwise be determined, then
1825 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}
1826 the enumeration type entry has either a
1827 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1828 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1829 \addtoindexx{bit stride attribute}
1830 which specifies the separation
1831 between successive elements along the dimension as described
1833 Section \refersec{chap:visibilityofdeclarations}.
1835 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1836 \addtoindexx{bit stride attribute}
1837 is interpreted as bits and the value of
1838 \addtoindexx{byte stride attribute}
1840 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1841 attribute is interpreted as bytes.
1844 \section{Subroutine Type Entries}
1845 \label{chap:subroutinetypeentries}
1847 \textit{It is possible in \addtoindex{C}
1848 to declare pointers to subroutines
1849 that return a value of a specific type. In both
1850 \addtoindex{C} and \addtoindex{C++},
1851 it is possible to declare pointers to subroutines that not
1852 only return a value of a specific type, but accept only
1853 arguments of specific types. The type of such pointers would
1854 be described with a ``pointer to'' modifier applied to a
1855 user\dash defined type.}
1857 A subroutine type is represented by a debugging information
1859 \addtoindexx{subroutine type entry}
1860 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1862 been given to the subroutine type in the source program,
1863 then the corresponding subroutine type entry has
1864 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1865 \addtoindexx{name attribute}
1866 whose value is a null\dash terminated string containing
1867 the subroutine type name as it appears in the source program.
1869 If the subroutine type describes a function that returns
1870 a value, then the subroutine type entry has
1871 \addtoindexx{type attribute}
1872 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1873 attribute to denote the type returned by the subroutine. If
1874 the types of the arguments are necessary to describe the
1875 subroutine type, then the corresponding subroutine type
1876 entry owns debugging information entries that describe the
1877 arguments. These debugging information entries appear in the
1878 order that the corresponding argument types appear in the
1881 \textit{In \addtoindex{C} there
1882 is a difference between the types of functions
1883 declared using function prototype style declarations and
1884 those declared using non\dash prototype declarations.}
1887 \hypertarget{chap:DWATprototypedsubroutineprototype}
1888 subroutine entry declared with a function prototype style
1889 declaration may have
1890 \addtoindexx{prototyped attribute}
1892 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1893 a \livelink{chap:flag}{flag}.
1895 Each debugging information entry owned by a subroutine
1896 type entry has a tag whose value has one of two possible
1899 \begin{enumerate}[1.]
1900 \item The formal parameters of a parameter list (that have a
1901 specific type) are represented by a debugging information entry
1902 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}.
1903 Each formal parameter
1905 \addtoindexx{type attribute}
1906 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1907 the formal parameter.
1909 \item The unspecified parameters of a variable parameter list
1910 \addtoindexx{unspecified parameters entry}
1912 \addtoindexx{... parameters|see{unspecified parameters entry}}
1913 represented by a debugging information entry with the
1914 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1919 \section{String Type Entries}
1920 \label{chap:stringtypeentries}
1922 \textit{A ``string'' is a sequence of characters that have specific
1923 \addtoindexx{string type entry}
1924 semantics and operations that separate them from arrays of
1926 \addtoindex{Fortran} is one of the languages that has a string
1927 type. Note that ``string'' in this context refers to a target
1928 machine concept, not the class string as used in this document
1929 (except for the name attribute).}
1931 A string type is represented by a debugging information entry
1932 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1933 If a name has been given to
1934 the string type in the source program, then the corresponding
1935 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1936 \addtoindexx{name attribute}
1938 a null\dash terminated string containing the string type name as
1939 it appears in the source program.
1942 \hypertarget{chap:DWATstringlengthstringlengthofstringtype}
1943 string type entry may have a
1944 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1946 \addtoindexx{string length attribute}
1948 \addtoindex{location description} yielding the location
1949 where the length of the string is stored in the program. The
1950 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1951 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1952 (see Section \refersec{chap:byteandbitsizes})
1953 is the size of the data to be retrieved from the location
1954 referenced by the string length attribute. If no (byte or bit)
1955 size attribute is present, the size of the data to be retrieved
1957 \addtoindex{size of an address} on the target machine.
1959 If no string length attribute is present, the string type
1960 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or
1961 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1962 attribute, whose value
1963 (see Section \refersec{chap:byteandbitsizes})
1965 storage needed to hold a value of the string type.
1968 \section{Set Type Entries}
1969 \label{chap:settypeentries}
1971 \textit{\addtoindex{Pascal} provides the concept of a \doublequote{set,} which represents
1972 a group of values of ordinal type.}
1974 A set is represented by a debugging information entry with
1975 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1976 \addtoindexx{set type entry}
1977 If a name has been given to the
1978 set type, then the set type entry has
1979 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1980 \addtoindexx{name attribute}
1981 whose value is a null\dash terminated string containing the
1982 set type name as it appears in the source program.
1984 The set type entry has
1985 \addtoindexx{type attribute}
1986 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1987 type of an element of the set.
1989 If the amount of storage allocated to hold each element of an
1990 object of the given set type is different from the amount of
1991 storage that is normally allocated to hold an individual object
1992 of the indicated element type, then the set type entry has
1993 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or
1994 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1995 whose value (see Section \refersec{chap:byteandbitsizes}) is
1996 the amount of storage needed to hold a value of the set type.
1999 \section{Subrange Type Entries}
2000 \label{chap:subrangetypeentries}
2002 \textit{Several languages support the concept of a ``subrange''
2003 type object. These objects can represent a subset of the
2004 values that an object of the basis type for the subrange can
2006 Subrange type entries may also be used to represent
2007 the bounds of array dimensions.}
2009 A subrange type is represented by a debugging information
2011 \addtoindexx{subrange type entry}
2012 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
2014 given to the subrange type, then the subrange type entry
2015 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
2016 \addtoindexx{name attribute}
2017 whose value is a null\dash terminated
2018 string containing the subrange type name as it appears in
2021 The subrange entry may have
2022 \addtoindexx{type attribute}
2023 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
2024 the type of object, called the basis type, of whose values
2025 this subrange is a subset.
2027 If the amount of storage allocated to hold each element of an
2028 object of the given subrange type is different from the amount
2029 of storage that is normally allocated to hold an individual
2030 object of the indicated element type, then the subrange
2032 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or
2033 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
2034 attribute, whose value
2035 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2037 storage needed to hold a value of the subrange type.
2040 \hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
2041 subrange entry may have
2042 \addtoindexx{threads scaled attribute}
2044 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
2045 which is a \livelink{chap:flag}{flag}.
2046 If present, this attribute indicates whether
2047 this subrange represents a \addtoindex{UPC} array bound which is scaled
2048 by the runtime THREADS value (the number of UPC threads in
2049 this execution of the program).
2051 \textit{This allows the representation of a \addtoindex{UPC} shared array such as}
2053 \begin{lstlisting}[numbers=none]
2054 int shared foo[34*THREADS][10][20];
2058 \hypertarget{chap:DWATlowerboundlowerboundofsubrange}
2060 \hypertarget{chap:DWATupperboundupperboundofsubrange}
2061 entry may have the attributes
2062 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
2063 \addtoindexx{lower bound attribute}
2064 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2065 \addtoindexx{upper bound attribute} to specify, respectively, the lower
2066 and upper bound values of the subrange. The
2067 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2069 \hypertarget{chap:DWATcountelementsofsubrangetype}
2071 % FIXME: The following matches DWARF4: odd as there is no default count.
2072 \addtoindexx{count attribute!default}
2074 \addtoindexx{count attribute}
2076 \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute,
2078 value describes the number of elements in the subrange rather
2079 than the value of the last element. The value of each of
2080 these attributes is determined as described in
2081 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2083 If the lower bound value is missing, the value is assumed to
2084 be a language\dash dependent default constant.
2085 \addtoindexx{lower bound attribute!default}
2086 The default lower bound is 0 for
2087 \addtoindex{C}, \addtoindex{C++},
2090 \addtoindex{Objective C},
2091 \addtoindex{Objective C++},
2092 \addtoindex{Python}, and
2094 The default lower bound is 1 for
2095 \addtoindex{Ada}, \addtoindex{COBOL},
2096 \addtoindex{Fortran},
2097 \addtoindex{Modula-2},
2098 \addtoindex{Pascal} and
2101 \textit{No other default lower bound values are currently defined.}
2103 If the upper bound and count are missing, then the upper bound value is
2104 \textit{unknown}.\addtoindexx{upper bound attribute!default unknown}
2106 If the subrange entry has no type attribute describing the
2107 basis type, the basis type is assumed to be the same as
2108 the object described by the lower bound attribute (if it
2109 references an object). If there is no lower bound attribute,
2110 or that attribute does not reference an object, the basis type
2111 is the type of the upper bound or \addtoindex{count attribute}
2113 of them references an object). If there is no upper bound or
2114 count attribute, or neither references an object, the type is
2115 assumed to be the same type, in the source language of the
2116 compilation unit containing the subrange entry, as a signed
2117 integer with the same size as an address on the target machine.
2119 If the subrange type occurs as the description of a dimension
2120 of an array type, and the stride for that dimension is
2121 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}
2122 different than what would otherwise be determined, then
2123 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}
2124 the subrange type entry has either
2125 \addtoindexx{byte stride attribute}
2127 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
2128 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
2129 \addtoindexx{bit stride attribute}
2130 which specifies the separation
2131 between successive elements along the dimension as described
2133 Section \refersec{chap:byteandbitsizes}.
2135 \textit{Note that the stride can be negative.}
2137 \section{Pointer to Member Type Entries}
2138 \label{chap:pointertomembertypeentries}
2140 \textit{In \addtoindex{C++}, a
2141 pointer to a data or function member of a class or
2142 structure is a unique type.}
2144 A debugging information entry representing the type of an
2145 object that is a pointer to a structure or class member has
2146 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
2148 If the \addtoindex{pointer to member type} has a name, the
2149 \addtoindexx{pointer to member type entry}
2150 pointer to member entry has a
2151 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2152 \addtoindexx{name attribute}
2154 null\dash terminated string containing the type name as it appears
2155 in the source program.
2157 The \addtoindex{pointer to member} entry
2159 \addtoindexx{type attribute}
2160 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
2161 describe the type of the class or structure member to which
2162 objects of this type may point.
2164 The \addtoindex{pointer to member} entry also
2165 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
2167 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
2168 attribute, whose value is a reference to a debugging
2169 information entry for the class or structure to whose members
2170 objects of this type may point.
2173 \hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}
2175 \addtoindex{pointer to member entry}
2177 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
2178 \addtoindexx{use location attribute}
2180 \addtoindex{location description} that computes the
2181 address of the member of the class to which the pointer to
2182 member entry points.
2184 \textit{The method used to find the address of a given member of a
2185 class or structure is common to any instance of that class
2186 or structure and to any instance of the pointer or member
2187 type. The method is thus associated with the type entry,
2188 rather than with each instance of the type.}
2190 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
2191 with the location descriptions for a particular object of the
2192 given \addtoindex{pointer to member type} and for a particular structure or
2193 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}
2194 attribute expects two values to be
2195 \addtoindexi{pushed}{address!implicit push for member operator}
2196 onto the DWARF expression stack before
2197 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated.
2199 \addtoindexi{pushed}{address!implicit push for member operator}
2200 is the value of the \addtoindex{pointer to member} object
2201 itself. The second value
2202 \addtoindexi{pushed}{address!implicit push for member operator}
2203 is the base address of the
2204 entire structure or union instance containing the member
2205 whose address is being calculated.
2207 \textit{For an expression such as}
2209 \begin{lstlisting}[numbers=none]
2212 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
2213 \textit{where mbr\_ptr has some \addtoindex{pointer to member type}, a debugger should:}
2215 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
2217 \textit{2. Push the base address of object onto the DWARF expression stack.}
2219 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
2220 given in the type of mbr\_ptr.}
2222 \section{File Type Entries}
2223 \label{chap:filetypeentries}
2225 \textit{Some languages, such as \addtoindex{Pascal},
2226 provide a data type to represent
2229 A file type is represented by a debugging information entry
2231 \addtoindexx{file type entry}
2233 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
2234 If the file type has a name,
2235 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2236 \addtoindexx{name attribute}
2238 is a null\dash terminated string containing the type name as it
2239 appears in the source program.
2241 The file type entry has
2242 \addtoindexx{type attribute}
2243 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
2244 the type of the objects contained in the file.
2246 The file type entry also
2247 \addtoindexx{byte size}
2249 \addtoindexx{bit size}
2251 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
2252 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
2253 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
2254 is the amount of storage need to hold a value of the file type.
2256 \section{Dynamic Type Properties}
2257 \label{chap:dynamictypeproperties}
2258 \subsection{Data Location}
2259 \label{chap:datalocation}
2261 \textit{Some languages may represent objects using descriptors to hold
2262 information, including a location and/or run\dash time parameters,
2263 about the data that represents the value for that object.}
2265 \hypertarget{chap:DWATdatalocationindirectiontoactualdata}
2266 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2267 attribute may be used with any
2268 \addtoindexx{data location attribute}
2269 type that provides one or more levels of
2270 \addtoindexx{hidden indirection|see{data location attribute}}
2272 and/or run\dash time parameters in its representation. Its value
2273 is a \addtoindex{location description}.
2274 The result of evaluating this
2275 description yields the location of the data for an object.
2276 When this attribute is omitted, the address of the data is
2277 the same as the address of the object.
2279 \textit{This location description will typically begin with
2280 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
2281 which loads the address of the
2282 object which can then serve as a descriptor in subsequent
2283 calculation. For an example using
2284 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2285 for a \addtoindex{Fortran 90 array}, see
2286 Appendix \refersec{app:fortran90example}.}
2288 \subsection{Allocation and Association Status}
2289 \label{chap:allocationandassociationstatus}
2291 \textit{Some languages, such as \addtoindex{Fortran 90},
2292 provide types whose values
2293 may be dynamically allocated or associated with a variable
2294 under explicit program control.}
2296 \hypertarget{chap:DWATallocatedallocationstatusoftypes}
2298 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
2300 \addtoindexx{allocated attribute}
2301 may optionally be used with any
2302 type for which objects of the type can be explicitly allocated
2303 and deallocated. The presence of the attribute indicates that
2304 objects of the type are allocatable and deallocatable. The
2305 integer value of the attribute (see below) specifies whether
2306 an object of the type is
2307 currently allocated or not.
2309 \hypertarget{chap:DWATassociatedassociationstatusoftypes}
2311 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute
2313 \addtoindexx{associated attribute}
2314 optionally be used with
2315 any type for which objects of the type can be dynamically
2316 associated with other objects. The presence of the attribute
2317 indicates that objects of the type can be associated. The
2318 integer value of the attribute (see below) indicates whether
2319 an object of the type is currently associated or not.
2321 \textit{While these attributes are defined specifically with
2322 \addtoindex{Fortran 90} ALLOCATABLE and POINTER types
2323 in mind, usage is not limited
2324 to just that language.}
2326 The value of these attributes is determined as described in
2327 Section \refersec{chap:staticanddynamicvaluesofattributes}.
2329 A non\dash zero value is interpreted as allocated or associated,
2330 and zero is interpreted as not allocated or not associated.
2332 \textit{For \addtoindex{Fortran 90},
2333 if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}
2334 attribute is present,
2335 the type has the POINTER property where either the parent
2336 variable is never associated with a dynamic object or the
2337 implementation does not track whether the associated object
2338 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
2339 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
2340 has the ALLOCATABLE property. If both attributes are present,
2341 then the type should be assumed to have the POINTER property
2342 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
2343 be used to indicate that the association status of the object
2344 resulted from execution of an ALLOCATE statement rather than
2345 pointer assignment.}
2347 \textit{For examples using
2348 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for \addtoindex{Ada} and
2349 \addtoindex{Fortran 90}
2351 see Appendix \refersec{app:aggregateexamples}.}
2355 \section{Template Alias Entries}
2356 \label{chap:templatealiasentries}
2358 A type named using a template alias is represented
2359 by a debugging information entry
2360 \addtoindexx{template alias entry}
2362 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
2363 The template alias entry has a
2364 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
2365 \addtoindexx{name attribute}
2366 whose value is a null\dash terminated string
2367 containing the name of the template alias as it appears in
2368 the source program. The template alias entry also contains
2369 \addtoindexx{type attribute}
2371 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
2372 whose value is a reference to the type
2373 named by the template alias. The template alias entry has
2374 the following child entries:
2376 \begin{enumerate}[1.]
2377 \item Each formal parameterized type declaration appearing
2378 in the template alias declaration is represented
2379 by a debugging information entry with the tag
2380 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}.
2381 Each such entry may have
2382 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2383 \addtoindexx{name attribute}
2384 whose value is a null\dash terminated
2385 string containing the name of the formal type parameter as it
2386 appears in the source program. The template type parameter
2388 \addtoindexx{type attribute}
2389 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
2390 describing the actual
2391 type by which the formal is replaced for this instantiation.
2393 \item Each formal parameterized value declaration
2394 appearing in the template alias declaration is
2395 represented by a debugging information entry with the tag
2396 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
2397 Each such entry may have
2398 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2399 \addtoindexx{name attribute}
2400 whose value is a null\dash terminated
2401 string containing the name of the formal value parameter
2402 as it appears in the source program. The template value
2403 parameter entry also has
2404 \addtoindexx{type attribute}
2405 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
2406 the type of the parameterized value. Finally, the template
2407 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
2408 attribute, whose value is the actual constant value of the value parameter for
2409 this instantiation as represented on the target architecture.