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 \hypertarget{chap:DWATstartscopetypedeclaration}
9 the low pc value for the scope most closely enclosing the
10 declaration, the declaration may have a
11 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}
12 attribute as described for objects in
13 Section \refersec{chap:dataobjectentries}.
15 \section{Base Type Entries}
16 \label{chap:basetypeentries}
18 \textit{A base type is a data type that is not defined in terms of
19 other data types. Each programming language has a set of base
20 types that are considered to be built into that language.}
22 A base type is represented by a debugging information entry
24 \livetarg{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}.
26 A base type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
27 a null\dash terminated string containing the name of the base type
28 as recognized by the programming language of the compilation
29 unit containing the base type entry.
31 A base type entry has a \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding} attribute describing
32 how the base type is encoded and is to be interpreted. The
33 value of this attribute is an integer constant. The set of
34 values and their meanings for the \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding} attribute
36 Figure \refersec{fig:encodingattributevalues}
40 may have a \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute as described in
41 Section \refersec{chap:dataobjectentries}.
42 If omitted, the encoding assumes the representation that
43 is the default for the target architecture.
46 \hypertarget{chap:DWATbytesizedataobjectordatatypesize}
47 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
48 \hypertarget{chap:DWATbitsizebasetypebitsize}
49 or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose integer constant value
50 (see Section \refersec{chap:byteandbitsizes})
51 is the amount of storage needed to hold
54 \textit{For example, the C type int on a machine that uses 32\dash bit
55 integers is represented by a base type entry with a name
56 attribute whose value is “int”, an encoding attribute
57 whose value is \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed} and a byte size attribute whose
60 If the value of an object of the given type does not fully
61 occupy the storage described by a byte size attribute,
62 \hypertarget{chap:DWATdatabitoffsetbasetypebitlocation}
63 the base type entry may also have a
64 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and a
65 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, both of whose values are
66 integer constant values (
67 see Section \refersec{chap:staticanddynamicvaluesofattributes}).
69 attribute describes the actual size in bits used to represent
70 values of the given type. The data bit offset attribute is the
71 offset in bits from the beginning of the containing storage to
72 the beginning of the value. Bits that are part of the offset
73 are padding. The data bit offset uses the bit numbering and
74 direction conventions that are appropriate to the current
76 target system to locate the beginning of the storage and
77 value. If this attribute is omitted a default data bit offset
80 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
81 is also used for bit field members
82 (see Section \refersec{chap:datamemberentries}).
84 \hypertarget{chap:DWATbitoffsetbasetypebitlocation}
85 replaces the attribute \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} when used for base
86 types as defined in DWARF V3 and earlier. The earlier attribute
87 is defined in a manner suitable for bit field members on
88 big\dash endian architectures but which is wasteful for use on
89 little\dash endian architectures.}
91 \textit{The attribute \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} is
92 deprecated in DWARF Version
93 4 for use in base types, but implementations may continue to
94 support its use for compatibility.}
96 \textit{The DWARF Version 3 definition of these attributes is as follows.}
98 \begin{myindentpara}{1cm}
99 \textit{A base type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, whose value
100 (see Section 2.19) is the size in bytes of the storage unit
101 used to represent an object of the given type.}
103 \textit{If the value of an object of the given type does not fully
104 occupy the storage unit described by the byte size attribute,
105 the base type entry may have a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute and a
106 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute, both of whose values (see Section
107 2.19) are integers. The bit size attribute describes the actual
108 size in bits used to represent a value of the given type.
109 The bit offset attribute describes the offset in bits of the
110 high order bit of a value of the given type from the high
111 order bit of the storage unit used to contain that value.}
114 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
115 defines the following combinations of attributes:}
118 \item \textit{DW\-\_AT\-\_byte\-\_size}
119 \item \textit{DW\-\_AT\-\_bit\-\_size}
120 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
121 and optionally \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}}
123 DWARF V3 defines the following combinations:
124 % FIXME: the figure below interferes with the following
125 % bullet list, which looks horrible as a result.
127 \item \textit{DW\-\_AT\-\_byte\-\_size}
128 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}}
131 \begin{figure}[!here]
133 \begin{tabular}{lp{9cm}}
134 Name&Meaning\\ \hline
135 \livetarg{chap:DWATEaddress}{DW\-\_ATE\-\_address} & linear machine address (for
136 segmented addresses see
137 Section \refersec{chap:segmentedaddresses}) \\
138 \livetarg{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}& true or false \\
140 \livetarg{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}& complex binary floating\dash point number \\
141 \livetarg{chap:DWATEfloat}{DW\-\_ATE\-\_float} & binary floating\dash point number \\
142 \livetarg{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}& imaginary binary floating\dash point number \\
143 \livetarg{chap:DWATEsigned}{DW\-\_ATE\-\_signed}& signed binary integer \\
144 \livetarg{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}& signed character \\
145 \livetarg{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned} & unsigned binary integer \\
146 \livetarg{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char} & unsigned character \\
147 \livetarg{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} & packed decimal \\
148 \livetarg{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}& numeric string \\
149 \livetarg{chap:DWATEedited}{DW\-\_ATE\-\_edited} & edited string \\
150 \livetarg{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} & signed fixed\dash point scaled integer \\
151 \livetarg{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}& unsigned fixed\dash point scaled integer \\
152 \livetarg{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & decimal floating\dash point number \\
153 \livetarg{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} & Unicode character \\
155 \caption{Encoding attribute values}
156 \label{fig:encodingattributevalues}
159 \textit{The \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} encoding is intended for
160 floating\dash point representations that have a power\dash of\dash ten
161 exponent, such as that specified in IEEE 754R.}
163 \textit{The \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} encoding is intended for Unicode string
164 encodings (see the Universal Character Set standard,
165 ISO/IEC 10646\dash 1:1993). For example, the C++ type char16\_t is
166 represented by a base type entry with a name attribute whose
167 value is “char16\_t”, an encoding attribute whose value
168 is \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} and a byte size attribute whose value is 2.}
171 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
173 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}
175 represent packed and unpacked decimal string numeric data
176 types, respectively, either of which may be either signed
178 \hypertarget{chap:DWATdecimalsigndecimalsignrepresentation}
180 \hypertarget{chap:DWATdigitcountdigitcountforpackeddecimalornumericstringtype}
181 base types are used in combination with
182 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign},
183 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
184 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
187 A \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute is an integer constant that
188 conveys the representation of the sign of the decimal type
189 (see Figure \refersec{fig:decimalsignattributevalues}).
190 Its integer constant value is interpreted to
191 mean that the type has a leading overpunch, trailing overpunch,
192 leading separate or trailing separate sign representation or,
193 alternatively, no sign at all.
196 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
197 attribute is an integer constant
198 value that represents the number of digits in an instance of
201 \hypertarget{chap:DWATdecimalscaledecimalscalefactor}
202 The \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute is an integer constant value
203 that represents the exponent of the base ten scale factor to
204 be applied to an instance of the type. A scale of zero puts the
205 decimal point immediately to the right of the least significant
206 digit. Positive scale moves the decimal point to the right
207 and implies that additional zero digits on the right are not
208 stored in an instance of the type. Negative scale moves the
209 decimal point to the left; if the absolute value of the scale
210 is larger than the digit count, this implies additional zero
211 digits on the left are not stored in an instance of the type.
213 The \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}
215 \hypertarget{chap:DWATpicturestringpicturestringfornumericstringtype}
216 type is used to represent an edited
217 numeric or alphanumeric data type. It is used in combination
218 with an \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string} attribute whose value is a
219 null\dash terminated string containing the target\dash dependent picture
220 string associated with the type.
222 If the edited base type entry describes an edited numeric
223 data type, the edited type entry has a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and a
224 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute. These attributes have the same
225 interpretation as described for the \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and
226 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types. If the edited type entry
227 describes an edited alphanumeric data type, the edited type
228 entry does not have these attributes.
231 \textit{The presence or absence of the \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count} and
232 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attributes allows a debugger to easily
233 distinguish edited numeric from edited alphanumeric, although
234 in principle the digit count and scale are derivable by
235 interpreting the picture string.}
237 The \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed} and \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed} entries
238 describe signed and unsigned fixed\dash point binary data types,
241 The fixed binary type entries have a \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
242 attribute with the same interpretation as described for the
243 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal} and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
245 For a data type with a decimal scale factor, the fixed binary
246 type entry has a \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale} attribute with the same
247 interpretation as described for the \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}
248 and \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string} base types.
250 \hypertarget{chap:DWATbinaryscalebinaryscalefactorforfixedpointtype}
251 For a data type with a binary scale factor, the fixed
252 binary type entry has a \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute. The
253 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale} attribute is an integer constant value
254 that represents the exponent of the base two scale factor to
255 be applied to an instance of the type. Zero scale puts the
256 binary point immediately to the right of the least significant
257 bit. Positive scale moves the binary point to the right and
258 implies that additional zero bits on the right are not stored
259 in an instance of the type. Negative scale moves the binary
260 point to the left; if the absolute value of the scale is
261 larger than the number of bits, this implies additional zero
262 bits on the left are not stored in an instance of the type.
265 \hypertarget{chap:DWATsmallscalefactorforfixedpointtype}
266 a data type with a non\dash decimal and non\dash binary scale factor,
267 the fixed binary type entry has a
268 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute which
270 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The scale factor value
271 is interpreted in accordance with the value defined by the
272 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} entry. The value represented is the product
273 of the integer value in memory and the associated constant
276 \textit{The \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} attribute
277 is defined with the \addtoindex{Ada} small
282 \begin{tabular}{lp{9cm}}
283 Name&Meaning\\ \hline
284 \livetarg{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & unsigned \\
285 \livetarg{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & Sign is encoded in the most significant digit in a target\dash dependent manner \\
286 \livetarg{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & Sign is encoded in the least significant digit in a target\dash dependent manner \\
287 \livetarg{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate}
288 & Decimal type: Sign is a ``+'' or ``-'' character
289 to the left of the most significant digit. \\
290 \livetarg{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate}
291 & Decimal type: Sign is a ``+'' or ``-'' character
292 to the right of the least significant digit. \\
293 &Packed decimal type: Least significant nibble contains
294 a target\dash dependent value
295 indicating positive or negative. \\
297 \caption{Decimal sign attribute values}
298 \label{fig:decimalsignattributevalues}
301 \section{Unspecified Type Entries}
302 \label{chap:unspecifiedtypeentries}
303 Some languages have constructs in which a type
304 may be left unspecified or the absence of a type
305 \addtoindex{unspecified type entry}
306 may be explicitly indicated.
308 An unspecified (implicit, unknown, ambiguous or nonexistent)
309 type is represented by a debugging information entry with
310 the tag \livetarg{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}.
311 If a name has been given
312 to the type, then the corresponding unspecified type entry
313 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
314 string containing the name as it appears in the source program.
316 The interpretation of this debugging information entry is
317 intentionally left flexible to allow it to be interpreted
318 appropriately in different languages. For example, in C and C++
319 the language implementation can provide an unspecified type
320 entry with the name “void” which can be referenced by the
321 type attribute of pointer types and typedef declarations for
323 % FIXME: the following reference was wrong in DW4 so DavidA guessed
325 Sections \refersec{chap:unspecifiedtypeentries} and
326 %The following reference was valid, so the following is probably correct.
327 Section \refersec{chap:typedefentries},
328 respectively). As another
329 example, in \addtoindex{Ada} such an unspecified type entry can be referred
330 to by the type attribute of an access type where the denoted
331 type is incomplete (the name is declared as a type but the
332 definition is deferred to a separate compilation unit). Type
335 A base or user\dash defined type may be modified in different ways
336 in different languages. A type modifier is represented in
337 DWARF by a debugging information entry with one of the tags
339 Figure \refersec{fig:typemodifiertags}.
342 If a name has been given to the modified type in the source
343 program, then the corresponding modified type entry has
344 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null-terminated
345 string containing the modified type name as it appears in
348 Each of the type modifier entries has a
349 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute,
350 whose value is a reference to a debugging information entry
351 describing a base type, a user-defined type or another type
354 A modified type entry describing a pointer or reference
355 type (using \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}, \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type} or
356 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type})
357 % Another instance of no-good-place-to-put-index entry.
359 \addtoindexx{address class!attribute}
361 \hypertarget{chap:DWATadressclasspointerorreferencetypes}
363 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
364 attribute to describe how objects having the given pointer
365 or reference type ought to be dereferenced.
367 A modified type entry describing a shared qualified type
368 (using \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}) may have a \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute
369 whose value is a constant expressing the blocksize of the
370 type. If no count attribute is present, then the “infinite”
371 blocksize is assumed.
373 When multiple type modifiers are chained together to modify
374 a base or user-defined type, the tree ordering reflects the
375 semantics of the applicable lanuage rather than the textual
376 order in the source presentation.
380 \begin{tabular}{lp{9cm}}
381 Name&Meaning\\ \hline
382 \livetarg{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} & C or C++ const qualified type \addtoindexx{C} \addtoindexx{C++} \\
383 \livetarg{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}& Pascal or Ada packed type \addtoindexx{Ada} \addtoindexx{Pascal} \\
384 \livetarg{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} & Pointer to an object of the type being modified \\
385 \livetarg{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}& C++ (lvalue) reference to an object of the type
387 \livetarg{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&C restrict qualified type \\
388 \livetarg{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} & C++ rvalue reference to an object of the type
390 \livetarg{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&UPC shared qualified type \\
391 \livetarg{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&C or C++ volatile qualified type \\
393 \caption{Type modifier tags}
394 \label{fig:typemodifiertags}
397 % The following prevents splitting the examples up.
398 % FIXME perhaps there is a better way. We could box the verbatim,
399 % see memman.pdf on verbatims.
401 \textit{As examples of how tye modifiers are ordered, take the following C
405 const unsigned char * volatile p;
406 which represents a volatile pointer to a constant
407 character. This is encoded in DWARF as:
408 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
409 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
410 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
411 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
412 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
414 volatile unsigned char * const restrict p;
415 on the other hand, represents a restricted constant
416 pointer to a volatile character. This is encoded as:
417 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}(p) -->
418 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type} -->
419 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type} -->
420 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type} -->
421 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type} -->
422 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}(unsigned char)
426 \section{Typedef Entries}
427 \label{chap:typedefentries}
428 A named type that is defined in terms of another type
429 definition is represented by a debugging information entry with
430 the tag \livetarg{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}.
431 The typedef entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
432 attribute whose value is a null-terminated string containing
433 the name of the typedef as it appears in the source program.
435 The typedef entry may also contain a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose
436 value is a reference to the type named by the typedef. If
437 the debugging information entry for a typedef represents
438 a declaration of the type that is not also a definition,
439 it does not contain a type attribute.
441 \textit{Depending on the language, a named type that is defined in
442 terms of another type may be called a type alias, a subtype,
443 a constrained type and other terms. A type name declared with
444 no defining details may be termed an incomplete, forward
445 or hidden type. While the DWARF \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef} entry was
446 originally inspired by the like named construct in C and C++,
447 it is broadly suitable for similar constructs (by whatever
448 source syntax) in other languages.}
450 \section{Array Type Entries}
451 \label{chap:arraytypeentries}
453 Many languages share the concept of an ``array,'' which is
454 a table of components of identical type.
456 An array type is represented by a debugging information entry
457 with the tag \livetarg{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type}.
458 If a name has been given to
459 the array type in the source program, then the corresponding
460 array type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a
461 null-terminated string containing the array type name as it
462 appears in the source program.
465 \hypertarget{chap:DWATorderingarrayrowcolumnordering}
466 array type entry describing a multidimensional array may
467 have a \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute whose integer constant value is
468 interpreted to mean either row-major or column-major ordering
469 of array elements. The set of values and their meanings
470 for the ordering attribute are listed in
471 Figure \refersec{fig:arrayordering}.
473 ordering attribute is present, the default ordering for the
474 source language (which is indicated by the \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
475 attribute of the enclosing compilation unit entry) is assumed.
478 \autorows[0pt]{c}{1}{l}{
479 \livetarg{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major},
480 \livetarg{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}
482 \caption{Array ordering}\label{fig:arrayordering}
485 The ordering attribute may optionally appear on one-dimensional
486 arrays; it will be ignored.
488 An array type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
489 the type of each element of the array.
491 If the amount of storage allocated to hold each element of an
492 object of the given array type is different from the amount
493 of storage that is normally allocated to hold an individual
494 \hypertarget{chap:DWATbitstridearrayelementstrideofarraytype}
496 \hypertarget{chap:DWATbytestridearrayelementstrideofarraytype}
497 indicated element type, then the array type
498 entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or a \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
499 attribute, whose value
500 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
502 element of the array.
504 The array type entry may have either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a
505 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
506 (see Section \refersec{chap:byteandbitsizes}),
508 amount of storage needed to hold an instance of the array type.
510 \textit{If the size of the array can be determined statically at
511 compile time, this value can usually be computed by multiplying
512 the number of array elements by the size of each element.}
515 Each array dimension is described by a debugging information
516 entry with either the tag \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} or the tag
517 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}. These entries are children of the
518 array type entry and are ordered to reflect the appearance of
519 the dimensions in the source program (i.e., leftmost dimension
520 first, next to leftmost second, and so on).
522 In languages, such as C, in which there is no concept of
523 a “multidimensional array”, an array of arrays may
524 be represented by a debugging information entry for a
525 multidimensional array.
527 Other attributes especially applicable to arrays are
528 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated},
529 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} and
530 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location},
531 which are described in
532 Section \refersec{chap:dynamictypeproperties}.
533 For relevant examples,
535 Appendix \refersec{app:fortran90example}.
537 \section{ Structure, Union, Class and Interface Type Entries}
538 \label{chap:structureunionclassandinterfacetypeentries}
540 \textit{The languages C, C++, and Pascal, among others, allow the
541 programmer to define types that are collections of related
542 components. In C and C++, these collections are called
543 “structures.” In Pascal, they are called “records.”
544 The components may be of different types. The components are
545 called “members” in C and C++, and “fields” in Pascal.}
547 \textit{The components of these collections each exist in their
548 own space in computer memory. The components of a C or C++
549 “union” all coexist in the same memory.}
551 \textit{Pascal and other languages have a “discriminated union,”
552 also called a “variant record.” Here, selection of a
553 number of alternative substructures (“variants”) is based
554 on the value of a component that is not part of any of those
555 substructures (the “discriminant”).}
557 \textit{C++ and Java have the notion of "class”, which is in some
558 ways similar to a structure. A class may have “member
559 functions” which are subroutines that are within the scope
560 of a class or structure.}
562 \textit{The C++ notion of structure is more general than in C, being
563 equivalent to a class with minor differences. Accordingly,
564 in the following discussion statements about C++ classes may
565 be understood to apply to C++ structures as well.}
567 \subsection{Structure, Union and Class Type Entries}
568 \label{chap:structureunionandclasstypeentries}
571 Structure, union, and class types are represented by debugging
572 information entries with
573 the tags \livetarg{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type},
574 \livetarg{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type},
575 and \livetarg{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
576 respectively. If a name has been given to the structure,
577 union, or class in the source program, then the corresponding
578 structure type, union type, or class type entry has a
579 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
580 containing the type name as it appears in the source program.
582 The members of a structure, union, or class are represented
583 by debugging information entries that are owned by the
584 corresponding structure type, union type, or class type entry
585 and appear in the same order as the corresponding declarations
586 in the source program.
588 A structure type, union type or class type entry may have
589 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
590 \hypertarget{chap:DWATbitsizedatamemberbitsize}
591 (see Section \refersec{chap:byteandbitsizes}),
592 whose value is the amount of storage needed
593 to hold an instance of the structure, union or class type,
594 including any padding. An incomplete structure, union or
595 class type is represented by a structure, union or class
596 entry that does not have a byte size attribute and that has
597 a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
599 If the complete declaration of a type has been placed in
600 \hypertarget{chap:DWATsignaturetypesignature}
602 (see Section \refersec{chap:separatetypeunitentries}),
604 declaration of that type in the compilation unit may provide
605 the unique 64\dash bit signature of the type using a \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature}
608 If a structure, union or class entry represents the definition
609 of a structure, class or union member corresponding to a prior
610 incomplete structure, class or union, the entry may have a
611 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute whose value is a reference to
612 the debugging information entry representing that incomplete
615 Structure, union and class entries containing the
616 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute do not need to duplicate
617 information provided by the declaration entry referenced by the
618 specification attribute. In particular, such entries do not
619 need to contain an attribute for the name of the structure,
620 class or union they represent if such information is already
621 provided in the declaration.
623 \textit{For C and C++, data member declarations occurring within
624 the declaration of a structure, union or class type are
625 considered to be “definitions” of those members, with
626 the exception of “static” data members, whose definitions
627 appear outside of the declaration of the enclosing structure,
628 union or class type. Function member declarations appearing
629 within a structure, union or class type declaration are
630 definitions only if the body of the function also appears
631 within the type declaration.}
633 If the definition for a given member of the structure, union
634 or class does not appear within the body of the declaration,
635 that member also has a debugging information entry describing
636 its definition. That latter entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
637 attribute referencing the debugging information entry
638 owned by the body of the structure, union or class entry and
639 representing a non\dash defining declaration of the data, function
640 or type member. The referenced entry will not have information
641 about the location of that member (low and high pc attributes
642 for function members, location descriptions for data members)
643 and will have a \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute.
645 \textit{Consider a nested class whose
646 definition occurs outside of the containing class definition, as in:}
655 \textit{The two different structs can be described in
656 different compilation units to
657 facilitate DWARF space compression
658 (see Appendix \refersec{app:usingcompilationunits}).}
660 \subsection{Interface Type Entries}
661 \label{chap:interfacetypeentries}
663 \textit{The Java language defines "interface" types. An interface
664 in Java is similar to a C++ or Java class with only abstract
665 methods and constant data members.}
667 Interface types are represented by debugging information
669 tag \livetarg{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}.
671 An interface type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
672 value is a null-terminated string containing the type name
673 as it appears in the source program.
675 The members of an interface are represented by debugging
676 information entries that are owned by the interface type
677 entry and that appear in the same order as the corresponding
678 declarations in the source program.
680 \subsection{Derived or Extended Structs, Classes and Interfaces}
681 \label{chap:derivedorextendedstructsclasesandinterfaces}
683 \textit{In C++, a class (or struct) may be ``derived from'' or be a
684 ``subclass of'' another class. In Java, an interface may ``extend''
685 one or more other interfaces, and a class may "extend" another
686 class and/or "implement" one or more interfaces. All of these
687 relationships may be described using the following. Note that
688 in Java, the distinction between extends and implements is
689 implied by the entities at the two ends of the relationship.}
691 A class type or interface type entry that describes a
692 derived, extended or implementing class or interface owns
693 debugging information entries describing each of the classes
694 or interfaces it is derived from, extending or implementing,
695 respectively, ordered as they were in the source program. Each
697 tag \livetarg{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}.
699 An inheritance entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is
700 a reference to the debugging information entry describing the
701 class or interface from which the parent class or structure
702 of the inheritance entry is derived, extended or implementing.
704 An inheritance entry for a class that derives from or extends
705 \hypertarget{chap:DWATdatamemberlocationinheritedmemberlocation}
706 another class or struct also has a
707 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
708 attribute, whose value describes the location of the beginning
709 of the inherited type relative to the beginning address of the
710 derived class. If that value is a constant, it is the offset
711 in bytes from the beginning of the class to the beginning of
712 the inherited type. Otherwise, the value must be a location
713 description. In this latter case, the beginning address of
714 the derived class is pushed on the expression stack before
715 the location description is evaluated and the result of the
716 evaluation is the location of the inherited type.
718 \textit{The interpretation of the value of this attribute for
719 inherited types is the same as the interpretation for data
721 (see Section \refersec{chap:datamemberentries}). }
724 \hypertarget{chap:DWATaccessibilitycppinheritedmembers}
726 \addtoindexx{accessibility attribute}
728 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
729 attribute. If no accessibility attribute
730 is present, private access is assumed for an entry of a class
731 and public access is assumed for an entry of an interface,
735 \hypertarget{chap:DWATvirtualityvirtualityofbaseclass}
736 the class referenced by the inheritance entry serves
737 as a C++ virtual base class, the inheritance entry has a
738 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
740 \textit{For a C++ virtual base, the data member location attribute
741 will usually consist of a non-trivial location description.}
743 \subsection{Access Declarations}
744 \label{chap:accessdeclarations}
746 \textit{In C++, a derived class may contain access declarations that
747 \addtoindex{access declaration entry}
748 change the accessibility of individual class members from the
749 overall accessibility specified by the inheritance declaration.
750 A single access declaration may refer to a set of overloaded
753 If a derived class or structure contains access declarations,
754 each such declaration may be represented by a debugging
755 information entry with the tag
756 \livetarg{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}.
758 such entry is a child of the class or structure type entry.
760 An access declaration entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
761 value is a null-terminated string representing the name used
762 in the declaration in the source program, including any class
763 or structure qualifiers.
765 An access declaration entry
766 \hypertarget{chap:DWATaccessibilitycppbaseclasses}
769 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
770 attribute describing the declared accessibility of the named
777 Each ``friend'' declared by a structure, union or class
778 \hypertarget{chap:DWATfriendfriendrelationship}
779 type may be represented by a debugging information entry
780 that is a child of the structure, union or class type entry;
781 the friend entry has the
782 tag \livetarg{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}.
784 A friend entry has a \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute, whose value is
785 a reference to the debugging information entry describing
786 the declaration of the friend.
789 \subsection{Data Member Entries}
790 \label{chap:datamemberentries}
792 A data member (as opposed to a member function) is
793 represented by a debugging information entry with the
794 tag \livetarg{chap:DWTAGmember}{DW\-\_TAG\-\_member}.
795 The member entry for a named member has
796 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null-terminated
797 string containing the member name as it appears in the source
798 program. If the member entry describes an anonymous union, the
799 name attribute is omitted or consists of a single zero byte.
801 The data member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote
802 the type of that member.
804 A data member entry may
805 \addtoindexx{accessibility attribute}
807 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
808 attribute. If no accessibility attribute is present, private
809 access is assumed for an entry of a class and public access
810 is assumed for an entry of a structure, union, or interface.
813 \hypertarget{chap:DWATmutablemutablepropertyofmemberdata}
814 entry may have a \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable} attribute,
815 which is a \livelink{chap:flag}{flag}.
816 This attribute indicates whether the data
817 member was declared with the mutable storage class specifier.
819 The beginning of a data member is described relative to
820 the beginning of the object in which it is immediately
821 contained. In general, the beginning is characterized by
822 both an address and a bit offset within the byte at that
823 address. When the storage for an entity includes all of
824 the bits in the beginning byte, the beginning bit offset is
827 Bit offsets in DWARF use the bit numbering and direction
828 conventions that are appropriate to the current language on
831 The member entry corresponding to a data member that is
832 \hypertarget{chap:DWATdatabitoffsetdatamemberbitlocation}
834 \hypertarget{chap:DWATdatamemberlocationdatamemberlocation}
835 in a structure, union or class may have either a
836 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute or a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
837 attribute. If the beginning of the data member is the same as
838 the beginning of the containing entity then neither attribute
841 For a \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute there are two cases:
843 \begin{enumerate}[1.]
845 \item If the value is an integer constant, it is the offset
846 in bytes from the beginning of the containing entity. If
847 the beginning of the containing entity has a non-zero bit
848 offset then the beginning of the member entry has that same
851 \item Otherwise, the value must be a location description. In
852 this case, the beginning of the containing entity must be byte
853 aligned. The beginning address is pushed on the DWARF stack
854 before the location description is evaluated; the result of
855 the evaluation is the base address of the member entry.
857 \textit{The push on the DWARF expression stack of the base address of
858 the containing construct is equivalent to execution of the
859 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} operation
860 (see Section \refersec{chap:stackoperations});
861 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address} therefore is not needed at the
862 beginning of a location description for a data member. The
863 result of the evaluation is a location--either an address or
864 the name of a register, not an offset to the member.}
866 \textit{A \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} attribute that has the form of a
867 location description is not valid for a data member contained
868 in an entity that is not byte aligned because DWARF operations
869 do not allow for manipulating or computing bit offsets.}
873 For a \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} attribute, the value is an integer
875 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
876 that specifies the number of bits
877 from the beginning of the containing entity to the beginning
878 of the data member. This value must be greater than or equal
879 to zero, but is not limited to less than the number of bits
882 If the size of a data member is not the same as the size
883 of the type given for the data member, the data member has
884 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or a \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose
885 integer constant value
886 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
888 of storage needed to hold the value of the data member.
890 \textit{C and C++ bit fields typically require the use of the
891 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} and \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attributes.}
893 \textit{This Standard uses the following bit numbering and direction
894 conventions in examples. These conventions are for illustrative
895 purposes and other conventions may apply on particular
900 \item \textit{For big\dash endian architectures, bit offsets are
901 counted from high-order to low\dash order bits within a byte (or
902 larger storage unit); in this case, the bit offset identifies
903 the high\dash order bit of the object.}
905 \item \textit{For little\dash endian architectures, bit offsets are
906 counted from low\dash order to high\dash order bits within a byte (or
907 larger storage unit); in this case, the bit offset identifies
908 the low\dash order bit of the object.}
912 \textit{In either case, the bit so identified is defined as the beginning of the object.}
914 \textit{For example, take one possible representation of the following C structure definition in both big\dash and little\dash endian byte orders:}
925 \textit{The following diagrams show the structure layout
926 and data bit offsets for example big\dash\ and little\dash endian
927 architectures, respectively. Both diagrams show a structure
928 that begins at address A and whose size is four bytes. Also,
929 high order bits are to the left and low order bits are to
932 \textit{Big\dash Endian Data Bit Offsets:}
940 Addresses increase ->
941 | A | A + 1 | A + 2 | A + 3 |
943 Data bit offsets increase ->
944 +---------------+---------------+---------------+---------------+
945 |0 4|5 10|11 15|16 23|24 31|
946 | j | k | m | n | <pad> |
948 +---------------------------------------------------------------+
951 \textit{Little\dash Endian Data Bit Offsets:}
957 <- Addresses increase
958 | A | A + 1 | A + 2 | A + 3 |
960 <- Data bit offsets increase
962 +---------------+---------------+---------------+---------------+
963 |31 24|23 16|15 11|10 5|4 0|
964 | <pad> | n | m | k | j |
966 +---------------------------------------------------------------+
970 \textit{Note that data member bit offsets in this example are the
971 same for both big\dash\ and little\dash endian architectures even
972 though the fields are allocated in different directions
973 (high\dash order to low-order versus low\dash order to high\dash order);
974 the bit naming conventions for memory and/or registers of
975 the target architecture may or may not make this seem natural.}
977 \textit{For a more extensive example showing nested and packed records
979 Appendix \refersec{app:pascalexample}.}
981 \textit{Attribute \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} is new in DWARF Version 4 and
982 is also used for base types
984 \refersec{chap:basetypeentries}).
986 \livetarg{chap:DWATbitoffsetdatamemberbitlocation}
987 attributes \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} and \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} when used to
988 identify the beginning of bit field data members as defined
989 in DWARF V3 and earlier. The earlier attributes are defined
990 in a manner suitable for bit field members on big-endian
991 architectures but which is either awkward or incomplete for
992 use on little-endian architectures.
993 (\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} also
994 has other uses that are not affected by this change.)}
996 \textit{The \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
997 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and
998 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
999 attribute combination is deprecated for data members in DWARF
1000 Version 4, but implementations may continue to support this
1001 use for compatibility.}
1003 \textit{The DWARF Version 3 definitions of these attributes are
1006 \begin{myindentpara}{1cm}
1007 \textit{If the data member entry describes a bit field, then that
1008 entry has the following attributes:}
1011 \item \textit{A \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute whose value (see Section
1012 2.19) is the number of bytes that contain an instance of the
1013 bit field and any padding bits.}
1015 \textit{The byte size attribute may be omitted if the size of the
1016 object containing the bit field can be inferred from the type
1017 attribute of the data member containing the bit field.}
1019 \item \textit{A \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute whose value (see Section
1020 2.19) is the number of bits to the left of the leftmost
1021 (most significant) bit of the bit field value.}
1023 \item \textit{A \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute whose value (see Section
1024 2.19) is the number of bits occupied by the bit field value.}
1028 \textit{The location description for a bit field calculates the address
1029 of an anonymous object containing the bit field. The address
1030 is relative to the structure, union, or class that most closely
1031 encloses the bit field declaration. The number of bytes in this
1032 anonymous object is the value of the byte size attribute of
1033 the bit field. The offset (in bits) from the most significant
1034 bit of the anonymous object to the most significant bit of
1035 the bit field is the value of the bit offset attribute.}
1039 \textit{Diagrams similar to the above that show the use of the
1040 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset} attribute
1041 combination may be found in the DWARF Version 3 Standard.}
1043 \textit{In comparing DWARF Versions 3 and 4, note that DWARF V4
1044 defines the following combinations of attributes:}
1047 \item \textit{either \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} or
1048 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} (to specify the beginning of the
1051 % FIXME: the indentation of the following line is suspect.
1052 \textit{optionally together with}
1054 \item \textit{either \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} (to
1055 specify the size of the data member)}
1059 \textit{DWARF V3 defines the following combinations}
1062 \item \textit{\livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location} (to specify the beginning
1063 of the data member, except this specification is only partial
1064 in the case of a bit field) }
1066 % FIXME: the indentation of the following line is suspect.
1067 \textit{optionally together with}
1069 \item \textit{\livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}, \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} and \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
1070 (to further specify the beginning of a bit field data member
1071 as well as specify the size of the data member) }
1074 \subsection{Member Function Entries}
1075 \label{chap:memberfunctionentries}
1077 A member function is represented by a debugging information
1078 entry with the tag \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}. The member function entry
1079 may contain the same attributes and follows the same rules
1080 as non\dash member global subroutine entries
1081 (see Section \refersec{chap:subroutineandentrypointentries}).
1084 \addtoindexx{accessibility attribute}
1085 member function entry may have a
1086 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1087 attribute. If no accessibility attribute is present, private
1088 access is assumed for an entry of a class and public access
1089 is assumed for an entry of a structure, union or interface.
1092 \hypertarget{chap:DWATvirtualityvirtualityoffunction}
1093 the member function entry describes a virtual function,
1094 then that entry has a
1095 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute.
1098 \hypertarget{chap:DWATexplicitexplicitpropertyofmemberfunction}
1099 the member function entry describes an explicit member
1100 function, then that entry has a
1101 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit} attribute.
1104 \hypertarget{chap:DWATvtableelemlocationvirtualfunctiontablevtableslot}
1105 entry for a virtual function also has a
1106 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location} attribute whose value contains
1107 a location description yielding the address of the slot
1108 for the function within the virtual function table for the
1109 enclosing class. The address of an object of the enclosing
1110 type is pushed onto the expression stack before the location
1111 description is evaluated.
1114 \hypertarget{chap:DWATobjectpointerobjectthisselfpointerofmemberfunction}
1115 the member function entry describes a non\dash static member
1116 function, then that entry has a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer} attribute
1117 whose value is a reference to the formal parameter entry
1118 that corresponds to the object for which the function is
1119 called. The name attribute of that formal parameter is defined
1120 by the current language (for example, this for C++ or self
1121 for Objective C and some other languages). That parameter
1122 also has a \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial} attribute whose value is true.
1124 Conversely, if the member function entry describes a static
1125 member function, the entry does not have a \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}
1128 If the member function entry describes a non\dash static member
1129 function that has a const\dash volatile qualification, then
1130 the entry describes a non\dash static member function whose
1131 object formal parameter has a type that has an equivalent
1132 const\dash volatile qualification.
1134 If a subroutine entry represents the defining declaration
1135 of a member function and that definition appears outside of
1136 the body of the enclosing class declaration, the subroutine
1137 entry has a \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification} attribute, whose value is
1138 a reference to the debugging information entry representing
1139 the declaration of this function member. The referenced entry
1140 will be a child of some class (or structure) type entry.
1142 Subroutine entries containing the \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
1143 attribute do not need to duplicate information provided
1144 by the declaration entry referenced by the specification
1145 attribute. In particular, such entries do not need to contain
1146 attributes for the name or return type of the function member
1147 whose definition they represent.
1149 \subsection{Class Template Instantiations}
1150 \label{chap:classtemplateinstantiations}
1152 \textit{In C++ a class template is a generic definition of a class
1153 type that may be instantiated when an instance of the class
1154 is declared or defined. The generic description of the
1155 class may include both parameterized types and parameterized
1156 constant values. DWARF does not represent the generic template
1157 definition, but does represent each instantiation.}
1159 A class template instantiation is represented by a
1160 debugging information entry with the tag \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type},
1161 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type} or \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}. With five
1162 exceptions, such an entry will contain the same attributes
1163 and have the same types of child entries as would an entry
1164 for a class type defined explicitly using the instantiation
1165 types and values. The exceptions are:
1167 \begin{enumerate}[1.]
1168 \item Each formal parameterized type declaration appearing in the
1169 template definition is represented by a debugging information
1170 entry with the tag \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each
1171 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1172 a null\dash terminated string containing the name of the formal
1173 type parameter as it appears in the source program. The
1174 template type parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1175 describing the actual type by which the formal is replaced
1176 for this instantiation.
1178 \item Each formal parameterized value declaration appearing in the
1179 template definition is represented by a debugging information
1181 tag \livetarg{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}.
1183 such entry may have a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is
1184 a null\dash terminated string containing the name of the formal
1185 value parameter as it appears in the source program.
1187 \hypertarget{chap:DWATconstvaluetemplatevalueparameter}
1188 template value parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1189 describing the type of the parameterized value. Finally,
1190 the template value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
1191 attribute, whose value is the actual constant value of the
1192 value parameter for this instantiation as represented on the
1193 target architecture.
1195 \item The class type entry and each of its child entries references
1196 a template type parameter entry in any circumstance where the
1197 source template definition references a formal parameterized
1198 type. Similarly, the class type entry and each of its child
1199 entries references a template value parameter entry in any
1200 circumstance where the source template definition references
1201 a formal parameterized value.
1203 \item If the compiler has generated a special compilation unit to
1204 hold the template instantiation and that special compilation
1205 unit has a different name from the compilation unit containing
1206 the template definition, the name attribute for the debugging
1207 information entry representing the special compilation unit
1208 should be empty or omitted.
1210 \item If the class type entry representing the template
1211 instantiation or any of its child entries contains declaration
1212 coordinate attributes, those attributes should refer to
1213 the source for the template definition, not to any source
1214 generated artificially by the compiler.
1218 \subsection{Variant Entries}
1219 \label{chap:variantentries}
1221 A variant part of a structure is represented by a debugging
1222 information entry with the
1223 tag \livetarg{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part} and is
1224 owned by the corresponding structure type entry.
1226 If the variant part has a discriminant, the discriminant is
1227 \hypertarget{chap:DWATdiscrdiscriminantofvariantpart}
1228 represented by a separate debugging information entry which
1229 is a child of the variant part entry. This entry has the form
1230 of a structure data member entry. The variant part entry will
1232 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr} attribute whose value is a reference to
1233 the member entry for the discriminant.
1235 If the variant part does not have a discriminant (tag field),
1236 the variant part entry has a
1237 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to represent
1240 Each variant of a particular variant part is represented by
1241 \hypertarget{chap:DWATdiscrvaluediscriminantvalue}
1242 a debugging information entry with the
1243 tag \livetarg{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}
1244 and is a child of the variant part entry. The value that
1245 selects a given variant may be represented in one of three
1246 ways. The variant entry may have a
1247 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute
1248 whose value represents a single case label. The value of this
1249 attribute is encoded as an LEB128 number. The number is signed
1250 if the tag type for the variant part containing this variant
1251 is a signed type. The number is unsigned if the tag type is
1255 \hypertarget{chap:DWATdiscrlistlistofdiscriminantvalues}
1256 the variant entry may contain a
1257 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
1258 attribute, whose value represents a list of discriminant
1259 values. This list is represented by any of the
1260 \livelink{chap:block}{block} forms and
1261 may contain a mixture of case labels and label ranges. Each
1262 item on the list is prefixed with a discriminant value
1263 descriptor that determines whether the list item represents
1264 a single label or a label range. A single case label is
1265 represented as an LEB128 number as defined above for the
1266 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value} attribute. A label range is represented by
1267 two LEB128 numbers, the low value of the range followed by the
1268 high value. Both values follow the rules for signedness just
1269 described. The discriminant value descriptor is an integer
1270 constant that may have one of the values given in
1271 Figure \refersec{fig:discriminantdescriptorvalues}.
1273 \begin{figure}[here]
1274 \autorows[0pt]{c}{1}{l}{
1275 \addtoindex{DW\-\_DSC\-\_label},
1276 \addtoindex{DW\-\_DSC\-\_range}
1278 \caption{Discriminant descriptor values}\label{fig:discriminantdescriptorvalues}
1281 If a variant entry has neither a \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
1282 attribute nor a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute, or if it has
1283 a \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute with 0 size, the variant is a
1286 The components selected by a particular variant are represented
1287 by debugging information entries owned by the corresponding
1288 variant entry and appear in the same order as the corresponding
1289 declarations in the source program.
1291 \section{Condition Entries}
1292 \label{chap:conditionentries}
1294 \textit{COBOL has the notion of a ``level\dash 88 condition'' that
1295 associates a data item, called the conditional variable, with
1296 a set of one or more constant values and/or value ranges.
1297 Semantically, the condition is ‛true’ if the conditional
1298 variable's value matches any of the described constants,
1299 and the condition is ‛false’ otherwise.}
1301 The \livetarg{chap:DWTAGcondition}{DW\-\_TAG\-\_condition} debugging information entry
1303 logical condition that tests whether a given data item’s
1304 value matches one of a set of constant values. If a name
1305 has been given to the condition, the condition entry has a
1306 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1307 giving the condition name as it appears in the source program.
1309 The condition entry's parent entry describes the conditional
1310 variable; normally this will be a \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable},
1311 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member} or \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter} entry. If the parent
1312 entry has an array type, the condition can test any individual
1313 element, but not the array as a whole. The condition entry
1314 implicitly specifies a “comparison type” that is the
1315 type of an array element if the parent has an array type;
1316 otherwise it is the type of the parent entry.
1318 The condition entry owns \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant} and/or
1319 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} entries that describe the constant
1320 values associated with the condition. If any child entry has
1321 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, that attribute should describe a type
1322 compatible with the comparison type (according to the source
1323 language); otherwise the child’s type is the same as the
1326 \textit{For conditional variables with alphanumeric types, COBOL
1327 permits a source program to provide ranges of alphanumeric
1328 constants in the condition. Normally a subrange type entry
1329 does not describe ranges of strings; however, this can be
1330 represented using bounds attributes that are references to
1331 constant entries describing strings. A subrange type entry may
1332 refer to constant entries that are siblings of the subrange
1336 \section{Enumeration Type Entries}
1337 \label{chap:enumerationtypeentries}
1339 \textit{An “enumeration type” is a scalar that can assume one of
1340 a fixed number of symbolic values.}
1342 An enumeration type is represented by a debugging information
1344 \livetarg{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}.
1346 If a name has been given to the enumeration type in the source
1347 program, then the corresponding enumeration type entry has
1348 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1349 string containing the enumeration type name as it appears
1350 in the source program. This entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
1351 attribute whose integer constant value is the number of bytes
1352 required to hold an instance of the enumeration.
1354 The enumeration type entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute
1355 which refers to the underlying data type used to implement
1358 If an enumeration type has type safe semantics such that
1360 \begin{enumerate}[1.]
1361 \item Enumerators are contained in the scope of the enumeration type, and/or
1363 \item Enumerators are not implicitly converted to another type
1366 then the enumeration type entry may have a \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
1367 attribute, which is a \livelink{chap:flag}{flag}.
1368 In a language that offers only
1369 one kind of enumeration declaration, this attribute is not
1372 \textit{In C or C++, the underlying type will be the appropriate
1373 integral type determined by the compiler from the properties of
1374 \hypertarget{chap:DWATenumclasstypesafeenumerationdefinition}
1375 the enumeration literal values. A C++ type declaration written
1376 using enum class declares a strongly typed enumeration and
1377 is represented using \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type} in combination
1378 with \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}.}
1380 Each enumeration literal is represented by a debugging
1381 information entry with the
1382 tag \livetarg{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}.
1384 such entry is a child of the enumeration type entry, and the
1385 enumerator entries appear in the same order as the declarations
1386 of the enumeration literals in the source program.
1388 Each enumerator entry has a
1389 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose
1390 value is a null\dash terminated string containing the name of the
1391 \hypertarget{chap:DWATconstvalueenumerationliteralvalue}
1392 enumeration literal as it appears in the source program.
1393 Each enumerator entry also has a
1394 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute,
1395 whose value is the actual numeric value of the enumerator as
1396 represented on the target system.
1399 If the enumeration type occurs as the description of a
1400 dimension of an array type, and the stride for that dimension
1401 \hypertarget{chap:DWATbytestrideenumerationstridedimensionofarraytype}
1402 is different than what would otherwise be determined, then
1403 \hypertarget{chap:DWATbitstrideenumerationstridedimensionofarraytype}
1404 the enumeration type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1405 or \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1406 between successive elements along the dimension as described
1408 Section \refersec{chap:visibilityofdeclarations}.
1409 The value of the \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute
1410 is interpreted as bits and the value of the \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
1411 attribute is interpreted as bytes.
1414 \section{Subroutine Type Entries}
1415 \label{chap:subroutinetypeentries}
1417 It is possible in C to declare pointers to subroutines
1418 that return a value of a specific type. In both C and C++,
1419 it is possible to declare pointers to subroutines that not
1420 only return a value of a specific type, but accept only
1421 arguments of specific types. The type of such pointers would
1422 be described with a ``pointer to'' modifier applied to a
1423 user\dash defined type.
1425 A subroutine type is represented by a debugging information
1427 tag \livetarg{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}.
1429 been given to the subroutine type in the source program,
1430 then the corresponding subroutine type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name}
1431 attribute whose value is a null\dash terminated string containing
1432 the subroutine type name as it appears in the source program.
1434 If the subroutine type describes a function that returns
1435 a value, then the subroutine type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type}
1436 attribute to denote the type returned by the subroutine. If
1437 the types of the arguments are necessary to describe the
1438 subroutine type, then the corresponding subroutine type
1439 entry owns debugging information entries that describe the
1440 arguments. These debugging information entries appear in the
1441 order that the corresponding argument types appear in the
1444 In C there is a difference between the types of functions
1445 declared using function prototype style declarations and
1446 those declared using non\dash prototype declarations.
1449 \hypertarget{chap:DWATprototypedsubroutineprototype}
1450 subroutine entry declared with a function prototype style
1451 declaration may have a
1452 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped} attribute, which is
1453 a \livelink{chap:flag}{flag}.
1455 Each debugging information entry owned by a subroutine
1456 type entry has a tag whose value has one of two possible
1459 \begin{enumerate}[1.]
1460 \item The formal parameters of a parameter list (that have a
1461 specific type) are represented by a debugging information entry
1462 with the tag \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}. Each formal parameter
1463 entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute that refers to the type of
1464 the formal parameter.
1466 \item The unspecified parameters of a variable parameter list
1467 \addtoindexx{unspecified parameters entry}
1469 \addtoindexx{... parameters|see{unspecified parameters entry}}
1470 represented by a debugging information entry with the
1471 tag \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}.
1476 \section{String Type Entries}
1477 \label{chap:stringtypeentries}
1480 A ``string'' is a sequence of characters that have specific
1481 semantics and operations that separate them from arrays of
1482 characters. Fortran is one of the languages that has a string
1483 type. Note that ``string'' in this context refers to a target
1484 machine concept, not the class string as used in this document
1485 (except for the name attribute).
1487 A string type is represented by a debugging information entry
1488 with the tag \livetarg{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}.
1489 If a name has been given to
1490 the string type in the source program, then the corresponding
1491 string type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is
1492 a null\dash terminated string containing the string type name as
1493 it appears in the source program.
1496 \hypertarget{chap:DWATstringlengthstringlengthofstringtype}
1497 string type entry may have a
1498 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length} attribute
1499 whose value is a location description yielding the location
1500 where the length of the string is stored in the program. The
1501 string type entry may also have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute
1502 or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1503 (see Section \refersec{chap:byteandbitsizes})
1504 is the size of the data to be retrieved from the location
1505 referenced by the string length attribute. If no (byte or bit)
1506 size attribute is present, the size of the data to be retrieved
1507 is the same as the size of an address on the target machine.
1509 If no string length attribute is present, the string type
1510 entry may have a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1511 attribute, whose value
1512 (see Section \refersec{chap:byteandbitsizes})
1514 storage needed to hold a value of the string type.
1517 \section{Set Type Entries}
1518 \label{chap:settypeentries}
1520 \textit{Pascal provides the concept of a “set,” which represents
1521 a group of values of ordinal type.}
1523 A set is represented by a debugging information entry with
1524 the tag \livetarg{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}.
1525 If a name has been given to the
1526 set type, then the set type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute
1527 whose value is a null\dash terminated string containing the
1528 set type name as it appears in the source program.
1530 The set type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to denote the
1531 type of an element of the set.
1533 If the amount of storage allocated to hold each element of an
1534 object of the given set type is different from the amount of
1535 storage that is normally allocated to hold an individual object
1536 of the indicated element type, then the set type entry has
1537 either a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute, or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute
1538 whose value (see Section \refersec{chap:byteandbitsizes}) is
1539 the amount of storage needed to hold a value of the set type.
1542 \section{Subrange Type Entries}
1543 \label{chap:subrangetypeentries}
1545 \textit{Several languages support the concept of a ``subrange''
1546 type object. These objects can represent a subset of the
1547 values that an object of the basis type for the subrange can
1548 represent. Subrange type entries may also be used to represent
1549 the bounds of array dimensions.}
1551 A subrange type is represented by a debugging information
1553 tag \livetarg{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}.
1555 given to the subrange type, then the subrange type entry
1556 has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated
1557 string containing the subrange type name as it appears in
1560 The subrange entry may have a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to describe
1561 the type of object, called the basis type, of whose values
1562 this subrange is a subset.
1564 If the amount of storage allocated to hold each element of an
1565 object of the given subrange type is different from the amount
1566 of storage that is normally allocated to hold an individual
1567 object of the indicated element type, then the subrange
1568 type entry has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} attribute or \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
1569 attribute, whose value
1570 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1572 storage needed to hold a value of the subrange type.
1575 \hypertarget{chap:DWATthreadsscaledupcarrayboundthreadsscalfactor}
1576 subrange entry may have a \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled} attribute,
1577 which is a \livelink{chap:flag}{flag}.
1578 If present, this attribute indicates whether
1579 this subrange represents a UPC array bound which is scaled
1580 by the runtime THREADS value (the number of UPC threads in
1581 this execution of the program).
1583 \textit{This allows the representation of a UPC shared array such as}
1586 int shared foo[34*THREADS][10][20];
1590 \hypertarget{chap:DWATlowerboundlowerboundofsubrange}
1592 \hypertarget{chap:DWATupperboundupperboundofsubrange}
1593 entry may have the attributes
1594 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
1595 and \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound} to specify, respectively, the lower
1596 and upper bound values of the subrange. The \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
1598 \hypertarget{chap:DWATcountelementsofsubrangetype}
1599 may be replaced by a
1600 \livelink{chap:DWATcount}{DW\-\_AT\-\_count} attribute, whose
1601 value describes the number of elements in the subrange rather
1602 than the value of the last element. The value of each of
1603 these attributes is determined as described in
1604 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1606 If the lower bound value is missing, the value is assumed to
1607 be a language\dash dependent default constant. The default lower
1609 \addtoindex{C}, \addtoindex{C++},
1612 \addtoindex{Objective C},
1613 \addtoindex{Objective C++},
1614 \addtoindex{Python}, and
1616 The default lower bound is 1 for
1617 \addtoindex{Ada}, \addtoindex{COBOL},
1618 \addtoindex{Fortran},
1619 \addtoindex{Modula}\dash 2,
1620 \addtoindex{Pascal} and
1623 \textit{No other default lower bound values are currently defined.}
1625 If the upper bound and count are missing, then the upper bound value is
1628 If the subrange entry has no type attribute describing the
1629 basis type, the basis type is assumed to be the same as
1630 the object described by the lower bound attribute (if it
1631 references an object). If there is no lower bound attribute,
1632 or that attribute does not reference an object, the basis type
1633 is the type of the upper bound or count attribute (if either
1634 of them references an object). If there is no upper bound or
1635 count attribute, or neither references an object, the type is
1636 assumed to be the same type, in the source language of the
1637 compilation unit containing the subrange entry, as a signed
1638 integer with the same size as an address on the target machine.
1640 If the subrange type occurs as the description of a dimension
1641 of an array type, and the stride for that dimension is
1642 \hypertarget{chap:DWATbytestridesubrangestridedimensionofarraytype}
1643 different than what would otherwise be determined, then
1644 \hypertarget{chap:DWATbitstridesubrangestridedimensionofarraytype}
1645 the subrange type entry has either a \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride} or
1646 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride} attribute which specifies the separation
1647 between successive elements along the dimension as described
1649 Section \refersec{chap:byteandbitsizes}.
1651 \textit{Note that the stride can be negative.}
1653 \section{Pointer to Member Type Entries}
1654 \label{chap:pointertomembertypeentries}
1656 \textit{In C++, a pointer to a data or function member of a class or
1657 structure is a unique type.}
1659 A debugging information entry representing the type of an
1660 object that is a pointer to a structure or class member has
1661 the tag \livetarg{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}.
1663 If the pointer to member type has a name, the pointer to
1664 member entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a
1665 null\dash terminated string containing the type name as it appears
1666 in the source program.
1668 The pointer to member entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute to
1669 describe the type of the class or structure member to which
1670 objects of this type may point.
1672 The pointer to member entry also
1673 \hypertarget{chap:DWATcontainingtypecontainingtypeofpointertomembertype}
1675 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
1676 attribute, whose value is a reference to a debugging
1677 information entry for the class or structure to whose members
1678 objects of this type may point.
1681 \hypertarget{chap:DWATuselocationmemberlocationforpointertomembertype}
1682 pointer to member entry has a
1683 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute
1684 whose value is a location description that computes the
1685 address of the member of the class to which the pointer to
1686 member entry points.
1688 \textit{The method used to find the address of a given member of a
1689 class or structure is common to any instance of that class
1690 or structure and to any instance of the pointer or member
1691 type. The method is thus associated with the type entry,
1692 rather than with each instance of the type.}
1694 The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is used in conjunction
1695 with the location descriptions for a particular object of the
1696 given pointer to member type and for a particular structure or
1697 class instance. The \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} attribute expects two
1699 \addtoindexi{pushed}{address!implicit push for member operator}
1700 onto the DWARF expression stack before
1701 the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description is evaluated. The first
1703 \addtoindexi{pushed}{address!implicit push for member operator}
1704 is the value of the pointer to member object
1705 itself. The second value
1706 \addtoindexi{pushed}{address!implicit push for member operator}
1707 is the base address of the
1708 entire structure or union instance containing the member
1709 whose address is being calculated.
1711 \textit{For an expression such as}
1716 % FIXME: object and mbr\_ptr should be distinguished from italic. See DW4.
1717 \textit{where mbr\_ptr has some pointer to member type, a debugger should:}
1719 \textit{1. Push the value of mbr\_ptr onto the DWARF expression stack.}
1721 \textit{2. Push the base address of object onto the DWARF expression stack.}
1723 \textit{3. Evaluate the \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location} description
1724 given in the type of mbr\_ptr.}
1726 \section{File Type Entries}
1727 \label{chap:filetypeentries}
1729 \textit{Some languages, such as Pascal, provide a data type to represent
1732 A file type is represented by a debugging information entry
1734 \livetarg{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}.
1735 If the file type has a name,
1736 the file type entry has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value
1737 is a null\dash terminated string containing the type name as it
1738 appears in the source program.
1740 The file type entry has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1741 the type of the objects contained in the file.
1743 The file type entry also has a \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size} or
1744 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size} attribute, whose value
1745 (see Section \refersec{chap:staticanddynamicvaluesofattributes})
1746 is the amount of storage need to hold a value of the file type.
1748 \section{Dynamic Type Properties}
1749 \label{chap:dynamictypeproperties}
1750 \subsection{Data Location}
1751 \label{chap:datalocation}
1753 \textit{Some languages may represent objects using descriptors to hold
1754 information, including a location and/or run\dash time parameters,
1755 about the data that represents the value for that object.}
1757 \hypertarget{chap:DWATdatalocationindirectiontoactualdata}
1758 The \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
1759 attribute may be used with any
1760 type that provides one or more levels of hidden indirection
1761 and/or run\dash time parameters in its representation. Its value
1762 is a location description. The result of evaluating this
1763 description yields the location of the data for an object.
1764 When this attribute is omitted, the address of the data is
1765 the same as the address of the object.
1767 \textit{This location description will typically begin with
1768 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}
1769 which loads the address of the
1770 object which can then serve as a descriptor in subsequent
1771 calculation. For an example using
1772 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
1773 for a Fortran 90 array, see
1774 Appendix \refersec{app:fortran90example}.}
1776 \subsection{Allocation and Association Status}
1777 \label{chap:allocationandassociationstatus}
1779 \textit{Some languages, such as Fortran 90, provide types whose values
1780 may be dynamically allocated or associated with a variable
1781 under explicit program control.}
1783 \hypertarget{chap:DWATallocatedallocationstatusoftypes}
1785 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
1786 attribute may optionally be used with any
1787 type for which objects of the type can be explicitly allocated
1788 and deallocated. The presence of the attribute indicates that
1789 objects of the type are allocatable and deallocatable. The
1790 integer value of the attribute (see below) specifies whether
1791 an object of the type is
1792 currently allocated or not.
1794 \hypertarget{chap:DWATassociatedassociationstatusoftypes}
1796 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute
1797 may optionally be used with
1798 any type for which objects of the type can be dynamically
1799 associated with other objects. The presence of the attribute
1800 indicates that objects of the type can be associated. The
1801 integer value of the attribute (see below) indicates whether
1802 an object of the type is currently associated or not.
1804 While these attributes are defined specifically with Fortran
1805 90 ALLOCATABLE and POINTER types in mind, usage is not limited
1806 to just that language.
1808 The value of these attributes is determined as described in
1809 Section \refersec{chap:staticanddynamicvaluesofattributes}.
1811 A non\dash zero value is interpreted as allocated or associated,
1812 and zero is interpreted as not allocated or not associated.
1814 \textit{For \addtoindex{Fortran} 90,
1815 if the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}
1816 attribute is present,
1817 the type has the POINTER property where either the parent
1818 variable is never associated with a dynamic object or the
1819 implementation does not track whether the associated object
1820 is static or dynamic. If the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute is
1821 present and the \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated} attribute is not, the type
1822 has the ALLOCATABLE property. If both attributes are present,
1823 then the type should be assumed to have the POINTER property
1824 (and not ALLOCATABLE); the \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} attribute may then
1825 be used to indicate that the association status of the object
1826 resulted from execution of an ALLOCATE statement rather than
1827 pointer assignment.}
1829 \textit{For examples using
1830 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated} for \addtoindex{Ada} and
1831 \addtoindex{Fortran} 90
1833 see Appendix \refersec{app:aggregateexamples}.}
1837 \section{Template Alias Entries}
1838 \label{chap:templatealiasentries}
1840 A type named using a template alias is represented
1841 by a debugging information entry with the tag
1842 \livetarg{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias}.
1843 The template alias entry has a
1844 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute whose value is a null\dash terminated string
1845 containing the name of the template alias as it appears in
1846 the source program. The template alias entry also contains a
1847 \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute whose value is a reference to the type
1848 named by the template alias. The template alias entry has
1849 the following child entries:
1851 \begin{enumerate}[1.]
1852 \item Each formal parameterized type declaration appearing
1853 in the template alias declaration is represented
1854 by a debugging information entry with the tag
1855 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}. Each such entry may have
1856 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1857 string containing the name of the formal type parameter as it
1858 appears in the source program. The template type parameter
1859 entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing the actual
1860 type by which the formal is replaced for this instantiation.
1862 \item Each formal parameterized value declaration
1863 appearing in the template alias declaration is
1864 represented by a debugging information entry with the tag
1865 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}. Each such entry may have
1866 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, whose value is a null\dash terminated
1867 string containing the name of the formal value parameter
1868 as it appears in the source program. The template value
1869 parameter entry also has a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute describing
1870 the type of the parameterized value. Finally, the template
1871 value parameter entry has a \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value} attribute, whose
1872 value is the actual constant value of the value parameter for
1873 this instantiation as represented on the target architecture.