1 \chapter{Data Representation}
2 \label{datarep:datarepresentation}
4 This section describes the binary representation of the
5 debugging information entry itself, of the attribute types
6 and of other fundamental elements described above.
9 \section{Vendor Extensibility}
10 \label{datarep:vendorextensibility}
11 \addtoindexx{vendor extensibility}
12 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
14 To reserve a portion of the DWARF name space and ranges of
15 enumeration values for use for vendor specific extensions,
16 special labels are reserved for tag names, attribute names,
17 base type encodings, location operations, language names,
18 calling conventions and call frame instructions.
20 The labels denoting the beginning and end of the reserved
21 value range for vendor specific extensions consist of the
22 appropriate prefix (DW\-\_TAG, DW\-\_AT, DW\-\_END, DW\-\_ATE, DW\-\_OP,
23 DW\-\_LANG, DW\-\_LNE, DW\-\_CC or DW\-\_CFA respectively) followed by
24 \_lo\_user or \_hi\_user.
25 \textit{For example, for entry tags, the special
26 labels are \livetarg{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user} and
27 \livetarg{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}.}
29 range between \textit{prefix}\_lo\_user and \textit{prefix}\_hi\_user inclusive,
30 are reserved for vendor specific extensions. Vendors may
31 use values in this range without conflicting with current or
32 future system\dash defined values. All other values are reserved
33 for use by the system.
35 \textit{There may also be codes for vendor specific extensions
36 between the number of standard line number opcodes and
37 the first special line number opcode. However, since the
38 number of standard opcodes varies with the DWARF version,
39 the range for extensions is also version dependent. Thus,
40 \livetarg{chap:DWLNSlouser}{DW\-\_LNS\-\_lo\-\_user} and
41 \livetarg{chap:DWLNShiuser}{DW\-\_LNS\-\_hi\-\_user} symbols are not defined.
44 Vendor defined tags, attributes, base type encodings, location
45 atoms, language names, line number actions, calling conventions
46 and call frame instructions, conventionally use the form
47 \text{prefix\_vendor\_id\_name}, where
48 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
49 character sequence chosen so as to avoid conflicts with
52 To ensure that extensions added by one vendor may be safely
53 ignored by consumers that do not understand those extensions,
54 the following rules should be followed:
57 \item New attributes should be added in such a way that a
58 debugger may recognize the format of a new attribute value
59 without knowing the content of that attribute value.
61 \item The semantics of any new attributes should not alter
62 the semantics of previously existing attributes.
64 \item The semantics of any new tags should not conflict with
65 the semantics of previously existing tags.
67 \item Do not add any new forms of attribute value.
72 \section{Reserved Values}
73 \label{datarep:reservedvalues}
74 \subsection{Error Values}
75 \label{datarep:errorvalues}
76 \addtoindexx{reserved values!error}
78 As a convenience for consumers of DWARF information, the value
79 0 is reserved in the encodings for attribute names, attribute
80 forms, base type encodings, location operations, languages,
81 line number program opcodes, macro information entries and tag
82 names to represent an error condition or unknown value. DWARF
83 does not specify names for these reserved values, since they
84 do not represent valid encodings for the given type and should
85 not appear in DWARF debugging information.
88 \subsection{Initial Length Values}
89 \label{datarep:initiallengthvalues}
90 \addtoindexx{reserved values!initial length}
92 An initial length field is one of the length fields that occur
93 at the beginning of those DWARF sections that have a header
94 (\addtoindex{.debug\_aranges},
95 \addtoindex{.debug\_info},
96 \addtoindex{.debug\_types},
97 \addtoindex{.debug\_line},
98 \addtoindex{.debug\_pubnames}, and
99 \addtoindex{.debug\_pubtypes}) or the length field
100 that occurs at the beginning of the CIE and FDE structures
101 in the \addtoindex{.debug\_frame} section.
103 In an initial length field, the values 0xfffffff0 through
104 0xffffffff are reserved by DWARF to indicate some form of
105 extension relative to DWARF Version 2; such values must not
106 be interpreted as a length field. The use of one such value,
107 0xffffffff, is defined below
108 (see Section \refersec{datarep:32bitand64bitdwarfformats});
110 the other values is reserved for possible future extensions.
114 \section{Executable Objects and Shared Objects}
115 \label{datarep:executableobjectsandsharedobjects}
117 The relocated addresses in the debugging information for an
118 executable object are virtual addresses and the relocated
119 addresses in the debugging information for a shared object
120 are offsets relative to the start of the lowest region of
121 memory loaded from that shared object.
123 \textit{This requirement makes the debugging information for
124 shared objects position independent. Virtual addresses in a
125 shared object may be calculated by adding the offset to the
126 base address at which the object was attached. This offset
127 is available in the run\dash time linker’s data structures.}
131 \section{32-Bit and 64-Bit DWARF Formats}
132 \label{datarep:32bitand64bitdwarfformats}
134 \addtoindexx{32-bit DWARF format}
135 \addtoindexx{64-bit DWARF format}
136 There are two closely related file formats. In the 32\dash bit DWARF
137 format, all values that represent lengths of DWARF sections
138 and offsets relative to the beginning of DWARF sections are
139 represented using 32\dash bits. In the 64\dash bit DWARF format, all
140 values that represent lengths of DWARF sections and offsets
141 relative to the beginning of DWARF sections are represented
142 using 64\dash bits. A special convention applies to the initial
143 length field of certain DWARF sections, as well as the CIE and
144 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
145 can coexist and be distinguished within a single linked object.
147 The differences between the 32\dash\ and 64\dash bit
149 detailed in the following:
152 \begin{enumerate}[1.]
154 \item In the 32\dash bit DWARF format, an initial length field
155 (see Section \refersec{datarep:initiallengthvalues})
156 is an unsigned 32\dash bit integer (which
157 must be less than 0xfffffff0); in the 64\dash bit DWARF format,
158 an initial length field is 96 bits in size, and has two parts:
160 \item The first 32\dash bits have the value 0xffffffff.
162 \item The following 64\dash bits contain the actual length
163 represented as an unsigned 64\dash bit integer.
166 \textit{This representation allows a DWARF consumer to dynamically
167 detect that a DWARF section contribution is using the 64\dash bit
168 format and to adapt its processing accordingly.}
170 \item Section offset and section length fields that occur
171 in the headers of DWARF sections (other than initial length
172 fields) are listed following. In the 32\dash bit DWARF format these
173 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
174 they are 64\dash bit unsigned integer values.
178 Section &Name & Role \\ \hline
179 \addtoindex{.debug\_ranges} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
180 \addtoindex{.debug\_frame}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
181 \addtoindex{.debug\_frame}/FDE & \addtoindex{CIE\_pointer} & offset in \addtoindex{.debug\_frame} \\
182 \addtoindex{.debug\_info} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_abbrev} \\
183 \addtoindex{.debug\_line} & \addtoindex{header\_length} & length of header itself \\
184 \addtoindex{.debug\_pubnames} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
185 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
187 \addtoindex{.debug\_pubtypes} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
188 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
190 \addtoindex{.debug\_types} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_info} \\
191 & \addtoindex{type\_offset} & offset in of \addtoindex{.debug\_types} \\
196 \textit{The CIE\_id field in a CIE structure must be 64 bits because
197 it overlays the CIE\_pointer in a FDE structure; this implicit
198 union must be accessed to distinguish whether a CIE or FDE is
199 present, consequently, these two fields must exactly overlay
200 each other (both offset and size).}
202 \item Within the body of the \addtoindex{.debug\_info} or \addtoindex{.debug\_types}
203 section, certain forms of attribute value depend on the choice
204 of DWARF format as follows. For the 32\dash bit DWARF format,
205 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
206 format, the value is a 64\dash bit unsigned integer.
209 Form & Role \\ \hline
210 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}& offset in \addtoindex{.debug\_info} \\
211 \livetarg{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}& offset in a section other than \addtoindex{.debug\_info} or \addtoindex{.debug\_str} \\
212 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&offset in \addtoindex{.debug\_str} \\
213 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&offset in \addtoindex{.debug\_info} \\
217 \item Within the body of the \addtoindex{.debug\_pubnames} and
218 \addtoindex{.debug\_pubtypes}
219 sections, the representation of the first field
220 of each tuple (which represents an offset in the
221 \addtoindex{.debug\_info}
222 section) depends on the DWARF format as follows: in the
223 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
224 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
229 The 32\dash bit and 64\dash bit DWARF format conventions must not be
230 intermixed within a single compilation unit.
232 \textit{Attribute values and section header fields that represent
233 addresses in the target program are not affected by these
236 A DWARF consumer that supports the 64\dash bit DWARF format must
237 support executables in which some compilation units use the
238 32\dash bit format and others use the 64\dash bit format provided that
239 the combination links correctly (that is, provided that there
240 are no link\dash time errors due to truncation or overflow). (An
241 implementation is not required to guarantee detection and
242 reporting of all such errors.)
244 \textit{It is expected that DWARF producing compilers will not use
245 the 64\dash bit format by default. In most cases, the division of
246 even very large applications into a number of executable and
247 shared objects will suffice to assure that the DWARF sections
248 within each individual linked object are less than 4 GBytes
249 in size. However, for those cases where needed, the 64\dash bit
250 format allows the unusual case to be handled as well. Even
251 in this case, it is expected that only application supplied
252 objects will need to be compiled using the 64\dash bit format;
253 separate 32\dash bit format versions of system supplied shared
254 executable libraries can still be used.}
258 \section{Format of Debugging Information}
259 \label{datarep:formatofdebugginginformation}
261 For each compilation unit compiled with a DWARF producer,
262 a contribution is made to the \addtoindex{.debug\_info} section of
263 the object file. Each such contribution consists of a
264 compilation unit header
265 (see Section \refersec{datarep:compilationunitheader})
267 single \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} or \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} debugging
268 information entry, together with its children.
270 For each type defined in a compilation unit, a contribution may
271 be made to the \addtoindex{.debug\_types}
272 section of the object file. Each
273 such contribution consists of a type unit header
274 (see Section \refersec{datarep:typeunitheader})
275 followed by a \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} entry, together with
278 Each debugging information entry begins with a code that
279 represents an entry in a separate
280 \addtoindex{abbreviations table}. This
281 code is followed directly by a series of attribute values.
283 The appropriate entry in the
284 \addtoindex{abbreviations table} guides the
285 interpretation of the information contained directly in the
286 \addtoindex{.debug\_info} or
287 \addtoindex{.debug\_types} section.
289 Multiple debugging information entries may share the same
290 abbreviation table entry. Each compilation unit is associated
291 with a particular abbreviation table, but multiple compilation
292 units may share the same table.
293 \subsection{Unit Headers}
294 \label{datarep:unitheaders}
296 \subsubsection{Compilation Unit Header}
297 \label{datarep:compilationunitheader}
299 \begin{enumerate}[1.]
301 \item unit\_length (initial length) \\
302 A 4\dash byte or 12\dash byte unsigned integer representing the length
303 of the \addtoindex{.debug\_info}
304 contribution for that compilation unit,
305 not including the length field itself. In the 32\dash bit DWARF
306 format, this is a 4\dash byte unsigned integer (which must be less
307 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
308 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
309 integer that gives the actual length
310 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
312 \item version (uhalf)
313 A 2\dash byte unsigned integer representing the version of the
314 DWARF information for the compilation unit\addtoindexx{version number!compilation unit}
315 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
316 The value in this field is 4.
318 \item \addtoindex{debug\_abbrev\_offset} (section offset) \\
319 A 4\dash byte or 8\dash byte unsigned offset into the
320 \addtoindex{.debug\_abbrev}
321 section. This offset associates the compilation unit with a
322 particular set of debugging information entry abbreviations. In
323 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
324 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
325 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
327 \item address\_size (ubyte) \\
328 A 1\dash byte unsigned integer representing the size in bytes of
329 \addtoindexx{address\_size}
330 an address on the target architecture. If the system uses
331 \addtoindexx{address space!segmented}
332 segmented addressing, this value represents the size of the
333 offset portion of an address.
340 \subsubsection{Type Unit Header}
341 \label{datarep:typeunitheader}
343 The header for the series of debugging information entries
344 contributing to the description of a type that has been
345 placed in its own type unit, within the
346 \addtoindex{.debug\_types} section,
347 consists of the following information:
349 \begin{enumerate}[1.]
351 \item unit\_length (initial length) \\
352 A 4\dash byte or 12\dash byte unsigned integer representing the length
353 of the \addtoindex{.debug\_types} contribution for that compilation unit,
354 not including the length field itself. In the 32\dash bit DWARF
355 format, this is a 4\dash byte unsigned integer (which must be
356 less than 0xfffffff0); in the 64\dash bit DWARF format, this
357 consists of the 4\dash byte value 0xffffffff followed by an
358 8\dash byte unsigned integer that gives the actual length
359 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
361 \item version (uhalf)
362 A 2\dash byte unsigned integer representing the version of the
363 DWARF information for the compilation unit\addtoindexx{version number!type unit}
364 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
365 The value in this field is 4.
367 \item \addtoindex{debug\_abbrev\_offset} (section offset) \\
368 A 4\dash byte or 8\dash byte unsigned offset into the
369 \addtoindex{.debug\_abbrev}
370 section. This offset associates the compilation unit with a
371 particular set of debugging information entry abbreviations. In
372 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
373 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
374 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
376 \item address\_size (ubyte) \\
377 A 1\dash byte unsigned integer representing the size in bytes of
378 \addtoindexx{address\_size}
379 an address on the target architecture. If the system uses
380 \addtoindexx{address space!segmented}
381 segmented addressing, this value represents the size of the
382 offset portion of an address.
385 \item type\_signature (8\dash byte unsigned integer) \\
386 A 64\dash bit unique signature of the type described in this type
389 \textit{An attribute that refers(using \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) to
390 the primary type contained in this type unit uses this value.}
393 \item type\_offset (section offset) \\
394 A 4\dash byte or 8\dash byte unsigned offset relative to the beginning
395 of the type unit header. This offset refers to the debugging
396 information entry that describes the type. Because the type
397 may be nested inside a namespace or other structures, and may
398 contain references to other types that have not been placed in
399 separate type units, it is not necessarily either the first or
400 the only entry in the type unit. In the 32\dash bit DWARF format,
401 this is a 4\dash byte unsigned length; in the 64\dash bit DWARF format,
402 this is an 8\dash byte unsigned length
403 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
407 \subsection{Debugging Information Entry}
408 \label{datarep:debugginginformationentry}
410 Each debugging information entry begins with an unsigned LEB128
411 number containing the abbreviation code for the entry. This
412 code represents an entry within the abbreviations table
413 associated with the compilation unit containing this entry. The
414 abbreviation code is followed by a series of attribute values.
416 On some architectures, there are alignment constraints on
417 section boundaries. To make it easier to pad debugging
418 information sections to satisfy such constraints, the
419 abbreviation code 0 is reserved. Debugging information entries
420 consisting of only the abbreviation code 0 are considered
423 \subsection{Abbreviations Tables}
424 \label{datarep:abbreviationstables}
426 The abbreviations tables for all compilation units
427 are contained in a separate object file section called
428 \addtoindex{.debug\_abbrev}.
429 As mentioned before, multiple compilation
430 units may share the same abbreviations table.
432 The abbreviations table for a single compilation unit consists
433 of a series of abbreviation declarations. Each declaration
434 specifies the tag and attributes for a particular form of
435 debugging information entry. Each declaration begins with
436 an unsigned LEB128 number representing the abbreviation
437 code itself. It is this code that appears at the beginning
438 of a debugging information entry in the
439 \addtoindex{.debug\_info} or
440 \addtoindex{.debug\_types}
441 section. As described above, the abbreviation
442 code 0 is reserved for null debugging information entries. The
443 abbreviation code is followed by another unsigned LEB128
444 number that encodes the entry’s tag. The encodings for the
445 tag names are given in
446 Table \refersec{tab:tagencodings}.
448 Following the tag encoding is a 1\dash byte value that determines
449 whether a debugging information entry using this abbreviation
450 has child entries or not. If the value is
451 \livetarg{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes},
452 the next physically succeeding entry of any debugging
453 information entry using this abbreviation is the first
454 child of that entry. If the 1\dash byte value following the
455 abbreviation’s tag encoding is
456 \livetarg{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}, the next
457 physically succeeding entry of any debugging information entry
458 using this abbreviation is a sibling of that entry. (Either
459 the first child or sibling entries may be null entries). The
460 encodings for the child determination byte are given in
461 Table \refersec{tab:childdeterminationencodings}
463 Section \refersec{chap:relationshipofdebugginginformationentries},
465 sibling entries is terminated by a null entry.)
467 Finally, the child encoding is followed by a series of
468 attribute specifications. Each attribute specification
469 consists of two parts. The first part is an unsigned LEB128
470 number representing the attribute’s name. The second part
471 is an unsigned LEB128 number representing the attribute’s
472 form. The series of attribute specifications ends with an
473 entry containing 0 for the name and 0 for the form.
476 \livetarg{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect} is a special case. For
477 attributes with this form, the attribute value itself in the
478 \addtoindex{.debug\_info} or
479 \addtoindex{.debug\_types}
480 section begins with an unsigned
481 LEB128 number that represents its form. This allows producers
482 to choose forms for particular attributes
483 \addtoindexx{abbreviations table!dynamic forms in}
485 without having to add a new entry to the abbreviations table.
487 The abbreviations for a given compilation unit end with an
488 entry consisting of a 0 byte for the abbreviation code.
491 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
492 for a depiction of the organization of the
493 debugging information.
495 \subsection{Attribute Encodings}
496 \label{datarep:attributeencodings}
498 The encodings for the attribute names are given in
499 Table \refersec{tab:attributeencodings}.
501 The attribute form governs how the value of the attribute is
502 encoded. There are nine classes of form, listed below. Each
503 class is a set of forms which have related representations
504 and which are given a common interpretation according to the
505 attribute in which the form is used.
507 Form \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} is a member of more than one class,
508 namely \livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr}; the list
509 of classes allowed by the applicable attribute in
510 Table \refersec{tab:attributeencodings}
511 determines the class of the form.
513 \textit{In DWARF V3 the forms \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} were
514 members of either class constant or one of the classes \livelink{chap:lineptr}{lineptr},
515 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr}, depending on context. In
516 DWARF V4 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} are members of class
517 constant in all cases. The new \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} replaces
518 their usage for the other classes.}
520 Each possible form belongs to one or more of the following classes:
523 \item \livelinki{chap:DWATaddressclass}{address}{address class} \\
524 Represented as an object of appropriate size to hold an
525 address on the target machine
526 (\livetarg{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}).
528 encoded in the compilation unit header
529 (see Section \refersec{datarep:compilationunitheader}).
530 This address is relocatable in a relocatable object file and
531 is relocated in an executable file or shared object.
533 \item \livelink{chap:block}{block} \\
534 Blocks come in four forms:
536 \begin{myindentpara}{1cm}
537 A 1\dash byte length followed by 0 to 255 contiguous information
538 bytes (\livetarg{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}).
541 \begin{myindentpara}{1cm}
542 A 2\dash byte length followed by 0 to 65,535 contiguous information
543 bytes (\livetarg{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}).
547 \begin{myindentpara}{1cm}
548 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
549 information bytes (\livetarg{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}).
553 \begin{myindentpara}{1cm}
554 An unsigned LEB128 length followed by the number of bytes
555 specified by the length (\livetarg{chap:DWFORMblock}{DW\-\_FORM\-\_block}).
558 In all forms, the length is the number of information bytes
559 that follow. The information bytes may contain any mixture
560 of relocated (or relocatable) addresses, references to other
561 debugging information entries or data bytes.
564 There are six forms of constants. There are fixed length
565 constant data forms for one, two, four and eight byte values
567 \livetarg{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
568 \livetarg{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
569 \livetarg{chap:DWFORMdata4}{DW\-\_FORM\-\_data4},
570 and \livetarg{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}).
571 There are also variable length constant
572 data forms encoded using LEB128 numbers (see below). Both
573 signed (\livetarg{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}) and unsigned
574 (\livetarg{chap:DWFORMudata}{DW\-\_FORM\-\_udata}) variable
575 length constants are available
577 The data in \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
578 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
579 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
580 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}
581 can be anything. Depending on context, it may
582 be a signed integer, an unsigned integer, a floating\dash point
583 constant, or anything else. A consumer must use context to
584 know how to interpret the bits, which if they are target
585 machine data (such as an integer or floating point constant)
586 will be in target machine byte\dash order.
588 \textit{If one of the \livetarg{chap:DWFORMdata}{DW\-\_FORM\-\_data}<n> forms is used to represent a
589 signed or unsigned integer, it can be hard for a consumer
590 to discover the context necessary to determine which
591 interpretation is intended. Producers are therefore strongly
592 encouraged to use \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata} or
593 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata} for signed and
594 unsigned integers respectively, rather than
595 \livelink{chap:DWFORMdata}{DW\-\_FORM\-\_data} \textless n \textgreater.}
598 \item \livelink{chap:exprloc}{exprloc} \\
599 This is an unsigned LEB128 length followed by the
600 number of information bytes specified by the length
601 (\livetarg{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc}).
602 The information bytes contain a DWARF
604 (see Section \refersec{chap:dwarfexpressions})
605 or location description
606 (see Section \refersec{chap:locationdescriptions}).
608 \item \livelink{chap:flag}{flag} \\
609 A flag is represented explicitly as a single byte of data
610 (\livetarg{chap:DWFORMflag}{DW\-\_FORM\-\_flag}) or
611 implicitly (\livetarg{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present}).
613 first case, if the \nolink{flag} has value zero, it indicates the
614 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
615 it indicates the presence of the attribute. In the second
616 case, the attribute is implicitly indicated as present, and
617 no value is encoded in the debugging information entry itself.
619 \item \livelink{chap:lineptr}{lineptr} \\
620 This is an offset into the
621 \addtoindex{.debug\_line} section
622 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
624 \addtoindex{.debug\_line}
625 section to the first byte of
626 the data making up the line number list for the compilation
628 It is relocatable in a relocatable object file, and
629 relocated in an executable or shared object. In the 32\dash bit
630 DWARF format, this offset is a 4\dash byte unsigned value;
631 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
632 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
635 \item \livelink{chap:loclistptr}{loclistptr} \\
636 This is an offset into the
637 \addtoindex{.debug\_loc}
639 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
641 \addtoindex{.debug\_loc}
642 section to the first byte of
643 the data making up the location list for the compilation
645 It is relocatable in a relocatable object file, and
646 relocated in an executable or shared object. In the 32\dash bit
647 DWARF format, this offset is a 4\dash byte unsigned value;
648 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
649 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
652 \item \livelink{chap:macptr}{macptr} \\
653 This is an offset into the
654 \addtoindex{.debug\_macinfo} section
655 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
656 beginning of the \addtoindex{.debug\_macinfo}
657 section to the first byte of
658 the data making up the macro information list for the compilation
660 It is relocatable in a relocatable object file, and
661 relocated in an executable or shared object. In the 32\dash bit
662 DWARF format, this offset is a 4\dash byte unsigned value;
663 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
664 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
666 \item \livelink{chap:rangelistptr}{rangelistptr} \\
667 This is an offset into the \addtoindex{.debug\_ranges} section
668 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
670 offset from the beginning of the
671 \addtoindex{.debug\_ranges} section
672 to the beginning of the non\dash contiguous address ranges
673 information for the referencing entity.
675 a relocatable object file, and relocated in an executable or
676 shared object. In the 32\dash bit DWARF format, this offset
677 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
678 format, it is an 8\dash byte unsigned value (see Section
679 \refersec{datarep:32bitand64bitdwarfformats}).
682 \textit{Because classes \livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} and \livelink{chap:rangelistptr}{rangelistptr}
683 share a common representation, it is not possible for an
684 attribute to allow more than one of these classes}
689 There are three types of reference.
691 The first type of reference can identify any debugging
692 information entry within the containing unit. This type of
693 reference is an offset from the first byte of the compilation
694 header for the compilation unit containing the reference. There
695 are five forms for this type of reference. There are fixed
696 length forms for one, two, four and eight byte offsets
697 (respectively, \livetarg{chap:DWFORMref1}{DW\-\_FORM\-\_ref1},
698 \livetarg{chap:DWFORMref2}{DW\-\_FORM\-\_ref2},
699 \livetarg{chap:DWFORMref4}{DW\-\_FORM\-\_ref4},
700 and \livetarg{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}).
701 There is also an unsigned variable
702 length offset encoded form that uses unsigned LEB128 numbers
703 (\livetarg{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}).
704 Because this type of reference is within
705 the containing compilation unit no relocation of the value
708 The second type of reference can identify any debugging
709 information entry within a
710 \addtoindex{.debug\_info} section; in particular,
711 it may refer to an entry in a different compilation unit
712 from the unit containing the reference, and may refer to an
713 entry in a different shared object. This type of reference
714 (\livetarg{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}) is an offset from the beginning of the
715 \addtoindex{.debug\_info}
716 section of the target executable or shared object;
717 it is relocatable in a relocatable object file and frequently
718 relocated in an executable file or shared object. For
719 references from one shared object or static executable file
720 to another, the relocation and identification of the target
721 object must be performed by the consumer. In the 32\dash bit DWARF
722 format, this offset is a 4\dash byte unsigned value;
723 in the 64\dash bit DWARF format, it is an 8\dash byte
725 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
727 A debugging information entry that may be referenced by
728 another compilation unit using \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr} must have a
729 global symbolic name.
731 For a reference from one executable or shared object to
732 another, the reference is resolved by the debugger to identify
733 the shared object or executable and the offset into that
734 object’s \addtoindex{.debug\_info}
735 section in the same fashion as the run
736 time loader, either when the debug information is first read,
737 or when the reference is used.
739 The third type of reference can identify any debugging
740 information type entry that has been placed in its own
741 type unit. This type of
742 reference (\livetarg{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) is the
743 64\dash bit type signature
744 (see Section \refersec{datarep:typesignaturecomputation})
748 The use of compilation unit relative references will reduce the
749 number of link\dash time relocations and so speed up linking. The
750 use of the second and third type of reference allows for the
751 sharing of information, such as types, across compilation
754 A reference to any kind of compilation unit identifies the
755 debugging information entry for that unit, not the preceding
759 A string is a sequence of contiguous non\dash null bytes followed by
760 one null byte. A string may be represented immediately in the
761 debugging information entry itself
762 (\livetarg{chap:DWFORMstring}{DW\-\_FORM\-\_string}), or may
763 be represented as an offset into a string table contained in
764 the \addtoindex{.debug\_str} section of the object file
765 (\livetarg{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}). In
766 the 32\dash bit DWARF format, the representation of a
767 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}
768 value is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
769 it is an 8\dash byte unsigned offset
770 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
772 If the \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8} attribute is specified for the
773 compilation unit entry, string values are encoded using the
774 UTF\dash 8 (Unicode Transformation Format\dash 8) from the Universal
775 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
776 the string representation is unspecified.
778 The Unicode Standard Version 3 is fully compatible with
779 ISO/IEC 10646\dash 1:1993. It contains all the same characters
780 and encoding points as ISO/IEC 10646, as well as additional
781 information about the characters and their use.
783 Earlier versions of DWARF did not specify the representation
784 of strings; for compatibility, this version also does
785 not. However, the UTF\dash 8 representation is strongly recommended.
789 In no case does an attribute use one of the classes \livelink{chap:lineptr}{lineptr},
790 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr} to point into either the
791 \addtoindex{.debug\_info} or \addtoindex{.debug\_str} section.
793 The form encodings are listed in
794 Table \refersec{tab:attributeformencodings}.
797 \setlength{\extrarowheight}{0.1cm}
798 \begin{longtable}{l|l}
799 \caption{Tag encodings} \label{tab:tagencodings} \\
800 \hline \\ \bfseries Tag name&\bfseries Value\\ \hline
802 \bfseries Tag name&\bfseries Value \\ \hline
804 \hline \emph{Continued on next page}
808 \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type} &0x01 \\
809 \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type}&0x02 \\
810 \livelink{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point}&0x03 \\
811 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}&0x04 \\
812 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}&0x05 \\
813 \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}&0x08 \\
814 \livelink{chap:DWTAGlabel}{DW\-\_TAG\-\_label}&0x0a \\
815 \livelink{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}&0x0b \\
816 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}&0x0d \\
817 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}&0x0f \\
818 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}&0x10 \\
819 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}&0x11 \\
820 \livelink{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}&0x12 \\
821 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}&0x13 \\
822 \livelink{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}&0x15 \\
823 \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}&0x16 \\
824 \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}&0x17 \\
825 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}&0x18 \\
826 \livelink{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}&0x19 \\
827 \livelink{chap:DWTAGcommonblock}{DW\-\_TAG\-\_common\-\_block}&0x1a \\
828 \livelink{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}&0x1b \\
829 \livelink{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}&0x1c \\
830 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}&0x1d \\
831 \livelink{chap:DWTAGmodule}{DW\-\_TAG\-\_module}&0x1e \\
832 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}&0x1f \\
833 \livelink{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}&0x20 \\
834 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}&0x21 \\
835 \livelink{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}&0x22 \\
836 \livelink{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}&0x23 \\
837 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}&0x24 \\
838 \livelink{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}&0x25 \\
839 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type}&0x26 \\
840 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant}&0x27 \\
841 \livelink{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}&0x28 \\
842 \livelink{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}&0x29 \\
843 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}&0x2a \\
844 \livelink{chap:DWTAGnamelist}{DW\-\_TAG\-\_namelist}&0x2b \\
845 \livelink{chap:DWTAGnamelistitem}{DW\-\_TAG\-\_namelist\-\_item}&0x2c \\
846 \livelink{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}&0x2d \\
847 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}&0x2e \\
848 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}&0x2f \\
849 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}&0x30 \\
850 \livelink{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}&0x31 \\
851 \livelink{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}&0x32 \\
852 \livelink{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part}&0x33 \\
853 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}&0x34 \\
854 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&0x35 \\
855 \livelink{chap:DWTAGdwarfprocedure}{DW\-\_TAG\-\_dwarf\-\_procedure}&0x36 \\
856 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&0x37 \\
857 \livelink{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}&0x38 \\
858 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}&0x39 \\
859 \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}&0x3a \\
860 \livelink{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}&0x3b \\
861 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}&0x3c \\
862 \livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}&0x3d \\
863 \livelink{chap:DWTAGcondition}{DW\-\_TAG\-\_condition}&0x3f \\
864 \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&0x40 \\
865 \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} \ddag &0x41 \\
866 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} \ddag &0x42 \\
867 \livelink{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias} \ddag &0x43 \\
868 \livelink{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user}&0x4080 \\
869 \livelink{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}&0xffff \\
871 \ddag TAG new in DWARF Version 4
877 \setlength{\extrarowheight}{0.1cm}
878 \caption{Child determination encodings}
879 \label{tab:childdeterminationencodings}
880 \begin{tabular}{l|l} \hline
881 Child determination name& Value\\ \hline
882 \livelink{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}&0x00 \\
883 \livelink{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes}&0x01 \\ \hline
889 \setlength{\extrarowheight}{0.1cm}
890 \begin{longtable}{l|l|l}
891 \caption{Attribute encodings} \label{tab:attributeencodings} \addtoindexx{attribute encodings} \\
892 \hline \\ \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
894 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
896 \hline \emph{Continued on next page}
900 \livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling}&0x01&reference
901 \addtoindexx{sibling attribute!encoding} \\
902 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}&0x02&\livelink{chap:exprloc}{exprloc},
903 \livelink{chap:loclistptr}{loclistptr}\addtoindex{location attribute!encoding} \\
904 \livelink{chap:DWATname}{DW\-\_AT\-\_name}&0x03&string
905 \addtoindexx{name attribute!encoding} \\
906 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}&0x09&constant
907 \addtoindexx{ordering attribute!encoding} \\
908 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}&0x0b&constant, \livelink{chap:exprloc}{exprloc},
909 reference \addtoindexx{byte size attribute!encoding} \\
910 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}&0x0c&constant,
911 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit offset attribute!encoding} \\
912 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}&0x0d&constant,
913 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit size attribute!encoding} \\
914 \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list}&0x10&\livelink{chap:lineptr}{lineptr}
915 \addtoindex{statement list attribute!encoding} \\
916 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}&0x11&address
917 \addtoindexx{lowpc attribute!encoding} \\
918 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}&0x12&address, constant
919 \addtoindexx{highpc attribute!encoding} \\
920 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}&0x13&constant
921 \addtoindexx{language attribute!encoding} \\
922 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}&0x15&reference
923 \addtoindexx{discriminant attribute!encoding} \\
924 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}&0x16&constant
925 \addtoindexx{discriminant value attribute!encoding} \\
926 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}&0x17&constant
927 \addtoindexx{visibility attribute!encoding} \\
928 \livelink{chap:DWATimport}{DW\-\_AT\-\_import}&0x18&reference
929 \addtoindexx{import attribute!encoding} \\
930 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}&0x19&\livelink{chap:exprloc}{exprloc},
931 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{string length attribute!encoding} \\
932 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference}&0x1a&reference
933 \addtoindexx{common reference attribute!encoding} \\
934 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}&0x1b&string
935 \addtoindexx{compilation directory attribute!encoding} \\
936 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}&0x1c&\livelink{chap:block}{block}, constant, string
937 \addtoindexx{constant value attribute!encoding} \\
938 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}&0x1d&reference
939 \addtoindexx{containing type attribute!encoding} \\
940 \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}&0x1e&reference
941 \addtoindexx{default value attribute!encoding} \\
942 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline}&0x20&constant
943 \addtoindexx{inlineibute!encoding} \\
944 \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}&0x21&\livelink{chap:flag}{flag}
945 \addtoindexx{is optional attribute!encoding} \\
946 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}&0x22&constant,
947 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{lower bound attribute!encoding} \\
948 \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer}&0x25&string \addtoindexx{producer attribute!encoding} \\
949 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}&0x27&\livelink{chap:flag}{flag}
950 \addtoindexx{prototyped attribute!encoding} \\
951 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}&0x2a&\livelink{chap:exprloc}{exprloc},
952 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{return address attribute!encoding} \\
953 % FIXME: lower case , not Constant
954 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}&0x2c&Constant,
955 \livelink{chap:rangelistptr}{rangelistptr} \addtoindexx{start scope attribute!encoding} \\
956 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}&0x2e&constant,
957 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit stride attribute!encoding} \\
958 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}&0x2f&constant,
959 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{upper bound attribute!encoding} \\
960 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}&0x31&reference
961 \addtoindexx{abstract origin attribute!encoding} \\
962 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}&0x32&constant
963 \addtoindexx{accessibility attribute!encoding} \\
964 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}&0x33&constant
965 \addtoindexx{address class atribute!encoding} \\
966 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}&0x34&\livelink{chap:flag}{flag}
967 \addtoindexx{artificial attribute!encoding} \\
968 \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types}&0x35&reference
969 \addtoindexx{base types attribute!encoding} \\
970 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}&0x36&constant
971 \addtoindexx{calling convention attribute!encoding} \\
972 \livelink{chap:DWATcount}{DW\-\_AT\-\_count}&0x37&constant, \livelink{chap:exprloc}{exprloc}, reference
973 \addtoindexx{count attribute!encoding} \\
974 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}&0x38&constant,
975 \livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr}
976 \addtoindexx{data member attribute!encoding} \\
977 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column}&0x39&constant
978 \addtoindexx{declaration column attribute!encoding} \\
979 \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}&0x3a&constant
980 \addtoindexx{declaration file attribute!encoding} \\
981 \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}&0x3b&constant
982 \addtoindexx{declaration line attribute!encoding} \\
983 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}&0x3c&\livelink{chap:flag}{flag}
984 \addtoindexx{declaration attribute!encoding} \\
985 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}&0x3d&\livelink{chap:block}{block}
986 \addtoindexx{discriminant list attribute!encoding} \\
987 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}&0x3e&constant
988 \addtoindexx{encoding attribute!encoding} \\
989 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external}&0x3f&\livelink{chap:flag}{flag}
990 \addtoindexx{external attribute!encoding} \\
991 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base}&0x40&\livelink{chap:exprloc}{exprloc},
992 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{frame base attribute!encoding} \\
993 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}&0x41&reference
994 \addtoindexx{friend attribute!encoding} \\
995 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}&0x42&constant
996 \addtoindexx{identifier case attribute!encoding} \\
997 \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info}&0x43&\livelink{chap:macptr}{macptr}
998 \addtoindexx{macro information attribute!encoding} \\
999 \livelink{chap:DWATnamelistitem}{DW\-\_AT\-\_namelist\-\_item}&0x44&reference
1000 \addtoindexx{name list item attribute!encoding} \\
1001 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority}&0x45&reference
1002 \addtoindexx{priority attribute!encoding} \\
1003 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}&0x46&\livelink{chap:exprloc}{exprloc},
1004 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{segment attribute!encoding} \\
1005 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}&0x47&reference
1006 \addtoindexx{specification attribute!encoding} \\
1007 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}&0x48&\livelink{chap:exprloc}{exprloc},
1008 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{static link attribute!encoding} \\
1009 \livelink{chap:DWATtype}{DW\-\_AT\-\_type}&0x49&reference
1010 \addtoindexx{type attribute!encoding} \\
1011 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}&0x4a&\livelink{chap:exprloc}{exprloc},
1012 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{location list attribute!encoding} \\
1013 \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}&0x4b&\livelink{chap:flag}{flag}
1014 \addtoindexx{variable parameter attribute!encoding} \\
1015 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}&0x4c&constant
1016 \addtoindexx{virtuality attribute!encoding} \\
1017 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}&0x4d&\livelink{chap:exprloc}{exprloc},
1018 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{vtable element location attribute!encoding} \\
1020 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}&0x4e&constant, \livelink{chap:exprloc}{exprloc},
1021 reference \addtoindexx{allocated attribute!encoding} \\
1022 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}&0x4f&constant, \livelink{chap:exprloc}{exprloc},
1023 reference \addtoindexx{associated attribute!encoding} \\
1024 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}&0x50&\livelink{chap:exprloc}{exprloc}
1025 \addtoindexx{data location attribute!encoding} \\
1026 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}&0x51&constant, \livelink{chap:exprloc}{exprloc},
1027 reference \addtoindexx{byte stride attribute!encoding} \\
1028 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}&0x52&address
1029 \addtoindexx{entry pc attribute!encoding} \\
1030 \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}&0x53&\livelink{chap:flag}{flag}
1031 \addtoindexx{use UTF8 attribute!encoding} \\
1032 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}&0x54&reference
1033 \addtoindexx{extension attribute!encoding} \\
1034 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}&0x55&\livelink{chap:rangelistptr}{rangelistptr}
1035 \addtoindexx{ranges attribute!encoding} \\
1036 \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline}&0x56&address, \livelink{chap:flag}{flag},
1037 reference, string \addtoindexx{trampoline attribute!encoding} \\
1038 \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column}&0x57&constant
1039 \addtoindexx{call column attribute!encoding} \\
1040 \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file}&0x58&constant
1041 \addtoindexx{call file attribute!encoding} \\
1042 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line}&0x59&constant
1043 \addtoindexx{call line attribute!encoding} \\
1044 \livelink{chap:DWATdescription}{DW\-\_AT\-\_description}&0x5a&string
1045 \addtoindexx{description attribute!encoding} \\
1046 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}&0x5b&constant
1047 \addtoindexx{binary scale attribute!encoding} \\
1048 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}&0x5c&constant
1049 \addtoindexx{decimal scale attribute!encoding} \\
1050 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} &0x5d&reference
1051 \addtoindexx{small attribute!encoding} \\
1052 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}&0x5e&constant
1053 \addtoindexx{decimal scale attribute!encoding} \\
1054 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}&0x5f&constant
1055 \addtoindexx{digit count attribute!encoding} \\
1056 \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}&0x60&string
1057 \addtoindexx{picture string attribute!encoding} \\
1058 \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}&0x61&\livelink{chap:flag}{flag}
1059 \addtoindexx{mutable attribute!encoding} \\
1061 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}&0x62&\livelink{chap:flag}{flag}
1062 \addtoindexx{thread scaled attribute!encoding} \\
1063 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}&0x63&\livelink{chap:flag}{flag}
1064 \addtoindexx{explicit attribute!encoding} \\
1065 \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}&0x64&reference
1066 \addtoindexx{object pointer attribute!encoding} \\
1067 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}&0x65&constant
1068 \addtoindexx{endianity attribute!encoding} \\
1069 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental}&0x66&\livelink{chap:flag}{flag}
1070 \addtoindexx{elemental attribute!encoding} \\
1071 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure}&0x67&\livelink{chap:flag}{flag}
1072 \addtoindexx{pure attribute!encoding} \\
1073 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}&0x68&\livelink{chap:flag}{flag}
1074 \addtoindexx{recursive attribute!encoding} \\
1075 \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature} \ddag &0x69&reference
1076 \addtoindexx{signature attribute!encoding} \\
1077 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} \ddag &0x6a&\livelink{chap:flag}{flag}
1078 \addtoindexx{main subprogram attribute!encoding} \\
1079 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} \ddag &0x6b&constant
1080 \addtoindexx{data bit offset attribute!encoding} \\
1081 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} \ddag &0x6c&\livelink{chap:flag}{flag}
1082 \addtoindexx{constant expression attribute!encoding} \\
1083 \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class} \ddag &0x6d&\livelink{chap:flag}{flag}
1084 \addtoindexx{enumeration class attribute!encoding} \\
1085 \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} \ddag &0x6e&string
1086 \addtoindexx{linkage name attribute!encoding} \\
1087 \livetarg{chap:DWATlouser}{DW\-\_AT\-\_lo\-\_user}&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1088 \livetarg{chap:DWAThiuser}{DW\-\_AT\-\_hi\-\_user}&0x3fff& --- \addtoindexx{high user attribute encoding} \\
1091 \ddag Attribute new in DWARF Version 4
1095 \setlength{\extrarowheight}{0.1cm}
1096 \begin{longtable}{l|l|l}
1097 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1098 \hline \\ \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1100 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1102 \hline \emph{Continued on next page}
1106 \livelink{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}&0x01&address \\
1107 \livelink{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}&0x03&\livelink{chap:block}{block} \\
1108 \livelink{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}&0x04&\livelink{chap:block}{block} \\
1109 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2}&0x05&constant \\
1110 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4}&0x06&constant \\
1111 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}&0x07&constant \\
1112 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string}&0x08&string \\
1113 \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}&0x09&\livelink{chap:block}{block} \\
1114 \livelink{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}&0x0a&\livelink{chap:block}{block} \\
1115 \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1}&0x0b&constant \\
1116 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag}&0x0c&\livelink{chap:flag}{flag} \\
1117 \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}&0x0d&constant \\
1118 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&0x0e&string \\
1119 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata}&0x0f&constant \\
1120 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}&0x10&reference \\
1121 \livelink{chap:DWFORMref1}{DW\-\_FORM\-\_ref1}&0x11&reference \\
1122 \livelink{chap:DWFORMref2}{DW\-\_FORM\-\_ref2}&0x12&reference \\
1123 \livelink{chap:DWFORMref4}{DW\-\_FORM\-\_ref4}&0x13&reference \\
1124 \livelink{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}&0x14&reference \\
1125 \livelink{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}&0x15&reference \\
1126 \livelink{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect}&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1127 \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} \ddag &0x17&\livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr}, \livelink{chap:rangelistptr}{rangelistptr} \\
1128 \livelink{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc} \ddag &0x18&\livelink{chap:exprloc}{exprloc} \\
1129 \livelink{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present} \ddag &0x19&\livelink{chap:flag}{flag} \\
1130 \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8} \ddag &0x20&reference \\
1133 \ddag FORM new in DWARF Version 4
1136 \section{Variable Length Data}
1137 \label{datarep:variablelengthdata}
1138 \addtoindexx{variable length data|see {LEB128}}
1139 \addtoindexx{LEB128 encoding}
1140 Integers may be encoded using ``Little Endian Base 128''
1141 (LEB128) numbers. LEB128 is a scheme for encoding integers
1142 densely that exploits the assumption that most integers are
1145 This encoding is equally suitable whether the target machine
1146 architecture represents data in big\dash\ endian or little\dash endian
1147 order. It is ``little\dash endian'' only in the sense that it
1148 avoids using space to represent the ``big'' end of an
1149 unsigned integer, when the big end is all zeroes or sign
1152 Unsigned LEB128 (ULEB128) numbers are encoded as follows:
1153 start at the low order end of an unsigned integer and chop
1154 it into 7\dash bit chunks. Place each chunk into the low order 7
1155 bits of a byte. Typically, several of the high order bytes
1156 will be zero; discard them. Emit the remaining bytes in a
1157 stream, starting with the low order byte; set the high order
1158 bit on each byte except the last emitted byte. The high bit
1159 of zero on the last byte indicates to the decoder that it
1160 has encountered the last byte.
1162 The integer zero is a special case, consisting of a single
1165 Table \refersec{tab:examplesofunsignedleb128encodings}
1166 gives some examples of unsigned LEB128 numbers. The
1167 0x80 in each case is the high order bit of the byte, indicating
1168 that an additional byte follows.
1171 The encoding for signed, two’s complement LEB128 (SLEB128)
1172 numbers is similar, except that the criterion for discarding
1173 high order bytes is not whether they are zero, but whether
1174 they consist entirely of sign extension bits. Consider the
1175 32\dash bit integer -2. The three high level bytes of the number
1176 are sign extension, thus LEB128 would represent it as a single
1177 byte containing the low order 7 bits, with the high order
1178 bit cleared to indicate the end of the byte stream. Note
1179 that there is nothing within the LEB128 representation that
1180 indicates whether an encoded number is signed or unsigned. The
1181 decoder must know what type of number to expect.
1182 Table \refersec{tab:examplesofunsignedleb128encodings}
1183 gives some examples of unsigned LEB128 numbers and
1184 Table \refersec{tab:examplesofsignedleb128encodings}
1185 gives some examples of signed LEB128 numbers.
1187 Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1188 gives algorithms for encoding and decoding these forms.
1192 \setlength{\extrarowheight}{0.1cm}
1193 \begin{longtable}{l|l|l}
1194 \caption{Examples of unsigned LEB128 encodings} \label{tab:examplesofunsignedleb128encodings} \\
1195 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1197 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1199 \hline \emph{Continued on next page}
1205 128& 0 + 0x80 & 1 \\
1206 129& 1 + 0x80 & 1 \\
1207 130& 2 + 0x80 & 1 \\
1208 12857& 57 + 0x80 & 100 \\
1209 \addtoindex{LEB128 encoding!examples}
1216 \setlength{\extrarowheight}{0.1cm}
1217 \begin{longtable}{l|l|l}
1218 \caption{Examples of signed LEB128 encodings} \label{tab:examplesofsignedleb128encodings} \\
1219 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1221 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1223 \hline \emph{Continued on next page}
1229 127& 127 + 0x80 & 0 \\
1230 -127& 1 + 0x80 & 0x7f \\
1231 128& 0 + 0x80 & 1 \\
1232 -128& 0 + 0x80 & 0x7f \\
1233 129& 1 + 0x80 & 1 \\
1234 -129& -x7f + 0x80 & 0xtc \\
1241 \section{DWARF Expressions and Location Descriptions}
1242 \label{datarep:dwarfexpressionsandlocationdescriptions}
1243 \subsection{DWARF Expressions}
1244 \label{datarep:dwarfexpressions}
1246 A DWARF expression is stored in a \nolink{block} of contiguous
1247 bytes. The bytes form a sequence of operations. Each operation
1248 is a 1\dash byte code that identifies that operation, followed by
1249 zero or more bytes of additional data. The encodings for the
1250 operations are described in
1251 Table \refersec{tab:dwarfoperationencodings}.
1254 \setlength{\extrarowheight}{0.1cm}
1255 \begin{longtable}{l|l|l|l}
1256 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1257 \hline \\ & &\bfseries No. of &\\
1258 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1260 & &\bfseries No. of &\\
1261 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1263 \hline \emph{Continued on next page}
1268 \livelink{chap:DWOPaddr}{DW\-\_OP\-\_addr}&0x03&1 & constant address \\
1269 & & &(size target specific) \\
1271 \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}&0x06&0 & \\
1274 \livelink{chap:DWOPconst1u}{DW\-\_OP\-\_const1u}&0x08&1&1\dash byte constant \\
1275 \livelink{chap:DWOPconst1s}{DW\-\_OP\-\_const1s}&0x09&1&1\dash byte constant \\
1276 \livelink{chap:DWOPconst2u}{DW\-\_OP\-\_const2u}&0x0a&1&2\dash byte constant \\
1277 \livelink{chap:DWOPconst2s}{DW\-\_OP\-\_const2s}&0x0b&1&2\dash byte constant \\
1278 \livelink{chap:DWOPconst4u}{DW\-\_OP\-\_const4u}&0x0c&1&4\dash byte constant \\
1279 \livelink{chap:DWOPconst4s}{DW\-\_OP\-\_const4s}&0x0d&1&4\dash byte constant \\
1280 \livelink{chap:DWOPconst8u}{DW\-\_OP\-\_const8u}&0x0e&1&8\dash byte constant \\
1281 \livelink{chap:DWOPconst8s}{DW\-\_OP\-\_const8s}&0x0f&1&8\dash byte constant \\
1282 \livelink{chap:DWOPconstu}{DW\-\_OP\-\_constu}&0x10&1&ULEB128 constant \\
1283 \livelink{chap:DWOPconsts}{DW\-\_OP\-\_consts}&0x11&1&SLEB128 constant \\
1284 \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}&0x12&0 & \\
1285 \livelink{chap:DWOPdrop}{DW\-\_OP\-\_drop}&0x13&0 & \\
1286 \livelink{chap:DWOPover}{DW\-\_OP\-\_over}&0x14&0 & \\
1287 \livelink{chap:DWOPpick}{DW\-\_OP\-\_pick}&0x15&1&1\dash byte stack index \\
1288 \livelink{chap:DWOPswap}{DW\-\_OP\-\_swap}&0x16&0 & \\
1289 \livelink{chap:DWOProt}{DW\-\_OP\-\_rot}&0x17&0 & \\
1290 \livelink{chap:DWOPxderef}{DW\-\_OP\-\_xderef}&0x18&0 & \\
1291 \livelink{chap:DWOPabs}{DW\-\_OP\-\_abs}&0x19&0 & \\
1292 \livelink{chap:DWOPand}{DW\-\_OP\-\_and}&0x1a&0 & \\
1293 \livelink{chap:DWOPdiv}{DW\-\_OP\-\_div}&0x1b&0 & \\
1297 \livelink{chap:DWOPminus}{DW\-\_OP\-\_minus}&0x1c&0 & \\
1298 \livelink{chap:DWOPmod}{DW\-\_OP\-\_mod}&0x1d&0 & \\
1299 \livelink{chap:DWOPmul}{DW\-\_OP\-\_mul}&0x1e&0 & \\
1300 \livelink{chap:DWOPneg}{DW\-\_OP\-\_neg}&0x1f&0 & \\
1301 \livelink{chap:DWOPnot}{DW\-\_OP\-\_not}&0x20&0 & \\
1302 \livelink{chap:DWOPor}{DW\-\_OP\-\_or}&0x21&0 & \\
1303 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}&0x22&0 & \\
1304 \livelink{chap:DWOPplusuconst}{DW\-\_OP\-\_plus\-\_uconst}&0x23&1&ULEB128 addend \\
1305 \livelink{chap:DWOPshl}{DW\-\_OP\-\_shl}&0x24&0 & \\
1306 \livelink{chap:DWOPshr}{DW\-\_OP\-\_shr}&0x25&0 & \\
1307 \livelink{chap:DWOPshra}{DW\-\_OP\-\_shra}&0x26&0 & \\
1308 \livelink{chap:DWOPxor}{DW\-\_OP\-\_xor}&0x27&0 & \\
1309 \livelink{chap:DWOPskip}{DW\-\_OP\-\_skip}&0x2f&1&signed 2\dash byte constant \\
1310 \livelink{chap:DWOPbra}{DW\-\_OP\-\_bra}&0x28&1 & signed 2\dash byte constant \\
1311 \livelink{chap:DWOPeq}{DW\-\_OP\-\_eq}&0x29&0 & \\
1312 \livelink{chap:DWOPge}{DW\-\_OP\-\_ge}&0x2a&0 & \\
1313 \livelink{chap:DWOPgt}{DW\-\_OP\-\_gt}&0x2b&0 & \\
1314 \livelink{chap:DWOPle}{DW\-\_OP\-\_le}&0x2c&0 & \\
1315 \livelink{chap:DWOPlt}{DW\-\_OP\-\_lt}&0x2d&0 & \\
1316 \livelink{chap:DWOPne}{DW\-\_OP\-\_ne}&0x2e&0 & \\ \hline
1320 \livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0}&0x30 & 0 & \\
1322 \livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1}&0x31 & 0& literals 0 .. 31 = \\
1323 \ldots & & & (\livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0} + literal) \\
1324 \livelink{chap:DWOPlit31}{DW\-\_OP\-\_lit31}&0x4f & 0 & \\ \hline
1326 \livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} & 0x50 & 0 & \\
1327 \livelink{chap:DWOPreg1}{DW\-\_OP\-\_reg1} & 0x51 & 0® 0 .. 31 = \\
1328 \ldots & & & (\livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} + regnum) \\
1329 \livelink{chap:DWOPreg31}{DW\-\_OP\-\_reg31} & 0x6f & 0 & \\ \hline
1331 \livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} & 0x70 &1 & SLEB128 offset \\
1332 \livelink{chap:DWOPbreg1}{DW\-\_OP\-\_breg1} & 0x71 & 1 &base register 0 .. 31 = \\
1333 ... & & &(\livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} + regnum) \\
1334 \livelink{chap:DWOPbreg31}{DW\-\_OP\-\_breg31} & 0x8f & 1 & \\ \hline
1336 \livelink{chap:DWOPregx}{DW\-\_OP\-\_regx} & 0x90 &1&ULEB128 register \\
1337 \livelink{chap:DWOPfbreg}{DW\-\_OP\-\_fbreg} & 0x91&1&SLEB128 offset \\
1338 \livelink{chap:DWOPbregx}{DW\-\_OP\-\_bregx} & 0x92&2 &ULEB128 register followed \\
1339 & & & by SLEB128 offset \\
1340 \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} & 0x93 &1& ULEB128 size of piece addressed \\
1341 \livelink{chap:DWOPderefsize}{DW\-\_OP\-\_deref\-\_size} & 0x94 &1& 1-byte size of data retrieved \\
1342 \livelink{chap:DWOPxderefsize}{DW\-\_OP\-\_xderef\-\_size} & 0x95&1&1-byte size of data retrieved \\
1343 \livelink{chap:DWOPnop}{DW\-\_OP\-\_nop} & 0x96 &0& \\
1346 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}&0x97&0 & \\
1347 \livelink{chap:DWOPcall2}{DW\-\_OP\-\_call2}&0x98&1& 2\dash byte offset of DIE \\
1348 \livelink{chap:DWOPcall4}{DW\-\_OP\-\_call4}&0x99&1& 4\dash byte offset of DIE \\
1349 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&0x9a&1& 4\dash\ or 8\dash byte\\
1350 &&& offset of DIE \\
1351 \livelink{chap:DWOPformtlsaddress}{DW\-\_OP\-\_form\-\_tls\-\_address}&0x9b &0& \\
1352 \livelink{chap:DWOPcallframecfa}{DW\-\_OP\-\_call\-\_frame\-\_cfa} &0x9c &0& \\
1353 \livelink{chap:DWOPbitpiece}{DW\-\_OP\-\_bit\-\_piece}&0x9d &2&ULEB128 size followed by \\
1355 \livelink{chap:DWOPimplicitvalue}{DW\-\_OP\-\_implicit\-\_value}&0x9e &2&ULEB128 size followed by \\
1356 &&&\nolink{block} of that size\\
1357 \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} &0x9f &0& \\
1358 \livetarg{chap:DWOPlouser}{DW\-\_OP\-\_lo\-\_user} &0xe0 && \\
1359 \livetarg{chap:DWOPhiuser}{DW\-\_OP\-\_hi\-\_user} &0xff && \\
1365 \subsection{Location Descriptions}
1366 \label{datarep:locationdescriptions}
1368 A location description is used to compute the
1369 location of a variable or other entity.
1371 \subsection{Location Lists}
1372 \label{datarep:locationlists}
1374 Each entry in a location list is either a location list entry,
1375 a base address selection entry, or an end of list entry.
1377 A location list entry consists of two address offsets followed
1378 by a 2\dash byte length, followed by a block of contiguous bytes
1379 that contains a DWARF location description. The length
1380 specifies the number of bytes in that block. The two offsets
1381 are the same size as an address on the target machine.
1383 A base address selection entry and an end of list entry each
1384 consist of two (constant or relocated) address offsets. The two
1385 offsets are the same size as an address on the target machine.
1387 For a location list to be specified, the base address of
1388 \addtoindexx{base address selection entry!in location list}
1389 the corresponding compilation unit must be defined
1390 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1392 \section{Base Type Attribute Encodings}
1393 \label{datarep:basetypeattributeencodings}
1395 The encodings of the
1396 \hypertarget{chap:DWATencodingencodingofbasetype}
1397 constants used in the
1398 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
1399 attribute are given in
1400 Table \refersec{tab:basetypeencodingvalues}
1403 \setlength{\extrarowheight}{0.1cm}
1404 \begin{longtable}{l|c}
1405 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1406 \hline \\ \bfseries Base type encoding code name&\bfseries Value \\ \hline
1408 \bfseries Base type encoding code name&\bfseries Value\\ \hline
1410 \hline \emph{Continued on next page}
1415 \livelink{chap:DWATEaddress}{DW\-\_ATE\-\_address}&0x01 \\
1416 \livelink{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}&0x02 \\
1417 \livelink{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}&0x03 \\
1418 \livelink{chap:DWATEfloat}{DW\-\_ATE\-\_float}&0x04 \\
1419 \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed}&0x05 \\
1420 \livelink{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}&0x06 \\
1421 \livelink{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned}&0x07 \\
1422 \livelink{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char}&0x08 \\
1423 \livelink{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}&0x09 \\
1424 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}&0x0a \\
1425 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}&0x0b \\
1426 \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}&0x0c \\
1427 \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed}&0x0d \\
1428 \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}&0x0e \\
1429 \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & 0x0f \\
1430 \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} \ddag & 0x10 \\
1431 \livetarg{chap:DWATElouser}{DW\-\_ATE\-\_lo\-\_user} & 0x80 \\
1432 \livetarg{chap:DWATEhiuser}{DW\-\_ATE\-\_hi\-\_user} & 0xff \\
1435 \ddag Base type encoding new in DWARF Version 4
1439 The encodings of the constants used in the
1440 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute
1442 Table \refersec{tab:decimalsignencodings}.
1446 \setlength{\extrarowheight}{0.1cm}
1447 \begin{longtable}{l|c}
1448 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1449 \hline \\ \bfseries Decimal sign code name&\bfseries Value \\ \hline
1451 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1453 \hline \emph{Continued on next page}
1458 \livelink{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & 0x01 \\
1459 \livelink{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & 0x02 \\
1460 \livelink{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & 0x03 \\
1461 \livelink{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate} & 0x04 \\
1462 \livelink{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate} & 0x05 \\
1467 The encodings of the constants used in the
1468 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute are given in
1469 Table \refersec{tab:endianityencodings}.
1472 \setlength{\extrarowheight}{0.1cm}
1473 \begin{longtable}{l|c}
1474 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1475 \hline \\ \bfseries Endian code name&\bfseries Value \\ \hline
1477 \bfseries Endian code name&\bfseries Value\\ \hline
1479 \hline \emph{Continued on next page}
1484 \livelink{chap:DWENDdefault}{DW\-\_END\-\_default} & 0x00 \\
1485 \livelink{chap:DWENDbig}{DW\-\_END\-\_big} & 0x01 \\
1486 \livelink{chap:DWENDlittle}{DW\-\_END\-\_little} & 0x02 \\
1487 \livetarg{chap:DWENDlouser}{DW\-\_END\-\_lo\-\_user} & 0x40 \\
1488 \livetarg{chap:DWENDhiuser}{DW\-\_END\-\_hi\-\_user} & 0xff \\
1493 \section{Accessibility Codes}
1494 \label{datarep:accessibilitycodes}
1495 The encodings of the constants used in the
1496 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1498 \addtoindexx{accessibility attribute!encoding}
1500 Table \refersec{tab:accessibilityencodings}.
1503 \setlength{\extrarowheight}{0.1cm}
1504 \begin{longtable}{l|c}
1505 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1506 \hline \\ \bfseries Accessibility code name&\bfseries Value \\ \hline
1508 \bfseries Accessibility code name&\bfseries Value\\ \hline
1510 \hline \emph{Continued on next page}
1515 \livelink{chap:DWACCESSpublic}{DW\-\_ACCESS\-\_public}&0x01 \\
1516 \livelink{chap:DWACCESSprotected}{DW\-\_ACCESS\-\_protected}&0x02 \\
1517 \livelink{chap:DWACCESSprivate}{DW\-\_ACCESS\-\_private}&0x03 \\
1523 \section{Visibility Codes}
1524 \label{datarep:visibilitycodes}
1525 The encodings of the constants used in the
1526 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility} attribute are given in
1527 Table \refersec{tab:visibilityencodings}.
1530 \setlength{\extrarowheight}{0.1cm}
1531 \begin{longtable}{l|c}
1532 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
1533 \hline \\ \bfseries Visiibility code name&\bfseries Value \\ \hline
1535 \bfseries Visibility code name&\bfseries Value\\ \hline
1537 \hline \emph{Continued on next page}
1542 \livelink{chap:DWVISlocal}{DW\-\_VIS\-\_local}&0x01 \\
1543 \livelink{chap:DWVISexported}{DW\-\_VIS\-\_exported}&0x02 \\
1544 \livelink{chap:DWVISqualified}{DW\-\_VIS\-\_qualified}&0x03 \\
1549 \section{Virtuality Codes}
1550 \label{datarep:vitualitycodes}
1552 The encodings of the constants used in the
1553 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute are given in
1554 Table \refersec{tab:virtualityencodings}.
1557 \setlength{\extrarowheight}{0.1cm}
1558 \begin{longtable}{l|c}
1559 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
1560 \hline \\ \bfseries Virtuality code name&\bfseries Value \\ \hline
1562 \bfseries Virtuality code name&\bfseries Value\\ \hline
1564 \hline \emph{Continued on next page}
1569 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none}&0x00 \\
1570 \livelink{chap:DWVIRTUALITYvirtual}{DW\-\_VIRTUALITY\-\_virtual}&0x01 \\
1571 \livelink{chap:DWVIRTUALITYpurevirtual}{DW\-\_VIRTUALITY\-\_pure\-\_virtual}&0x02 \\
1579 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none} is equivalent to the absence of the
1580 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
1583 \section{Source Languages}
1584 \label{datarep:sourcelanguages}
1586 The encodings of the constants used in the \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
1587 attribute are given in
1588 Table \refersec{tab:languageencodings}.
1590 % If we don't force a following space it looks odd
1592 and their associated values are reserved, but the
1593 languages they represent are not well supported.
1594 Table \refersec{tab:languageencodings}
1595 also shows the default lower bound, if any, assumed for
1596 an omitted \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound} attribute in the context of a
1597 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} debugging information entry for each
1601 \setlength{\extrarowheight}{0.1cm}
1602 \begin{longtable}{l|c|c}
1603 \caption{Language encodings} \label{tab:languageencodings}\\
1604 \hline \\ \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
1606 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
1608 \hline \emph{Continued on next page}
1613 \livelink{chap:DWLANGC89}{DW\-\_LANG\-\_C89}&0x0001&0 \\
1614 \livelink{chap:DWLANGC}{DW\-\_LANG\-\_C}&0x0002&0 \\
1615 \livelink{chap:DWLANGAda83}{DW\-\_LANG\-\_Ada83} \dag &0x0003&1 \addtoindexx{Ada} \\
1616 \livelink{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus} &0x0004&0 \\
1617 \livelink{chap:DWLANGCobol74}{DW\-\_LANG\-\_Cobol74} \dag &0x0005&1 \\
1618 \livelink{chap:DWLANGCobol85}{DW\-\_LANG\-\_Cobol85} \dag &0x0006&1 \\
1619 \livelink{chap:DWLANGFortran77}{DW\-\_LANG\-\_Fortran77}&0x0007&1 \\
1620 \livelink{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90}&0x0008&1 \\
1621 \livelink{chap:DWLANGPascal83}{DW\-\_LANG\-\_Pascal83}&0x0009&1 \\
1622 \livelink{chap:DWLANGModula2}{DW\-\_LANG\-\_Modula2}&0x000a&1 \\
1623 \livelink{chap:DWLANGJava}{DW\-\_LANG\-\_Java}&0x000b&0 \\
1624 \livelink{chap:DWLANGC99}{DW\-\_LANG\-\_C99}&0x000c&0 \\
1625 \livelink{chap:DWLANGAda95}{DW\-\_LANG\-\_Ada95} \dag &0x000d&1 \addtoindexx{Ada} \\
1626 \livelink{chap:DWLANGFortran95}{DW\-\_LANG\-\_Fortran95} &0x000e&1 \\
1627 \livelink{chap:DWLANGPLI}{DW\-\_LANG\-\_PLI} \dag &0x000f&1 \\
1628 \livelink{chap:DWLANGObjC}{DW\-\_LANG\-\_ObjC}&0x0010&0 \\
1629 \livelink{chap:DWLANGObjCplusplus}{DW\-\_LANG\-\_ObjC\-\_plus\-\_plus}&0x0011&0 \\
1630 \livelink{chap:DWLANGUPC}{DW\-\_LANG\-\_UPC}&0x0012&0 \\
1631 \livelink{chap:DWLANGD}{DW\-\_LANG\-\_D}&0x0013&0 \\
1632 \livelink{chap:DWLANGPython}{DW\-\_LANG\-\_Python} \dag &0x0014&0 \\
1633 \livetarg{chap:DWLANGlouser}{DW\-\_LANG\-\_lo\-\_user}&0x8000 & \\
1634 \livetarg{chap:DWLANGhiuser}{DW\-\_LANG\-\_hi\-\_user}&0xffff & \\
1640 \section{Address Class Encodings}
1641 \label{datarep:addressclassencodings}
1643 The value of the common
1644 \addtoindexi{address}{address class!attribute encoding}
1646 \livelink{chap:DWADDRnone}{DW\-\_ADDR\-\_none} is 0.
1649 \section{Identifier Case}
1650 \label{datarep:identifiercase}
1652 The encodings of the constants used in the
1653 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case} attribute are given in
1654 Table \refersec{tab:identifiercaseencodings}.
1657 \setlength{\extrarowheight}{0.1cm}
1658 \begin{longtable}{l|c}
1659 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
1660 \hline \\ \bfseries Identifier case name&\bfseries Value \\ \hline
1662 \bfseries Identifier case name&\bfseries Value\\ \hline
1664 \hline \emph{Continued on next page}
1668 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive}&0x00 \\
1669 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case}&0x01 \\
1670 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case}&0x02 \\
1671 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive}&0x03 \\
1675 \section{Calling Convention Encodings}
1676 \label{datarep:callingconventionencodings}
1677 The encodings of the constants used in the
1678 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention} attribute are given in
1679 Table \refersec{tab:callingconventionencodings}.
1682 \setlength{\extrarowheight}{0.1cm}
1683 \begin{longtable}{l|c}
1684 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
1685 \hline \\ \bfseries Calling Convention name&\bfseries Value \\ \hline
1687 \bfseries Calling Convention name&\bfseries Value\\ \hline
1689 \hline \emph{Continued on next page}
1694 \livelink{chap:DWCCnormal}{DW\-\_CC\-\_normal}&0x01 \\
1695 \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}&0x02 \\
1696 \livelink{chap:DWCCnocall}{DW\-\_CC\-\_nocall}&0x03 \\
1697 \livetarg{chap:DWCClouser}{DW\-\_CC\-\_lo\-\_user}&0x40 \\
1698 \livetarg{chap:DWCChiuser}{DW\-\_CC\-\_hi\-\_user}&0xff \\
1703 \section{Inline Codes}
1704 \label{datarep:inlinecodes}
1706 The encodings of the constants used in the
1707 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute are given in
1708 Table \refersec{tab:inlineencodings}.
1711 \setlength{\extrarowheight}{0.1cm}
1712 \begin{longtable}{l|c}
1713 \caption{Inline encodings} \label{tab:inlineencodings}\\
1714 \hline \\ \bfseries Iline Code name&\bfseries Value \\ \hline
1716 \bfseries Iline Code name&\bfseries Value\\ \hline
1718 \hline \emph{Continued on next page}
1723 \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}&0x00 \\
1724 \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}&0x01 \\
1725 \livelink{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined}&0x02 \\
1726 \livelink{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined}&0x03 \\
1731 % this clearpage is ugly, but the following table came
1732 % out oddly without it.
1734 \section{Array Ordering}
1735 \label{datarep:arrayordering}
1737 The encodings of the constants used in the
1738 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute are given in
1739 Table \refersec{tab:orderingencodings}.
1742 \setlength{\extrarowheight}{0.1cm}
1743 \begin{longtable}{l|c}
1744 \caption{Ordering encodings} \label{tab:orderingencodings}\\
1745 \hline \\ \bfseries Ordering name&\bfseries Value \\ \hline
1747 \bfseries Ordering name&\bfseries Value\\ \hline
1749 \hline \emph{Continued on next page}
1754 \livelink{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}&0x00 \\
1755 \livelink{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major}&0x01 \\
1761 \section{Discriminant Lists}
1762 \label{datarep:discriminantlists}
1764 The descriptors used in the
1765 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute are
1766 encoded as 1\dash byte constants. The
1767 defined values are given in
1768 Table \refersec{tab:discriminantdescriptorencodings}.
1770 % Odd that the 'Name' field captalized here, it is not caps elsewhere.
1772 \setlength{\extrarowheight}{0.1cm}
1773 \begin{longtable}{l|c}
1774 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
1775 \hline \\ \bfseries Descriptor Name&\bfseries Value \\ \hline
1777 \bfseries Descriptor Name&\bfseries Value\\ \hline
1779 \hline \emph{Continued on next page}
1784 \livetarg{chap:DWDSClabel}{DW\-\_DSC\-\_label}&0x00 \\
1785 \livetarg{chap:DWDSCrange}{DW\-\_DSC\-\_range}&0x01 \\
1790 \section{Name Lookup Tables}
1791 \label{datarep:namelookuptables}
1793 Each set of entries in the table of global names contained
1794 in the \addtoindex{.debug\_pubnames} and
1795 \addtoindex{.debug\_pubtypes} sections begins
1796 with a header consisting of:
1799 \begin{enumerate}[1.]
1800 \item unit\_length (initial length) \\
1801 A 4\dash byte or 12\dash byte unsigned integer representing the length
1802 of the \addtoindex{.debug\_info}
1803 contribution for that compilation unit,
1804 not including the length field itself. In the 32\dash bit DWARF
1805 format, this is a 4\dash byte unsigned integer (which must be less
1806 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
1807 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
1808 integer that gives the actual length
1809 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1811 \item version (uhalf)
1812 A 2\dash byte unsigned integer representing the version of the
1813 DWARF information\addtoindexx{version number!compilation unit} for the compilation unit
1814 \addtoindexx{version number!name lookup table}
1815 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1816 The value in this field is 4.
1818 % Some say unsigned offset this just says offset: FIXME
1819 \item debug\_info\_offset (section offset) \\
1820 A 4\dash byte or 8\dash byte offset into the
1821 \addtoindex{.debug\_info}
1822 section of the compilation unit header.
1824 the 32\dash bit DWARF format, this is a 4\dash byte unsigned offset;
1825 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned offsets
1826 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1828 \item debug\_info\_length (section length) \\
1829 A 4\dash byte or 8\dash byte length containing the size in bytes of the
1830 contents of the \addtoindex{.debug\_info}
1831 section generated to represent
1832 this compilation unit. In the 32\dash bit DWARF format, this is
1833 a 4\dash byte unsigned length; in the 64\dash bit DWARF format, this
1834 is an 8-byte unsigned length
1835 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1840 This header is followed by a series of tuples. Each tuple
1841 consists of a 4\dash byte or 8\dash byte offset followed by a string
1842 of non\dash null bytes terminated by one null byte.
1844 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
1845 format, it is an 8\dash byte offset.
1846 Each set is terminated by an
1847 offset containing the value 0.
1850 \section{Address Range Table}
1851 \label{datarep:addrssrangetable}
1853 Each set of entries in the table of address ranges contained
1854 in the \addtoindex{.debug\_aranges}
1855 section begins with a header containing:
1857 \begin{enumerate}[1.]
1858 % FIXME The unit length text is not fully consistent across
1861 \item unit\_length (initial length) \\
1862 A 4-byte or 12-byte length containing the length of the
1863 set of entries for this compilation unit, not including the
1864 length field itself. In the 32-bit DWARF format, this is a
1865 4-byte unsigned integer (which must be less than 0xfffffff0);
1866 in the 64-bit DWARF format, this consists of the 4-byte value
1867 0xffffffff followed by an 8-byte unsigned integer that gives
1869 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1871 \item version (uhalf) \\
1872 A 2\dash byte version identifier
1873 \addtoindexx{version number!address range table} containing the value 2
1874 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1876 \item debug\_info\_offset (section offset) \\
1877 A 4\dash byte or 8\dash byte offset into the
1878 \addtoindex{.debug\_info} section of
1879 the compilation unit header. In the 32\dash bit DWARF format,
1880 this is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
1881 this is an 8\dash byte unsigned offset
1882 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1884 \item address\_size (ubyte) \\
1885 A 1\dash byte unsigned integer containing the size in bytes of an
1886 \addtoindexx{address\_size}
1887 address (or the offset portion of an address for segmented
1888 \addtoindexx{address space!segmented}
1889 addressing) on the target system.
1891 \item segment\_size (ubyte) \\
1892 A 1\dash byte unsigned integer containing the size in bytes of a
1893 segment selector on the target system.
1897 This header is followed by a series of tuples. Each tuple
1898 consists of a segment, an address and a length.
1900 size is given by the segment\_size field of the header; the
1901 address and length size are each given by the address\_size
1902 field of the header.
1903 The first tuple following the header in
1904 each set begins at an offset that is a multiple of the size
1905 of a single tuple (that is, the size of a segment selector
1906 plus twice the size of an address).
1907 The header is padded, if
1908 necessary, to that boundary. Each set of tuples is terminated
1909 by a 0 for the segment, a 0 for the address and 0 for the
1910 length. If the segment\_size field in the header is zero,
1911 the segment selectors are omitted from all tuples, including
1912 the terminating tuple.
1915 \section{Line Number Information}
1916 \label{datarep:linenumberinformation}
1918 The \addtoindexi{version number}{version number!line number information}
1919 in the line number program header is 4
1920 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1922 The boolean values ``true'' and ``false''
1923 used by the line number information program are encoded
1924 as a single byte containing the value 0
1925 for ``false,'' and a non-zero value for ``true.''
1927 The encodings for the standard opcodes are given in
1928 Table \refersec{tab:linenumberstandardopcodeencodings}.
1930 % Odd that the 'Name' field captalized here, it is not caps elsewhere.
1932 \setlength{\extrarowheight}{0.1cm}
1933 \begin{longtable}{l|c}
1934 \caption{Line Number Standard Opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
1935 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
1937 \bfseries Opcode Name&\bfseries Value\\ \hline
1939 \hline \emph{Continued on next page}
1944 \livelink{chap:DWLNScopy}{DW\-\_LNS\-\_copy}&0x01 \\
1945 \livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}&0x02 \\
1946 \livelink{chap:DWLNSadvanceline}{DW\-\_LNS\-\_advance\-\_line}&0x03 \\
1947 \livelink{chap:DWLNSsetfile}{DW\-\_LNS\-\_set\-\_file}&0x04 \\
1948 \livelink{chap:DWLNSsetcolumn}{DW\-\_LNS\-\_set\-\_column}&0x05 \\
1949 \livelink{chap:DWLNSnegatestmt}{DW\-\_LNS\-\_negate\-\_stmt}&0x06 \\
1950 \livelink{chap:DWLNSsetbasicblock}{DW\-\_LNS\-\_set\-\_basic\-\_block}&0x07 \\
1951 \livelink{chap:DWLNSconstaddpc}{DW\-\_LNS\-\_const\-\_add\-\_pc}*0x08 \\
1952 \livelink{chap:DWLNSfixedadvancepc}{DW\-\_LNS\-\_fixed\-\_advance\-\_pc}&0x09 \\
1953 \livelink{chap:DWLNSsetprologueend}{DW\-\_LNS\-\_set\-\_prologue\-\_end}&0x0a \\
1954 \livelink{chap:DWLNSsetepiloguebegin}{DW\-\_LNS\-\_set\-\_epilogue\-\_begin}&0x0b \\
1955 \livelink{chap:DWLNSsetisa}{DW\-\_LNS\-\_set\-\_isa}&0x0c \\
1961 The encodings for the extended opcodes are given in
1962 Table \refersec{tab:linenumberextendedopcodeencodings}.
1965 \setlength{\extrarowheight}{0.1cm}
1966 \begin{longtable}{l|c}
1967 \caption{Line Number Extended Opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
1968 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
1970 \bfseries Opcode Name&\bfseries Value\\ \hline
1972 \hline \emph{Continued on next page}
1977 \livelink{chap:DWLNEendsequence}{DW\-\_LNE\-\_end\-\_sequence}&0x01 \\
1978 \livelink{chap:DWLNEsetaddress}{DW\-\_LNE\-\_set\-\_address}&0x02\\
1979 \livelink{chap:DWLNEdefinefile}{DW\-\_LNE\-\_define\-\_file}&0x03\\
1980 \livelink{chap:DWLNEsetdiscriminator}{DW\-\_LNE\-\_set\-\_discriminator} \ddag &0x04 \\
1981 \livetarg{chap:DWLNElouser}{DW\-\_LNE\-\_lo\-\_user}&0x80 \\
1982 \livetarg{chap:DWLNEhiuser}{DW\-\_LNE\-\_hi\-\_user}&0xff \\
1985 \ddag Extended opcode new in DWARF Version 4.
1988 \section{Macro Information}
1989 \label{datarep:macroinformation}
1991 The source line numbers and source file indices encoded in the
1992 macro information section are represented as unsigned LEB128
1993 numbers as are the constants in a
1994 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext} entry.
1996 The macinfo type is encoded as a single byte.
1997 The encodings are given in
1998 Table \refersec{tab:macinfotypeencodings}.
2002 \setlength{\extrarowheight}{0.1cm}
2003 \begin{longtable}{l|c}
2004 \caption{Macinfo Type Encodings} \label{tab:macinfotypeencodings}\\
2005 \hline \\ \bfseries Macinfo Type Name&\bfseries Value \\ \hline
2007 \bfseries Macinfo Type Name&\bfseries Value\\ \hline
2009 \hline \emph{Continued on next page}
2014 \livelink{chap:DWMACINFOdefine}{DW\-\_MACINFO\-\_define}&0x01 \\
2015 \livelink{chap:DWMACINFOundef}{DW\-\_MACINFO\-\_undef}&0x02 \\
2016 \livelink{chap:DWMACINFOstartfile}{DW\-\_MACINFO\-\_start\-\_file}&0x03 \\
2017 \livelink{chap:DWMACINFOendfile}{DW\-\_MACINFO\-\_end\-\_file}&0x04 \\
2018 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext}&0xff \\
2023 \section{Call Frame Information}
2024 \label{datarep:callframeinformation}
2026 In the 32\dash bit DWARF format, the value of the CIE id in the
2027 CIE header is 0xffffffff; in the 64\dash bit DWARF format, the
2028 value is 0xffffffffffffffff.
2030 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2031 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2033 Call frame instructions are encoded in one or more bytes. The
2034 primary opcode is encoded in the high order two bits of
2035 the first byte (that is, opcode = byte >> 6). An operand
2036 or extended opcode may be encoded in the low order 6
2037 bits. Additional operands are encoded in subsequent bytes.
2038 The instructions and their encodings are presented in
2039 Table \refersec{tab:callframeinstructionencodings}.
2042 \setlength{\extrarowheight}{0.1cm}
2043 \begin{longtable}{l|c|c|l|l}
2044 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2045 \hline \\ &\bfseries High 2 &\bfseries Low 6 & & \\
2046 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2048 & \bfseries High 2 &\bfseries Low 6 & &\\
2049 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2051 \hline \emph{Continued on next page}
2056 \livelink{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\-\_loc}&0x1&delta & \\
2057 \livelink{chap:DWCFAoffset}{DW\-\_CFA\-\_offset}&0x2®ister&ULEB128 offset \\
2058 \livelink{chap:DWCFArestore}{DW\-\_CFA\-\_restore}&0x3®ister & & \\
2059 \livelink{chap:DWCFAnop}{DW\-\_CFA\-\_nop}&0&0 & & \\
2060 \livelink{chap:DWCFAsetloc}{DW\-\_CFA\-\_set\-\_loc}&0&0x01&address & \\
2061 \livelink{chap:DWCFAadvanceloc1}{DW\-\_CFA\-\_advance\-\_loc1}&0&0x02&1\dash byte delta & \\
2062 \livelink{chap:DWCFAadvanceloc2}{DW\-\_CFA\-\_advance\-\_loc2}&0&0x03&2\dash byte delta & \\
2063 \livelink{chap:DWCFAadvanceloc4}{DW\-\_CFA\-\_advance\-\_loc4}&0&0x04&4\dash byte delta & \\
2064 \livelink{chap:DWCFAoffsetextended}{DW\-\_CFA\-\_offset\-\_extended}&0&0x05&ULEB128 register&ULEB128 offset \\
2065 \livelink{chap:DWCFArestoreextended}{DW\-\_CFA\-\_restore\-\_extended}&0&0x06&ULEB128 register & \\
2066 \livelink{chap:DWCFAundefined}{DW\-\_CFA\-\_undefined}&0&0x07&ULEB128 register & \\
2067 \livelink{chap:DWCFAsamevalue}{DW\-\_CFA\-\_same\-\_value}&0&0x08 &ULEB128 register & \\
2068 \livelink{chap:DWCFAregister}{DW\-\_CFA\-\_register}&0&0x09&ULEB128 register &ULEB128 offset \\
2069 \livelink{chap:DWCFArememberstate}{DW\-\_CFA\-\_remember\-\_state}&0&0x0a & & \\
2070 \livelink{chap:DWCFArestorestate}{DW\-\_CFA\-\_restore\-\_state}&0&0x0b & & \\
2071 \livelink{chap:DWCFAdefcfa}{DW\-\_CFA\-\_def\-\_cfa}&0&0x0c &ULEB128 register&ULEB128 offset \\
2072 \livelink{chap:DWCFAdefcfaregister}{DW\-\_CFA\-\_def\-\_cfa\-\_register}&0&0x0d&ULEB128 register & \\
2073 \livelink{chap:DWCFAdefcfaoffset}{DW\-\_CFA\-\_def\-\_cfa\-\_offset}&0&0x0e &ULEB128 offset & \\
2074 \livelink{chap:DWCFAdefcfaexpression}{DW\-\_CFA\-\_def\-\_cfa\-\_expression}&0&0x0f &BLOCK \\
2075 \livelink{chap:DWCFAexpression}{DW\-\_CFA\-\_expression}&0&0x10&ULEB128 register & BLOCK \\
2077 \livelink{chap:DWCFAoffsetextendedsf}{DW\-\_CFA\-\_offset\-\_extended\-\_sf}&0&0x11&ULEB128 register&SLEB128 offset \\
2078 \livelink{chap:DWCFAdefcfasf}{DW\-\_CFA\-\_def\-\_cfa\-\_sf}&0&0x12&ULEB128 register&SLEB128 offset \\
2079 \livelink{chap:DWCFAdefcfaoffsetsf}{DW\-\_CFA\-\_def\-\_cfa\-\_offset\-\_sf}&0&0x13&SLEB128 offset & \\
2080 \livelink{chap:DWCFAvaloffset}{DW\-\_CFA\-\_val\-\_offset}&0&0x14&ULEB128&ULEB128 \\
2081 \livelink{chap:DWCFAvaloffsetsf}{DW\-\_CFA\-\_val\-\_offset\-\_sf}&0&0x15&ULEB128&SLEB128 \\
2082 \livelink{chap:DWCFAvalexpression}{DW\-\_CFA\-\_val\-\_expression}&0&0x16&ULEB128&BLOCK \\
2083 \livetarg{chap:DWCFAlouser}{DW\-\_CFA\-\_lo\-\_user}&0&0x1c & & \\
2084 \livetarg{chap:DWCFAhiuser}{DW\-\_CFA\-\_hi\-\_user}&0&0x3f & & \\
2088 \section{Non-continguous Address Ranges}
2089 \label{datarep:noncontiguousaddressranges}
2091 Each entry in a range list
2092 (see Section \refersec{chap:noncontiguousaddressranges})
2094 \addtoindexx{base address selection entry!in range list}
2095 range list entry, a base address selection entry, or an end
2098 A range list entry consists of two relative addresses. The
2099 addresses are the same size as addresses on the target machine.
2101 A base address selection entry and an end of list entry each
2102 \addtoindexx{base address selection entry!in range list}
2103 consist of two (constant or relocated) addresses. The two
2104 addresses are the same size as addresses on the target machine.
2106 For a range list to be specified, the base address of the
2107 \addtoindexx{base address selection entry!in range list}
2108 corresponding compilation unit must be defined
2109 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2112 \section{Dependencies and Constraints}
2113 \label{datarep:dependenciesandconstraints}
2115 The debugging information in this format is intended to
2117 the \addtoindex{.debug\_abbrev},
2118 \addtoindex{.debug\_aranges},
2119 \addtoindex{.debug\_frame},
2120 \addtoindex{.debug\_info},
2121 \addtoindex{.debug\_line},
2122 \addtoindex{.debug\_loc},
2123 \addtoindex{.debug\_macinfo},
2124 \addtoindex{.debug\_pubnames},
2125 \addtoindex{.debug\_pubtypes},
2126 \addtoindex{.debug\_ranges},
2127 \addtoindex{.debug\_str}
2129 \addtoindex{.debug\_types}
2130 sections of an object file, or equivalent
2131 separate file or database. The information is not
2132 word\dash aligned. Consequently: •
2135 \item For the 32\dash bit DWARF format and a target architecture with
2136 32\dash bit addresses, an assembler or compiler must provide a way
2137 to produce 2\dash byte and 4\dash byte quantities without alignment
2138 restrictions, and the linker must be able to relocate a
2139 4\dash byte address or section offset that occurs at an arbitrary
2142 \item For the 32\dash bit DWARF format and a target architecture with
2143 64\dash bit addresses, an assembler or compiler must provide a
2144 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2145 alignment restrictions, and the linker must be able to relocate
2146 an 8\dash byte address or 4\dash byte section offset that occurs at an
2147 arbitrary alignment.
2149 \item For the 64\dash bit DWARF format and a target architecture with
2150 32\dash bit addresses, an assembler or compiler must provide a
2151 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2152 alignment restrictions, and the linker must be able to relocate
2153 a 4\dash byte address or 8\dash byte section offset that occurs at an
2154 arbitrary alignment.
2156 \textit{It is expected that this will be required only for very large
2157 32\dash bit programs or by those architectures which support
2158 a mix of 32\dash bit and 64\dash bit code and data within the same
2161 \item For the 64\dash bit DWARF format and a target architecture with
2162 64\dash bit addresses, an assembler or compiler must provide a
2163 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2164 alignment restrictions, and the linker must be able to
2165 relocate an 8\dash byte address or section offset that occurs at
2166 an arbitrary alignment.
2169 \section{Integer Representation Names}
2170 \label{datarep:integerrepresentationnames}
2172 The sizes of the integers used in the lookup by name, lookup
2173 by address, line number and call frame information sections
2175 Table 41 \refersec{tab:integerrepresentationnames}.
2178 \setlength{\extrarowheight}{0.1cm}
2179 \begin{longtable}{c|l}
2180 \caption{Integer Representation Names} \label{tab:integerrepresentationnames}\\
2181 \hline \\ \bfseries Representation Name&\bfseries Representation \\ \hline
2183 \bfseries Representation Name&\bfseries Representation\\ \hline
2185 \hline \emph{Continued on next page}
2190 sbyte& signed, 1\dash byte integer \\
2191 ubyte&unsigned, 1\dash byte integer \\
2192 uhalf&unsigned, 2\dash byte integer \\
2193 uword&unsigned, 4\dash byte integer \\
2198 \section{Type Signature Computation}
2199 \label{datarep:typesignaturecomputation}
2201 A type signature is computed only by the DWARF producer;
2202 it is used by a DWARF consumer to resolve type references to
2203 the type definitions that are contained in type units.
2205 The type signature for a type T0 is formed from the MD5
2206 hash of a flattened description of the type. The flattened
2207 description of the type is a byte sequence derived from the
2208 DWARF encoding of the type as follows:
2210 \begin{enumerate}[1.]
2212 \item Start with an empty sequence S and a list V of visited
2213 types, where V is initialized to a list containing the type
2214 T0 as its single element. Elements in V are indexed from 1,
2217 \item If the debugging information entry represents a type that
2218 is nested inside another type or a namespace, append to S
2219 the type’s context as follows: For each surrounding type
2220 or namespace, beginning with the outermost such construct,
2221 append the letter 'C', the DWARF tag of the construct, and
2222 the name (taken from the \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute) of the type
2223 or namespace (including its trailing null byte).
2225 \item Append to S the letter 'D', followed by the DWARF tag of
2226 the debugging information entry.
2228 \item For each of the following attributes that are present in
2229 the debugging information entry, in the order listed below,
2230 append to S a marker letter (see below), the DWARF attribute
2231 code, and the attribute value.
2234 \item \livelink{chap:DWATname}{DW\-\_AT\-\_name}
2235 \item \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
2236 \item \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
2237 \item \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
2238 \item \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}
2239 \item \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}
2240 \item \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}
2241 \item \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
2242 \item \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
2243 \item \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
2244 \item \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
2245 \item \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
2246 \item \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
2247 \item \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
2248 \item \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
2249 \item \livelink{chap:DWATcount}{DW\-\_AT\-\_count}
2250 \item \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
2251 \item \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2252 \item \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
2253 \item \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
2254 \item \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}
2255 \item \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}
2256 \item \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
2257 \item \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}
2258 \item \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
2259 \item \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
2260 \item \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
2261 \item \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
2262 \item \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}
2263 \item \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}
2264 \item \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}
2265 \item \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}
2266 \item \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
2267 \item \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}
2268 \item \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}
2269 \item \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}
2270 \item \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}
2271 \item \livelink{chap:DWATsmall}{DW\-\_AT\-\_small}
2272 \item \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
2273 \item \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}
2274 \item \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}
2275 \item \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2276 \item \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}
2277 \item \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}
2278 \item \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}
2279 \item \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
2280 \item \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}
2281 \item \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}
2284 Note that except for the initial \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2285 attributes are appended in order according to the alphabetical
2286 spelling of their identifier.
2288 If an implementation defines any vendor-specific attributes,
2289 any such attributes that are essential to the definition of
2290 the type should also be included at the end of the above list,
2291 in their own alphabetical suborder.
2293 An attribute that refers to another type entry T is processed
2294 as follows: (a) If T is in the list V at some V[x], use the
2295 letter 'R' as the marker and use the unsigned LEB128 encoding
2296 of x as the attribute value; otherwise, (b) use the letter 'T'
2297 as the marker, process the type T recursively by performing
2298 Steps 2 through 7, and use the result as the attribute value.
2300 Other attribute values use the letter 'A' as the marker, and
2301 the value consists of the form code (encoded as an unsigned
2302 LEB128 value) followed by the encoding of the value according
2303 to the form code. To ensure reproducibility of the signature,
2304 the set of forms used in the signature computation is limited
2305 to the following: \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata},
2306 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag},
2307 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string},
2308 and \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}.
2310 \item If the tag in Step 3 is one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2311 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2312 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2313 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type},
2314 or \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, and the referenced
2315 type (via the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2316 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) has a
2317 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to S the letter 'N', the DWARF
2318 attribute code (\livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2319 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}), the context of
2320 the type (according to the method in Step 2), the letter 'E',
2321 and the name of the type. For \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, if the referenced
2322 entry is a \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}, the context is omitted and the
2323 name to be used is the ABI-specific name of the subprogram
2324 (e.g., the mangled linker name).
2327 \item 6.If the tag in Step 3 is not one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2328 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2329 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2330 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}, or
2331 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, but has
2332 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, or if the referenced type (via
2333 the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2334 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) does not have a
2335 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, the attribute is processed according to
2336 the method in Step 4 for an attribute that refers to another
2340 \item Visit each child C of the debugging information
2341 entry as follows: If C is a nested type entry or a member
2342 function entry, and has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to
2343 S the letter 'S', the tag of C, and its name; otherwise,
2344 process C recursively by performing Steps 3 through 7,
2345 appending the result to S. Following the last child (or if
2346 there are no children), append a zero byte.
2351 For the purposes of this algorithm, if a debugging information
2353 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
2354 attribute that refers to
2355 another entry D (which has a
2356 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}
2358 then S inherits the attributes and children of D, and S is
2359 processed as if those attributes and children were present in
2360 the entry S. Exception: if a particular attribute is found in
2361 both S and D, the attribute in S is used and the corresponding
2362 one in D is ignored.
2364 DWARF tag and attribute codes are appended to the sequence
2365 as unsigned LEB128 values, using the values defined earlier
2368 \textit{A grammar describing this computation may be found in
2369 Appendix \refersec{app:typesignaturecomputationgrammar}.
2372 \textit{An attribute that refers to another type entry should
2373 be recursively processed or replaced with the name of the
2374 referent (in Step 4, 5 or 6). If neither treatment applies to
2375 an attribute that references another type entry, the entry
2376 that contains that attribute should not be considered for a
2377 separate type unit.}
2379 \textit{If a debugging information entry contains an attribute from
2380 the list above that would require an unsupported form, that
2381 entry should not be considered for a separate type unit.}
2383 \textit{A type should be considered for a separate type unit only
2384 if all of the type entries that it contains or refers to in
2385 Steps 6 and 7 can themselves each be considered for a separate
2388 Where the DWARF producer may reasonably choose two or more
2389 different forms for a given attribute, it should choose
2390 the simplest possible form in computing the signature. (For
2391 example, a constant value should be preferred to a location
2392 expression when possible.)
2394 Once the string S has been formed from the DWARF encoding,
2395 an MD5 hash is computed for the string and the lower 64 bits
2396 are taken as the type signature.
2398 \textit{The string S is intended to be a flattened representation of
2399 the type that uniquely identifies that type (i.e., a different
2400 type is highly unlikely to produce the same string).}
2402 \textit{A debugging information entry should not be placed in a
2403 separate type unit if any of the following apply:}
2407 \item \textit{The entry has an attribute whose value is a location
2408 expression, and the location expression contains a reference to
2409 another debugging information entry (e.g., a \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}
2410 operator), as it is unlikely that the entry will remain
2411 identical across compilation units.}
2413 \item \textit{The entry has an attribute whose value refers
2414 to a code location or a location list.}
2416 \item \textit{The entry has an attribute whose value refers
2417 to another debugging information entry that does not represent
2422 \textit{Certain attributes are not included in the type signature:}
2425 \item \textit{The \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute is not included because it
2426 indicates that the debugging information entry represents an
2427 incomplete declaration, and incomplete declarations should
2428 not be placed in separate type units.}
2430 \item \textit{The \livelink{chap:DWATdescription}{DW\-\_AT\-\_description} attribute is not included because
2431 it does not provide any information unique to the defining
2432 declaration of the type.}
2434 \item \textit{The \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}, \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}, and
2435 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column} attributes are not included because they
2436 may vary from one source file to the next, and would prevent
2437 two otherwise identical type declarations from producing the