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 the low pc value for the scope most closely enclosing the
9 declaration, the declaration may have a \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}
10 attribute as described for objects in
11 Section \refersec{chap:dataobjectentries}.
13 \section{Base Type Entries}
14 \label{chap:basetypeentries}
16 \textit{A base type is a data type that is not defined in terms of
17 other data types. Each programming language has a set of base
18 types that are considered to be built into that language.}
20 A base type is represented by a debugging information entry
22 \livetarg{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}.
24 A base type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
25 a null\dash terminated string containing the name of the base type
26 as recognized by the programming language of the compilation
27 unit containing the base type entry.
29 A base type entry has a \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding} attribute describing
30 how the base type is encoded and is to be interpreted. The
31 value of this attribute is an integer constant. The set of
32 values and their meanings for the \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding} attribute
34 Figure \refersec{fig:encodingattributevalues}
38 may have a \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute as described in
39 Section \refersec{chap:dataobjectentries}.
40 If omitted, the encoding assumes the representation that
41 is the default for the target architecture.
43 A base type entry has either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
44 or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose integer constant value
45 (see Section \refersec{chap:byteandbitsizes})
46 is the amount of storage needed to hold
49 \textit{For example, the C type int on a machine that uses 32\dash bit
50 integers is represented by a base type entry with a name
51 attribute whose value is “int”, an encoding attribute
52 whose value is \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed} and a byte size attribute whose
55 If the value of an object of the given type does not fully
56 occupy the storage described by a byte size attribute,
57 the base type entry may also have a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and a
58 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, both of whose values are
59 integer constant values (
60 see Section \refersec{chap:staticanddynamicvaluesofattributes}).
62 attribute describes the actual size in bits used to represent
63 values of the given type. The data bit offset attribute is the
64 offset in bits from the beginning of the containing storage to
65 the beginning of the value. Bits that are part of the offset
66 are padding. The data bit offset uses the bit numbering and
67 direction conventions that are appropriate to the current
69 target system to locate the beginning of the storage and
70 value. If this attribute is omitted a default data bit offset
73 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
74 is also used for bit field members
75 (see Section \refersec{chap:datamemberentries}).
77 replaces the attribute \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} when used for base
78 types as defined in DWARF V3 and earlier. The earlier attribute
79 is defined in a manner suitable for bit field members on
80 big\dash endian architectures but which is wasteful for use on
81 little\dash endian architectures.}
83 \textit{The attribute \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} is deprecated in DWARF Version
84 4 for use in base types, but implementations may continue to
85 support its use for compatibility.}
87 \textit{The DWARF Version 3 definition of these attributes is as follows.}
89 \begin{myindentpara}{1cm}
90 \textit{A base type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, whose value
91 (see Section 2.19) is the size in bytes of the storage unit
92 used to represent an object of the given type.}
94 \textit{If the value of an object of the given type does not fully
95 occupy the storage unit described by the byte size attribute,
96 the base type entry may have a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute and a
97 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute, both of whose values (see Section
98 2.19) are integers. The bit size attribute describes the actual
99 size in bits used to represent a value of the given type.
100 The bit offset attribute describes the offset in bits of the
101 high order bit of a value of the given type from the high
102 order bit of the storage unit used to contain that value.}
105 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
106 defines the following combinations of attributes:}
109 \item \textit{DW\-\_AT\-\_byte\-\_size}
110 \item \textit{DW\-\_AT\-\_bit\-\_size}
111 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
112 and optionally \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}}
114 DWARF V3 defines the following combinations:
115 % FIXME: the figure below interferes with the following
116 % bullet list, which looks horrible as a result.
118 \item \textit{DW\-\_AT\-\_byte\-\_size}
119 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}}
122 \begin{figure}[!here]
124 \begin{tabular}{lp{9cm}}
125 Name&Meaning\\ \hline
126 \livetarg{chap:DWATEaddress}{DW\-\_ATE\-\_address} & linear machine address (for
127 segmented addresses see
128 Section \refersec{chap:segmentedaddresses}) \\
129 \livetarg{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}& true or false \\
131 \livetarg{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}& complex binary floating\dash point number \\
132 \livetarg{chap:DWATEfloat}{DW\-\_ATE\-\_float} & binary floating\dash point number \\
133 \livetarg{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}& imaginary binary floating\dash point number \\
134 \livetarg{chap:DWATEsigned}{DW\-\_ATE\-\_signed}& signed binary integer \\
135 \livetarg{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}& signed character \\
136 \livetarg{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned} & unsigned binary integer \\
137 \livetarg{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char} & unsigned character \\
138 \livetarg{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} & packed decimal \\
139 \livetarg{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}& numeric string \\
140 \livetarg{chap:DWATEedited}{DW\-\_ATE\-\_edited} & edited string \\
141 \livetarg{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} & signed fixed\dash point scaled integer \\
142 \livetarg{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}& unsigned fixed\dash point scaled integer \\
143 \livetarg{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & decimal floating\dash point number \\
144 \livetarg{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} & Unicode character \\
146 \caption{Encoding attribute values}
147 \label{fig:encodingattributevalues}
150 \textit{The \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} encoding is intended for
151 floating\dash point representations that have a power\dash of\dash ten
152 exponent, such as that specified in IEEE 754R.}
154 \textit{The \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} encoding is intended for Unicode string
155 encodings (see the Universal Character Set standard,
156 ISO/IEC 10646\dash 1:1993). For example, the C++ type char16\_t is
157 represented by a base type entry with a name attribute whose
158 value is “char16\_t”, an encoding attribute whose value
159 is \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} and a byte size attribute whose value is 2.}
161 The \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types
162 represent packed and unpacked decimal string numeric data
163 types, respectively, either of which may be either signed
164 or unsigned. These base types are used in combination with
165 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}, \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
168 A \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute is an integer constant that
169 conveys the representation of the sign of the decimal type
170 (see Figure \refersec{fig:decimalsignattributevalues}).
171 Its integer constant value is interpreted to
172 mean that the type has a leading overpunch, trailing overpunch,
173 leading separate or trailing separate sign representation or,
174 alternatively, no sign at all.
176 The \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} attribute is an integer constant
177 value that represents the number of digits in an instance of
180 The \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute is an integer constant value
181 that represents the exponent of the base ten scale factor to
182 be applied to an instance of the type. A scale of zero puts the
183 decimal point immediately to the right of the least significant
184 digit. Positive scale moves the decimal point to the right
185 and implies that additional zero digits on the right are not
186 stored in an instance of the type. Negative scale moves the
187 decimal point to the left; if the absolute value of the scale
188 is larger than the digit count, this implies additional zero
189 digits on the left are not stored in an instance of the type.
191 The \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited} base type is used to represent an edited
192 numeric or alphanumeric data type. It is used in combination
193 with an \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string} attribute whose value is a
194 null\dash terminated string containing the target\dash dependent picture
195 string associated with the type.
197 If the edited base type entry describes an edited numeric
198 data type, the edited type entry has a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and a
199 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute. These attributes have the same
200 interpretation as described for the \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and
201 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types. If the edited type entry
202 describes an edited alphanumeric data type, the edited type
203 entry does not have these attributes.
206 \textit{The presence or absence of the \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
207 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attributes allows a debugger to easily
208 distinguish edited numeric from edited alphanumeric, although
209 in principle the digit count and scale are derivable by
210 interpreting the picture string.}
212 The \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} and \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed} entries
213 describe signed and unsigned fixed\dash point binary data types,
216 The fixed binary type entries have a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
217 attribute with the same interpretation as described for the
218 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
220 For a data type with a decimal scale factor, the fixed binary
221 type entry has a \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute with the same
222 interpretation as described for the \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
223 and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
225 For a data type with a binary scale factor, the fixed
226 binary type entry has a \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute. The
227 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute is an integer constant value
228 that represents the exponent of the base two scale factor to
229 be applied to an instance of the type. Zero scale puts the
230 binary point immediately to the right of the least significant
231 bit. Positive scale moves the binary point to the right and
232 implies that additional zero bits on the right are not stored
233 in an instance of the type. Negative scale moves the binary
234 point to the left; if the absolute value of the scale is
235 larger than the number of bits, this implies additional zero
236 bits on the left are not stored in an instance of the type.
238 For a data type with a non\dash decimal and non\dash binary scale factor,
239 the fixed binary type entry has a \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute which
240 references a \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The scale factor value
241 is interpreted in accordance with the value defined by the
242 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The value represented is the product
243 of the integer value in memory and the associated constant
246 \textit{The \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute is defined with the Ada small
251 \begin{tabular}{lp{9cm}}
252 Name&Meaning\\ \hline
253 \livetarg{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & unsigned \\
254 \livetarg{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & Sign is encoded in the most significant digit in a target\dash dependent manner \\
255 \livetarg{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & Sign is encoded in the least significant digit in a target\dash dependent manner \\
256 \livetarg{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate}
257 & Decimal type: Sign is a ``+'' or ``-'' character
258 to the left of the most significant digit. \\
259 \livetarg{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate}
260 & Decimal type: Sign is a ``+'' or ``-'' character
261 to the right of the least significant digit. \\
262 &Packed decimal type: Least significant nibble contains
263 a target\dash dependent value
264 indicating positive or negative. \\
266 \caption{Decimal sign attribute values}
267 \label{fig:decimalsignattributevalues}
270 \section{Unspecified Type Entries}
271 \label{chap:unspecifiedtypeentries}
272 Some languages have constructs in which a type may be left unspecified or the absence of a type
273 may be explicitly indicated.
275 An unspecified (implicit, unknown, ambiguous or nonexistent)
276 type is represented by a debugging information entry with
277 the tag \livetarg{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}.
278 If a name has been given
279 to the type, then the corresponding unspecified type entry
280 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
281 string containing the name as it appears in the source program.
283 The interpretation of this debugging information entry is
284 intentionally left flexible to allow it to be interpreted
285 appropriately in different languages. For example, in C and C++
286 the language implementation can provide an unspecified type
287 entry with the name “void” which can be referenced by the
288 type attribute of pointer types and typedef declarations for
290 % FIXME: the following reference was wrong in DW4 so DavidA guessed
292 Sections \refersec{chap:unspecifiedtypeentries} and
293 %The following reference was valid, so the following is probably correct.
294 Section \refersec{chap:typedefentries},
295 respectively). As another
296 example, in Ada such an unspecified type entry can be referred
297 to by the type attribute of an access type where the denoted
298 type is incomplete (the name is declared as a type but the
299 definition is deferred to a separate compilation unit). Type
302 A base or user\dash defined type may be modified in different ways
303 in different languages. A type modifier is represented in
304 DWARF by a debugging information entry with one of the tags
306 Figure \refersec{fig:typemodifiertags}.
309 If a name has been given to the modified type in the source
310 program, then the corresponding modified type entry has
311 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null-terminated
312 string containing the modified type name as it appears in
315 Each of the type modifier entries has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
316 whose value is a reference to a debugging information entry
317 describing a base type, a user-defined type or another type
320 A modified type entry describing a pointer or reference
321 type (using \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}, \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type} or
322 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type}) may have a \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
323 attribute to describe how objects having the given pointer
324 or reference type ought to be dereferenced.
326 A modified type entry describing a shared qualified type
327 (using \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}) may have a \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute
328 whose value is a constant expressing the blocksize of the
329 type. If no count attribute is present, then the “infinite”
330 blocksize is assumed.
332 When multiple type modifiers are chained together to modify
333 a base or user-defined type, the tree ordering reflects the
334 semantics of the applicable lanuage rather than the textual
335 order in the source presentation.
339 \begin{tabular}{lp{9cm}}
340 Name&Meaning\\ \hline
341 \livetarg{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} & C or C++ const qualified type \\
342 \livetarg{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}& Pascal or Ada packed type \\
343 \livetarg{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} & Pointer to an object of the type being modified \\
344 \livetarg{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}& C++ (lvalue) reference to an object of the type
346 \livetarg{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&C restrict qualified type \\
347 \livetarg{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} & C++ rvalue reference to an object of the type
349 \livetarg{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&UPC shared qualified type \\
350 \livetarg{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&C or C++ volatile qualified type \\
352 \caption{Type modifier tags}
353 \label{fig:typemodifiertags}
356 % The following prevents splitting the examples up.
357 % FIXME perhaps there is a better way. We could box the verbatim,
358 % see memman.pdf on verbatims.
360 \textit{As examples of how tye modifiers are ordered, take the following C
364 const unsigned char * volatile p;
365 which represents a volatile pointer to a constant
366 character. This is encoded in DWARF as:
367 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
368 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
369 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
370 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
371 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
373 volatile unsigned char * const restrict p;
374 on the other hand, represents a restricted constant
375 pointer to a volatile character. This is encoded as:
376 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
377 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type} -->
378 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
379 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
380 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
381 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
385 \section{Typedef Entries}
386 \label{chap:typedefentries}
387 A named type that is defined in terms of another type
388 definition is represented by a debugging information entry with
389 the tag \livetarg{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}.
390 The typedef entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
391 attribute whose value is a null-terminated string containing
392 the name of the typedef as it appears in the source program.
394 The typedef entry may also contain a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose
395 value is a reference to the type named by the typedef. If
396 the debugging information entry for a typedef represents
397 a declaration of the type that is not also a definition,
398 it does not contain a type attribute.
400 \textit{Depending on the language, a named type that is defined in
401 terms of another type may be called a type alias, a subtype,
402 a constrained type and other terms. A type name declared with
403 no defining details may be termed an incomplete, forward
404 or hidden type. While the DWARF \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef} entry was
405 originally inspired by the like named construct in C and C++,
406 it is broadly suitable for similar constructs (by whatever
407 source syntax) in other languages.}
409 \section{Array Type Entries}
410 \label{chap:arraytypeentries}
412 Many languages share the concept of an ``array,'' which is
413 a table of components of identical type.
415 An array type is represented by a debugging information entry
416 with the tag \livetarg{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}.
417 If a name has been given to
418 the array type in the source program, then the corresponding
419 array type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a
420 null-terminated string containing the array type name as it
421 appears in the source program.
423 The array type entry describing a multidimensional array may
424 have a \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute whose integer constant value is
425 interpreted to mean either row-major or column-major ordering
426 of array elements. The set of values and their meanings
427 for the ordering attribute are listed in
428 Figure \refersec{fig:arrayordering}.
430 ordering attribute is present, the default ordering for the
431 source language (which is indicated by the \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
432 attribute of the enclosing compilation unit entry) is assumed.
435 \autorows[0pt]{c}{1}{l}{
436 \livetarg{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major},
437 \livetarg{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}
439 \caption{Array ordering}\label{fig:arrayordering}
442 The ordering attribute may optionally appear on one-dimensional
443 arrays; it will be ignored.
445 An array type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
446 the type of each element of the array.
448 If the amount of storage allocated to hold each element of an
449 object of the given array type is different from the amount
450 of storage that is normally allocated to hold an individual
451 object of the indicated element type, then the array type
452 entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or a \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
453 attribute, whose value
454 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
456 element of the array.
458 The array type entry may have either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
459 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
460 (see Section \refersec{chap:byteandbitsizes}),
462 amount of storage needed to hold an instance of the array type.
464 \textit{If the size of the array can be determined statically at
465 compile time, this value can usually be computed by multiplying
466 the number of array elements by the size of each element.}
469 Each array dimension is described by a debugging information
470 entry with either the tag \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} or the tag
471 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}. These entries are children of the
472 array type entry and are ordered to reflect the appearance of
473 the dimensions in the source program (i.e., leftmost dimension
474 first, next to leftmost second, and so on).
476 In languages, such as C, in which there is no concept of
477 a “multidimensional array”, an array of arrays may
478 be represented by a debugging information entry for a
479 multidimensional array.
481 Other attributes especially applicable to arrays are
482 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}, \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} and \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location},
483 which are described in
484 Section \refersec{chap:dynamictypeproperties}.
485 For relevant examples,
487 Appendix \refersec{app:fortran90example}.
489 \section{ Structure, Union, Class and Interface Type Entries}
490 \label{chap:structureunionclassandinterfacetypeentries}
492 \textit{The languages C, C++, and Pascal, among others, allow the
493 programmer to define types that are collections of related
494 components. In C and C++, these collections are called
495 “structures.” In Pascal, they are called “records.”
496 The components may be of different types. The components are
497 called “members” in C and C++, and “fields” in Pascal.}
499 \textit{The components of these collections each exist in their
500 own space in computer memory. The components of a C or C++
501 “union” all coexist in the same memory.}
503 \textit{Pascal and other languages have a “discriminated union,”
504 also called a “variant record.” Here, selection of a
505 number of alternative substructures (“variants”) is based
506 on the value of a component that is not part of any of those
507 substructures (the “discriminant”).}
509 \textit{C++ and Java have the notion of "class”, which is in some
510 ways similar to a structure. A class may have “member
511 functions” which are subroutines that are within the scope
512 of a class or structure.}
514 \textit{The C++ notion of structure is more general than in C, being
515 equivalent to a class with minor differences. Accordingly,
516 in the following discussion statements about C++ classes may
517 be understood to apply to C++ structures as well.}
519 \subsection{Structure, Union and Class Type Entries}
520 \label{chap:structureunionandclasstypeentries}
523 Structure, union, and class types are represented by debugging
524 information entries with
525 the tags \livetarg{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type},
526 \livetarg{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type},
527 and \livetarg{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
528 respectively. If a name has been given to the structure,
529 union, or class in the source program, then the corresponding
530 structure type, union type, or class type entry has a
531 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
532 containing the type name as it appears in the source program.
534 The members of a structure, union, or class are represented
535 by debugging information entries that are owned by the
536 corresponding structure type, union type, or class type entry
537 and appear in the same order as the corresponding declarations
538 in the source program.
540 A structure type, union type or class type entry may have
541 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
542 (see Section \refersec{chap:byteandbitsizes}),
543 whose value is the amount of storage needed
544 to hold an instance of the structure, union or class type,
545 including any padding. An incomplete structure, union or
546 class type is represented by a structure, union or class
547 entry that does not have a byte size attribute and that has
548 a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
550 If the complete declaration of a type has been placed in
552 (see Section \refersec{chap:separatetypeunitentries}),
554 declaration of that type in the compilation unit may provide
555 the unique 64\dash bit signature of the type using a \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature}
558 If a structure, union or class entry represents the definition
559 of a structure, class or union member corresponding to a prior
560 incomplete structure, class or union, the entry may have a
561 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute whose value is a reference to
562 the debugging information entry representing that incomplete
565 Structure, union and class entries containing the
566 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute do not need to duplicate
567 information provided by the declaration entry referenced by the
568 specification attribute. In particular, such entries do not
569 need to contain an attribute for the name of the structure,
570 class or union they represent if such information is already
571 provided in the declaration.
573 \textit{For C and C++, data member declarations occurring within
574 the declaration of a structure, union or class type are
575 considered to be “definitions” of those members, with
576 the exception of “static” data members, whose definitions
577 appear outside of the declaration of the enclosing structure,
578 union or class type. Function member declarations appearing
579 within a structure, union or class type declaration are
580 definitions only if the body of the function also appears
581 within the type declaration.}
583 If the definition for a given member of the structure, union
584 or class does not appear within the body of the declaration,
585 that member also has a debugging information entry describing
586 its definition. That latter entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
587 attribute referencing the debugging information entry
588 owned by the body of the structure, union or class entry and
589 representing a non\dash defining declaration of the data, function
590 or type member. The referenced entry will not have information
591 about the location of that member (low and high pc attributes
592 for function members, location descriptions for data members)
593 and will have a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
595 \textit{Consider a nested class whose
596 definition occurs outside of the containing class definition, as in:}
605 \textit{The two different structs can be described in
606 different compilation units to
607 facilitate DWARF space compression
608 (see Appendix \refersec{app:usingcompilationunits}).}
610 \subsection{Interface Type Entries}
611 \label{chap:interfacetypeentries}
613 \textit{The Java language defines "interface" types. An interface
614 in Java is similar to a C++ or Java class with only abstract
615 methods and constant data members.}
617 Interface types are represented by debugging information
619 tag \livetarg{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}.
621 An interface type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
622 value is a null-terminated string containing the type name
623 as it appears in the source program.
625 The members of an interface are represented by debugging
626 information entries that are owned by the interface type
627 entry and that appear in the same order as the corresponding
628 declarations in the source program.
630 \subsection{Derived or Extended Structs, Classes and Interfaces}
631 \label{chap:derivedorextendedstructsclasesandinterfaces}
633 \textit{In C++, a class (or struct) may be ``derived from'' or be a
634 ``subclass of'' another class. In Java, an interface may ``extend''
635 one or more other interfaces, and a class may "extend" another
636 class and/or "implement" one or more interfaces. All of these
637 relationships may be described using the following. Note that
638 in Java, the distinction between extends and implements is
639 implied by the entities at the two ends of the relationship.}
641 A class type or interface type entry that describes a
642 derived, extended or implementing class or interface owns
643 debugging information entries describing each of the classes
644 or interfaces it is derived from, extending or implementing,
645 respectively, ordered as they were in the source program. Each
647 tag \livetarg{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}.
649 An inheritance entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is
650 a reference to the debugging information entry describing the
651 class or interface from which the parent class or structure
652 of the inheritance entry is derived, extended or implementing.
654 An inheritance entry for a class that derives from or extends
655 another class or struct also has a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
656 attribute, whose value describes the location of the beginning
657 of the inherited type relative to the beginning address of the
658 derived class. If that value is a constant, it is the offset
659 in bytes from the beginning of the class to the beginning of
660 the inherited type. Otherwise, the value must be a location
661 description. In this latter case, the beginning address of
662 the derived class is pushed on the expression stack before
663 the location description is evaluated and the result of the
664 evaluation is the location of the inherited type.
666 \textit{The interpretation of the value of this attribute for
667 inherited types is the same as the interpretation for data
669 (see Section \refersec{chap:datamemberentries}). }
671 An inheritance entry may have a
672 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility} attribute. If no accessibility attribute
673 is present, private access is assumed for an entry of a class
674 and public access is assumed for an entry of an interface,
677 If the class referenced by the inheritance entry serves
678 as a C++ virtual base class, the inheritance entry has a
679 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
681 \textit{For a C++ virtual base, the data member location attribute
682 will usually consist of a non-trivial location description.}
684 \subsection{Access Declarations}
685 \label{chap:accessdeclarations}
687 \textit{In C++, a derived class may contain access declarations that
688 change the accessibility of individual class members from the
689 overall accessibility specified by the inheritance declaration.
690 A single access declaration may refer to a set of overloaded
693 If a derived class or structure contains access declarations,
694 each such declaration may be represented by a debugging
695 information entry with the tag
696 \livetarg{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}.
698 such entry is a child of the class or structure type entry.
700 An access declaration entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
701 value is a null-terminated string representing the name used
702 in the declaration in the source program, including any class
703 or structure qualifiers.
705 An access declaration entry also has a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
706 attribute describing the declared accessibility of the named
713 Each ``friend'' declared by a structure, union or class
714 type may be represented by a debugging information entry
715 that is a child of the structure, union or class type entry;
716 the friend entry has the
717 tag \livetarg{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}.
719 A friend entry has a \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute, whose value is
720 a reference to the debugging information entry describing
721 the declaration of the friend.
724 \subsection{Data Member Entries}
725 \label{chap:datamemberentries}
727 A data member (as opposed to a member function) is
728 represented by a debugging information entry with the
729 tag \livetarg{chap:DWTAGmember}{DW\-\_TAG\-\_member}.
730 The member entry for a named member has
731 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null-terminated
732 string containing the member name as it appears in the source
733 program. If the member entry describes an anonymous union, the
734 name attribute is omitted or consists of a single zero byte.
736 The data member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote
737 the type of that member.
739 A data member entry may have a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
740 attribute. If no accessibility attribute is present, private
741 access is assumed for an entry of a class and public access
742 is assumed for an entry of a structure, union, or interface.
744 A data member entry may have a \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable} attribute,
745 which is a \livelink{chap:flag}{flag}.
746 This attribute indicates whether the data
747 member was declared with the mutable storage class specifier.
749 The beginning of a data member is described relative to
750 the beginning of the object in which it is immediately
751 contained. In general, the beginning is characterized by
752 both an address and a bit offset within the byte at that
753 address. When the storage for an entity includes all of
754 the bits in the beginning byte, the beginning bit offset is
757 Bit offsets in DWARF use the bit numbering and direction
758 conventions that are appropriate to the current language on
761 The member entry corresponding to a data member that is
762 defined in a structure, union or class may have either a
763 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute or a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
764 attribute. If the beginning of the data member is the same as
765 the beginning of the containing entity then neither attribute
768 For a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute there are two cases:
770 \begin{enumerate}[1.]
772 \item If the value is an integer constant, it is the offset
773 in bytes from the beginning of the containing entity. If
774 the beginning of the containing entity has a non-zero bit
775 offset then the beginning of the member entry has that same
778 \item Otherwise, the value must be a location description. In
779 this case, the beginning of the containing entity must be byte
780 aligned. The beginning address is pushed on the DWARF stack
781 before the location description is evaluated; the result of
782 the evaluation is the base address of the member entry.
784 \textit{The push on the DWARF expression stack of the base address of
785 the containing construct is equivalent to execution of the
786 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} operation
787 (see Section \refersec{chap:stackoperations});
788 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} therefore is not needed at the
789 beginning of a location description for a data member. The
790 result of the evaluation is a location--either an address or
791 the name of a register, not an offset to the member.}
793 \textit{A \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute that has the form of a
794 location description is not valid for a data member contained
795 in an entity that is not byte aligned because DWARF operations
796 do not allow for manipulating or computing bit offsets.}
800 For a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, the value is an integer
802 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
803 that specifies the number of bits
804 from the beginning of the containing entity to the beginning
805 of the data member. This value must be greater than or equal
806 to zero, but is not limited to less than the number of bits
809 If the size of a data member is not the same as the size
810 of the type given for the data member, the data member has
811 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose
812 integer constant value
813 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
815 of storage needed to hold the value of the data member.
817 \textit{C and C++ bit fields typically require the use of the
818 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
820 \textit{This Standard uses the following bit numbering and direction
821 conventions in examples. These conventions are for illustrative
822 purposes and other conventions may apply on particular
827 \item \textit{For big\dash endian architectures, bit offsets are
828 counted from high-order to low\dash order bits within a byte (or
829 larger storage unit); in this case, the bit offset identifies
830 the high\dash order bit of the object.}
832 \item \textit{For little\dash endian architectures, bit offsets are
833 counted from low\dash order to high\dash order bits within a byte (or
834 larger storage unit); in this case, the bit offset identifies
835 the low\dash order bit of the object.}
839 \textit{In either case, the bit so identified is defined as the beginning of the object.}
841 \textit{For example, take one possible representation of the following C structure definition in both big\dash and little\dash endian byte orders:}
852 \textit{The following diagrams show the structure layout
853 and data bit offsets for example big\dash\ and little\dash endian
854 architectures, respectively. Both diagrams show a structure
855 that begins at address A and whose size is four bytes. Also,
856 high order bits are to the left and low order bits are to
859 \textit{Big\dash Endian Data Bit Offsets:}
867 Addresses increase ->
868 | A | A + 1 | A + 2 | A + 3 |
870 Data bit offsets increase ->
871 +---------------+---------------+---------------+---------------+
872 |0 4|5 10|11 15|16 23|24 31|
873 | j | k | m | n | <pad> |
875 +---------------------------------------------------------------+
878 \textit{Little\dash Endian Data Bit Offsets:}
884 <- Addresses increase
885 | A | A + 1 | A + 2 | A + 3 |
887 <- Data bit offsets increase
889 +---------------+---------------+---------------+---------------+
890 |31 24|23 16|15 11|10 5|4 0|
891 | <pad> | n | m | k | j |
893 +---------------------------------------------------------------+
897 \textit{Note that data member bit offsets in this example are the
898 same for both big\dash\ and little\dash endian architectures even
899 though the fields are allocated in different directions
900 (high\dash order to low-order versus low\dash order to high\dash order);
901 the bit naming conventions for memory and/or registers of
902 the target architecture may or may not make this seem natural.}
904 \textit{For a more extensive example showing nested and packed records
906 Appendix \refersec{app:pascalexample}.}
908 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
909 is also used for base types
910 (see Section \refersec{chap:basetypeentries}).
912 attributes \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} and \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} when used to
913 identify the beginning of bit field data members as defined
914 in DWARF V3 and earlier. The earlier attributes are defined
915 in a manner suitable for bit field members on big-endian
916 architectures but which is either awkward or incomplete for
917 use on little-endian architectures. (\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} also
918 has other uses that are not affected by this change.)}
920 \textit{The \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
921 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
922 attribute combination is deprecated for data members in DWARF
923 Version 4, but implementations may continue to support this
924 use for compatibility.}
926 \textit{The DWARF Version 3 definitions of these attributes are
929 \begin{myindentpara}{1cm}
930 \textit{If the data member entry describes a bit field, then that
931 entry has the following attributes:}
934 \item \textit{A \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute whose value (see Section
935 2.19) is the number of bytes that contain an instance of the
936 bit field and any padding bits.}
938 \textit{The byte size attribute may be omitted if the size of the
939 object containing the bit field can be inferred from the type
940 attribute of the data member containing the bit field.}
942 \item \textit{A \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute whose value (see Section
943 2.19) is the number of bits to the left of the leftmost
944 (most significant) bit of the bit field value.}
946 \item \textit{A \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose value (see Section
947 2.19) is the number of bits occupied by the bit field value.}
951 \textit{The location description for a bit field calculates the address
952 of an anonymous object containing the bit field. The address
953 is relative to the structure, union, or class that most closely
954 encloses the bit field declaration. The number of bytes in this
955 anonymous object is the value of the byte size attribute of
956 the bit field. The offset (in bits) from the most significant
957 bit of the anonymous object to the most significant bit of
958 the bit field is the value of the bit offset attribute.}
962 \textit{Diagrams similar to the above that show the use of the
963 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute
964 combination may be found in the DWARF Version 3 Standard.}
966 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
967 defines the following combinations of attributes:}
970 \item \textit{either \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} or
971 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} (to specify the beginning of the
974 % FIXME: the indentation of the following line is suspect.
975 \textit{optionally together with}
977 \item \textit{either \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} (to
978 specify the size of the data member)}
982 \textit{DWARF V3 defines the following combinations}
985 \item \textit{\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} (to specify the beginning
986 of the data member, except this specification is only partial
987 in the case of a bit field) }
989 % FIXME: the indentation of the following line is suspect.
990 \textit{optionally together with}
992 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
993 (to further specify the beginning of a bit field data member
994 as well as specify the size of the data member) }
997 \subsection{Member Function Entries}
998 \label{chap:memberfunctionentries}
1000 A member function is represented by a debugging information
1001 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. The member function entry
1002 may contain the same attributes and follows the same rules
1003 as non\dash member global subroutine entries
1004 (see Section \refersec{chap:subroutineandentrypointentries}).
1006 A member function entry may have a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1007 attribute. If no accessibility attribute is present, private
1008 access is assumed for an entry of a class and public access
1009 is assumed for an entry of a structure, union or interface.
1011 If the member function entry describes a virtual function,
1012 then that entry has a \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
1014 If the member function entry describes an explicit member
1015 function, then that entry has a \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1017 An entry for a virtual function also has a
1018 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location} attribute whose value contains
1019 a location description yielding the address of the slot
1020 for the function within the virtual function table for the
1021 enclosing class. The address of an object of the enclosing
1022 type is pushed onto the expression stack before the location
1023 description is evaluated.
1025 If the member function entry describes a non\dash static member
1026 function, then that entry has a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer} attribute
1027 whose value is a reference to the formal parameter entry
1028 that corresponds to the object for which the function is
1029 called. The name attribute of that formal parameter is defined
1030 by the current language (for example, this for C++ or self
1031 for Objective C and some other languages). That parameter
1032 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1034 Conversely, if the member function entry describes a static
1035 member function, the entry does not have a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1038 If the member function entry describes a non\dash static member
1039 function that has a const\dash volatile qualification, then
1040 the entry describes a non\dash static member function whose
1041 object formal parameter has a type that has an equivalent
1042 const\dash volatile qualification.
1044 If a subroutine entry represents the defining declaration
1045 of a member function and that definition appears outside of
1046 the body of the enclosing class declaration, the subroutine
1047 entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute, whose value is
1048 a reference to the debugging information entry representing
1049 the declaration of this function member. The referenced entry
1050 will be a child of some class (or structure) type entry.
1052 Subroutine entries containing the \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1053 attribute do not need to duplicate information provided
1054 by the declaration entry referenced by the specification
1055 attribute. In particular, such entries do not need to contain
1056 attributes for the name or return type of the function member
1057 whose definition they represent.
1059 \subsection{Class Template Instantiations}
1060 \label{chap:classtemplateinstantiations}
1062 \textit{In C++ a class template is a generic definition of a class
1063 type that may be instantiated when an instance of the class
1064 is declared or defined. The generic description of the
1065 class may include both parameterized types and parameterized
1066 constant values. DWARF does not represent the generic template
1067 definition, but does represent each instantiation.}
1069 A class template instantiation is represented by a
1070 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1071 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1072 exceptions, such an entry will contain the same attributes
1073 and have the same types of child entries as would an entry
1074 for a class type defined explicitly using the instantiation
1075 types and values. The exceptions are:
1077 \begin{enumerate}[1.]
1078 \item Each formal parameterized type declaration appearing in the
1079 template definition is represented by a debugging information
1080 entry with the tag \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1081 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1082 a null\dash terminated string containing the name of the formal
1083 type parameter as it appears in the source program. The
1084 template type parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1085 describing the actual type by which the formal is replaced
1086 for this instantiation.
1088 \item Each formal parameterized value declaration appearing in the
1089 template definition is represented by a debugging information
1091 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1093 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1094 a null\dash terminated string containing the name of the formal
1095 value parameter as it appears in the source program. The
1096 template value parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1097 describing the type of the parameterized value. Finally,
1098 the template value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1099 attribute, whose value is the actual constant value of the
1100 value parameter for this instantiation as represented on the
1101 target architecture.
1103 \item The class type entry and each of its child entries references
1104 a template type parameter entry in any circumstance where the
1105 source template definition references a formal parameterized
1106 type. Similarly, the class type entry and each of its child
1107 entries references a template value parameter entry in any
1108 circumstance where the source template definition references
1109 a formal parameterized value.
1111 \item If the compiler has generated a special compilation unit to
1112 hold the template instantiation and that special compilation
1113 unit has a different name from the compilation unit containing
1114 the template definition, the name attribute for the debugging
1115 information entry representing the special compilation unit
1116 should be empty or omitted.
1118 \item If the class type entry representing the template
1119 instantiation or any of its child entries contains declaration
1120 coordinate attributes, those attributes should refer to
1121 the source for the template definition, not to any source
1122 generated artificially by the compiler.
1126 \subsection{Variant Entries}
1127 \label{chap:variantentries}
1129 A variant part of a structure is represented by a debugging
1130 information entry with the
1131 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1132 owned by the corresponding structure type entry.
1134 If the variant part has a discriminant, the discriminant is
1135 represented by a separate debugging information entry which
1136 is a child of the variant part entry. This entry has the form
1137 of a structure data member entry. The variant part entry will
1138 have a \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute whose value is a reference to
1139 the member entry for the discriminant.
1141 If the variant part does not have a discriminant (tag field),
1142 the variant part entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1145 Each variant of a particular variant part is represented by
1146 a debugging information entry with the
1147 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1148 and is a child of the variant part entry. The value that
1149 selects a given variant may be represented in one of three
1150 ways. The variant entry may have a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1151 whose value represents a single case label. The value of this
1152 attribute is encoded as an LEB128 number. The number is signed
1153 if the tag type for the variant part containing this variant
1154 is a signed type. The number is unsigned if the tag type is
1157 Alternatively, the variant entry may contain a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1158 attribute, whose value represents a list of discriminant
1159 values. This list is represented by any of the
1160 \livelink{chap:block}{block} forms and
1161 may contain a mixture of case labels and label ranges. Each
1162 item on the list is prefixed with a discriminant value
1163 descriptor that determines whether the list item represents
1164 a single label or a label range. A single case label is
1165 represented as an LEB128 number as defined above for the
1166 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute. A label range is represented by
1167 two LEB128 numbers, the low value of the range followed by the
1168 high value. Both values follow the rules for signedness just
1169 described. The discriminant value descriptor is an integer
1170 constant that may have one of the values given in
1171 Figure \refersec{fig:discriminantdescriptorvalues}.
1173 \begin{figure}[here]
1174 \autorows[0pt]{c}{1}{l}{
1175 \addtoindex{DW\-\_DSC\-\_label},
1176 \addtoindex{DW\-\_DSC\-\_range}
1178 \caption{Discriminant descriptor values}\label{fig:discriminantdescriptorvalues}
1181 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1182 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1183 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1186 The components selected by a particular variant are represented
1187 by debugging information entries owned by the corresponding
1188 variant entry and appear in the same order as the corresponding
1189 declarations in the source program.
1191 \section{Condition Entries}
1192 \label{chap:conditionentries}
1194 \textit{COBOL has the notion of a ``level\dash 88 condition'' that
1195 associates a data item, called the conditional variable, with
1196 a set of one or more constant values and/or value ranges.
1197 Semantically, the condition is ‛true’ if the conditional
1198 variable's value matches any of the described constants,
1199 and the condition is ‛false’ otherwise.}
1201 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition} debugging information entry
1203 logical condition that tests whether a given data item’s
1204 value matches one of a set of constant values. If a name
1205 has been given to the condition, the condition entry has a
1206 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1207 giving the condition name as it appears in the source program.
1209 The condition entry's parent entry describes the conditional
1210 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1211 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry. If the parent
1212 entry has an array type, the condition can test any individual
1213 element, but not the array as a whole. The condition entry
1214 implicitly specifies a “comparison type” that is the
1215 type of an array element if the parent has an array type;
1216 otherwise it is the type of the parent entry.
1218 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1219 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1220 values associated with the condition. If any child entry has
1221 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, that attribute should describe a type
1222 compatible with the comparison type (according to the source
1223 language); otherwise the child’s type is the same as the
1226 \textit{For conditional variables with alphanumeric types, COBOL
1227 permits a source program to provide ranges of alphanumeric
1228 constants in the condition. Normally a subrange type entry
1229 does not describe ranges of strings; however, this can be
1230 represented using bounds attributes that are references to
1231 constant entries describing strings. A subrange type entry may
1232 refer to constant entries that are siblings of the subrange
1236 \section{Enumeration Type Entries}
1237 \label{chap:enumerationtypeentries}
1239 \textit{An “enumeration type” is a scalar that can assume one of
1240 a fixed number of symbolic values.}
1242 An enumeration type is represented by a debugging information
1244 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1246 If a name has been given to the enumeration type in the source
1247 program, then the corresponding enumeration type entry has
1248 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1249 string containing the enumeration type name as it appears
1250 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1251 attribute whose integer constant value is the number of bytes
1252 required to hold an instance of the enumeration.
1254 The enumeration type entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1255 which refers to the underlying data type used to implement
1258 If an enumeration type has type safe semantics such that
1260 \begin{enumerate}[1.]
1261 \item Enumerators are contained in the scope of the enumeration type, and/or
1263 \item Enumerators are not implicitly converted to another type
1266 then the enumeration type entry may have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1267 attribute, which is a \livelink{chap:flag}{flag}.
1268 In a language that offers only
1269 one kind of enumeration declaration, this attribute is not
1272 \textit{In C or C++, the underlying type will be the appropriate
1273 integral type determined by the compiler from the properties of
1274 the enumeration literal values. A C++ type declaration written
1275 using enum class declares a strongly typed enumeration and
1276 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type} in combination
1277 with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1279 Each enumeration literal is represented by a debugging
1280 information entry with the
1281 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1283 such entry is a child of the enumeration type entry, and the
1284 enumerator entries appear in the same order as the declarations
1285 of the enumeration literals in the source program.
1287 Each enumerator entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1288 value is a null\dash terminated string containing the name of the
1289 enumeration literal as it appears in the source program. Each
1290 enumerator entry also has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1291 whose value is the actual numeric value of the enumerator as
1292 represented on the target system.
1295 If the enumeration type occurs as the description of a
1296 dimension of an array type, and the stride for that dimension
1297 is different than what would otherwise be determined, then
1298 the enumeration type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1299 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1300 between successive elements along the dimension as described
1302 Section \refersec{chap:visibilityofdeclarations}.
1303 The value of the \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1304 is interpreted as bits and the value of the \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1305 attribute is interpreted as bytes.
1308 \section{Subroutine Type Entries}
1309 \label{chap:subroutinetypeentries}
1311 It is possible in C to declare pointers to subroutines
1312 that return a value of a specific type. In both C and C++,
1313 it is possible to declare pointers to subroutines that not
1314 only return a value of a specific type, but accept only
1315 arguments of specific types. The type of such pointers would
1316 be described with a ``pointer to'' modifier applied to a
1317 user\dash defined type.
1319 A subroutine type is represented by a debugging information
1321 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1323 been given to the subroutine type in the source program,
1324 then the corresponding subroutine type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
1325 attribute whose value is a null\dash terminated string containing
1326 the subroutine type name as it appears in the source program.
1328 If the subroutine type describes a function that returns
1329 a value, then the subroutine type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1330 attribute to denote the type returned by the subroutine. If
1331 the types of the arguments are necessary to describe the
1332 subroutine type, then the corresponding subroutine type
1333 entry owns debugging information entries that describe the
1334 arguments. These debugging information entries appear in the
1335 order that the corresponding argument types appear in the
1338 In C there is a difference between the types of functions
1339 declared using function prototype style declarations and
1340 those declared using non\dash prototype declarations.
1342 A subroutine entry declared with a function prototype style
1343 declaration may have a \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1344 a \livelink{chap:flag}{flag}.
1346 Each debugging information entry owned by a subroutine
1347 type entry has a tag whose value has one of two possible
1350 \begin{enumerate}[1.]
1351 \item The formal parameters of a parameter list (that have a
1352 specific type) are represented by a debugging information entry
1353 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}. Each formal parameter
1354 entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1355 the formal parameter.
1357 \item The unspecified parameters of a variable parameter list
1358 are represented by a debugging information entry with the
1359 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1364 \section{String Type Entries}
1365 \label{chap:stringtypeentries}
1368 A ``string'' is a sequence of characters that have specific
1369 semantics and operations that separate them from arrays of
1370 characters. Fortran is one of the languages that has a string
1371 type. Note that ``string'' in this context refers to a target
1372 machine concept, not the class string as used in this document
1373 (except for the name attribute).
1375 A string type is represented by a debugging information entry
1376 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1377 If a name has been given to
1378 the string type in the source program, then the corresponding
1379 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
1380 a null\dash terminated string containing the string type name as
1381 it appears in the source program.
1383 The string type entry may have a \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1384 whose value is a location description yielding the location
1385 where the length of the string is stored in the program. The
1386 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1387 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1388 (see Section \refersec{chap:byteandbitsizes})
1389 is the size of the data to be retrieved from the location
1390 referenced by the string length attribute. If no (byte or bit)
1391 size attribute is present, the size of the data to be retrieved
1392 is the same as the size of an address on the target machine.
1394 If no string length attribute is present, the string type
1395 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1396 attribute, whose value
1397 (see Section \refersec{chap:byteandbitsizes})
1399 storage needed to hold a value of the string type.
1402 \section{Set Type Entries}
1403 \label{chap:settypeentries}
1405 \textit{Pascal provides the concept of a “set,” which represents
1406 a group of values of ordinal type.}
1408 A set is represented by a debugging information entry with
1409 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1410 If a name has been given to the
1411 set type, then the set type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1412 whose value is a null\dash terminated string containing the
1413 set type name as it appears in the source program.
1415 The set type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1416 type of an element of the set.
1418 If the amount of storage allocated to hold each element of an
1419 object of the given set type is different from the amount of
1420 storage that is normally allocated to hold an individual object
1421 of the indicated element type, then the set type entry has
1422 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1423 whose value (see Section \refersec{chap:byteandbitsizes}) is
1424 the amount of storage needed to hold a value of the set type.
1427 \section{Subrange Type Entries}
1428 \label{chap:subrangetypeentries}
1430 \textit{Several languages support the concept of a ``subrange''
1431 type object. These objects can represent a subset of the
1432 values that an object of the basis type for the subrange can
1433 represent. Subrange type entries may also be used to represent
1434 the bounds of array dimensions.}
1436 A subrange type is represented by a debugging information
1438 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
1440 given to the subrange type, then the subrange type entry
1441 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1442 string containing the subrange type name as it appears in
1445 The subrange entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
1446 the type of object, called the basis type, of whose values
1447 this subrange is a subset.
1449 If the amount of storage allocated to hold each element of an
1450 object of the given subrange type is different from the amount
1451 of storage that is normally allocated to hold an individual
1452 object of the indicated element type, then the subrange
1453 type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1454 attribute, whose value
1455 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1457 storage needed to hold a value of the subrange type.
1459 The subrange entry may have a \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
1460 which is a \livelink{chap:flag}{flag}.
1461 If present, this attribute indicates whether
1462 this subrange represents a UPC array bound which is scaled
1463 by the runtime THREADS value (the number of UPC threads in
1464 this execution of the program).
1466 \textit{This allows the representation of a UPC shared array such as}
1469 int shared foo[34*THREADS][10][20];
1472 The subrange entry may have the attributes \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
1473 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound} to specify, respectively, the lower
1474 and upper bound values of the subrange. The \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
1475 attribute may be replaced by a \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute, whose
1476 value describes the number of elements in the subrange rather
1477 than the value of the last element. The value of each of
1478 these attributes is determined as described in
1479 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1481 If the lower bound value is missing, the value is assumed to
1482 be a language\dash dependent default constant. The default lower
1483 bound is 0 for C, C++, D, Java, Objective C, Objective C++,
1484 Python, and UPC. The default lower bound is 1 for Ada, COBOL,
1485 Fortran, Modula\dash 2, Pascal and PL/I.
1487 \textit{No other default lower bound values are currently defined.}
1489 If the upper bound and count are missing, then the upper bound value is
1492 If the subrange entry has no type attribute describing the
1493 basis type, the basis type is assumed to be the same as
1494 the object described by the lower bound attribute (if it
1495 references an object). If there is no lower bound attribute,
1496 or that attribute does not reference an object, the basis type
1497 is the type of the upper bound or count attribute (if either
1498 of them references an object). If there is no upper bound or
1499 count attribute, or neither references an object, the type is
1500 assumed to be the same type, in the source language of the
1501 compilation unit containing the subrange entry, as a signed
1502 integer with the same size as an address on the target machine.
1504 If the subrange type occurs as the description of a dimension
1505 of an array type, and the stride for that dimension is
1506 different than what would otherwise be determined, then
1507 the subrange type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
1508 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1509 between successive elements along the dimension as described
1511 Section \refersec{chap:byteandbitsizes}.
1513 \textit{Note that the stride can be negative.}
1515 \section{Pointer to Member Type Entries}
1516 \label{chap:pointertomembertypeentries}
1518 \textit{In C++, a pointer to a data or function member of a class or
1519 structure is a unique type.}
1521 A debugging information entry representing the type of an
1522 object that is a pointer to a structure or class member has
1523 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
1525 If the pointer to member type has a name, the pointer to
1526 member entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a
1527 null\dash terminated string containing the type name as it appears
1528 in the source program.
1530 The pointer to member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
1531 describe the type of the class or structure member to which
1532 objects of this type may point.
1534 The pointer to member entry also has a \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
1535 attribute, whose value is a reference to a debugging
1536 information entry for the class or structure to whose members
1537 objects of this type may point.
1539 The pointer to member entry has a \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
1540 whose value is a location description that computes the
1541 address of the member of the class to which the pointer to
1542 member entry points.
1544 \textit{The method used to find the address of a given member of a
1545 class or structure is common to any instance of that class
1546 or structure and to any instance of the pointer or member
1547 type. The method is thus associated with the type entry,
1548 rather than with each instance of the type.}
1550 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
1551 with the location descriptions for a particular object of the
1552 given pointer to member type and for a particular structure or
1553 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute expects two
1554 values to be pushed onto the DWARF expression stack before
1555 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated. The first
1556 value pushed is the value of the pointer to member object
1557 itself. The second value pushed is the base address of the
1558 entire structure or union instance containing the member
1559 whose address is being calculated.
1561 \textit{For an expression such as}
1566 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
1567 \textit{where mbr\_ptr has some pointer to member type, a debugger should:}
1569 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
1571 \textit{2. Push the base address of object onto the DWARF expression stack.}
1573 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
1574 given in the type of mbr\_ptr.}
1576 \section{File Type Entries}
1577 \label{chap:filetypeentries}
1579 \textit{Some languages, such as Pascal, provide a data type to represent
1582 A file type is represented by a debugging information entry
1584 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
1585 If the file type has a name,
1586 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value
1587 is a null\dash terminated string containing the type name as it
1588 appears in the source program.
1590 The file type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1591 the type of the objects contained in the file.
1593 The file type entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1594 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1595 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1596 is the amount of storage need to hold a value of the file type.
1598 \section{Dynamic Type Properties}
1599 \label{chap:dynamictypeproperties}
1600 \subsection{Data Location}
1601 \label{chap:datalocation}
1603 \textit{Some languages may represent objects using descriptors to hold
1604 information, including a location and/or run\dash time parameters,
1605 about the data that represents the value for that object.}
1607 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} attribute may be used with any
1608 type that provides one or more levels of hidden indirection
1609 and/or run\dash time parameters in its representation. Its value
1610 is a location description. The result of evaluating this
1611 description yields the location of the data for an object.
1612 When this attribute is omitted, the address of the data is
1613 the same as the address of the object.
1615 \textit{This location description will typically begin with
1616 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} which loads the address of the
1617 object which can then serve as a descriptor in subsequent
1618 calculation. For an example using \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} for a
1619 Fortran 90 array, see
1620 Appendix \refersec{app:fortran90example}.}
1622 \subsection{Allocation and Association Status}
1623 \label{chap:allocationandassociationstatus}
1625 \textit{Some languages, such as Fortran 90, provide types whose values
1626 may be dynamically allocated or associated with a variable
1627 under explicit program control.}
1629 The \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may optionally be used with any
1630 type for which objects of the type can be explicitly allocated
1631 and deallocated. The presence of the attribute indicates that
1632 objects of the type are allocatable and deallocatable. The
1633 integer value of the attribute (see below) specifies whether
1634 an object of the type is currently allocated or not.
1636 The \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute may optionally be used with
1637 any type for which objects of the type can be dynamically
1638 associated with other objects. The presence of the attribute
1639 indicates that objects of the type can be associated. The
1640 integer value of the attribute (see below) indicates whether
1641 an object of the type is currently associated or not.
1643 While these attributes are defined specifically with Fortran
1644 90 ALLOCATABLE and POINTER types in mind, usage is not limited
1645 to just that language.
1647 The value of these attributes is determined as described in
1648 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1650 A non\dash zero value is interpreted as allocated or associated,
1651 and zero is interpreted as not allocated or not associated.
1653 \textit{For Fortran 90, if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is present,
1654 the type has the POINTER property where either the parent
1655 variable is never associated with a dynamic object or the
1656 implementation does not track whether the associated object
1657 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
1658 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
1659 has the ALLOCATABLE property. If both attributes are present,
1660 then the type should be assumed to have the POINTER property
1661 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
1662 be used to indicate that the association status of the object
1663 resulted from execution of an ALLOCATE statement rather than
1664 pointer assignment.}
1666 \textit{For examples using \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for Ada and Fortran 90
1668 see Appendix \refersec{app:aggregateexamples}.}
1672 \section{Template Alias Entries}
1673 \label{chap:templatealiasentries}
1675 A type named using a template alias is represented
1676 by a debugging information entry with the tag
1677 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
1678 The template alias entry has a
1679 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1680 containing the name of the template alias as it appears in
1681 the source program. The template alias entry also contains a
1682 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is a reference to the type
1683 named by the template alias. The template alias entry has
1684 the following child entries:
1686 \begin{enumerate}[1.]
1687 \item Each formal parameterized type declaration appearing
1688 in the template alias declaration is represented
1689 by a debugging information entry with the tag
1690 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each such entry may have
1691 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1692 string containing the name of the formal type parameter as it
1693 appears in the source program. The template type parameter
1694 entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing the actual
1695 type by which the formal is replaced for this instantiation.
1697 \item Each formal parameterized value declaration
1698 appearing in the template alias declaration is
1699 represented by a debugging information entry with the tag
1700 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}. Each such entry may have
1701 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1702 string containing the name of the formal value parameter
1703 as it appears in the source program. The template value
1704 parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1705 the type of the parameterized value. Finally, the template
1706 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute, whose
1707 value is the actual constant value of the value parameter for
1708 this instantiation as represented on the target architecture.