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
316 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
317 whose value is a reference to a debugging information entry
318 describing a base type, a user-defined type or another type
321 A modified type entry describing a pointer or reference
322 type (using \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}, \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type} or
323 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type})
325 \hypertarget{chap:DWATadressclasspointerorreferencetypes}
327 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
328 attribute to describe how objects having the given pointer
329 or reference type ought to be dereferenced.
331 A modified type entry describing a shared qualified type
332 (using \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}) may have a \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute
333 whose value is a constant expressing the blocksize of the
334 type. If no count attribute is present, then the “infinite”
335 blocksize is assumed.
337 When multiple type modifiers are chained together to modify
338 a base or user-defined type, the tree ordering reflects the
339 semantics of the applicable lanuage rather than the textual
340 order in the source presentation.
344 \begin{tabular}{lp{9cm}}
345 Name&Meaning\\ \hline
346 \livetarg{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} & C or C++ const qualified type \\
347 \livetarg{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}& Pascal or Ada packed type \\
348 \livetarg{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} & Pointer to an object of the type being modified \\
349 \livetarg{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}& C++ (lvalue) reference to an object of the type
351 \livetarg{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&C restrict qualified type \\
352 \livetarg{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} & C++ rvalue reference to an object of the type
354 \livetarg{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&UPC shared qualified type \\
355 \livetarg{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&C or C++ volatile qualified type \\
357 \caption{Type modifier tags}
358 \label{fig:typemodifiertags}
361 % The following prevents splitting the examples up.
362 % FIXME perhaps there is a better way. We could box the verbatim,
363 % see memman.pdf on verbatims.
365 \textit{As examples of how tye modifiers are ordered, take the following C
369 const unsigned char * volatile p;
370 which represents a volatile pointer to a constant
371 character. This is encoded in DWARF as:
372 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
373 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
374 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
375 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
376 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
378 volatile unsigned char * const restrict p;
379 on the other hand, represents a restricted constant
380 pointer to a volatile character. This is encoded as:
381 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
382 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type} -->
383 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
384 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
385 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
386 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
390 \section{Typedef Entries}
391 \label{chap:typedefentries}
392 A named type that is defined in terms of another type
393 definition is represented by a debugging information entry with
394 the tag \livetarg{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}.
395 The typedef entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
396 attribute whose value is a null-terminated string containing
397 the name of the typedef as it appears in the source program.
399 The typedef entry may also contain a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose
400 value is a reference to the type named by the typedef. If
401 the debugging information entry for a typedef represents
402 a declaration of the type that is not also a definition,
403 it does not contain a type attribute.
405 \textit{Depending on the language, a named type that is defined in
406 terms of another type may be called a type alias, a subtype,
407 a constrained type and other terms. A type name declared with
408 no defining details may be termed an incomplete, forward
409 or hidden type. While the DWARF \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef} entry was
410 originally inspired by the like named construct in C and C++,
411 it is broadly suitable for similar constructs (by whatever
412 source syntax) in other languages.}
414 \section{Array Type Entries}
415 \label{chap:arraytypeentries}
417 Many languages share the concept of an ``array,'' which is
418 a table of components of identical type.
420 An array type is represented by a debugging information entry
421 with the tag \livetarg{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}.
422 If a name has been given to
423 the array type in the source program, then the corresponding
424 array type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a
425 null-terminated string containing the array type name as it
426 appears in the source program.
428 The array type entry describing a multidimensional array may
429 have a \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute whose integer constant value is
430 interpreted to mean either row-major or column-major ordering
431 of array elements. The set of values and their meanings
432 for the ordering attribute are listed in
433 Figure \refersec{fig:arrayordering}.
435 ordering attribute is present, the default ordering for the
436 source language (which is indicated by the \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
437 attribute of the enclosing compilation unit entry) is assumed.
440 \autorows[0pt]{c}{1}{l}{
441 \livetarg{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major},
442 \livetarg{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}
444 \caption{Array ordering}\label{fig:arrayordering}
447 The ordering attribute may optionally appear on one-dimensional
448 arrays; it will be ignored.
450 An array type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
451 the type of each element of the array.
453 If the amount of storage allocated to hold each element of an
454 object of the given array type is different from the amount
455 of storage that is normally allocated to hold an individual
456 object of the indicated element type, then the array type
457 entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or a \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
458 attribute, whose value
459 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
461 element of the array.
463 The array type entry may have either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
464 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
465 (see Section \refersec{chap:byteandbitsizes}),
467 amount of storage needed to hold an instance of the array type.
469 \textit{If the size of the array can be determined statically at
470 compile time, this value can usually be computed by multiplying
471 the number of array elements by the size of each element.}
474 Each array dimension is described by a debugging information
475 entry with either the tag \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} or the tag
476 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}. These entries are children of the
477 array type entry and are ordered to reflect the appearance of
478 the dimensions in the source program (i.e., leftmost dimension
479 first, next to leftmost second, and so on).
481 In languages, such as C, in which there is no concept of
482 a “multidimensional array”, an array of arrays may
483 be represented by a debugging information entry for a
484 multidimensional array.
486 Other attributes especially applicable to arrays are
487 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated},
488 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} and
489 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location},
490 which are described in
491 Section \refersec{chap:dynamictypeproperties}.
492 For relevant examples,
494 Appendix \refersec{app:fortran90example}.
496 \section{ Structure, Union, Class and Interface Type Entries}
497 \label{chap:structureunionclassandinterfacetypeentries}
499 \textit{The languages C, C++, and Pascal, among others, allow the
500 programmer to define types that are collections of related
501 components. In C and C++, these collections are called
502 “structures.” In Pascal, they are called “records.”
503 The components may be of different types. The components are
504 called “members” in C and C++, and “fields” in Pascal.}
506 \textit{The components of these collections each exist in their
507 own space in computer memory. The components of a C or C++
508 “union” all coexist in the same memory.}
510 \textit{Pascal and other languages have a “discriminated union,”
511 also called a “variant record.” Here, selection of a
512 number of alternative substructures (“variants”) is based
513 on the value of a component that is not part of any of those
514 substructures (the “discriminant”).}
516 \textit{C++ and Java have the notion of "class”, which is in some
517 ways similar to a structure. A class may have “member
518 functions” which are subroutines that are within the scope
519 of a class or structure.}
521 \textit{The C++ notion of structure is more general than in C, being
522 equivalent to a class with minor differences. Accordingly,
523 in the following discussion statements about C++ classes may
524 be understood to apply to C++ structures as well.}
526 \subsection{Structure, Union and Class Type Entries}
527 \label{chap:structureunionandclasstypeentries}
530 Structure, union, and class types are represented by debugging
531 information entries with
532 the tags \livetarg{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type},
533 \livetarg{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type},
534 and \livetarg{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
535 respectively. If a name has been given to the structure,
536 union, or class in the source program, then the corresponding
537 structure type, union type, or class type entry has a
538 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
539 containing the type name as it appears in the source program.
541 The members of a structure, union, or class are represented
542 by debugging information entries that are owned by the
543 corresponding structure type, union type, or class type entry
544 and appear in the same order as the corresponding declarations
545 in the source program.
547 A structure type, union type or class type entry may have
548 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
549 (see Section \refersec{chap:byteandbitsizes}),
550 whose value is the amount of storage needed
551 to hold an instance of the structure, union or class type,
552 including any padding. An incomplete structure, union or
553 class type is represented by a structure, union or class
554 entry that does not have a byte size attribute and that has
555 a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
557 If the complete declaration of a type has been placed in
559 (see Section \refersec{chap:separatetypeunitentries}),
561 declaration of that type in the compilation unit may provide
562 the unique 64\dash bit signature of the type using a \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature}
565 If a structure, union or class entry represents the definition
566 of a structure, class or union member corresponding to a prior
567 incomplete structure, class or union, the entry may have a
568 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute whose value is a reference to
569 the debugging information entry representing that incomplete
572 Structure, union and class entries containing the
573 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute do not need to duplicate
574 information provided by the declaration entry referenced by the
575 specification attribute. In particular, such entries do not
576 need to contain an attribute for the name of the structure,
577 class or union they represent if such information is already
578 provided in the declaration.
580 \textit{For C and C++, data member declarations occurring within
581 the declaration of a structure, union or class type are
582 considered to be “definitions” of those members, with
583 the exception of “static” data members, whose definitions
584 appear outside of the declaration of the enclosing structure,
585 union or class type. Function member declarations appearing
586 within a structure, union or class type declaration are
587 definitions only if the body of the function also appears
588 within the type declaration.}
590 If the definition for a given member of the structure, union
591 or class does not appear within the body of the declaration,
592 that member also has a debugging information entry describing
593 its definition. That latter entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
594 attribute referencing the debugging information entry
595 owned by the body of the structure, union or class entry and
596 representing a non\dash defining declaration of the data, function
597 or type member. The referenced entry will not have information
598 about the location of that member (low and high pc attributes
599 for function members, location descriptions for data members)
600 and will have a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
602 \textit{Consider a nested class whose
603 definition occurs outside of the containing class definition, as in:}
612 \textit{The two different structs can be described in
613 different compilation units to
614 facilitate DWARF space compression
615 (see Appendix \refersec{app:usingcompilationunits}).}
617 \subsection{Interface Type Entries}
618 \label{chap:interfacetypeentries}
620 \textit{The Java language defines "interface" types. An interface
621 in Java is similar to a C++ or Java class with only abstract
622 methods and constant data members.}
624 Interface types are represented by debugging information
626 tag \livetarg{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}.
628 An interface type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
629 value is a null-terminated string containing the type name
630 as it appears in the source program.
632 The members of an interface are represented by debugging
633 information entries that are owned by the interface type
634 entry and that appear in the same order as the corresponding
635 declarations in the source program.
637 \subsection{Derived or Extended Structs, Classes and Interfaces}
638 \label{chap:derivedorextendedstructsclasesandinterfaces}
640 \textit{In C++, a class (or struct) may be ``derived from'' or be a
641 ``subclass of'' another class. In Java, an interface may ``extend''
642 one or more other interfaces, and a class may "extend" another
643 class and/or "implement" one or more interfaces. All of these
644 relationships may be described using the following. Note that
645 in Java, the distinction between extends and implements is
646 implied by the entities at the two ends of the relationship.}
648 A class type or interface type entry that describes a
649 derived, extended or implementing class or interface owns
650 debugging information entries describing each of the classes
651 or interfaces it is derived from, extending or implementing,
652 respectively, ordered as they were in the source program. Each
654 tag \livetarg{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}.
656 An inheritance entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is
657 a reference to the debugging information entry describing the
658 class or interface from which the parent class or structure
659 of the inheritance entry is derived, extended or implementing.
661 An inheritance entry for a class that derives from or extends
662 another class or struct also has a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
663 attribute, whose value describes the location of the beginning
664 of the inherited type relative to the beginning address of the
665 derived class. If that value is a constant, it is the offset
666 in bytes from the beginning of the class to the beginning of
667 the inherited type. Otherwise, the value must be a location
668 description. In this latter case, the beginning address of
669 the derived class is pushed on the expression stack before
670 the location description is evaluated and the result of the
671 evaluation is the location of the inherited type.
673 \textit{The interpretation of the value of this attribute for
674 inherited types is the same as the interpretation for data
676 (see Section \refersec{chap:datamemberentries}). }
679 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}
681 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
682 attribute. If no accessibility attribute
683 is present, private access is assumed for an entry of a class
684 and public access is assumed for an entry of an interface,
687 If the class referenced by the inheritance entry serves
688 as a C++ virtual base class, the inheritance entry has a
689 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
691 \textit{For a C++ virtual base, the data member location attribute
692 will usually consist of a non-trivial location description.}
694 \subsection{Access Declarations}
695 \label{chap:accessdeclarations}
697 \textit{In C++, a derived class may contain access declarations that
698 change the accessibility of individual class members from the
699 overall accessibility specified by the inheritance declaration.
700 A single access declaration may refer to a set of overloaded
703 If a derived class or structure contains access declarations,
704 each such declaration may be represented by a debugging
705 information entry with the tag
706 \livetarg{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}.
708 such entry is a child of the class or structure type entry.
710 An access declaration entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
711 value is a null-terminated string representing the name used
712 in the declaration in the source program, including any class
713 or structure qualifiers.
715 An access declaration entry
716 \hypertarget{chap:DWATaccessibilitycppbaseclasses}
718 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
719 attribute describing the declared accessibility of the named
726 Each ``friend'' declared by a structure, union or class
727 type may be represented by a debugging information entry
728 that is a child of the structure, union or class type entry;
729 the friend entry has the
730 tag \livetarg{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}.
732 A friend entry has a \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute, whose value is
733 a reference to the debugging information entry describing
734 the declaration of the friend.
737 \subsection{Data Member Entries}
738 \label{chap:datamemberentries}
740 A data member (as opposed to a member function) is
741 represented by a debugging information entry with the
742 tag \livetarg{chap:DWTAGmember}{DW\-\_TAG\-\_member}.
743 The member entry for a named member has
744 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null-terminated
745 string containing the member name as it appears in the source
746 program. If the member entry describes an anonymous union, the
747 name attribute is omitted or consists of a single zero byte.
749 The data member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote
750 the type of that member.
752 A data member entry may have a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
753 attribute. If no accessibility attribute is present, private
754 access is assumed for an entry of a class and public access
755 is assumed for an entry of a structure, union, or interface.
757 A data member entry may have a \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable} attribute,
758 which is a \livelink{chap:flag}{flag}.
759 This attribute indicates whether the data
760 member was declared with the mutable storage class specifier.
762 The beginning of a data member is described relative to
763 the beginning of the object in which it is immediately
764 contained. In general, the beginning is characterized by
765 both an address and a bit offset within the byte at that
766 address. When the storage for an entity includes all of
767 the bits in the beginning byte, the beginning bit offset is
770 Bit offsets in DWARF use the bit numbering and direction
771 conventions that are appropriate to the current language on
774 The member entry corresponding to a data member that is
775 defined in a structure, union or class may have either a
776 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute or a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
777 attribute. If the beginning of the data member is the same as
778 the beginning of the containing entity then neither attribute
781 For a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute there are two cases:
783 \begin{enumerate}[1.]
785 \item If the value is an integer constant, it is the offset
786 in bytes from the beginning of the containing entity. If
787 the beginning of the containing entity has a non-zero bit
788 offset then the beginning of the member entry has that same
791 \item Otherwise, the value must be a location description. In
792 this case, the beginning of the containing entity must be byte
793 aligned. The beginning address is pushed on the DWARF stack
794 before the location description is evaluated; the result of
795 the evaluation is the base address of the member entry.
797 \textit{The push on the DWARF expression stack of the base address of
798 the containing construct is equivalent to execution of the
799 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} operation
800 (see Section \refersec{chap:stackoperations});
801 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} therefore is not needed at the
802 beginning of a location description for a data member. The
803 result of the evaluation is a location--either an address or
804 the name of a register, not an offset to the member.}
806 \textit{A \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute that has the form of a
807 location description is not valid for a data member contained
808 in an entity that is not byte aligned because DWARF operations
809 do not allow for manipulating or computing bit offsets.}
813 For a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, the value is an integer
815 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
816 that specifies the number of bits
817 from the beginning of the containing entity to the beginning
818 of the data member. This value must be greater than or equal
819 to zero, but is not limited to less than the number of bits
822 If the size of a data member is not the same as the size
823 of the type given for the data member, the data member has
824 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose
825 integer constant value
826 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
828 of storage needed to hold the value of the data member.
830 \textit{C and C++ bit fields typically require the use of the
831 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
833 \textit{This Standard uses the following bit numbering and direction
834 conventions in examples. These conventions are for illustrative
835 purposes and other conventions may apply on particular
840 \item \textit{For big\dash endian architectures, bit offsets are
841 counted from high-order to low\dash order bits within a byte (or
842 larger storage unit); in this case, the bit offset identifies
843 the high\dash order bit of the object.}
845 \item \textit{For little\dash endian architectures, bit offsets are
846 counted from low\dash order to high\dash order bits within a byte (or
847 larger storage unit); in this case, the bit offset identifies
848 the low\dash order bit of the object.}
852 \textit{In either case, the bit so identified is defined as the beginning of the object.}
854 \textit{For example, take one possible representation of the following C structure definition in both big\dash and little\dash endian byte orders:}
865 \textit{The following diagrams show the structure layout
866 and data bit offsets for example big\dash\ and little\dash endian
867 architectures, respectively. Both diagrams show a structure
868 that begins at address A and whose size is four bytes. Also,
869 high order bits are to the left and low order bits are to
872 \textit{Big\dash Endian Data Bit Offsets:}
880 Addresses increase ->
881 | A | A + 1 | A + 2 | A + 3 |
883 Data bit offsets increase ->
884 +---------------+---------------+---------------+---------------+
885 |0 4|5 10|11 15|16 23|24 31|
886 | j | k | m | n | <pad> |
888 +---------------------------------------------------------------+
891 \textit{Little\dash Endian Data Bit Offsets:}
897 <- Addresses increase
898 | A | A + 1 | A + 2 | A + 3 |
900 <- Data bit offsets increase
902 +---------------+---------------+---------------+---------------+
903 |31 24|23 16|15 11|10 5|4 0|
904 | <pad> | n | m | k | j |
906 +---------------------------------------------------------------+
910 \textit{Note that data member bit offsets in this example are the
911 same for both big\dash\ and little\dash endian architectures even
912 though the fields are allocated in different directions
913 (high\dash order to low-order versus low\dash order to high\dash order);
914 the bit naming conventions for memory and/or registers of
915 the target architecture may or may not make this seem natural.}
917 \textit{For a more extensive example showing nested and packed records
919 Appendix \refersec{app:pascalexample}.}
921 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
922 is also used for base types
923 (see Section \refersec{chap:basetypeentries}).
925 attributes \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} and \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} when used to
926 identify the beginning of bit field data members as defined
927 in DWARF V3 and earlier. The earlier attributes are defined
928 in a manner suitable for bit field members on big-endian
929 architectures but which is either awkward or incomplete for
930 use on little-endian architectures. (\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} also
931 has other uses that are not affected by this change.)}
933 \textit{The \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
934 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
935 attribute combination is deprecated for data members in DWARF
936 Version 4, but implementations may continue to support this
937 use for compatibility.}
939 \textit{The DWARF Version 3 definitions of these attributes are
942 \begin{myindentpara}{1cm}
943 \textit{If the data member entry describes a bit field, then that
944 entry has the following attributes:}
947 \item \textit{A \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute whose value (see Section
948 2.19) is the number of bytes that contain an instance of the
949 bit field and any padding bits.}
951 \textit{The byte size attribute may be omitted if the size of the
952 object containing the bit field can be inferred from the type
953 attribute of the data member containing the bit field.}
955 \item \textit{A \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute whose value (see Section
956 2.19) is the number of bits to the left of the leftmost
957 (most significant) bit of the bit field value.}
959 \item \textit{A \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose value (see Section
960 2.19) is the number of bits occupied by the bit field value.}
964 \textit{The location description for a bit field calculates the address
965 of an anonymous object containing the bit field. The address
966 is relative to the structure, union, or class that most closely
967 encloses the bit field declaration. The number of bytes in this
968 anonymous object is the value of the byte size attribute of
969 the bit field. The offset (in bits) from the most significant
970 bit of the anonymous object to the most significant bit of
971 the bit field is the value of the bit offset attribute.}
975 \textit{Diagrams similar to the above that show the use of the
976 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute
977 combination may be found in the DWARF Version 3 Standard.}
979 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
980 defines the following combinations of attributes:}
983 \item \textit{either \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} or
984 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} (to specify the beginning of the
987 % FIXME: the indentation of the following line is suspect.
988 \textit{optionally together with}
990 \item \textit{either \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} (to
991 specify the size of the data member)}
995 \textit{DWARF V3 defines the following combinations}
998 \item \textit{\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} (to specify the beginning
999 of the data member, except this specification is only partial
1000 in the case of a bit field) }
1002 % FIXME: the indentation of the following line is suspect.
1003 \textit{optionally together with}
1005 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1006 (to further specify the beginning of a bit field data member
1007 as well as specify the size of the data member) }
1010 \subsection{Member Function Entries}
1011 \label{chap:memberfunctionentries}
1013 A member function is represented by a debugging information
1014 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. The member function entry
1015 may contain the same attributes and follows the same rules
1016 as non\dash member global subroutine entries
1017 (see Section \refersec{chap:subroutineandentrypointentries}).
1019 A member function entry may have a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1020 attribute. If no accessibility attribute is present, private
1021 access is assumed for an entry of a class and public access
1022 is assumed for an entry of a structure, union or interface.
1024 If the member function entry describes a virtual function,
1025 then that entry has a \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
1027 If the member function entry describes an explicit member
1028 function, then that entry has a \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1030 An entry for a virtual function also has a
1031 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location} attribute whose value contains
1032 a location description yielding the address of the slot
1033 for the function within the virtual function table for the
1034 enclosing class. The address of an object of the enclosing
1035 type is pushed onto the expression stack before the location
1036 description is evaluated.
1038 If the member function entry describes a non\dash static member
1039 function, then that entry has a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer} attribute
1040 whose value is a reference to the formal parameter entry
1041 that corresponds to the object for which the function is
1042 called. The name attribute of that formal parameter is defined
1043 by the current language (for example, this for C++ or self
1044 for Objective C and some other languages). That parameter
1045 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1047 Conversely, if the member function entry describes a static
1048 member function, the entry does not have a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1051 If the member function entry describes a non\dash static member
1052 function that has a const\dash volatile qualification, then
1053 the entry describes a non\dash static member function whose
1054 object formal parameter has a type that has an equivalent
1055 const\dash volatile qualification.
1057 If a subroutine entry represents the defining declaration
1058 of a member function and that definition appears outside of
1059 the body of the enclosing class declaration, the subroutine
1060 entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute, whose value is
1061 a reference to the debugging information entry representing
1062 the declaration of this function member. The referenced entry
1063 will be a child of some class (or structure) type entry.
1065 Subroutine entries containing the \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1066 attribute do not need to duplicate information provided
1067 by the declaration entry referenced by the specification
1068 attribute. In particular, such entries do not need to contain
1069 attributes for the name or return type of the function member
1070 whose definition they represent.
1072 \subsection{Class Template Instantiations}
1073 \label{chap:classtemplateinstantiations}
1075 \textit{In C++ a class template is a generic definition of a class
1076 type that may be instantiated when an instance of the class
1077 is declared or defined. The generic description of the
1078 class may include both parameterized types and parameterized
1079 constant values. DWARF does not represent the generic template
1080 definition, but does represent each instantiation.}
1082 A class template instantiation is represented by a
1083 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1084 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1085 exceptions, such an entry will contain the same attributes
1086 and have the same types of child entries as would an entry
1087 for a class type defined explicitly using the instantiation
1088 types and values. The exceptions are:
1090 \begin{enumerate}[1.]
1091 \item Each formal parameterized type declaration appearing in the
1092 template definition is represented by a debugging information
1093 entry with the tag \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1094 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1095 a null\dash terminated string containing the name of the formal
1096 type parameter as it appears in the source program. The
1097 template type parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1098 describing the actual type by which the formal is replaced
1099 for this instantiation.
1101 \item Each formal parameterized value declaration appearing in the
1102 template definition is represented by a debugging information
1104 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1106 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1107 a null\dash terminated string containing the name of the formal
1108 value parameter as it appears in the source program. The
1109 template value parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1110 describing the type of the parameterized value. Finally,
1111 the template value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1112 attribute, whose value is the actual constant value of the
1113 value parameter for this instantiation as represented on the
1114 target architecture.
1116 \item The class type entry and each of its child entries references
1117 a template type parameter entry in any circumstance where the
1118 source template definition references a formal parameterized
1119 type. Similarly, the class type entry and each of its child
1120 entries references a template value parameter entry in any
1121 circumstance where the source template definition references
1122 a formal parameterized value.
1124 \item If the compiler has generated a special compilation unit to
1125 hold the template instantiation and that special compilation
1126 unit has a different name from the compilation unit containing
1127 the template definition, the name attribute for the debugging
1128 information entry representing the special compilation unit
1129 should be empty or omitted.
1131 \item If the class type entry representing the template
1132 instantiation or any of its child entries contains declaration
1133 coordinate attributes, those attributes should refer to
1134 the source for the template definition, not to any source
1135 generated artificially by the compiler.
1139 \subsection{Variant Entries}
1140 \label{chap:variantentries}
1142 A variant part of a structure is represented by a debugging
1143 information entry with the
1144 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1145 owned by the corresponding structure type entry.
1147 If the variant part has a discriminant, the discriminant is
1148 represented by a separate debugging information entry which
1149 is a child of the variant part entry. This entry has the form
1150 of a structure data member entry. The variant part entry will
1151 have a \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute whose value is a reference to
1152 the member entry for the discriminant.
1154 If the variant part does not have a discriminant (tag field),
1155 the variant part entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1158 Each variant of a particular variant part is represented by
1159 a debugging information entry with the
1160 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1161 and is a child of the variant part entry. The value that
1162 selects a given variant may be represented in one of three
1163 ways. The variant entry may have a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1164 whose value represents a single case label. The value of this
1165 attribute is encoded as an LEB128 number. The number is signed
1166 if the tag type for the variant part containing this variant
1167 is a signed type. The number is unsigned if the tag type is
1170 Alternatively, the variant entry may contain a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1171 attribute, whose value represents a list of discriminant
1172 values. This list is represented by any of the
1173 \livelink{chap:block}{block} forms and
1174 may contain a mixture of case labels and label ranges. Each
1175 item on the list is prefixed with a discriminant value
1176 descriptor that determines whether the list item represents
1177 a single label or a label range. A single case label is
1178 represented as an LEB128 number as defined above for the
1179 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute. A label range is represented by
1180 two LEB128 numbers, the low value of the range followed by the
1181 high value. Both values follow the rules for signedness just
1182 described. The discriminant value descriptor is an integer
1183 constant that may have one of the values given in
1184 Figure \refersec{fig:discriminantdescriptorvalues}.
1186 \begin{figure}[here]
1187 \autorows[0pt]{c}{1}{l}{
1188 \addtoindex{DW\-\_DSC\-\_label},
1189 \addtoindex{DW\-\_DSC\-\_range}
1191 \caption{Discriminant descriptor values}\label{fig:discriminantdescriptorvalues}
1194 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1195 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1196 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1199 The components selected by a particular variant are represented
1200 by debugging information entries owned by the corresponding
1201 variant entry and appear in the same order as the corresponding
1202 declarations in the source program.
1204 \section{Condition Entries}
1205 \label{chap:conditionentries}
1207 \textit{COBOL has the notion of a ``level\dash 88 condition'' that
1208 associates a data item, called the conditional variable, with
1209 a set of one or more constant values and/or value ranges.
1210 Semantically, the condition is ‛true’ if the conditional
1211 variable's value matches any of the described constants,
1212 and the condition is ‛false’ otherwise.}
1214 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition} debugging information entry
1216 logical condition that tests whether a given data item’s
1217 value matches one of a set of constant values. If a name
1218 has been given to the condition, the condition entry has a
1219 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1220 giving the condition name as it appears in the source program.
1222 The condition entry's parent entry describes the conditional
1223 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1224 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry. If the parent
1225 entry has an array type, the condition can test any individual
1226 element, but not the array as a whole. The condition entry
1227 implicitly specifies a “comparison type” that is the
1228 type of an array element if the parent has an array type;
1229 otherwise it is the type of the parent entry.
1231 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1232 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1233 values associated with the condition. If any child entry has
1234 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, that attribute should describe a type
1235 compatible with the comparison type (according to the source
1236 language); otherwise the child’s type is the same as the
1239 \textit{For conditional variables with alphanumeric types, COBOL
1240 permits a source program to provide ranges of alphanumeric
1241 constants in the condition. Normally a subrange type entry
1242 does not describe ranges of strings; however, this can be
1243 represented using bounds attributes that are references to
1244 constant entries describing strings. A subrange type entry may
1245 refer to constant entries that are siblings of the subrange
1249 \section{Enumeration Type Entries}
1250 \label{chap:enumerationtypeentries}
1252 \textit{An “enumeration type” is a scalar that can assume one of
1253 a fixed number of symbolic values.}
1255 An enumeration type is represented by a debugging information
1257 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1259 If a name has been given to the enumeration type in the source
1260 program, then the corresponding enumeration type entry has
1261 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1262 string containing the enumeration type name as it appears
1263 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1264 attribute whose integer constant value is the number of bytes
1265 required to hold an instance of the enumeration.
1267 The enumeration type entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1268 which refers to the underlying data type used to implement
1271 If an enumeration type has type safe semantics such that
1273 \begin{enumerate}[1.]
1274 \item Enumerators are contained in the scope of the enumeration type, and/or
1276 \item Enumerators are not implicitly converted to another type
1279 then the enumeration type entry may have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1280 attribute, which is a \livelink{chap:flag}{flag}.
1281 In a language that offers only
1282 one kind of enumeration declaration, this attribute is not
1285 \textit{In C or C++, the underlying type will be the appropriate
1286 integral type determined by the compiler from the properties of
1287 the enumeration literal values. A C++ type declaration written
1288 using enum class declares a strongly typed enumeration and
1289 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type} in combination
1290 with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1292 Each enumeration literal is represented by a debugging
1293 information entry with the
1294 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1296 such entry is a child of the enumeration type entry, and the
1297 enumerator entries appear in the same order as the declarations
1298 of the enumeration literals in the source program.
1300 Each enumerator entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1301 value is a null\dash terminated string containing the name of the
1302 enumeration literal as it appears in the source program. Each
1303 enumerator entry also has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1304 whose value is the actual numeric value of the enumerator as
1305 represented on the target system.
1308 If the enumeration type occurs as the description of a
1309 dimension of an array type, and the stride for that dimension
1310 is different than what would otherwise be determined, then
1311 the enumeration type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1312 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1313 between successive elements along the dimension as described
1315 Section \refersec{chap:visibilityofdeclarations}.
1316 The value of the \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1317 is interpreted as bits and the value of the \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1318 attribute is interpreted as bytes.
1321 \section{Subroutine Type Entries}
1322 \label{chap:subroutinetypeentries}
1324 It is possible in C to declare pointers to subroutines
1325 that return a value of a specific type. In both C and C++,
1326 it is possible to declare pointers to subroutines that not
1327 only return a value of a specific type, but accept only
1328 arguments of specific types. The type of such pointers would
1329 be described with a ``pointer to'' modifier applied to a
1330 user\dash defined type.
1332 A subroutine type is represented by a debugging information
1334 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1336 been given to the subroutine type in the source program,
1337 then the corresponding subroutine type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
1338 attribute whose value is a null\dash terminated string containing
1339 the subroutine type name as it appears in the source program.
1341 If the subroutine type describes a function that returns
1342 a value, then the subroutine type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1343 attribute to denote the type returned by the subroutine. If
1344 the types of the arguments are necessary to describe the
1345 subroutine type, then the corresponding subroutine type
1346 entry owns debugging information entries that describe the
1347 arguments. These debugging information entries appear in the
1348 order that the corresponding argument types appear in the
1351 In C there is a difference between the types of functions
1352 declared using function prototype style declarations and
1353 those declared using non\dash prototype declarations.
1355 A subroutine entry declared with a function prototype style
1356 declaration may have a \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1357 a \livelink{chap:flag}{flag}.
1359 Each debugging information entry owned by a subroutine
1360 type entry has a tag whose value has one of two possible
1363 \begin{enumerate}[1.]
1364 \item The formal parameters of a parameter list (that have a
1365 specific type) are represented by a debugging information entry
1366 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}. Each formal parameter
1367 entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1368 the formal parameter.
1370 \item The unspecified parameters of a variable parameter list
1371 are represented by a debugging information entry with the
1372 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1377 \section{String Type Entries}
1378 \label{chap:stringtypeentries}
1381 A ``string'' is a sequence of characters that have specific
1382 semantics and operations that separate them from arrays of
1383 characters. Fortran is one of the languages that has a string
1384 type. Note that ``string'' in this context refers to a target
1385 machine concept, not the class string as used in this document
1386 (except for the name attribute).
1388 A string type is represented by a debugging information entry
1389 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1390 If a name has been given to
1391 the string type in the source program, then the corresponding
1392 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
1393 a null\dash terminated string containing the string type name as
1394 it appears in the source program.
1396 The string type entry may have a \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1397 whose value is a location description yielding the location
1398 where the length of the string is stored in the program. The
1399 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1400 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1401 (see Section \refersec{chap:byteandbitsizes})
1402 is the size of the data to be retrieved from the location
1403 referenced by the string length attribute. If no (byte or bit)
1404 size attribute is present, the size of the data to be retrieved
1405 is the same as the size of an address on the target machine.
1407 If no string length attribute is present, the string type
1408 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1409 attribute, whose value
1410 (see Section \refersec{chap:byteandbitsizes})
1412 storage needed to hold a value of the string type.
1415 \section{Set Type Entries}
1416 \label{chap:settypeentries}
1418 \textit{Pascal provides the concept of a “set,” which represents
1419 a group of values of ordinal type.}
1421 A set is represented by a debugging information entry with
1422 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1423 If a name has been given to the
1424 set type, then the set type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1425 whose value is a null\dash terminated string containing the
1426 set type name as it appears in the source program.
1428 The set type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1429 type of an element of the set.
1431 If the amount of storage allocated to hold each element of an
1432 object of the given set type is different from the amount of
1433 storage that is normally allocated to hold an individual object
1434 of the indicated element type, then the set type entry has
1435 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1436 whose value (see Section \refersec{chap:byteandbitsizes}) is
1437 the amount of storage needed to hold a value of the set type.
1440 \section{Subrange Type Entries}
1441 \label{chap:subrangetypeentries}
1443 \textit{Several languages support the concept of a ``subrange''
1444 type object. These objects can represent a subset of the
1445 values that an object of the basis type for the subrange can
1446 represent. Subrange type entries may also be used to represent
1447 the bounds of array dimensions.}
1449 A subrange type is represented by a debugging information
1451 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
1453 given to the subrange type, then the subrange type entry
1454 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1455 string containing the subrange type name as it appears in
1458 The subrange entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
1459 the type of object, called the basis type, of whose values
1460 this subrange is a subset.
1462 If the amount of storage allocated to hold each element of an
1463 object of the given subrange type is different from the amount
1464 of storage that is normally allocated to hold an individual
1465 object of the indicated element type, then the subrange
1466 type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1467 attribute, whose value
1468 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1470 storage needed to hold a value of the subrange type.
1472 The subrange entry may have a \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
1473 which is a \livelink{chap:flag}{flag}.
1474 If present, this attribute indicates whether
1475 this subrange represents a UPC array bound which is scaled
1476 by the runtime THREADS value (the number of UPC threads in
1477 this execution of the program).
1479 \textit{This allows the representation of a UPC shared array such as}
1482 int shared foo[34*THREADS][10][20];
1485 The subrange entry may have the attributes \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
1486 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound} to specify, respectively, the lower
1487 and upper bound values of the subrange. The \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
1488 attribute may be replaced by a \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute, whose
1489 value describes the number of elements in the subrange rather
1490 than the value of the last element. The value of each of
1491 these attributes is determined as described in
1492 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1494 If the lower bound value is missing, the value is assumed to
1495 be a language\dash dependent default constant. The default lower
1496 bound is 0 for C, C++, D, Java, Objective C, Objective C++,
1497 Python, and UPC. The default lower bound is 1 for Ada, COBOL,
1498 Fortran, Modula\dash 2, Pascal and PL/I.
1500 \textit{No other default lower bound values are currently defined.}
1502 If the upper bound and count are missing, then the upper bound value is
1505 If the subrange entry has no type attribute describing the
1506 basis type, the basis type is assumed to be the same as
1507 the object described by the lower bound attribute (if it
1508 references an object). If there is no lower bound attribute,
1509 or that attribute does not reference an object, the basis type
1510 is the type of the upper bound or count attribute (if either
1511 of them references an object). If there is no upper bound or
1512 count attribute, or neither references an object, the type is
1513 assumed to be the same type, in the source language of the
1514 compilation unit containing the subrange entry, as a signed
1515 integer with the same size as an address on the target machine.
1517 If the subrange type occurs as the description of a dimension
1518 of an array type, and the stride for that dimension is
1519 different than what would otherwise be determined, then
1520 the subrange type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
1521 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1522 between successive elements along the dimension as described
1524 Section \refersec{chap:byteandbitsizes}.
1526 \textit{Note that the stride can be negative.}
1528 \section{Pointer to Member Type Entries}
1529 \label{chap:pointertomembertypeentries}
1531 \textit{In C++, a pointer to a data or function member of a class or
1532 structure is a unique type.}
1534 A debugging information entry representing the type of an
1535 object that is a pointer to a structure or class member has
1536 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
1538 If the pointer to member type has a name, the pointer to
1539 member entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a
1540 null\dash terminated string containing the type name as it appears
1541 in the source program.
1543 The pointer to member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
1544 describe the type of the class or structure member to which
1545 objects of this type may point.
1547 The pointer to member entry also has a \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
1548 attribute, whose value is a reference to a debugging
1549 information entry for the class or structure to whose members
1550 objects of this type may point.
1552 The pointer to member entry has a \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
1553 whose value is a location description that computes the
1554 address of the member of the class to which the pointer to
1555 member entry points.
1557 \textit{The method used to find the address of a given member of a
1558 class or structure is common to any instance of that class
1559 or structure and to any instance of the pointer or member
1560 type. The method is thus associated with the type entry,
1561 rather than with each instance of the type.}
1563 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
1564 with the location descriptions for a particular object of the
1565 given pointer to member type and for a particular structure or
1566 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute expects two
1567 values to be pushed onto the DWARF expression stack before
1568 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated. The first
1569 value pushed is the value of the pointer to member object
1570 itself. The second value pushed is the base address of the
1571 entire structure or union instance containing the member
1572 whose address is being calculated.
1574 \textit{For an expression such as}
1579 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
1580 \textit{where mbr\_ptr has some pointer to member type, a debugger should:}
1582 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
1584 \textit{2. Push the base address of object onto the DWARF expression stack.}
1586 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
1587 given in the type of mbr\_ptr.}
1589 \section{File Type Entries}
1590 \label{chap:filetypeentries}
1592 \textit{Some languages, such as Pascal, provide a data type to represent
1595 A file type is represented by a debugging information entry
1597 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
1598 If the file type has a name,
1599 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value
1600 is a null\dash terminated string containing the type name as it
1601 appears in the source program.
1603 The file type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1604 the type of the objects contained in the file.
1606 The file type entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1607 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1608 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1609 is the amount of storage need to hold a value of the file type.
1611 \section{Dynamic Type Properties}
1612 \label{chap:dynamictypeproperties}
1613 \subsection{Data Location}
1614 \label{chap:datalocation}
1616 \textit{Some languages may represent objects using descriptors to hold
1617 information, including a location and/or run\dash time parameters,
1618 about the data that represents the value for that object.}
1620 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} attribute may be used with any
1621 type that provides one or more levels of hidden indirection
1622 and/or run\dash time parameters in its representation. Its value
1623 is a location description. The result of evaluating this
1624 description yields the location of the data for an object.
1625 When this attribute is omitted, the address of the data is
1626 the same as the address of the object.
1628 \textit{This location description will typically begin with
1629 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
1630 which loads the address of the
1631 object which can then serve as a descriptor in subsequent
1632 calculation. For an example using
1633 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
1634 for a Fortran 90 array, see
1635 Appendix \refersec{app:fortran90example}.}
1637 \subsection{Allocation and Association Status}
1638 \label{chap:allocationandassociationstatus}
1640 \textit{Some languages, such as Fortran 90, provide types whose values
1641 may be dynamically allocated or associated with a variable
1642 under explicit program control.}
1644 \hypertarget{chap:DWATallocatedallocationstatusoftypes}
1646 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
1647 attribute may optionally be used with any
1648 type for which objects of the type can be explicitly allocated
1649 and deallocated. The presence of the attribute indicates that
1650 objects of the type are allocatable and deallocatable. The
1651 integer value of the attribute (see below) specifies whether
1652 an object of the type is
1653 currently allocated or not.
1655 \hypertarget{chap:DWATassociatedassociationstatusoftypes}
1657 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute
1658 may optionally be used with
1659 any type for which objects of the type can be dynamically
1660 associated with other objects. The presence of the attribute
1661 indicates that objects of the type can be associated. The
1662 integer value of the attribute (see below) indicates whether
1663 an object of the type is currently associated or not.
1665 While these attributes are defined specifically with Fortran
1666 90 ALLOCATABLE and POINTER types in mind, usage is not limited
1667 to just that language.
1669 The value of these attributes is determined as described in
1670 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1672 A non\dash zero value is interpreted as allocated or associated,
1673 and zero is interpreted as not allocated or not associated.
1675 \textit{For Fortran 90, if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is present,
1676 the type has the POINTER property where either the parent
1677 variable is never associated with a dynamic object or the
1678 implementation does not track whether the associated object
1679 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
1680 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
1681 has the ALLOCATABLE property. If both attributes are present,
1682 then the type should be assumed to have the POINTER property
1683 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
1684 be used to indicate that the association status of the object
1685 resulted from execution of an ALLOCATE statement rather than
1686 pointer assignment.}
1688 \textit{For examples using \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for Ada and Fortran 90
1690 see Appendix \refersec{app:aggregateexamples}.}
1694 \section{Template Alias Entries}
1695 \label{chap:templatealiasentries}
1697 A type named using a template alias is represented
1698 by a debugging information entry with the tag
1699 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
1700 The template alias entry has a
1701 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1702 containing the name of the template alias as it appears in
1703 the source program. The template alias entry also contains a
1704 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is a reference to the type
1705 named by the template alias. The template alias entry has
1706 the following child entries:
1708 \begin{enumerate}[1.]
1709 \item Each formal parameterized type declaration appearing
1710 in the template alias declaration is represented
1711 by a debugging information entry with the tag
1712 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each such entry may have
1713 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1714 string containing the name of the formal type parameter as it
1715 appears in the source program. The template type parameter
1716 entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing the actual
1717 type by which the formal is replaced for this instantiation.
1719 \item Each formal parameterized value declaration
1720 appearing in the template alias declaration is
1721 represented by a debugging information entry with the tag
1722 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}. Each such entry may have
1723 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1724 string containing the name of the formal value parameter
1725 as it appears in the source program. The template value
1726 parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1727 the type of the parameterized value. Finally, the template
1728 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute, whose
1729 value is the actual constant value of the value parameter for
1730 this instantiation as represented on the target architecture.