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.
44 \hypertarget{chap:DWATbytesizedataobjectordatatypesize}
45 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
46 \hypertarget{chap:DWATbitsizebasetypebitsize}
47 or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose integer constant value
48 (see Section \refersec{chap:byteandbitsizes})
49 is the amount of storage needed to hold
52 \textit{For example, the C type int on a machine that uses 32\dash bit
53 integers is represented by a base type entry with a name
54 attribute whose value is “int”, an encoding attribute
55 whose value is \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed} and a byte size attribute whose
58 If the value of an object of the given type does not fully
59 occupy the storage described by a byte size attribute,
60 the base type entry may also have a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and a
61 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, both of whose values are
62 integer constant values (
63 see Section \refersec{chap:staticanddynamicvaluesofattributes}).
65 attribute describes the actual size in bits used to represent
66 values of the given type. The data bit offset attribute is the
67 offset in bits from the beginning of the containing storage to
68 the beginning of the value. Bits that are part of the offset
69 are padding. The data bit offset uses the bit numbering and
70 direction conventions that are appropriate to the current
72 target system to locate the beginning of the storage and
73 value. If this attribute is omitted a default data bit offset
76 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
77 is also used for bit field members
78 (see Section \refersec{chap:datamemberentries}).
80 \hypertarget{chap:DWATbitoffsetbasetypebitlocation}
81 replaces the attribute \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} when used for base
82 types as defined in DWARF V3 and earlier. The earlier attribute
83 is defined in a manner suitable for bit field members on
84 big\dash endian architectures but which is wasteful for use on
85 little\dash endian architectures.}
87 \textit{The attribute \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} is
88 deprecated in DWARF Version
89 4 for use in base types, but implementations may continue to
90 support its use for compatibility.}
92 \textit{The DWARF Version 3 definition of these attributes is as follows.}
94 \begin{myindentpara}{1cm}
95 \textit{A base type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, whose value
96 (see Section 2.19) is the size in bytes of the storage unit
97 used to represent an object of the given type.}
99 \textit{If the value of an object of the given type does not fully
100 occupy the storage unit described by the byte size attribute,
101 the base type entry may have a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute and a
102 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute, both of whose values (see Section
103 2.19) are integers. The bit size attribute describes the actual
104 size in bits used to represent a value of the given type.
105 The bit offset attribute describes the offset in bits of the
106 high order bit of a value of the given type from the high
107 order bit of the storage unit used to contain that value.}
110 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
111 defines the following combinations of attributes:}
114 \item \textit{DW\-\_AT\-\_byte\-\_size}
115 \item \textit{DW\-\_AT\-\_bit\-\_size}
116 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
117 and optionally \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}}
119 DWARF V3 defines the following combinations:
120 % FIXME: the figure below interferes with the following
121 % bullet list, which looks horrible as a result.
123 \item \textit{DW\-\_AT\-\_byte\-\_size}
124 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}}
127 \begin{figure}[!here]
129 \begin{tabular}{lp{9cm}}
130 Name&Meaning\\ \hline
131 \livetarg{chap:DWATEaddress}{DW\-\_ATE\-\_address} & linear machine address (for
132 segmented addresses see
133 Section \refersec{chap:segmentedaddresses}) \\
134 \livetarg{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}& true or false \\
136 \livetarg{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}& complex binary floating\dash point number \\
137 \livetarg{chap:DWATEfloat}{DW\-\_ATE\-\_float} & binary floating\dash point number \\
138 \livetarg{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}& imaginary binary floating\dash point number \\
139 \livetarg{chap:DWATEsigned}{DW\-\_ATE\-\_signed}& signed binary integer \\
140 \livetarg{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}& signed character \\
141 \livetarg{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned} & unsigned binary integer \\
142 \livetarg{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char} & unsigned character \\
143 \livetarg{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} & packed decimal \\
144 \livetarg{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}& numeric string \\
145 \livetarg{chap:DWATEedited}{DW\-\_ATE\-\_edited} & edited string \\
146 \livetarg{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} & signed fixed\dash point scaled integer \\
147 \livetarg{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}& unsigned fixed\dash point scaled integer \\
148 \livetarg{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & decimal floating\dash point number \\
149 \livetarg{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} & Unicode character \\
151 \caption{Encoding attribute values}
152 \label{fig:encodingattributevalues}
155 \textit{The \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} encoding is intended for
156 floating\dash point representations that have a power\dash of\dash ten
157 exponent, such as that specified in IEEE 754R.}
159 \textit{The \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} encoding is intended for Unicode string
160 encodings (see the Universal Character Set standard,
161 ISO/IEC 10646\dash 1:1993). For example, the C++ type char16\_t is
162 represented by a base type entry with a name attribute whose
163 value is “char16\_t”, an encoding attribute whose value
164 is \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} and a byte size attribute whose value is 2.}
166 The \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types
167 represent packed and unpacked decimal string numeric data
168 types, respectively, either of which may be either signed
169 or unsigned. These base types are used in combination with
170 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}, \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
173 A \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute is an integer constant that
174 conveys the representation of the sign of the decimal type
175 (see Figure \refersec{fig:decimalsignattributevalues}).
176 Its integer constant value is interpreted to
177 mean that the type has a leading overpunch, trailing overpunch,
178 leading separate or trailing separate sign representation or,
179 alternatively, no sign at all.
181 The \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} attribute is an integer constant
182 value that represents the number of digits in an instance of
185 The \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute is an integer constant value
186 that represents the exponent of the base ten scale factor to
187 be applied to an instance of the type. A scale of zero puts the
188 decimal point immediately to the right of the least significant
189 digit. Positive scale moves the decimal point to the right
190 and implies that additional zero digits on the right are not
191 stored in an instance of the type. Negative scale moves the
192 decimal point to the left; if the absolute value of the scale
193 is larger than the digit count, this implies additional zero
194 digits on the left are not stored in an instance of the type.
196 The \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited} base type is used to represent an edited
197 numeric or alphanumeric data type. It is used in combination
198 with an \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string} attribute whose value is a
199 null\dash terminated string containing the target\dash dependent picture
200 string associated with the type.
202 If the edited base type entry describes an edited numeric
203 data type, the edited type entry has a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and a
204 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute. These attributes have the same
205 interpretation as described for the \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and
206 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types. If the edited type entry
207 describes an edited alphanumeric data type, the edited type
208 entry does not have these attributes.
211 \textit{The presence or absence of the \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
212 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attributes allows a debugger to easily
213 distinguish edited numeric from edited alphanumeric, although
214 in principle the digit count and scale are derivable by
215 interpreting the picture string.}
217 The \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} and \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed} entries
218 describe signed and unsigned fixed\dash point binary data types,
221 The fixed binary type entries have a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
222 attribute with the same interpretation as described for the
223 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
225 For a data type with a decimal scale factor, the fixed binary
226 type entry has a \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute with the same
227 interpretation as described for the \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
228 and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
230 \hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
231 For a data type with a binary scale factor, the fixed
232 binary type entry has a \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute. The
233 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute is an integer constant value
234 that represents the exponent of the base two scale factor to
235 be applied to an instance of the type. Zero scale puts the
236 binary point immediately to the right of the least significant
237 bit. Positive scale moves the binary point to the right and
238 implies that additional zero bits on the right are not stored
239 in an instance of the type. Negative scale moves the binary
240 point to the left; if the absolute value of the scale is
241 larger than the number of bits, this implies additional zero
242 bits on the left are not stored in an instance of the type.
244 For a data type with a non\dash decimal and non\dash binary scale factor,
245 the fixed binary type entry has a \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute which
246 references a \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The scale factor value
247 is interpreted in accordance with the value defined by the
248 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The value represented is the product
249 of the integer value in memory and the associated constant
252 \textit{The \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute is defined with the Ada small
257 \begin{tabular}{lp{9cm}}
258 Name&Meaning\\ \hline
259 \livetarg{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & unsigned \\
260 \livetarg{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & Sign is encoded in the most significant digit in a target\dash dependent manner \\
261 \livetarg{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & Sign is encoded in the least significant digit in a target\dash dependent manner \\
262 \livetarg{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate}
263 & Decimal type: Sign is a ``+'' or ``-'' character
264 to the left of the most significant digit. \\
265 \livetarg{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate}
266 & Decimal type: Sign is a ``+'' or ``-'' character
267 to the right of the least significant digit. \\
268 &Packed decimal type: Least significant nibble contains
269 a target\dash dependent value
270 indicating positive or negative. \\
272 \caption{Decimal sign attribute values}
273 \label{fig:decimalsignattributevalues}
276 \section{Unspecified Type Entries}
277 \label{chap:unspecifiedtypeentries}
278 Some languages have constructs in which a type may be left unspecified or the absence of a type
279 may be explicitly indicated.
281 An unspecified (implicit, unknown, ambiguous or nonexistent)
282 type is represented by a debugging information entry with
283 the tag \livetarg{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}.
284 If a name has been given
285 to the type, then the corresponding unspecified type entry
286 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
287 string containing the name as it appears in the source program.
289 The interpretation of this debugging information entry is
290 intentionally left flexible to allow it to be interpreted
291 appropriately in different languages. For example, in C and C++
292 the language implementation can provide an unspecified type
293 entry with the name “void” which can be referenced by the
294 type attribute of pointer types and typedef declarations for
296 % FIXME: the following reference was wrong in DW4 so DavidA guessed
298 Sections \refersec{chap:unspecifiedtypeentries} and
299 %The following reference was valid, so the following is probably correct.
300 Section \refersec{chap:typedefentries},
301 respectively). As another
302 example, in Ada such an unspecified type entry can be referred
303 to by the type attribute of an access type where the denoted
304 type is incomplete (the name is declared as a type but the
305 definition is deferred to a separate compilation unit). Type
308 A base or user\dash defined type may be modified in different ways
309 in different languages. A type modifier is represented in
310 DWARF by a debugging information entry with one of the tags
312 Figure \refersec{fig:typemodifiertags}.
315 If a name has been given to the modified type in the source
316 program, then the corresponding modified type entry has
317 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null-terminated
318 string containing the modified type name as it appears in
321 Each of the type modifier entries has a
322 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
323 whose value is a reference to a debugging information entry
324 describing a base type, a user-defined type or another type
327 A modified type entry describing a pointer or reference
328 type (using \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}, \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type} or
329 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type})
331 \hypertarget{chap:DWATadressclasspointerorreferencetypes}
333 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
334 attribute to describe how objects having the given pointer
335 or reference type ought to be dereferenced.
337 A modified type entry describing a shared qualified type
338 (using \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}) may have a \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute
339 whose value is a constant expressing the blocksize of the
340 type. If no count attribute is present, then the “infinite”
341 blocksize is assumed.
343 When multiple type modifiers are chained together to modify
344 a base or user-defined type, the tree ordering reflects the
345 semantics of the applicable lanuage rather than the textual
346 order in the source presentation.
350 \begin{tabular}{lp{9cm}}
351 Name&Meaning\\ \hline
352 \livetarg{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} & C or C++ const qualified type \\
353 \livetarg{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}& Pascal or Ada packed type \\
354 \livetarg{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} & Pointer to an object of the type being modified \\
355 \livetarg{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}& C++ (lvalue) reference to an object of the type
357 \livetarg{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&C restrict qualified type \\
358 \livetarg{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} & C++ rvalue reference to an object of the type
360 \livetarg{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&UPC shared qualified type \\
361 \livetarg{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&C or C++ volatile qualified type \\
363 \caption{Type modifier tags}
364 \label{fig:typemodifiertags}
367 % The following prevents splitting the examples up.
368 % FIXME perhaps there is a better way. We could box the verbatim,
369 % see memman.pdf on verbatims.
371 \textit{As examples of how tye modifiers are ordered, take the following C
375 const unsigned char * volatile p;
376 which represents a volatile pointer to a constant
377 character. This is encoded in DWARF as:
378 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
379 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
380 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
381 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
382 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
384 volatile unsigned char * const restrict p;
385 on the other hand, represents a restricted constant
386 pointer to a volatile character. This is encoded as:
387 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
388 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type} -->
389 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
390 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
391 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
392 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
396 \section{Typedef Entries}
397 \label{chap:typedefentries}
398 A named type that is defined in terms of another type
399 definition is represented by a debugging information entry with
400 the tag \livetarg{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}.
401 The typedef entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
402 attribute whose value is a null-terminated string containing
403 the name of the typedef as it appears in the source program.
405 The typedef entry may also contain a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose
406 value is a reference to the type named by the typedef. If
407 the debugging information entry for a typedef represents
408 a declaration of the type that is not also a definition,
409 it does not contain a type attribute.
411 \textit{Depending on the language, a named type that is defined in
412 terms of another type may be called a type alias, a subtype,
413 a constrained type and other terms. A type name declared with
414 no defining details may be termed an incomplete, forward
415 or hidden type. While the DWARF \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef} entry was
416 originally inspired by the like named construct in C and C++,
417 it is broadly suitable for similar constructs (by whatever
418 source syntax) in other languages.}
420 \section{Array Type Entries}
421 \label{chap:arraytypeentries}
423 Many languages share the concept of an ``array,'' which is
424 a table of components of identical type.
426 An array type is represented by a debugging information entry
427 with the tag \livetarg{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}.
428 If a name has been given to
429 the array type in the source program, then the corresponding
430 array type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a
431 null-terminated string containing the array type name as it
432 appears in the source program.
434 The array type entry describing a multidimensional array may
435 have a \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute whose integer constant value is
436 interpreted to mean either row-major or column-major ordering
437 of array elements. The set of values and their meanings
438 for the ordering attribute are listed in
439 Figure \refersec{fig:arrayordering}.
441 ordering attribute is present, the default ordering for the
442 source language (which is indicated by the \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
443 attribute of the enclosing compilation unit entry) is assumed.
446 \autorows[0pt]{c}{1}{l}{
447 \livetarg{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major},
448 \livetarg{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}
450 \caption{Array ordering}\label{fig:arrayordering}
453 The ordering attribute may optionally appear on one-dimensional
454 arrays; it will be ignored.
456 An array type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
457 the type of each element of the array.
459 If the amount of storage allocated to hold each element of an
460 object of the given array type is different from the amount
461 of storage that is normally allocated to hold an individual
462 \hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}
464 \hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}
465 indicated element type, then the array type
466 entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or a \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
467 attribute, whose value
468 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
470 element of the array.
472 The array type entry may have either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
473 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
474 (see Section \refersec{chap:byteandbitsizes}),
476 amount of storage needed to hold an instance of the array type.
478 \textit{If the size of the array can be determined statically at
479 compile time, this value can usually be computed by multiplying
480 the number of array elements by the size of each element.}
483 Each array dimension is described by a debugging information
484 entry with either the tag \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} or the tag
485 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}. These entries are children of the
486 array type entry and are ordered to reflect the appearance of
487 the dimensions in the source program (i.e., leftmost dimension
488 first, next to leftmost second, and so on).
490 In languages, such as C, in which there is no concept of
491 a “multidimensional array”, an array of arrays may
492 be represented by a debugging information entry for a
493 multidimensional array.
495 Other attributes especially applicable to arrays are
496 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated},
497 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} and
498 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location},
499 which are described in
500 Section \refersec{chap:dynamictypeproperties}.
501 For relevant examples,
503 Appendix \refersec{app:fortran90example}.
505 \section{ Structure, Union, Class and Interface Type Entries}
506 \label{chap:structureunionclassandinterfacetypeentries}
508 \textit{The languages C, C++, and Pascal, among others, allow the
509 programmer to define types that are collections of related
510 components. In C and C++, these collections are called
511 “structures.” In Pascal, they are called “records.”
512 The components may be of different types. The components are
513 called “members” in C and C++, and “fields” in Pascal.}
515 \textit{The components of these collections each exist in their
516 own space in computer memory. The components of a C or C++
517 “union” all coexist in the same memory.}
519 \textit{Pascal and other languages have a “discriminated union,”
520 also called a “variant record.” Here, selection of a
521 number of alternative substructures (“variants”) is based
522 on the value of a component that is not part of any of those
523 substructures (the “discriminant”).}
525 \textit{C++ and Java have the notion of "class”, which is in some
526 ways similar to a structure. A class may have “member
527 functions” which are subroutines that are within the scope
528 of a class or structure.}
530 \textit{The C++ notion of structure is more general than in C, being
531 equivalent to a class with minor differences. Accordingly,
532 in the following discussion statements about C++ classes may
533 be understood to apply to C++ structures as well.}
535 \subsection{Structure, Union and Class Type Entries}
536 \label{chap:structureunionandclasstypeentries}
539 Structure, union, and class types are represented by debugging
540 information entries with
541 the tags \livetarg{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type},
542 \livetarg{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type},
543 and \livetarg{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
544 respectively. If a name has been given to the structure,
545 union, or class in the source program, then the corresponding
546 structure type, union type, or class type entry has a
547 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
548 containing the type name as it appears in the source program.
550 The members of a structure, union, or class are represented
551 by debugging information entries that are owned by the
552 corresponding structure type, union type, or class type entry
553 and appear in the same order as the corresponding declarations
554 in the source program.
556 A structure type, union type or class type entry may have
557 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
558 \hypertarget{chap:DWATbitsizedatamemberbitsize}
559 (see Section \refersec{chap:byteandbitsizes}),
560 whose value is the amount of storage needed
561 to hold an instance of the structure, union or class type,
562 including any padding. An incomplete structure, union or
563 class type is represented by a structure, union or class
564 entry that does not have a byte size attribute and that has
565 a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
567 If the complete declaration of a type has been placed in
569 (see Section \refersec{chap:separatetypeunitentries}),
571 declaration of that type in the compilation unit may provide
572 the unique 64\dash bit signature of the type using a \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature}
575 If a structure, union or class entry represents the definition
576 of a structure, class or union member corresponding to a prior
577 incomplete structure, class or union, the entry may have a
578 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute whose value is a reference to
579 the debugging information entry representing that incomplete
582 Structure, union and class entries containing the
583 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute do not need to duplicate
584 information provided by the declaration entry referenced by the
585 specification attribute. In particular, such entries do not
586 need to contain an attribute for the name of the structure,
587 class or union they represent if such information is already
588 provided in the declaration.
590 \textit{For C and C++, data member declarations occurring within
591 the declaration of a structure, union or class type are
592 considered to be “definitions” of those members, with
593 the exception of “static” data members, whose definitions
594 appear outside of the declaration of the enclosing structure,
595 union or class type. Function member declarations appearing
596 within a structure, union or class type declaration are
597 definitions only if the body of the function also appears
598 within the type declaration.}
600 If the definition for a given member of the structure, union
601 or class does not appear within the body of the declaration,
602 that member also has a debugging information entry describing
603 its definition. That latter entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
604 attribute referencing the debugging information entry
605 owned by the body of the structure, union or class entry and
606 representing a non\dash defining declaration of the data, function
607 or type member. The referenced entry will not have information
608 about the location of that member (low and high pc attributes
609 for function members, location descriptions for data members)
610 and will have a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
612 \textit{Consider a nested class whose
613 definition occurs outside of the containing class definition, as in:}
622 \textit{The two different structs can be described in
623 different compilation units to
624 facilitate DWARF space compression
625 (see Appendix \refersec{app:usingcompilationunits}).}
627 \subsection{Interface Type Entries}
628 \label{chap:interfacetypeentries}
630 \textit{The Java language defines "interface" types. An interface
631 in Java is similar to a C++ or Java class with only abstract
632 methods and constant data members.}
634 Interface types are represented by debugging information
636 tag \livetarg{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}.
638 An interface type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
639 value is a null-terminated string containing the type name
640 as it appears in the source program.
642 The members of an interface are represented by debugging
643 information entries that are owned by the interface type
644 entry and that appear in the same order as the corresponding
645 declarations in the source program.
647 \subsection{Derived or Extended Structs, Classes and Interfaces}
648 \label{chap:derivedorextendedstructsclasesandinterfaces}
650 \textit{In C++, a class (or struct) may be ``derived from'' or be a
651 ``subclass of'' another class. In Java, an interface may ``extend''
652 one or more other interfaces, and a class may "extend" another
653 class and/or "implement" one or more interfaces. All of these
654 relationships may be described using the following. Note that
655 in Java, the distinction between extends and implements is
656 implied by the entities at the two ends of the relationship.}
658 A class type or interface type entry that describes a
659 derived, extended or implementing class or interface owns
660 debugging information entries describing each of the classes
661 or interfaces it is derived from, extending or implementing,
662 respectively, ordered as they were in the source program. Each
664 tag \livetarg{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}.
666 An inheritance entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is
667 a reference to the debugging information entry describing the
668 class or interface from which the parent class or structure
669 of the inheritance entry is derived, extended or implementing.
671 An inheritance entry for a class that derives from or extends
672 another class or struct also has a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
673 attribute, whose value describes the location of the beginning
674 of the inherited type relative to the beginning address of the
675 derived class. If that value is a constant, it is the offset
676 in bytes from the beginning of the class to the beginning of
677 the inherited type. Otherwise, the value must be a location
678 description. In this latter case, the beginning address of
679 the derived class is pushed on the expression stack before
680 the location description is evaluated and the result of the
681 evaluation is the location of the inherited type.
683 \textit{The interpretation of the value of this attribute for
684 inherited types is the same as the interpretation for data
686 (see Section \refersec{chap:datamemberentries}). }
689 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}
691 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
692 attribute. If no accessibility attribute
693 is present, private access is assumed for an entry of a class
694 and public access is assumed for an entry of an interface,
697 If the class referenced by the inheritance entry serves
698 as a C++ virtual base class, the inheritance entry has a
699 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
701 \textit{For a C++ virtual base, the data member location attribute
702 will usually consist of a non-trivial location description.}
704 \subsection{Access Declarations}
705 \label{chap:accessdeclarations}
707 \textit{In C++, a derived class may contain access declarations that
708 change the accessibility of individual class members from the
709 overall accessibility specified by the inheritance declaration.
710 A single access declaration may refer to a set of overloaded
713 If a derived class or structure contains access declarations,
714 each such declaration may be represented by a debugging
715 information entry with the tag
716 \livetarg{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}.
718 such entry is a child of the class or structure type entry.
720 An access declaration entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
721 value is a null-terminated string representing the name used
722 in the declaration in the source program, including any class
723 or structure qualifiers.
725 An access declaration entry
726 \hypertarget{chap:DWATaccessibilitycppbaseclasses}
728 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
729 attribute describing the declared accessibility of the named
736 Each ``friend'' declared by a structure, union or class
737 type may be represented by a debugging information entry
738 that is a child of the structure, union or class type entry;
739 the friend entry has the
740 tag \livetarg{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}.
742 A friend entry has a \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute, whose value is
743 a reference to the debugging information entry describing
744 the declaration of the friend.
747 \subsection{Data Member Entries}
748 \label{chap:datamemberentries}
750 A data member (as opposed to a member function) is
751 represented by a debugging information entry with the
752 tag \livetarg{chap:DWTAGmember}{DW\-\_TAG\-\_member}.
753 The member entry for a named member has
754 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null-terminated
755 string containing the member name as it appears in the source
756 program. If the member entry describes an anonymous union, the
757 name attribute is omitted or consists of a single zero byte.
759 The data member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote
760 the type of that member.
762 A data member entry may have a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
763 attribute. If no accessibility attribute is present, private
764 access is assumed for an entry of a class and public access
765 is assumed for an entry of a structure, union, or interface.
767 A data member entry may have a \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable} attribute,
768 which is a \livelink{chap:flag}{flag}.
769 This attribute indicates whether the data
770 member was declared with the mutable storage class specifier.
772 The beginning of a data member is described relative to
773 the beginning of the object in which it is immediately
774 contained. In general, the beginning is characterized by
775 both an address and a bit offset within the byte at that
776 address. When the storage for an entity includes all of
777 the bits in the beginning byte, the beginning bit offset is
780 Bit offsets in DWARF use the bit numbering and direction
781 conventions that are appropriate to the current language on
784 The member entry corresponding to a data member that is
785 defined in a structure, union or class may have either a
786 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute or a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
787 attribute. If the beginning of the data member is the same as
788 the beginning of the containing entity then neither attribute
791 For a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute there are two cases:
793 \begin{enumerate}[1.]
795 \item If the value is an integer constant, it is the offset
796 in bytes from the beginning of the containing entity. If
797 the beginning of the containing entity has a non-zero bit
798 offset then the beginning of the member entry has that same
801 \item Otherwise, the value must be a location description. In
802 this case, the beginning of the containing entity must be byte
803 aligned. The beginning address is pushed on the DWARF stack
804 before the location description is evaluated; the result of
805 the evaluation is the base address of the member entry.
807 \textit{The push on the DWARF expression stack of the base address of
808 the containing construct is equivalent to execution of the
809 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} operation
810 (see Section \refersec{chap:stackoperations});
811 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} therefore is not needed at the
812 beginning of a location description for a data member. The
813 result of the evaluation is a location--either an address or
814 the name of a register, not an offset to the member.}
816 \textit{A \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute that has the form of a
817 location description is not valid for a data member contained
818 in an entity that is not byte aligned because DWARF operations
819 do not allow for manipulating or computing bit offsets.}
823 For a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, the value is an integer
825 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
826 that specifies the number of bits
827 from the beginning of the containing entity to the beginning
828 of the data member. This value must be greater than or equal
829 to zero, but is not limited to less than the number of bits
832 If the size of a data member is not the same as the size
833 of the type given for the data member, the data member has
834 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose
835 integer constant value
836 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
838 of storage needed to hold the value of the data member.
840 \textit{C and C++ bit fields typically require the use of the
841 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
843 \textit{This Standard uses the following bit numbering and direction
844 conventions in examples. These conventions are for illustrative
845 purposes and other conventions may apply on particular
850 \item \textit{For big\dash endian architectures, bit offsets are
851 counted from high-order to low\dash order bits within a byte (or
852 larger storage unit); in this case, the bit offset identifies
853 the high\dash order bit of the object.}
855 \item \textit{For little\dash endian architectures, bit offsets are
856 counted from low\dash order to high\dash order bits within a byte (or
857 larger storage unit); in this case, the bit offset identifies
858 the low\dash order bit of the object.}
862 \textit{In either case, the bit so identified is defined as the beginning of the object.}
864 \textit{For example, take one possible representation of the following C structure definition in both big\dash and little\dash endian byte orders:}
875 \textit{The following diagrams show the structure layout
876 and data bit offsets for example big\dash\ and little\dash endian
877 architectures, respectively. Both diagrams show a structure
878 that begins at address A and whose size is four bytes. Also,
879 high order bits are to the left and low order bits are to
882 \textit{Big\dash Endian Data Bit Offsets:}
890 Addresses increase ->
891 | A | A + 1 | A + 2 | A + 3 |
893 Data bit offsets increase ->
894 +---------------+---------------+---------------+---------------+
895 |0 4|5 10|11 15|16 23|24 31|
896 | j | k | m | n | <pad> |
898 +---------------------------------------------------------------+
901 \textit{Little\dash Endian Data Bit Offsets:}
907 <- Addresses increase
908 | A | A + 1 | A + 2 | A + 3 |
910 <- Data bit offsets increase
912 +---------------+---------------+---------------+---------------+
913 |31 24|23 16|15 11|10 5|4 0|
914 | <pad> | n | m | k | j |
916 +---------------------------------------------------------------+
920 \textit{Note that data member bit offsets in this example are the
921 same for both big\dash\ and little\dash endian architectures even
922 though the fields are allocated in different directions
923 (high\dash order to low-order versus low\dash order to high\dash order);
924 the bit naming conventions for memory and/or registers of
925 the target architecture may or may not make this seem natural.}
927 \textit{For a more extensive example showing nested and packed records
929 Appendix \refersec{app:pascalexample}.}
931 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
932 is also used for base types
933 (see Section \refersec{chap:basetypeentries}).
935 \livetarg{chap:DWATbitoffsetdatamemberbitlocation}
936 attributes \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} and \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} when used to
937 identify the beginning of bit field data members as defined
938 in DWARF V3 and earlier. The earlier attributes are defined
939 in a manner suitable for bit field members on big-endian
940 architectures but which is either awkward or incomplete for
941 use on little-endian architectures. (\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} also
942 has other uses that are not affected by this change.)}
944 \textit{The \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
945 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
946 attribute combination is deprecated for data members in DWARF
947 Version 4, but implementations may continue to support this
948 use for compatibility.}
950 \textit{The DWARF Version 3 definitions of these attributes are
953 \begin{myindentpara}{1cm}
954 \textit{If the data member entry describes a bit field, then that
955 entry has the following attributes:}
958 \item \textit{A \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute whose value (see Section
959 2.19) is the number of bytes that contain an instance of the
960 bit field and any padding bits.}
962 \textit{The byte size attribute may be omitted if the size of the
963 object containing the bit field can be inferred from the type
964 attribute of the data member containing the bit field.}
966 \item \textit{A \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute whose value (see Section
967 2.19) is the number of bits to the left of the leftmost
968 (most significant) bit of the bit field value.}
970 \item \textit{A \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose value (see Section
971 2.19) is the number of bits occupied by the bit field value.}
975 \textit{The location description for a bit field calculates the address
976 of an anonymous object containing the bit field. The address
977 is relative to the structure, union, or class that most closely
978 encloses the bit field declaration. The number of bytes in this
979 anonymous object is the value of the byte size attribute of
980 the bit field. The offset (in bits) from the most significant
981 bit of the anonymous object to the most significant bit of
982 the bit field is the value of the bit offset attribute.}
986 \textit{Diagrams similar to the above that show the use of the
987 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute
988 combination may be found in the DWARF Version 3 Standard.}
990 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
991 defines the following combinations of attributes:}
994 \item \textit{either \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} or
995 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} (to specify the beginning of the
998 % FIXME: the indentation of the following line is suspect.
999 \textit{optionally together with}
1001 \item \textit{either \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} (to
1002 specify the size of the data member)}
1006 \textit{DWARF V3 defines the following combinations}
1009 \item \textit{\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} (to specify the beginning
1010 of the data member, except this specification is only partial
1011 in the case of a bit field) }
1013 % FIXME: the indentation of the following line is suspect.
1014 \textit{optionally together with}
1016 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1017 (to further specify the beginning of a bit field data member
1018 as well as specify the size of the data member) }
1021 \subsection{Member Function Entries}
1022 \label{chap:memberfunctionentries}
1024 A member function is represented by a debugging information
1025 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. The member function entry
1026 may contain the same attributes and follows the same rules
1027 as non\dash member global subroutine entries
1028 (see Section \refersec{chap:subroutineandentrypointentries}).
1030 A member function entry may have a \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1031 attribute. If no accessibility attribute is present, private
1032 access is assumed for an entry of a class and public access
1033 is assumed for an entry of a structure, union or interface.
1035 If the member function entry describes a virtual function,
1036 then that entry has a \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
1039 \hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}
1040 the member function entry describes an explicit member
1041 function, then that entry has a
1042 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1044 An entry for a virtual function also has a
1045 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location} attribute whose value contains
1046 a location description yielding the address of the slot
1047 for the function within the virtual function table for the
1048 enclosing class. The address of an object of the enclosing
1049 type is pushed onto the expression stack before the location
1050 description is evaluated.
1052 If the member function entry describes a non\dash static member
1053 function, then that entry has a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer} attribute
1054 whose value is a reference to the formal parameter entry
1055 that corresponds to the object for which the function is
1056 called. The name attribute of that formal parameter is defined
1057 by the current language (for example, this for C++ or self
1058 for Objective C and some other languages). That parameter
1059 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1061 Conversely, if the member function entry describes a static
1062 member function, the entry does not have a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1065 If the member function entry describes a non\dash static member
1066 function that has a const\dash volatile qualification, then
1067 the entry describes a non\dash static member function whose
1068 object formal parameter has a type that has an equivalent
1069 const\dash volatile qualification.
1071 If a subroutine entry represents the defining declaration
1072 of a member function and that definition appears outside of
1073 the body of the enclosing class declaration, the subroutine
1074 entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute, whose value is
1075 a reference to the debugging information entry representing
1076 the declaration of this function member. The referenced entry
1077 will be a child of some class (or structure) type entry.
1079 Subroutine entries containing the \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1080 attribute do not need to duplicate information provided
1081 by the declaration entry referenced by the specification
1082 attribute. In particular, such entries do not need to contain
1083 attributes for the name or return type of the function member
1084 whose definition they represent.
1086 \subsection{Class Template Instantiations}
1087 \label{chap:classtemplateinstantiations}
1089 \textit{In C++ a class template is a generic definition of a class
1090 type that may be instantiated when an instance of the class
1091 is declared or defined. The generic description of the
1092 class may include both parameterized types and parameterized
1093 constant values. DWARF does not represent the generic template
1094 definition, but does represent each instantiation.}
1096 A class template instantiation is represented by a
1097 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1098 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1099 exceptions, such an entry will contain the same attributes
1100 and have the same types of child entries as would an entry
1101 for a class type defined explicitly using the instantiation
1102 types and values. The exceptions are:
1104 \begin{enumerate}[1.]
1105 \item Each formal parameterized type declaration appearing in the
1106 template definition is represented by a debugging information
1107 entry with the tag \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1108 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1109 a null\dash terminated string containing the name of the formal
1110 type parameter as it appears in the source program. The
1111 template type parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1112 describing the actual type by which the formal is replaced
1113 for this instantiation.
1115 \item Each formal parameterized value declaration appearing in the
1116 template definition is represented by a debugging information
1118 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1120 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1121 a null\dash terminated string containing the name of the formal
1122 value parameter as it appears in the source program.
1124 \hypertarget{chap:DWATconstvaluetemplatevalueparameter}
1125 template value parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1126 describing the type of the parameterized value. Finally,
1127 the template value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1128 attribute, whose value is the actual constant value of the
1129 value parameter for this instantiation as represented on the
1130 target architecture.
1132 \item The class type entry and each of its child entries references
1133 a template type parameter entry in any circumstance where the
1134 source template definition references a formal parameterized
1135 type. Similarly, the class type entry and each of its child
1136 entries references a template value parameter entry in any
1137 circumstance where the source template definition references
1138 a formal parameterized value.
1140 \item If the compiler has generated a special compilation unit to
1141 hold the template instantiation and that special compilation
1142 unit has a different name from the compilation unit containing
1143 the template definition, the name attribute for the debugging
1144 information entry representing the special compilation unit
1145 should be empty or omitted.
1147 \item If the class type entry representing the template
1148 instantiation or any of its child entries contains declaration
1149 coordinate attributes, those attributes should refer to
1150 the source for the template definition, not to any source
1151 generated artificially by the compiler.
1155 \subsection{Variant Entries}
1156 \label{chap:variantentries}
1158 A variant part of a structure is represented by a debugging
1159 information entry with the
1160 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1161 owned by the corresponding structure type entry.
1163 If the variant part has a discriminant, the discriminant is
1164 represented by a separate debugging information entry which
1165 is a child of the variant part entry. This entry has the form
1166 of a structure data member entry. The variant part entry will
1167 have a \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute whose value is a reference to
1168 the member entry for the discriminant.
1170 If the variant part does not have a discriminant (tag field),
1171 the variant part entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1174 Each variant of a particular variant part is represented by
1175 a debugging information entry with the
1176 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1177 and is a child of the variant part entry. The value that
1178 selects a given variant may be represented in one of three
1179 ways. The variant entry may have a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1180 whose value represents a single case label. The value of this
1181 attribute is encoded as an LEB128 number. The number is signed
1182 if the tag type for the variant part containing this variant
1183 is a signed type. The number is unsigned if the tag type is
1186 Alternatively, the variant entry may contain a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1187 attribute, whose value represents a list of discriminant
1188 values. This list is represented by any of the
1189 \livelink{chap:block}{block} forms and
1190 may contain a mixture of case labels and label ranges. Each
1191 item on the list is prefixed with a discriminant value
1192 descriptor that determines whether the list item represents
1193 a single label or a label range. A single case label is
1194 represented as an LEB128 number as defined above for the
1195 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute. A label range is represented by
1196 two LEB128 numbers, the low value of the range followed by the
1197 high value. Both values follow the rules for signedness just
1198 described. The discriminant value descriptor is an integer
1199 constant that may have one of the values given in
1200 Figure \refersec{fig:discriminantdescriptorvalues}.
1202 \begin{figure}[here]
1203 \autorows[0pt]{c}{1}{l}{
1204 \addtoindex{DW\-\_DSC\-\_label},
1205 \addtoindex{DW\-\_DSC\-\_range}
1207 \caption{Discriminant descriptor values}\label{fig:discriminantdescriptorvalues}
1210 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1211 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1212 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1215 The components selected by a particular variant are represented
1216 by debugging information entries owned by the corresponding
1217 variant entry and appear in the same order as the corresponding
1218 declarations in the source program.
1220 \section{Condition Entries}
1221 \label{chap:conditionentries}
1223 \textit{COBOL has the notion of a ``level\dash 88 condition'' that
1224 associates a data item, called the conditional variable, with
1225 a set of one or more constant values and/or value ranges.
1226 Semantically, the condition is ‛true’ if the conditional
1227 variable's value matches any of the described constants,
1228 and the condition is ‛false’ otherwise.}
1230 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition} debugging information entry
1232 logical condition that tests whether a given data item’s
1233 value matches one of a set of constant values. If a name
1234 has been given to the condition, the condition entry has a
1235 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1236 giving the condition name as it appears in the source program.
1238 The condition entry's parent entry describes the conditional
1239 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1240 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry. If the parent
1241 entry has an array type, the condition can test any individual
1242 element, but not the array as a whole. The condition entry
1243 implicitly specifies a “comparison type” that is the
1244 type of an array element if the parent has an array type;
1245 otherwise it is the type of the parent entry.
1247 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1248 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1249 values associated with the condition. If any child entry has
1250 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, that attribute should describe a type
1251 compatible with the comparison type (according to the source
1252 language); otherwise the child’s type is the same as the
1255 \textit{For conditional variables with alphanumeric types, COBOL
1256 permits a source program to provide ranges of alphanumeric
1257 constants in the condition. Normally a subrange type entry
1258 does not describe ranges of strings; however, this can be
1259 represented using bounds attributes that are references to
1260 constant entries describing strings. A subrange type entry may
1261 refer to constant entries that are siblings of the subrange
1265 \section{Enumeration Type Entries}
1266 \label{chap:enumerationtypeentries}
1268 \textit{An “enumeration type” is a scalar that can assume one of
1269 a fixed number of symbolic values.}
1271 An enumeration type is represented by a debugging information
1273 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1275 If a name has been given to the enumeration type in the source
1276 program, then the corresponding enumeration type entry has
1277 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1278 string containing the enumeration type name as it appears
1279 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1280 attribute whose integer constant value is the number of bytes
1281 required to hold an instance of the enumeration.
1283 The enumeration type entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1284 which refers to the underlying data type used to implement
1287 If an enumeration type has type safe semantics such that
1289 \begin{enumerate}[1.]
1290 \item Enumerators are contained in the scope of the enumeration type, and/or
1292 \item Enumerators are not implicitly converted to another type
1295 then the enumeration type entry may have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1296 attribute, which is a \livelink{chap:flag}{flag}.
1297 In a language that offers only
1298 one kind of enumeration declaration, this attribute is not
1301 \textit{In C or C++, the underlying type will be the appropriate
1302 integral type determined by the compiler from the properties of
1303 \hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}
1304 the enumeration literal values. A C++ type declaration written
1305 using enum class declares a strongly typed enumeration and
1306 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type} in combination
1307 with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1309 Each enumeration literal is represented by a debugging
1310 information entry with the
1311 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1313 such entry is a child of the enumeration type entry, and the
1314 enumerator entries appear in the same order as the declarations
1315 of the enumeration literals in the source program.
1317 Each enumerator entry has a
1318 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1319 value is a null\dash terminated string containing the name of the
1320 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}
1321 enumeration literal as it appears in the source program.
1322 Each enumerator entry also has a
1323 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1324 whose value is the actual numeric value of the enumerator as
1325 represented on the target system.
1328 If the enumeration type occurs as the description of a
1329 dimension of an array type, and the stride for that dimension
1330 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}
1331 is different than what would otherwise be determined, then
1332 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}
1333 the enumeration type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1334 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1335 between successive elements along the dimension as described
1337 Section \refersec{chap:visibilityofdeclarations}.
1338 The value of the \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1339 is interpreted as bits and the value of the \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1340 attribute is interpreted as bytes.
1343 \section{Subroutine Type Entries}
1344 \label{chap:subroutinetypeentries}
1346 It is possible in C to declare pointers to subroutines
1347 that return a value of a specific type. In both C and C++,
1348 it is possible to declare pointers to subroutines that not
1349 only return a value of a specific type, but accept only
1350 arguments of specific types. The type of such pointers would
1351 be described with a ``pointer to'' modifier applied to a
1352 user\dash defined type.
1354 A subroutine type is represented by a debugging information
1356 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1358 been given to the subroutine type in the source program,
1359 then the corresponding subroutine type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
1360 attribute whose value is a null\dash terminated string containing
1361 the subroutine type name as it appears in the source program.
1363 If the subroutine type describes a function that returns
1364 a value, then the subroutine type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1365 attribute to denote the type returned by the subroutine. If
1366 the types of the arguments are necessary to describe the
1367 subroutine type, then the corresponding subroutine type
1368 entry owns debugging information entries that describe the
1369 arguments. These debugging information entries appear in the
1370 order that the corresponding argument types appear in the
1373 In C there is a difference between the types of functions
1374 declared using function prototype style declarations and
1375 those declared using non\dash prototype declarations.
1377 A subroutine entry declared with a function prototype style
1378 declaration may have a \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1379 a \livelink{chap:flag}{flag}.
1381 Each debugging information entry owned by a subroutine
1382 type entry has a tag whose value has one of two possible
1385 \begin{enumerate}[1.]
1386 \item The formal parameters of a parameter list (that have a
1387 specific type) are represented by a debugging information entry
1388 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}. Each formal parameter
1389 entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1390 the formal parameter.
1392 \item The unspecified parameters of a variable parameter list
1393 are represented by a debugging information entry with the
1394 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1399 \section{String Type Entries}
1400 \label{chap:stringtypeentries}
1403 A ``string'' is a sequence of characters that have specific
1404 semantics and operations that separate them from arrays of
1405 characters. Fortran is one of the languages that has a string
1406 type. Note that ``string'' in this context refers to a target
1407 machine concept, not the class string as used in this document
1408 (except for the name attribute).
1410 A string type is represented by a debugging information entry
1411 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1412 If a name has been given to
1413 the string type in the source program, then the corresponding
1414 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
1415 a null\dash terminated string containing the string type name as
1416 it appears in the source program.
1418 The string type entry may have a \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1419 whose value is a location description yielding the location
1420 where the length of the string is stored in the program. The
1421 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1422 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1423 (see Section \refersec{chap:byteandbitsizes})
1424 is the size of the data to be retrieved from the location
1425 referenced by the string length attribute. If no (byte or bit)
1426 size attribute is present, the size of the data to be retrieved
1427 is the same as the size of an address on the target machine.
1429 If no string length attribute is present, the string type
1430 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1431 attribute, whose value
1432 (see Section \refersec{chap:byteandbitsizes})
1434 storage needed to hold a value of the string type.
1437 \section{Set Type Entries}
1438 \label{chap:settypeentries}
1440 \textit{Pascal provides the concept of a “set,” which represents
1441 a group of values of ordinal type.}
1443 A set is represented by a debugging information entry with
1444 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1445 If a name has been given to the
1446 set type, then the set type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1447 whose value is a null\dash terminated string containing the
1448 set type name as it appears in the source program.
1450 The set type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1451 type of an element of the set.
1453 If the amount of storage allocated to hold each element of an
1454 object of the given set type is different from the amount of
1455 storage that is normally allocated to hold an individual object
1456 of the indicated element type, then the set type entry has
1457 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1458 whose value (see Section \refersec{chap:byteandbitsizes}) is
1459 the amount of storage needed to hold a value of the set type.
1462 \section{Subrange Type Entries}
1463 \label{chap:subrangetypeentries}
1465 \textit{Several languages support the concept of a ``subrange''
1466 type object. These objects can represent a subset of the
1467 values that an object of the basis type for the subrange can
1468 represent. Subrange type entries may also be used to represent
1469 the bounds of array dimensions.}
1471 A subrange type is represented by a debugging information
1473 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
1475 given to the subrange type, then the subrange type entry
1476 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1477 string containing the subrange type name as it appears in
1480 The subrange entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
1481 the type of object, called the basis type, of whose values
1482 this subrange is a subset.
1484 If the amount of storage allocated to hold each element of an
1485 object of the given subrange type is different from the amount
1486 of storage that is normally allocated to hold an individual
1487 object of the indicated element type, then the subrange
1488 type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1489 attribute, whose value
1490 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1492 storage needed to hold a value of the subrange type.
1494 The subrange entry may have a \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
1495 which is a \livelink{chap:flag}{flag}.
1496 If present, this attribute indicates whether
1497 this subrange represents a UPC array bound which is scaled
1498 by the runtime THREADS value (the number of UPC threads in
1499 this execution of the program).
1501 \textit{This allows the representation of a UPC shared array such as}
1504 int shared foo[34*THREADS][10][20];
1507 The subrange entry may have the attributes \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
1508 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound} to specify, respectively, the lower
1509 and upper bound values of the subrange. The \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
1511 \hypertarget{chap:DWATcountelementsofsubrangetype}
1512 may be replaced by a
1513 \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute, whose
1514 value describes the number of elements in the subrange rather
1515 than the value of the last element. The value of each of
1516 these attributes is determined as described in
1517 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1519 If the lower bound value is missing, the value is assumed to
1520 be a language\dash dependent default constant. The default lower
1521 bound is 0 for C, C++, D, Java, Objective C, Objective C++,
1522 Python, and UPC. The default lower bound is 1 for Ada, COBOL,
1523 Fortran, Modula\dash 2, Pascal and PL/I.
1525 \textit{No other default lower bound values are currently defined.}
1527 If the upper bound and count are missing, then the upper bound value is
1530 If the subrange entry has no type attribute describing the
1531 basis type, the basis type is assumed to be the same as
1532 the object described by the lower bound attribute (if it
1533 references an object). If there is no lower bound attribute,
1534 or that attribute does not reference an object, the basis type
1535 is the type of the upper bound or count attribute (if either
1536 of them references an object). If there is no upper bound or
1537 count attribute, or neither references an object, the type is
1538 assumed to be the same type, in the source language of the
1539 compilation unit containing the subrange entry, as a signed
1540 integer with the same size as an address on the target machine.
1542 If the subrange type occurs as the description of a dimension
1543 of an array type, and the stride for that dimension is
1544 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}
1545 different than what would otherwise be determined, then
1546 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}
1547 the subrange type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
1548 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1549 between successive elements along the dimension as described
1551 Section \refersec{chap:byteandbitsizes}.
1553 \textit{Note that the stride can be negative.}
1555 \section{Pointer to Member Type Entries}
1556 \label{chap:pointertomembertypeentries}
1558 \textit{In C++, a pointer to a data or function member of a class or
1559 structure is a unique type.}
1561 A debugging information entry representing the type of an
1562 object that is a pointer to a structure or class member has
1563 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
1565 If the pointer to member type has a name, the pointer to
1566 member entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a
1567 null\dash terminated string containing the type name as it appears
1568 in the source program.
1570 The pointer to member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
1571 describe the type of the class or structure member to which
1572 objects of this type may point.
1574 The pointer to member entry also
1575 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
1577 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
1578 attribute, whose value is a reference to a debugging
1579 information entry for the class or structure to whose members
1580 objects of this type may point.
1582 The pointer to member entry has a \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
1583 whose value is a location description that computes the
1584 address of the member of the class to which the pointer to
1585 member entry points.
1587 \textit{The method used to find the address of a given member of a
1588 class or structure is common to any instance of that class
1589 or structure and to any instance of the pointer or member
1590 type. The method is thus associated with the type entry,
1591 rather than with each instance of the type.}
1593 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
1594 with the location descriptions for a particular object of the
1595 given pointer to member type and for a particular structure or
1596 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute expects two
1597 values to be pushed onto the DWARF expression stack before
1598 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated. The first
1599 value pushed is the value of the pointer to member object
1600 itself. The second value pushed is the base address of the
1601 entire structure or union instance containing the member
1602 whose address is being calculated.
1604 \textit{For an expression such as}
1609 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
1610 \textit{where mbr\_ptr has some pointer to member type, a debugger should:}
1612 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
1614 \textit{2. Push the base address of object onto the DWARF expression stack.}
1616 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
1617 given in the type of mbr\_ptr.}
1619 \section{File Type Entries}
1620 \label{chap:filetypeentries}
1622 \textit{Some languages, such as Pascal, provide a data type to represent
1625 A file type is represented by a debugging information entry
1627 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
1628 If the file type has a name,
1629 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value
1630 is a null\dash terminated string containing the type name as it
1631 appears in the source program.
1633 The file type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1634 the type of the objects contained in the file.
1636 The file type entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1637 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1638 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1639 is the amount of storage need to hold a value of the file type.
1641 \section{Dynamic Type Properties}
1642 \label{chap:dynamictypeproperties}
1643 \subsection{Data Location}
1644 \label{chap:datalocation}
1646 \textit{Some languages may represent objects using descriptors to hold
1647 information, including a location and/or run\dash time parameters,
1648 about the data that represents the value for that object.}
1650 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} attribute may be used with any
1651 type that provides one or more levels of hidden indirection
1652 and/or run\dash time parameters in its representation. Its value
1653 is a location description. The result of evaluating this
1654 description yields the location of the data for an object.
1655 When this attribute is omitted, the address of the data is
1656 the same as the address of the object.
1658 \textit{This location description will typically begin with
1659 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
1660 which loads the address of the
1661 object which can then serve as a descriptor in subsequent
1662 calculation. For an example using
1663 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
1664 for a Fortran 90 array, see
1665 Appendix \refersec{app:fortran90example}.}
1667 \subsection{Allocation and Association Status}
1668 \label{chap:allocationandassociationstatus}
1670 \textit{Some languages, such as Fortran 90, provide types whose values
1671 may be dynamically allocated or associated with a variable
1672 under explicit program control.}
1674 \hypertarget{chap:DWATallocatedallocationstatusoftypes}
1676 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
1677 attribute may optionally be used with any
1678 type for which objects of the type can be explicitly allocated
1679 and deallocated. The presence of the attribute indicates that
1680 objects of the type are allocatable and deallocatable. The
1681 integer value of the attribute (see below) specifies whether
1682 an object of the type is
1683 currently allocated or not.
1685 \hypertarget{chap:DWATassociatedassociationstatusoftypes}
1687 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute
1688 may optionally be used with
1689 any type for which objects of the type can be dynamically
1690 associated with other objects. The presence of the attribute
1691 indicates that objects of the type can be associated. The
1692 integer value of the attribute (see below) indicates whether
1693 an object of the type is currently associated or not.
1695 While these attributes are defined specifically with Fortran
1696 90 ALLOCATABLE and POINTER types in mind, usage is not limited
1697 to just that language.
1699 The value of these attributes is determined as described in
1700 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1702 A non\dash zero value is interpreted as allocated or associated,
1703 and zero is interpreted as not allocated or not associated.
1705 \textit{For Fortran 90, if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is present,
1706 the type has the POINTER property where either the parent
1707 variable is never associated with a dynamic object or the
1708 implementation does not track whether the associated object
1709 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
1710 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
1711 has the ALLOCATABLE property. If both attributes are present,
1712 then the type should be assumed to have the POINTER property
1713 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
1714 be used to indicate that the association status of the object
1715 resulted from execution of an ALLOCATE statement rather than
1716 pointer assignment.}
1718 \textit{For examples using \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for Ada and Fortran 90
1720 see Appendix \refersec{app:aggregateexamples}.}
1724 \section{Template Alias Entries}
1725 \label{chap:templatealiasentries}
1727 A type named using a template alias is represented
1728 by a debugging information entry with the tag
1729 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
1730 The template alias entry has a
1731 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1732 containing the name of the template alias as it appears in
1733 the source program. The template alias entry also contains a
1734 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is a reference to the type
1735 named by the template alias. The template alias entry has
1736 the following child entries:
1738 \begin{enumerate}[1.]
1739 \item Each formal parameterized type declaration appearing
1740 in the template alias declaration is represented
1741 by a debugging information entry with the tag
1742 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each such entry may have
1743 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1744 string containing the name of the formal type parameter as it
1745 appears in the source program. The template type parameter
1746 entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing the actual
1747 type by which the formal is replaced for this instantiation.
1749 \item Each formal parameterized value declaration
1750 appearing in the template alias declaration is
1751 represented by a debugging information entry with the tag
1752 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}. Each such entry may have
1753 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1754 string containing the name of the formal value parameter
1755 as it appears in the source program. The template value
1756 parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1757 the type of the parameterized value. Finally, the template
1758 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute, whose
1759 value is the actual constant value of the value parameter for
1760 this instantiation as represented on the target architecture.