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 \addtoindex{DW\-\_ORD\-\_col\-\_major},
437 \addtoindex{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 flag. This attribute indicates whether the data
746 member was declared with the mutable storage class specifier.
748 The beginning of a data member is described relative to
749 the beginning of the object in which it is immediately
750 contained. In general, the beginning is characterized by
751 both an address and a bit offset within the byte at that
752 address. When the storage for an entity includes all of
753 the bits in the beginning byte, the beginning bit offset is
756 Bit offsets in DWARF use the bit numbering and direction
757 conventions that are appropriate to the current language on
760 The member entry corresponding to a data member that is
761 defined in a structure, union or class may have either a
762 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute or a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
763 attribute. If the beginning of the data member is the same as
764 the beginning of the containing entity then neither attribute
767 For a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute there are two cases:
769 \begin{enumerate}[1.]
771 \item If the value is an integer constant, it is the offset
772 in bytes from the beginning of the containing entity. If
773 the beginning of the containing entity has a non-zero bit
774 offset then the beginning of the member entry has that same
777 \item Otherwise, the value must be a location description. In
778 this case, the beginning of the containing entity must be byte
779 aligned. The beginning address is pushed on the DWARF stack
780 before the location description is evaluated; the result of
781 the evaluation is the base address of the member entry.
783 \textit{The push on the DWARF expression stack of the base address of
784 the containing construct is equivalent to execution of the
785 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} operation
786 (see Section \refersec{chap:stackoperations});
787 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} therefore is not needed at the
788 beginning of a location description for a data member. The
789 result of the evaluation is a location--either an address or
790 the name of a register, not an offset to the member.}
792 \textit{A \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute that has the form of a
793 location description is not valid for a data member contained
794 in an entity that is not byte aligned because DWARF operations
795 do not allow for manipulating or computing bit offsets.}
799 For a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, the value is an integer
801 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
802 that specifies the number of bits
803 from the beginning of the containing entity to the beginning
804 of the data member. This value must be greater than or equal
805 to zero, but is not limited to less than the number of bits
808 If the size of a data member is not the same as the size
809 of the type given for the data member, the data member has
810 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose
811 integer constant value
812 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
814 of storage needed to hold the value of the data member.
816 \textit{C and C++ bit fields typically require the use of the
817 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
819 \textit{This Standard uses the following bit numbering and direction
820 conventions in examples. These conventions are for illustrative
821 purposes and other conventions may apply on particular
826 \item \textit{For big\dash endian architectures, bit offsets are
827 counted from high-order to low\dash order bits within a byte (or
828 larger storage unit); in this case, the bit offset identifies
829 the high\dash order bit of the object.}
831 \item \textit{For little\dash endian architectures, bit offsets are
832 counted from low\dash order to high\dash order bits within a byte (or
833 larger storage unit); in this case, the bit offset identifies
834 the low\dash order bit of the object.}
838 \textit{In either case, the bit so identified is defined as the beginning of the object.}
840 \textit{For example, take one possible representation of the following C structure definition in both big\dash and little\dash endian byte orders:}
851 \textit{The following diagrams show the structure layout
852 and data bit offsets for example big\dash\ and little\dash endian
853 architectures, respectively. Both diagrams show a structure
854 that begins at address A and whose size is four bytes. Also,
855 high order bits are to the left and low order bits are to
858 \textit{Big\dash Endian Data Bit Offsets:}
866 Addresses increase ->
867 | A | A + 1 | A + 2 | A + 3 |
869 Data bit offsets increase ->
870 +---------------+---------------+---------------+---------------+
871 |0 4|5 10|11 15|16 23|24 31|
872 | j | k | m | n | <pad> |
874 +---------------------------------------------------------------+
877 \textit{Little\dash Endian Data Bit Offsets:}
883 <- Addresses increase
884 | A | A + 1 | A + 2 | A + 3 |
886 <- Data bit offsets increase
888 +---------------+---------------+---------------+---------------+
889 |31 24|23 16|15 11|10 5|4 0|
890 | <pad> | n | m | k | j |
892 +---------------------------------------------------------------+
896 \textit{Note that data member bit offsets in this example are the
897 same for both big\dash\ and little\dash endian architectures even
898 though the fields are allocated in different directions
899 (high\dash order to low-order versus low\dash order to high\dash order);
900 the bit naming conventions for memory and/or registers of
901 the target architecture may or may not make this seem natural.}
903 \textit{For a more extensive example showing nested and packed records
905 Appendix \refersec{app:pascalexample}.}
907 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
908 is also used for base types
909 (see Section \refersec{chap:basetypeentries}).
911 attributes \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} and \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} when used to
912 identify the beginning of bit field data members as defined
913 in DWARF V3 and earlier. The earlier attributes are defined
914 in a manner suitable for bit field members on big-endian
915 architectures but which is either awkward or incomplete for
916 use on little-endian architectures. (\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} also
917 has other uses that are not affected by this change.)}
919 \textit{The \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
920 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
921 attribute combination is deprecated for data members in DWARF
922 Version 4, but implementations may continue to support this
923 use for compatibility.}
925 \textit{The DWARF Version 3 definitions of these attributes are
928 \begin{myindentpara}{1cm}
929 \textit{If the data member entry describes a bit field, then that
930 entry has the following attributes:}
933 \item \textit{A \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute whose value (see Section
934 2.19) is the number of bytes that contain an instance of the
935 bit field and any padding bits.}
937 \textit{The byte size attribute may be omitted if the size of the
938 object containing the bit field can be inferred from the type
939 attribute of the data member containing the bit field.}
941 \item \textit{A \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute whose value (see Section
942 2.19) is the number of bits to the left of the leftmost
943 (most significant) bit of the bit field value.}
945 \item \textit{A \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose value (see Section
946 2.19) is the number of bits occupied by the bit field value.}
950 \textit{The location description for a bit field calculates the address
951 of an anonymous object containing the bit field. The address
952 is relative to the structure, union, or class that most closely
953 encloses the bit field declaration. The number of bytes in this
954 anonymous object is the value of the byte size attribute of
955 the bit field. The offset (in bits) from the most significant
956 bit of the anonymous object to the most significant bit of
957 the bit field is the value of the bit offset attribute.}
961 \textit{Diagrams similar to the above that show the use of the
962 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute
963 combination may be found in the DWARF Version 3 Standard.}
965 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
966 defines the following combinations of attributes:}
969 \item \textit{either \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} or
970 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} (to specify the beginning of the
973 % FIXME: the indentation of the following line is suspect.
974 \textit{optionally together with}
976 \item \textit{either \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} (to
977 specify the size of the data member)}
981 \textit{DWARF V3 defines the following combinations}
984 \item \textit{\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} (to specify the beginning
985 of the data member, except this specification is only partial
986 in the case of a bit field) }
988 % FIXME: the indentation of the following line is suspect.
989 \textit{optionally together with}
991 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
992 (to further specify the beginning of a bit field data member
993 as well as specify the size of the data member) }
996 \subsection{Member Function Entries}
997 \label{chap:memberfunctionentries}
999 A member function is represented by a debugging information
1000 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. The member function entry
1001 may contain the same attributes and follows the same rules
1002 as non\dash member global subroutine entries
1003 (see Section \refersec{chap:subroutineandentrypointentries}).
1005 A member function entry may have a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1006 attribute. If no accessibility attribute is present, private
1007 access is assumed for an entry of a class and public access
1008 is assumed for an entry of a structure, union or interface.
1010 If the member function entry describes a virtual function,
1011 then that entry has a \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
1013 If the member function entry describes an explicit member
1014 function, then that entry has a \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1016 An entry for a virtual function also has a
1017 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location} attribute whose value contains
1018 a location description yielding the address of the slot
1019 for the function within the virtual function table for the
1020 enclosing class. The address of an object of the enclosing
1021 type is pushed onto the expression stack before the location
1022 description is evaluated.
1024 If the member function entry describes a non\dash static member
1025 function, then that entry has a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer} attribute
1026 whose value is a reference to the formal parameter entry
1027 that corresponds to the object for which the function is
1028 called. The name attribute of that formal parameter is defined
1029 by the current language (for example, this for C++ or self
1030 for Objective C and some other languages). That parameter
1031 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1033 Conversely, if the member function entry describes a static
1034 member function, the entry does not have a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1037 If the member function entry describes a non\dash static member
1038 function that has a const\dash volatile qualification, then
1039 the entry describes a non\dash static member function whose
1040 object formal parameter has a type that has an equivalent
1041 const\dash volatile qualification.
1043 If a subroutine entry represents the defining declaration
1044 of a member function and that definition appears outside of
1045 the body of the enclosing class declaration, the subroutine
1046 entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute, whose value is
1047 a reference to the debugging information entry representing
1048 the declaration of this function member. The referenced entry
1049 will be a child of some class (or structure) type entry.
1051 Subroutine entries containing the \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1052 attribute do not need to duplicate information provided
1053 by the declaration entry referenced by the specification
1054 attribute. In particular, such entries do not need to contain
1055 attributes for the name or return type of the function member
1056 whose definition they represent.
1058 \subsection{Class Template Instantiations}
1059 \label{chap:classtemplateinstantiations}
1061 \textit{In C++ a class template is a generic definition of a class
1062 type that may be instantiated when an instance of the class
1063 is declared or defined. The generic description of the
1064 class may include both parameterized types and parameterized
1065 constant values. DWARF does not represent the generic template
1066 definition, but does represent each instantiation.}
1068 A class template instantiation is represented by a
1069 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1070 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1071 exceptions, such an entry will contain the same attributes
1072 and have the same types of child entries as would an entry
1073 for a class type defined explicitly using the instantiation
1074 types and values. The exceptions are:
1076 \begin{enumerate}[1.]
1077 \item Each formal parameterized type declaration appearing in the
1078 template definition is represented by a debugging information
1079 entry with the tag \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1080 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1081 a null\dash terminated string containing the name of the formal
1082 type parameter as it appears in the source program. The
1083 template type parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1084 describing the actual type by which the formal is replaced
1085 for this instantiation.
1087 \item Each formal parameterized value declaration appearing in the
1088 template definition is represented by a debugging information
1090 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1092 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1093 a null\dash terminated string containing the name of the formal
1094 value parameter as it appears in the source program. The
1095 template value parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1096 describing the type of the parameterized value. Finally,
1097 the template value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1098 attribute, whose value is the actual constant value of the
1099 value parameter for this instantiation as represented on the
1100 target architecture.
1102 \item The class type entry and each of its child entries references
1103 a template type parameter entry in any circumstance where the
1104 source template definition references a formal parameterized
1105 type. Similarly, the class type entry and each of its child
1106 entries references a template value parameter entry in any
1107 circumstance where the source template definition references
1108 a formal parameterized value.
1110 \item If the compiler has generated a special compilation unit to
1111 hold the template instantiation and that special compilation
1112 unit has a different name from the compilation unit containing
1113 the template definition, the name attribute for the debugging
1114 information entry representing the special compilation unit
1115 should be empty or omitted.
1117 \item If the class type entry representing the template
1118 instantiation or any of its child entries contains declaration
1119 coordinate attributes, those attributes should refer to
1120 the source for the template definition, not to any source
1121 generated artificially by the compiler.
1125 \subsection{Variant Entries}
1126 \label{chap:variantentries}
1128 A variant part of a structure is represented by a debugging
1129 information entry with the
1130 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1131 owned by the corresponding structure type entry.
1133 If the variant part has a discriminant, the discriminant is
1134 represented by a separate debugging information entry which
1135 is a child of the variant part entry. This entry has the form
1136 of a structure data member entry. The variant part entry will
1137 have a \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute whose value is a reference to
1138 the member entry for the discriminant.
1140 If the variant part does not have a discriminant (tag field),
1141 the variant part entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1144 Each variant of a particular variant part is represented by
1145 a debugging information entry with the
1146 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1147 and is a child of the variant part entry. The value that
1148 selects a given variant may be represented in one of three
1149 ways. The variant entry may have a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1150 whose value represents a single case label. The value of this
1151 attribute is encoded as an LEB128 number. The number is signed
1152 if the tag type for the variant part containing this variant
1153 is a signed type. The number is unsigned if the tag type is
1156 Alternatively, the variant entry may contain a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1157 attribute, whose value represents a list of discriminant
1158 values. This list is represented by any of the block forms and
1159 may contain a mixture of case labels and label ranges. Each
1160 item on the list is prefixed with a discriminant value
1161 descriptor that determines whether the list item represents
1162 a single label or a label range. A single case label is
1163 represented as an LEB128 number as defined above for the
1164 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute. A label range is represented by
1165 two LEB128 numbers, the low value of the range followed by the
1166 high value. Both values follow the rules for signedness just
1167 described. The discriminant value descriptor is an integer
1168 constant that may have one of the values given in
1169 Figure \refersec{fig:discriminantdescriptorvalues}.
1171 \begin{figure}[here]
1172 \autorows[0pt]{c}{1}{l}{
1173 \addtoindex{DW\-\_DSC\-\_label},
1174 \addtoindex{DW\-\_DSC\-\_range}
1176 \caption{Discriminant descriptor values}\label{fig:discriminantdescriptorvalues}
1179 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1180 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1181 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1184 The components selected by a particular variant are represented
1185 by debugging information entries owned by the corresponding
1186 variant entry and appear in the same order as the corresponding
1187 declarations in the source program.
1189 \section{Condition Entries}
1190 \label{chap:conditionentries}
1192 \textit{COBOL has the notion of a ``level\dash 88 condition'' that
1193 associates a data item, called the conditional variable, with
1194 a set of one or more constant values and/or value ranges.
1195 Semantically, the condition is ‛true’ if the conditional
1196 variable's value matches any of the described constants,
1197 and the condition is ‛false’ otherwise.}
1199 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition} debugging information entry
1201 logical condition that tests whether a given data item’s
1202 value matches one of a set of constant values. If a name
1203 has been given to the condition, the condition entry has a
1204 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1205 giving the condition name as it appears in the source program.
1207 The condition entry's parent entry describes the conditional
1208 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1209 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry. If the parent
1210 entry has an array type, the condition can test any individual
1211 element, but not the array as a whole. The condition entry
1212 implicitly specifies a “comparison type” that is the
1213 type of an array element if the parent has an array type;
1214 otherwise it is the type of the parent entry.
1216 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1217 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1218 values associated with the condition. If any child entry has
1219 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, that attribute should describe a type
1220 compatible with the comparison type (according to the source
1221 language); otherwise the child’s type is the same as the
1224 \textit{For conditional variables with alphanumeric types, COBOL
1225 permits a source program to provide ranges of alphanumeric
1226 constants in the condition. Normally a subrange type entry
1227 does not describe ranges of strings; however, this can be
1228 represented using bounds attributes that are references to
1229 constant entries describing strings. A subrange type entry may
1230 refer to constant entries that are siblings of the subrange
1234 \section{Enumeration Type Entries}
1235 \label{chap:enumerationtypeentries}
1237 \textit{An “enumeration type” is a scalar that can assume one of
1238 a fixed number of symbolic values.}
1240 An enumeration type is represented by a debugging information
1242 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1244 If a name has been given to the enumeration type in the source
1245 program, then the corresponding enumeration type entry has
1246 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1247 string containing the enumeration type name as it appears
1248 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1249 attribute whose integer constant value is the number of bytes
1250 required to hold an instance of the enumeration.
1252 The enumeration type entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1253 which refers to the underlying data type used to implement
1256 If an enumeration type has type safe semantics such that
1258 \begin{enumerate}[1.]
1259 \item Enumerators are contained in the scope of the enumeration type, and/or
1261 \item Enumerators are not implicitly converted to another type
1264 then the enumeration type entry may have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1265 attribute, which is a flag. In a language that offers only
1266 one kind of enumeration declaration, this attribute is not
1269 \textit{In C or C++, the underlying type will be the appropriate
1270 integral type determined by the compiler from the properties of
1271 the enumeration literal values. A C++ type declaration written
1272 using enum class declares a strongly typed enumeration and
1273 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type} in combination
1274 with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1276 Each enumeration literal is represented by a debugging
1277 information entry with the
1278 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1280 such entry is a child of the enumeration type entry, and the
1281 enumerator entries appear in the same order as the declarations
1282 of the enumeration literals in the source program.
1284 Each enumerator entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1285 value is a null\dash terminated string containing the name of the
1286 enumeration literal as it appears in the source program. Each
1287 enumerator entry also has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1288 whose value is the actual numeric value of the enumerator as
1289 represented on the target system.
1292 If the enumeration type occurs as the description of a
1293 dimension of an array type, and the stride for that dimension
1294 is different than what would otherwise be determined, then
1295 the enumeration type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1296 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1297 between successive elements along the dimension as described
1299 Section \refersec{chap:visibilityofdeclarations}.
1300 The value of the \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1301 is interpreted as bits and the value of the \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1302 attribute is interpreted as bytes.
1305 \section{Subroutine Type Entries}
1306 \label{chap:subroutinetypeentries}
1308 It is possible in C to declare pointers to subroutines
1309 that return a value of a specific type. In both C and C++,
1310 it is possible to declare pointers to subroutines that not
1311 only return a value of a specific type, but accept only
1312 arguments of specific types. The type of such pointers would
1313 be described with a ``pointer to'' modifier applied to a
1314 user\dash defined type.
1316 A subroutine type is represented by a debugging information
1318 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1320 been given to the subroutine type in the source program,
1321 then the corresponding subroutine type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
1322 attribute whose value is a null\dash terminated string containing
1323 the subroutine type name as it appears in the source program.
1325 If the subroutine type describes a function that returns
1326 a value, then the subroutine type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1327 attribute to denote the type returned by the subroutine. If
1328 the types of the arguments are necessary to describe the
1329 subroutine type, then the corresponding subroutine type
1330 entry owns debugging information entries that describe the
1331 arguments. These debugging information entries appear in the
1332 order that the corresponding argument types appear in the
1335 In C there is a difference between the types of functions
1336 declared using function prototype style declarations and
1337 those declared using non\dash prototype declarations.
1339 A subroutine entry declared with a function prototype style
1340 declaration may have a \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1343 Each debugging information entry owned by a subroutine
1344 type entry has a tag whose value has one of two possible
1347 \begin{enumerate}[1.]
1348 \item The formal parameters of a parameter list (that have a
1349 specific type) are represented by a debugging information entry
1350 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}. Each formal parameter
1351 entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1352 the formal parameter.
1354 \item The unspecified parameters of a variable parameter list
1355 are represented by a debugging information entry with the
1356 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1361 \section{String Type Entries}
1362 \label{chap:stringtypeentries}
1365 A ``string'' is a sequence of characters that have specific
1366 semantics and operations that separate them from arrays of
1367 characters. Fortran is one of the languages that has a string
1368 type. Note that ``string'' in this context refers to a target
1369 machine concept, not the class string as used in this document
1370 (except for the name attribute).
1372 A string type is represented by a debugging information entry
1373 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1374 If a name has been given to
1375 the string type in the source program, then the corresponding
1376 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
1377 a null\dash terminated string containing the string type name as
1378 it appears in the source program.
1380 The string type entry may have a \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1381 whose value is a location description yielding the location
1382 where the length of the string is stored in the program. The
1383 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1384 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1385 (see Section \refersec{chap:byteandbitsizes})
1386 is the size of the data to be retrieved from the location
1387 referenced by the string length attribute. If no (byte or bit)
1388 size attribute is present, the size of the data to be retrieved
1389 is the same as the size of an address on the target machine.
1391 If no string length attribute is present, the string type
1392 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1393 attribute, whose value
1394 (see Section \refersec{chap:byteandbitsizes})
1396 storage needed to hold a value of the string type.
1399 \section{Set Type Entries}
1400 \label{chap:settypeentries}
1402 \textit{Pascal provides the concept of a “set,” which represents
1403 a group of values of ordinal type.}
1405 A set is represented by a debugging information entry with
1406 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1407 If a name has been given to the
1408 set type, then the set type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1409 whose value is a null\dash terminated string containing the
1410 set type name as it appears in the source program.
1412 The set type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1413 type of an element of the set.
1415 If the amount of storage allocated to hold each element of an
1416 object of the given set type is different from the amount of
1417 storage that is normally allocated to hold an individual object
1418 of the indicated element type, then the set type entry has
1419 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1420 whose value (see Section \refersec{chap:byteandbitsizes}) is
1421 the amount of storage needed to hold a value of the set type.
1424 \section{Subrange Type Entries}
1425 \label{chap:subrangetypeentries}
1427 \textit{Several languages support the concept of a ``subrange''
1428 type object. These objects can represent a subset of the
1429 values that an object of the basis type for the subrange can
1430 represent. Subrange type entries may also be used to represent
1431 the bounds of array dimensions.}
1433 A subrange type is represented by a debugging information
1435 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
1437 given to the subrange type, then the subrange type entry
1438 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1439 string containing the subrange type name as it appears in
1442 The subrange entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
1443 the type of object, called the basis type, of whose values
1444 this subrange is a subset.
1446 If the amount of storage allocated to hold each element of an
1447 object of the given subrange type is different from the amount
1448 of storage that is normally allocated to hold an individual
1449 object of the indicated element type, then the subrange
1450 type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1451 attribute, whose value
1452 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1454 storage needed to hold a value of the subrange type.
1456 The subrange entry may have a \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
1457 which is a flag. If present, this attribute indicates whether
1458 this subrange represents a UPC array bound which is scaled
1459 by the runtime THREADS value (the number of UPC threads in
1460 this execution of the program).
1462 \textit{This allows the representation of a UPC shared array such as}
1465 int shared foo[34*THREADS][10][20];
1468 The subrange entry may have the attributes \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
1469 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound} to specify, respectively, the lower
1470 and upper bound values of the subrange. The \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
1471 attribute may be replaced by a \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute, whose
1472 value describes the number of elements in the subrange rather
1473 than the value of the last element. The value of each of
1474 these attributes is determined as described in
1475 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1477 If the lower bound value is missing, the value is assumed to
1478 be a language\dash dependent default constant. The default lower
1479 bound is 0 for C, C++, D, Java, Objective C, Objective C++,
1480 Python, and UPC. The default lower bound is 1 for Ada, COBOL,
1481 Fortran, Modula\dash 2, Pascal and PL/I.
1483 \textit{No other default lower bound values are currently defined.}
1485 If the upper bound and count are missing, then the upper bound value is
1488 If the subrange entry has no type attribute describing the
1489 basis type, the basis type is assumed to be the same as
1490 the object described by the lower bound attribute (if it
1491 references an object). If there is no lower bound attribute,
1492 or that attribute does not reference an object, the basis type
1493 is the type of the upper bound or count attribute (if either
1494 of them references an object). If there is no upper bound or
1495 count attribute, or neither references an object, the type is
1496 assumed to be the same type, in the source language of the
1497 compilation unit containing the subrange entry, as a signed
1498 integer with the same size as an address on the target machine.
1500 If the subrange type occurs as the description of a dimension
1501 of an array type, and the stride for that dimension is
1502 different than what would otherwise be determined, then
1503 the subrange type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
1504 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1505 between successive elements along the dimension as described
1507 Section \refersec{chap:byteandbitsizes}.
1509 \textit{Note that the stride can be negative.}
1511 \section{Pointer to Member Type Entries}
1512 \label{chap:pointertomembertypeentries}
1514 \textit{In C++, a pointer to a data or function member of a class or
1515 structure is a unique type.}
1517 A debugging information entry representing the type of an
1518 object that is a pointer to a structure or class member has
1519 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
1521 If the pointer to member type has a name, the pointer to
1522 member entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a
1523 null\dash terminated string containing the type name as it appears
1524 in the source program.
1526 The pointer to member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
1527 describe the type of the class or structure member to which
1528 objects of this type may point.
1530 The pointer to member entry also has a \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
1531 attribute, whose value is a reference to a debugging
1532 information entry for the class or structure to whose members
1533 objects of this type may point.
1535 The pointer to member entry has a \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
1536 whose value is a location description that computes the
1537 address of the member of the class to which the pointer to
1538 member entry points.
1540 \textit{The method used to find the address of a given member of a
1541 class or structure is common to any instance of that class
1542 or structure and to any instance of the pointer or member
1543 type. The method is thus associated with the type entry,
1544 rather than with each instance of the type.}
1546 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
1547 with the location descriptions for a particular object of the
1548 given pointer to member type and for a particular structure or
1549 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute expects two
1550 values to be pushed onto the DWARF expression stack before
1551 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated. The first
1552 value pushed is the value of the pointer to member object
1553 itself. The second value pushed is the base address of the
1554 entire structure or union instance containing the member
1555 whose address is being calculated.
1557 \textit{For an expression such as}
1562 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
1563 \textit{where mbr\_ptr has some pointer to member type, a debugger should:}
1565 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
1567 \textit{2. Push the base address of object onto the DWARF expression stack.}
1569 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
1570 given in the type of mbr\_ptr.}
1572 \section{File Type Entries}
1573 \label{chap:filetypeentries}
1575 \textit{Some languages, such as Pascal, provide a data type to represent
1578 A file type is represented by a debugging information entry
1580 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
1581 If the file type has a name,
1582 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value
1583 is a null\dash terminated string containing the type name as it
1584 appears in the source program.
1586 The file type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1587 the type of the objects contained in the file.
1589 The file type entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1590 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1591 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1592 is the amount of storage need to hold a value of the file type.
1594 \section{Dynamic Type Properties}
1595 \label{chap:dynamictypeproperties}
1596 \subsection{Data Location}
1597 \label{chap:datalocation}
1599 \textit{Some languages may represent objects using descriptors to hold
1600 information, including a location and/or run\dash time parameters,
1601 about the data that represents the value for that object.}
1603 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} attribute may be used with any
1604 type that provides one or more levels of hidden indirection
1605 and/or run\dash time parameters in its representation. Its value
1606 is a location description. The result of evaluating this
1607 description yields the location of the data for an object.
1608 When this attribute is omitted, the address of the data is
1609 the same as the address of the object.
1611 \textit{This location description will typically begin with
1612 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} which loads the address of the
1613 object which can then serve as a descriptor in subsequent
1614 calculation. For an example using \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} for a
1615 Fortran 90 array, see
1616 Appendix \refersec{app:fortran90example}.}
1618 \subsection{Allocation and Association Status}
1619 \label{chap:allocationandassociationstatus}
1621 \textit{Some languages, such as Fortran 90, provide types whose values
1622 may be dynamically allocated or associated with a variable
1623 under explicit program control.}
1625 The \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may optionally be used with any
1626 type for which objects of the type can be explicitly allocated
1627 and deallocated. The presence of the attribute indicates that
1628 objects of the type are allocatable and deallocatable. The
1629 integer value of the attribute (see below) specifies whether
1630 an object of the type is currently allocated or not.
1632 The \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute may optionally be used with
1633 any type for which objects of the type can be dynamically
1634 associated with other objects. The presence of the attribute
1635 indicates that objects of the type can be associated. The
1636 integer value of the attribute (see below) indicates whether
1637 an object of the type is currently associated or not.
1639 While these attributes are defined specifically with Fortran
1640 90 ALLOCATABLE and POINTER types in mind, usage is not limited
1641 to just that language.
1643 The value of these attributes is determined as described in
1644 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1646 A non\dash zero value is interpreted as allocated or associated,
1647 and zero is interpreted as not allocated or not associated.
1649 \textit{For Fortran 90, if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is present,
1650 the type has the POINTER property where either the parent
1651 variable is never associated with a dynamic object or the
1652 implementation does not track whether the associated object
1653 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
1654 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
1655 has the ALLOCATABLE property. If both attributes are present,
1656 then the type should be assumed to have the POINTER property
1657 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
1658 be used to indicate that the association status of the object
1659 resulted from execution of an ALLOCATE statement rather than
1660 pointer assignment.}
1662 \textit{For examples using \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for Ada and Fortran 90
1664 see Appendix \refersec{app:aggregateexamples}.}
1668 \section{Template Alias Entries}
1669 \label{chap:templatealiasentries}
1671 A type named using a template alias is represented
1672 by a debugging information entry with the tag
1673 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
1674 The template alias entry has a
1675 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1676 containing the name of the template alias as it appears in
1677 the source program. The template alias entry also contains a
1678 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is a reference to the type
1679 named by the template alias. The template alias entry has
1680 the following child entries:
1682 \begin{enumerate}[1.]
1683 \item Each formal parameterized type declaration appearing
1684 in the template alias declaration is represented
1685 by a debugging information entry with the tag
1686 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each such entry may have
1687 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1688 string containing the name of the formal type parameter as it
1689 appears in the source program. The template type parameter
1690 entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing the actual
1691 type by which the formal is replaced for this instantiation.
1693 \item Each formal parameterized value declaration
1694 appearing in the template alias declaration is
1695 represented by a debugging information entry with the tag
1696 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}. Each such entry may have
1697 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1698 string containing the name of the formal value parameter
1699 as it appears in the source program. The template value
1700 parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1701 the type of the parameterized value. Finally, the template
1702 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute, whose
1703 value is the actual constant value of the value parameter for
1704 this instantiation as represented on the target architecture.