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.
1038 If the member function entry describes an explicit member
1039 function, then that entry has a \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1041 An entry for a virtual function also has a
1042 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location} attribute whose value contains
1043 a location description yielding the address of the slot
1044 for the function within the virtual function table for the
1045 enclosing class. The address of an object of the enclosing
1046 type is pushed onto the expression stack before the location
1047 description is evaluated.
1049 If the member function entry describes a non\dash static member
1050 function, then that entry has a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer} attribute
1051 whose value is a reference to the formal parameter entry
1052 that corresponds to the object for which the function is
1053 called. The name attribute of that formal parameter is defined
1054 by the current language (for example, this for C++ or self
1055 for Objective C and some other languages). That parameter
1056 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1058 Conversely, if the member function entry describes a static
1059 member function, the entry does not have a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1062 If the member function entry describes a non\dash static member
1063 function that has a const\dash volatile qualification, then
1064 the entry describes a non\dash static member function whose
1065 object formal parameter has a type that has an equivalent
1066 const\dash volatile qualification.
1068 If a subroutine entry represents the defining declaration
1069 of a member function and that definition appears outside of
1070 the body of the enclosing class declaration, the subroutine
1071 entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute, whose value is
1072 a reference to the debugging information entry representing
1073 the declaration of this function member. The referenced entry
1074 will be a child of some class (or structure) type entry.
1076 Subroutine entries containing the \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1077 attribute do not need to duplicate information provided
1078 by the declaration entry referenced by the specification
1079 attribute. In particular, such entries do not need to contain
1080 attributes for the name or return type of the function member
1081 whose definition they represent.
1083 \subsection{Class Template Instantiations}
1084 \label{chap:classtemplateinstantiations}
1086 \textit{In C++ a class template is a generic definition of a class
1087 type that may be instantiated when an instance of the class
1088 is declared or defined. The generic description of the
1089 class may include both parameterized types and parameterized
1090 constant values. DWARF does not represent the generic template
1091 definition, but does represent each instantiation.}
1093 A class template instantiation is represented by a
1094 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1095 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1096 exceptions, such an entry will contain the same attributes
1097 and have the same types of child entries as would an entry
1098 for a class type defined explicitly using the instantiation
1099 types and values. The exceptions are:
1101 \begin{enumerate}[1.]
1102 \item Each formal parameterized type declaration appearing in the
1103 template definition is represented by a debugging information
1104 entry with the tag \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1105 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1106 a null\dash terminated string containing the name of the formal
1107 type parameter as it appears in the source program. The
1108 template type parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1109 describing the actual type by which the formal is replaced
1110 for this instantiation.
1112 \item Each formal parameterized value declaration appearing in the
1113 template definition is represented by a debugging information
1115 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1117 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1118 a null\dash terminated string containing the name of the formal
1119 value parameter as it appears in the source program.
1121 \hypertarget{chap:DWATconstvaluetemplatevalueparameter}
1122 template value parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1123 describing the type of the parameterized value. Finally,
1124 the template value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1125 attribute, whose value is the actual constant value of the
1126 value parameter for this instantiation as represented on the
1127 target architecture.
1129 \item The class type entry and each of its child entries references
1130 a template type parameter entry in any circumstance where the
1131 source template definition references a formal parameterized
1132 type. Similarly, the class type entry and each of its child
1133 entries references a template value parameter entry in any
1134 circumstance where the source template definition references
1135 a formal parameterized value.
1137 \item If the compiler has generated a special compilation unit to
1138 hold the template instantiation and that special compilation
1139 unit has a different name from the compilation unit containing
1140 the template definition, the name attribute for the debugging
1141 information entry representing the special compilation unit
1142 should be empty or omitted.
1144 \item If the class type entry representing the template
1145 instantiation or any of its child entries contains declaration
1146 coordinate attributes, those attributes should refer to
1147 the source for the template definition, not to any source
1148 generated artificially by the compiler.
1152 \subsection{Variant Entries}
1153 \label{chap:variantentries}
1155 A variant part of a structure is represented by a debugging
1156 information entry with the
1157 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1158 owned by the corresponding structure type entry.
1160 If the variant part has a discriminant, the discriminant is
1161 represented by a separate debugging information entry which
1162 is a child of the variant part entry. This entry has the form
1163 of a structure data member entry. The variant part entry will
1164 have a \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute whose value is a reference to
1165 the member entry for the discriminant.
1167 If the variant part does not have a discriminant (tag field),
1168 the variant part entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1171 Each variant of a particular variant part is represented by
1172 a debugging information entry with the
1173 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1174 and is a child of the variant part entry. The value that
1175 selects a given variant may be represented in one of three
1176 ways. The variant entry may have a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1177 whose value represents a single case label. The value of this
1178 attribute is encoded as an LEB128 number. The number is signed
1179 if the tag type for the variant part containing this variant
1180 is a signed type. The number is unsigned if the tag type is
1183 Alternatively, the variant entry may contain a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1184 attribute, whose value represents a list of discriminant
1185 values. This list is represented by any of the
1186 \livelink{chap:block}{block} forms and
1187 may contain a mixture of case labels and label ranges. Each
1188 item on the list is prefixed with a discriminant value
1189 descriptor that determines whether the list item represents
1190 a single label or a label range. A single case label is
1191 represented as an LEB128 number as defined above for the
1192 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute. A label range is represented by
1193 two LEB128 numbers, the low value of the range followed by the
1194 high value. Both values follow the rules for signedness just
1195 described. The discriminant value descriptor is an integer
1196 constant that may have one of the values given in
1197 Figure \refersec{fig:discriminantdescriptorvalues}.
1199 \begin{figure}[here]
1200 \autorows[0pt]{c}{1}{l}{
1201 \addtoindex{DW\-\_DSC\-\_label},
1202 \addtoindex{DW\-\_DSC\-\_range}
1204 \caption{Discriminant descriptor values}\label{fig:discriminantdescriptorvalues}
1207 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1208 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1209 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1212 The components selected by a particular variant are represented
1213 by debugging information entries owned by the corresponding
1214 variant entry and appear in the same order as the corresponding
1215 declarations in the source program.
1217 \section{Condition Entries}
1218 \label{chap:conditionentries}
1220 \textit{COBOL has the notion of a ``level\dash 88 condition'' that
1221 associates a data item, called the conditional variable, with
1222 a set of one or more constant values and/or value ranges.
1223 Semantically, the condition is ‛true’ if the conditional
1224 variable's value matches any of the described constants,
1225 and the condition is ‛false’ otherwise.}
1227 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition} debugging information entry
1229 logical condition that tests whether a given data item’s
1230 value matches one of a set of constant values. If a name
1231 has been given to the condition, the condition entry has a
1232 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1233 giving the condition name as it appears in the source program.
1235 The condition entry's parent entry describes the conditional
1236 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1237 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry. If the parent
1238 entry has an array type, the condition can test any individual
1239 element, but not the array as a whole. The condition entry
1240 implicitly specifies a “comparison type” that is the
1241 type of an array element if the parent has an array type;
1242 otherwise it is the type of the parent entry.
1244 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1245 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1246 values associated with the condition. If any child entry has
1247 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, that attribute should describe a type
1248 compatible with the comparison type (according to the source
1249 language); otherwise the child’s type is the same as the
1252 \textit{For conditional variables with alphanumeric types, COBOL
1253 permits a source program to provide ranges of alphanumeric
1254 constants in the condition. Normally a subrange type entry
1255 does not describe ranges of strings; however, this can be
1256 represented using bounds attributes that are references to
1257 constant entries describing strings. A subrange type entry may
1258 refer to constant entries that are siblings of the subrange
1262 \section{Enumeration Type Entries}
1263 \label{chap:enumerationtypeentries}
1265 \textit{An “enumeration type” is a scalar that can assume one of
1266 a fixed number of symbolic values.}
1268 An enumeration type is represented by a debugging information
1270 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1272 If a name has been given to the enumeration type in the source
1273 program, then the corresponding enumeration type entry has
1274 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1275 string containing the enumeration type name as it appears
1276 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1277 attribute whose integer constant value is the number of bytes
1278 required to hold an instance of the enumeration.
1280 The enumeration type entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1281 which refers to the underlying data type used to implement
1284 If an enumeration type has type safe semantics such that
1286 \begin{enumerate}[1.]
1287 \item Enumerators are contained in the scope of the enumeration type, and/or
1289 \item Enumerators are not implicitly converted to another type
1292 then the enumeration type entry may have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1293 attribute, which is a \livelink{chap:flag}{flag}.
1294 In a language that offers only
1295 one kind of enumeration declaration, this attribute is not
1298 \textit{In C or C++, the underlying type will be the appropriate
1299 integral type determined by the compiler from the properties of
1300 the enumeration literal values. A C++ type declaration written
1301 using enum class declares a strongly typed enumeration and
1302 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type} in combination
1303 with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1305 Each enumeration literal is represented by a debugging
1306 information entry with the
1307 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1309 such entry is a child of the enumeration type entry, and the
1310 enumerator entries appear in the same order as the declarations
1311 of the enumeration literals in the source program.
1313 Each enumerator entry has a
1314 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1315 value is a null\dash terminated string containing the name of the
1316 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}
1317 enumeration literal as it appears in the source program.
1318 Each enumerator entry also has a
1319 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1320 whose value is the actual numeric value of the enumerator as
1321 represented on the target system.
1324 If the enumeration type occurs as the description of a
1325 dimension of an array type, and the stride for that dimension
1326 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}
1327 is different than what would otherwise be determined, then
1328 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}
1329 the enumeration type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1330 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1331 between successive elements along the dimension as described
1333 Section \refersec{chap:visibilityofdeclarations}.
1334 The value of the \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1335 is interpreted as bits and the value of the \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1336 attribute is interpreted as bytes.
1339 \section{Subroutine Type Entries}
1340 \label{chap:subroutinetypeentries}
1342 It is possible in C to declare pointers to subroutines
1343 that return a value of a specific type. In both C and C++,
1344 it is possible to declare pointers to subroutines that not
1345 only return a value of a specific type, but accept only
1346 arguments of specific types. The type of such pointers would
1347 be described with a ``pointer to'' modifier applied to a
1348 user\dash defined type.
1350 A subroutine type is represented by a debugging information
1352 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1354 been given to the subroutine type in the source program,
1355 then the corresponding subroutine type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
1356 attribute whose value is a null\dash terminated string containing
1357 the subroutine type name as it appears in the source program.
1359 If the subroutine type describes a function that returns
1360 a value, then the subroutine type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1361 attribute to denote the type returned by the subroutine. If
1362 the types of the arguments are necessary to describe the
1363 subroutine type, then the corresponding subroutine type
1364 entry owns debugging information entries that describe the
1365 arguments. These debugging information entries appear in the
1366 order that the corresponding argument types appear in the
1369 In C there is a difference between the types of functions
1370 declared using function prototype style declarations and
1371 those declared using non\dash prototype declarations.
1373 A subroutine entry declared with a function prototype style
1374 declaration may have a \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1375 a \livelink{chap:flag}{flag}.
1377 Each debugging information entry owned by a subroutine
1378 type entry has a tag whose value has one of two possible
1381 \begin{enumerate}[1.]
1382 \item The formal parameters of a parameter list (that have a
1383 specific type) are represented by a debugging information entry
1384 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}. Each formal parameter
1385 entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1386 the formal parameter.
1388 \item The unspecified parameters of a variable parameter list
1389 are represented by a debugging information entry with the
1390 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1395 \section{String Type Entries}
1396 \label{chap:stringtypeentries}
1399 A ``string'' is a sequence of characters that have specific
1400 semantics and operations that separate them from arrays of
1401 characters. Fortran is one of the languages that has a string
1402 type. Note that ``string'' in this context refers to a target
1403 machine concept, not the class string as used in this document
1404 (except for the name attribute).
1406 A string type is represented by a debugging information entry
1407 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1408 If a name has been given to
1409 the string type in the source program, then the corresponding
1410 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
1411 a null\dash terminated string containing the string type name as
1412 it appears in the source program.
1414 The string type entry may have a \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1415 whose value is a location description yielding the location
1416 where the length of the string is stored in the program. The
1417 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1418 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1419 (see Section \refersec{chap:byteandbitsizes})
1420 is the size of the data to be retrieved from the location
1421 referenced by the string length attribute. If no (byte or bit)
1422 size attribute is present, the size of the data to be retrieved
1423 is the same as the size of an address on the target machine.
1425 If no string length attribute is present, the string type
1426 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1427 attribute, whose value
1428 (see Section \refersec{chap:byteandbitsizes})
1430 storage needed to hold a value of the string type.
1433 \section{Set Type Entries}
1434 \label{chap:settypeentries}
1436 \textit{Pascal provides the concept of a “set,” which represents
1437 a group of values of ordinal type.}
1439 A set is represented by a debugging information entry with
1440 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1441 If a name has been given to the
1442 set type, then the set type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1443 whose value is a null\dash terminated string containing the
1444 set type name as it appears in the source program.
1446 The set type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1447 type of an element of the set.
1449 If the amount of storage allocated to hold each element of an
1450 object of the given set type is different from the amount of
1451 storage that is normally allocated to hold an individual object
1452 of the indicated element type, then the set type entry has
1453 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1454 whose value (see Section \refersec{chap:byteandbitsizes}) is
1455 the amount of storage needed to hold a value of the set type.
1458 \section{Subrange Type Entries}
1459 \label{chap:subrangetypeentries}
1461 \textit{Several languages support the concept of a ``subrange''
1462 type object. These objects can represent a subset of the
1463 values that an object of the basis type for the subrange can
1464 represent. Subrange type entries may also be used to represent
1465 the bounds of array dimensions.}
1467 A subrange type is represented by a debugging information
1469 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
1471 given to the subrange type, then the subrange type entry
1472 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1473 string containing the subrange type name as it appears in
1476 The subrange entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
1477 the type of object, called the basis type, of whose values
1478 this subrange is a subset.
1480 If the amount of storage allocated to hold each element of an
1481 object of the given subrange type is different from the amount
1482 of storage that is normally allocated to hold an individual
1483 object of the indicated element type, then the subrange
1484 type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1485 attribute, whose value
1486 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1488 storage needed to hold a value of the subrange type.
1490 The subrange entry may have a \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
1491 which is a \livelink{chap:flag}{flag}.
1492 If present, this attribute indicates whether
1493 this subrange represents a UPC array bound which is scaled
1494 by the runtime THREADS value (the number of UPC threads in
1495 this execution of the program).
1497 \textit{This allows the representation of a UPC shared array such as}
1500 int shared foo[34*THREADS][10][20];
1503 The subrange entry may have the attributes \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
1504 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound} to specify, respectively, the lower
1505 and upper bound values of the subrange. The \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
1507 \hypertarget{chap:DWATcountelementsofsubrangetype}
1508 may be replaced by a
1509 \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute, whose
1510 value describes the number of elements in the subrange rather
1511 than the value of the last element. The value of each of
1512 these attributes is determined as described in
1513 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1515 If the lower bound value is missing, the value is assumed to
1516 be a language\dash dependent default constant. The default lower
1517 bound is 0 for C, C++, D, Java, Objective C, Objective C++,
1518 Python, and UPC. The default lower bound is 1 for Ada, COBOL,
1519 Fortran, Modula\dash 2, Pascal and PL/I.
1521 \textit{No other default lower bound values are currently defined.}
1523 If the upper bound and count are missing, then the upper bound value is
1526 If the subrange entry has no type attribute describing the
1527 basis type, the basis type is assumed to be the same as
1528 the object described by the lower bound attribute (if it
1529 references an object). If there is no lower bound attribute,
1530 or that attribute does not reference an object, the basis type
1531 is the type of the upper bound or count attribute (if either
1532 of them references an object). If there is no upper bound or
1533 count attribute, or neither references an object, the type is
1534 assumed to be the same type, in the source language of the
1535 compilation unit containing the subrange entry, as a signed
1536 integer with the same size as an address on the target machine.
1538 If the subrange type occurs as the description of a dimension
1539 of an array type, and the stride for that dimension is
1540 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}
1541 different than what would otherwise be determined, then
1542 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}
1543 the subrange type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
1544 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1545 between successive elements along the dimension as described
1547 Section \refersec{chap:byteandbitsizes}.
1549 \textit{Note that the stride can be negative.}
1551 \section{Pointer to Member Type Entries}
1552 \label{chap:pointertomembertypeentries}
1554 \textit{In C++, a pointer to a data or function member of a class or
1555 structure is a unique type.}
1557 A debugging information entry representing the type of an
1558 object that is a pointer to a structure or class member has
1559 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
1561 If the pointer to member type has a name, the pointer to
1562 member entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a
1563 null\dash terminated string containing the type name as it appears
1564 in the source program.
1566 The pointer to member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
1567 describe the type of the class or structure member to which
1568 objects of this type may point.
1570 The pointer to member entry also
1571 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
1573 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
1574 attribute, whose value is a reference to a debugging
1575 information entry for the class or structure to whose members
1576 objects of this type may point.
1578 The pointer to member entry has a \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
1579 whose value is a location description that computes the
1580 address of the member of the class to which the pointer to
1581 member entry points.
1583 \textit{The method used to find the address of a given member of a
1584 class or structure is common to any instance of that class
1585 or structure and to any instance of the pointer or member
1586 type. The method is thus associated with the type entry,
1587 rather than with each instance of the type.}
1589 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
1590 with the location descriptions for a particular object of the
1591 given pointer to member type and for a particular structure or
1592 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute expects two
1593 values to be pushed onto the DWARF expression stack before
1594 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated. The first
1595 value pushed is the value of the pointer to member object
1596 itself. The second value pushed is the base address of the
1597 entire structure or union instance containing the member
1598 whose address is being calculated.
1600 \textit{For an expression such as}
1605 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
1606 \textit{where mbr\_ptr has some pointer to member type, a debugger should:}
1608 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
1610 \textit{2. Push the base address of object onto the DWARF expression stack.}
1612 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
1613 given in the type of mbr\_ptr.}
1615 \section{File Type Entries}
1616 \label{chap:filetypeentries}
1618 \textit{Some languages, such as Pascal, provide a data type to represent
1621 A file type is represented by a debugging information entry
1623 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
1624 If the file type has a name,
1625 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value
1626 is a null\dash terminated string containing the type name as it
1627 appears in the source program.
1629 The file type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1630 the type of the objects contained in the file.
1632 The file type entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1633 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1634 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1635 is the amount of storage need to hold a value of the file type.
1637 \section{Dynamic Type Properties}
1638 \label{chap:dynamictypeproperties}
1639 \subsection{Data Location}
1640 \label{chap:datalocation}
1642 \textit{Some languages may represent objects using descriptors to hold
1643 information, including a location and/or run\dash time parameters,
1644 about the data that represents the value for that object.}
1646 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location} attribute may be used with any
1647 type that provides one or more levels of hidden indirection
1648 and/or run\dash time parameters in its representation. Its value
1649 is a location description. The result of evaluating this
1650 description yields the location of the data for an object.
1651 When this attribute is omitted, the address of the data is
1652 the same as the address of the object.
1654 \textit{This location description will typically begin with
1655 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
1656 which loads the address of the
1657 object which can then serve as a descriptor in subsequent
1658 calculation. For an example using
1659 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
1660 for a Fortran 90 array, see
1661 Appendix \refersec{app:fortran90example}.}
1663 \subsection{Allocation and Association Status}
1664 \label{chap:allocationandassociationstatus}
1666 \textit{Some languages, such as Fortran 90, provide types whose values
1667 may be dynamically allocated or associated with a variable
1668 under explicit program control.}
1670 \hypertarget{chap:DWATallocatedallocationstatusoftypes}
1672 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
1673 attribute may optionally be used with any
1674 type for which objects of the type can be explicitly allocated
1675 and deallocated. The presence of the attribute indicates that
1676 objects of the type are allocatable and deallocatable. The
1677 integer value of the attribute (see below) specifies whether
1678 an object of the type is
1679 currently allocated or not.
1681 \hypertarget{chap:DWATassociatedassociationstatusoftypes}
1683 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute
1684 may optionally be used with
1685 any type for which objects of the type can be dynamically
1686 associated with other objects. The presence of the attribute
1687 indicates that objects of the type can be associated. The
1688 integer value of the attribute (see below) indicates whether
1689 an object of the type is currently associated or not.
1691 While these attributes are defined specifically with Fortran
1692 90 ALLOCATABLE and POINTER types in mind, usage is not limited
1693 to just that language.
1695 The value of these attributes is determined as described in
1696 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1698 A non\dash zero value is interpreted as allocated or associated,
1699 and zero is interpreted as not allocated or not associated.
1701 \textit{For Fortran 90, if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is present,
1702 the type has the POINTER property where either the parent
1703 variable is never associated with a dynamic object or the
1704 implementation does not track whether the associated object
1705 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
1706 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
1707 has the ALLOCATABLE property. If both attributes are present,
1708 then the type should be assumed to have the POINTER property
1709 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
1710 be used to indicate that the association status of the object
1711 resulted from execution of an ALLOCATE statement rather than
1712 pointer assignment.}
1714 \textit{For examples using \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for Ada and Fortran 90
1716 see Appendix \refersec{app:aggregateexamples}.}
1720 \section{Template Alias Entries}
1721 \label{chap:templatealiasentries}
1723 A type named using a template alias is represented
1724 by a debugging information entry with the tag
1725 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
1726 The template alias entry has a
1727 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1728 containing the name of the template alias as it appears in
1729 the source program. The template alias entry also contains a
1730 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is a reference to the type
1731 named by the template alias. The template alias entry has
1732 the following child entries:
1734 \begin{enumerate}[1.]
1735 \item Each formal parameterized type declaration appearing
1736 in the template alias declaration is represented
1737 by a debugging information entry with the tag
1738 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each such entry may have
1739 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1740 string containing the name of the formal type parameter as it
1741 appears in the source program. The template type parameter
1742 entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing the actual
1743 type by which the formal is replaced for this instantiation.
1745 \item Each formal parameterized value declaration
1746 appearing in the template alias declaration is
1747 represented by a debugging information entry with the tag
1748 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}. Each such entry may have
1749 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1750 string containing the name of the formal value parameter
1751 as it appears in the source program. The template value
1752 parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1753 the type of the parameterized value. Finally, the template
1754 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute, whose
1755 value is the actual constant value of the value parameter for
1756 this instantiation as represented on the target architecture.