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}}
15 \addtoindexx{extensibility|see{vendor extensibility}}
16 reserve a portion of the DWARF name space and ranges of
17 enumeration values for use for vendor specific extensions,
18 special labels are reserved for tag names, attribute names,
19 base type encodings, location operations, language names,
20 calling conventions and call frame instructions.
22 The labels denoting the beginning and end of the reserved
23 value range for vendor specific extensions consist of the
24 appropriate prefix (DW\-\_TAG, DW\-\_AT, DW\-\_END, DW\-\_ATE, DW\-\_OP,
25 DW\-\_LANG, DW\-\_LNE, DW\-\_CC or DW\-\_CFA respectively) followed by
26 \_lo\_user or \_hi\_user.
27 \textit{For example, for entry tags, the special
28 labels are \livetarg{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user} and
29 \livetarg{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}.}
31 range between \textit{prefix}\_lo\_user and \textit{prefix}\_hi\_user inclusive,
32 are reserved for vendor specific extensions. Vendors may
33 use values in this range without conflicting with current or
34 future system\dash defined values. All other values are reserved
35 for use by the system.
37 \textit{There may also be codes for vendor specific extensions
38 between the number of standard line number opcodes and
39 the first special line number opcode. However, since the
40 number of standard opcodes varies with the DWARF version,
41 the range for extensions is also version dependent. Thus,
42 \livetarg{chap:DWLNSlouser}{DW\-\_LNS\-\_lo\-\_user} and
43 \livetarg{chap:DWLNShiuser}{DW\-\_LNS\-\_hi\-\_user} symbols are not defined.
46 Vendor defined tags, attributes, base type encodings, location
47 atoms, language names, line number actions, calling conventions
48 and call frame instructions, conventionally use the form
49 \text{prefix\_vendor\_id\_name}, where
50 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
51 character sequence chosen so as to avoid conflicts with
54 To ensure that extensions added by one vendor may be safely
55 ignored by consumers that do not understand those extensions,
56 the following rules should be followed:
59 \item New attributes should be added in such a way that a
60 debugger may recognize the format of a new attribute value
61 without knowing the content of that attribute value.
63 \item The semantics of any new attributes should not alter
64 the semantics of previously existing attributes.
66 \item The semantics of any new tags should not conflict with
67 the semantics of previously existing tags.
69 \item Do not add any new forms of attribute value.
74 \section{Reserved Values}
75 \label{datarep:reservedvalues}
76 \subsection{Error Values}
77 \label{datarep:errorvalues}
78 \addtoindexx{reserved values!error}
81 \addtoindexx{error value}
82 a convenience for consumers of DWARF information, the value
83 0 is reserved in the encodings for attribute names, attribute
84 forms, base type encodings, location operations, languages,
85 line number program opcodes, macro information entries and tag
86 names to represent an error condition or unknown value. DWARF
87 does not specify names for these reserved values, since they
88 do not represent valid encodings for the given type and should
89 not appear in DWARF debugging information.
92 \subsection{Initial Length Values}
93 \label{datarep:initiallengthvalues}
94 \addtoindexx{reserved values!initial length}
96 An \addtoindex{initial length field} is one of the length fields that occur
97 at the beginning of those DWARF sections that have a header
98 (\addtoindex{.debug\_aranges},
99 \addtoindex{.debug\_info},
100 \addtoindex{.debug\_types},
101 \addtoindex{.debug\_line},
102 \addtoindex{.debug\_pubnames}, and
103 \addtoindex{.debug\_pubtypes}) or the length field
104 that occurs at the beginning of the CIE and FDE structures
105 in the \addtoindex{.debug\_frame} section.
107 In an \addtoindex{initial length field}, the values 0xfffffff0 through
108 0xffffffff are reserved by DWARF to indicate some form of
109 extension relative to \addtoindex{DWARF Version 2}; such values must not
110 be interpreted as a length field. The use of one such value,
111 0xffffffff, is defined below
112 (see Section \refersec{datarep:32bitand64bitdwarfformats});
114 the other values is reserved for possible future extensions.
118 \section{Executable Objects and Shared Objects}
119 \label{datarep:executableobjectsandsharedobjects}
121 The relocated addresses in the debugging information for an
122 executable object are virtual addresses and the relocated
123 addresses in the debugging information for a shared object
124 are offsets relative to the start of the lowest region of
125 memory loaded from that shared object.
127 \textit{This requirement makes the debugging information for
128 shared objects position independent. Virtual addresses in a
129 shared object may be calculated by adding the offset to the
130 base address at which the object was attached. This offset
131 is available in the run\dash time linker’s data structures.}
135 \section{32-Bit and 64-Bit DWARF Formats}
136 \label{datarep:32bitand64bitdwarfformats}
138 \addtoindexx{32-bit DWARF format}
139 \addtoindexx{64-bit DWARF format}
140 There are two closely related file formats. In the 32\dash bit DWARF
141 format, all values that represent lengths of DWARF sections
142 and offsets relative to the beginning of DWARF sections are
143 represented using 32\dash bits. In the 64\dash bit DWARF format, all
144 values that represent lengths of DWARF sections and offsets
145 relative to the beginning of DWARF sections are represented
146 using 64\dash bits. A special convention applies to the initial
147 length field of certain DWARF sections, as well as the CIE and
148 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
149 can coexist and be distinguished within a single linked object.
151 The differences between the 32\dash\ and 64\dash bit
153 detailed in the following:
156 \begin{enumerate}[1.]
158 \item In the 32\dash bit DWARF format, an
159 \addtoindex{initial length field}
161 \addtoindex{initial length field!encoding}
162 Section \refersec{datarep:initiallengthvalues})
163 is an unsigned 32\dash bit integer (which
164 must be less than 0xfffffff0); in the 64\dash bit DWARF format,
165 an \addtoindex{initial length field} is 96 bits in size,
168 \item The first 32\dash bits have the value 0xffffffff.
170 \item The following 64\dash bits contain the actual length
171 represented as an unsigned 64\dash bit integer.
174 \textit{This representation allows a DWARF consumer to dynamically
175 detect that a DWARF section contribution is using the 64\dash bit
176 format and to adapt its processing accordingly.}
178 \item Section offset and section length fields that occur
179 in the headers of DWARF sections (other
180 \addtoindex{initial length field}
182 \addtoindex{initial length}
183 fields) are listed following. In the 32\dash bit DWARF format these
184 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
185 they are 64\dash bit unsigned integer values.
189 Section &Name & Role \\ \hline
190 \addtoindex{.debug\_ranges} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
191 \addtoindex{.debug\_frame}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
192 \addtoindex{.debug\_frame}/FDE & \addtoindex{CIE\_pointer} & offset in \addtoindex{.debug\_frame} \\
193 \addtoindex{.debug\_info} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_abbrev} \\
194 \addtoindex{.debug\_line} & \addtoindex{header\_length} & length of header itself \\
195 \addtoindex{.debug\_pubnames} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
196 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
198 \addtoindex{.debug\_pubtypes} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
199 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
201 \addtoindex{.debug\_types} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_info} \\
202 & \addtoindex{type\_offset} & offset in of \addtoindex{.debug\_types} \\
207 \textit{The CIE\_id field in a CIE structure must be 64 bits because
208 it overlays the CIE\_pointer in a FDE structure; this implicit
209 union must be accessed to distinguish whether a CIE or FDE is
210 present, consequently, these two fields must exactly overlay
211 each other (both offset and size).}
213 \item Within the body of the \addtoindex{.debug\_info} or \addtoindex{.debug\_types}
214 section, certain forms of attribute value depend on the choice
215 of DWARF format as follows. For the 32\dash bit DWARF format,
216 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
217 format, the value is a 64\dash bit unsigned integer.
220 Form & Role \\ \hline
221 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}& offset in \addtoindex{.debug\_info} \\
222 \livetarg{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}& offset in a section other than \addtoindex{.debug\_info} or \addtoindex{.debug\_str} \\
223 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&offset in \addtoindex{.debug\_str} \\
224 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&offset in \addtoindex{.debug\_info} \\
228 \item Within the body of the \addtoindex{.debug\_pubnames} and
229 \addtoindex{.debug\_pubtypes}
230 sections, the representation of the first field
231 of each tuple (which represents an offset in the
232 \addtoindex{.debug\_info}
233 section) depends on the DWARF format as follows: in the
234 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
235 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
240 The 32\dash bit and 64\dash bit DWARF format conventions must not be
241 intermixed within a single compilation unit.
243 \textit{Attribute values and section header fields that represent
244 addresses in the target program are not affected by these
247 A DWARF consumer that supports the 64\dash bit DWARF format must
248 support executables in which some compilation units use the
249 32\dash bit format and others use the 64\dash bit format provided that
250 the combination links correctly (that is, provided that there
251 are no link\dash time errors due to truncation or overflow). (An
252 implementation is not required to guarantee detection and
253 reporting of all such errors.)
255 \textit{It is expected that DWARF producing compilers will not use
256 the 64\dash bit format by default. In most cases, the division of
257 even very large applications into a number of executable and
258 shared objects will suffice to assure that the DWARF sections
259 within each individual linked object are less than 4 GBytes
260 in size. However, for those cases where needed, the 64\dash bit
261 format allows the unusual case to be handled as well. Even
262 in this case, it is expected that only application supplied
263 objects will need to be compiled using the 64\dash bit format;
264 separate 32\dash bit format versions of system supplied shared
265 executable libraries can still be used.}
269 \section{Format of Debugging Information}
270 \label{datarep:formatofdebugginginformation}
272 For each compilation unit compiled with a DWARF producer,
273 a contribution is made to the \addtoindex{.debug\_info} section of
274 the object file. Each such contribution consists of a
275 compilation unit header
276 (see Section \refersec{datarep:compilationunitheader})
278 single \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} or \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} debugging
279 information entry, together with its children.
281 For each type defined in a compilation unit, a contribution may
282 be made to the \addtoindex{.debug\_types}
283 section of the object file. Each
284 such contribution consists of a type unit header
285 (see Section \refersec{datarep:typeunitheader})
286 followed by a \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} entry, together with
289 Each debugging information entry begins with a code that
290 represents an entry in a separate
291 \addtoindex{abbreviations table}. This
292 code is followed directly by a series of attribute values.
294 The appropriate entry in the
295 \addtoindex{abbreviations table} guides the
296 interpretation of the information contained directly in the
297 \addtoindex{.debug\_info} or
298 \addtoindex{.debug\_types} section.
300 Multiple debugging information entries may share the same
301 abbreviation table entry. Each compilation unit is associated
302 with a particular abbreviation table, but multiple compilation
303 units may share the same table.
304 \subsection{Unit Headers}
305 \label{datarep:unitheaders}
307 \subsubsection{Compilation Unit Header}
308 \label{datarep:compilationunitheader}
310 \begin{enumerate}[1.]
312 \item unit\_length (initial length) \\
313 A 4\dash byte or 12\dash byte
314 \addtoindexx{initial length}
315 unsigned integer representing the length
316 of the \addtoindex{.debug\_info}
317 contribution for that compilation unit,
318 not including the length field itself. In the 32\dash bit DWARF
319 format, this is a 4\dash byte unsigned integer (which must be less
320 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
321 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
322 integer that gives the actual length
323 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
325 \item version (uhalf)
326 A 2\dash byte unsigned integer representing the version of the
327 DWARF information for the compilation unit\addtoindexx{version number!compilation unit}
328 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
329 The value in this field is 4.
331 \item \addtoindex{debug\_abbrev\_offset} (section offset) \\
332 A 4\dash byte or 8\dash byte unsigned offset into the
333 \addtoindex{.debug\_abbrev}
334 section. This offset associates the compilation unit with a
335 particular set of debugging information entry abbreviations. In
336 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
337 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
338 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
340 \item address\_size (ubyte) \\
341 A 1\dash byte unsigned integer representing the size in bytes of
342 \addtoindexx{address\_size}
343 an address on the target architecture. If the system uses
344 \addtoindexx{address space!segmented}
345 segmented addressing, this value represents the size of the
346 offset portion of an address.
353 \subsubsection{Type Unit Header}
354 \label{datarep:typeunitheader}
356 The header for the series of debugging information entries
357 contributing to the description of a type that has been
358 placed in its own type unit, within the
359 \addtoindex{.debug\_types} section,
360 consists of the following information:
362 \begin{enumerate}[1.]
364 \item unit\_length (initial length) \\
365 A 4\dash byte or 12\dash byte unsigned integer
366 \addtoindexx{initial length}
367 representing the length
368 of the \addtoindex{.debug\_types} contribution for that compilation unit,
369 not including the length field itself. In the 32\dash bit DWARF
370 format, this is a 4\dash byte unsigned integer (which must be
371 less than 0xfffffff0); in the 64\dash bit DWARF format, this
372 consists of the 4\dash byte value 0xffffffff followed by an
373 8\dash byte unsigned integer that gives the actual length
374 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
376 \item version (uhalf)
377 A 2\dash byte unsigned integer representing the version of the
378 DWARF information for the compilation unit\addtoindexx{version number!type unit}
379 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
380 The value in this field is 4.
382 \item \addtoindex{debug\_abbrev\_offset} (section offset) \\
383 A 4\dash byte or 8\dash byte unsigned offset into the
384 \addtoindex{.debug\_abbrev}
385 section. This offset associates the compilation unit with a
386 particular set of debugging information entry abbreviations. In
387 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
388 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
389 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
391 \item address\_size (ubyte) \\
392 A 1\dash byte unsigned integer representing the size in bytes of
393 \addtoindexx{address\_size}
394 an address on the target architecture. If the system uses
395 \addtoindexx{address space!segmented}
396 segmented addressing, this value represents the size of the
397 offset portion of an address.
400 \item type\_signature (8\dash byte unsigned integer) \\
401 A 64\dash bit unique signature of the type described in this type
404 \textit{An attribute that refers(using \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) to
405 the primary type contained in this type unit uses this value.}
408 \item type\_offset (section offset) \\
409 A 4\dash byte or 8\dash byte unsigned offset relative to the beginning
410 of the type unit header. This offset refers to the debugging
411 information entry that describes the type. Because the type
412 may be nested inside a namespace or other structures, and may
413 contain references to other types that have not been placed in
414 separate type units, it is not necessarily either the first or
415 the only entry in the type unit. In the 32\dash bit DWARF format,
416 this is a 4\dash byte unsigned length; in the 64\dash bit DWARF format,
417 this is an 8\dash byte unsigned length
418 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
422 \subsection{Debugging Information Entry}
423 \label{datarep:debugginginformationentry}
425 Each debugging information entry begins with an unsigned LEB128
426 number containing the abbreviation code for the entry. This
427 code represents an entry within the abbreviations table
428 associated with the compilation unit containing this entry. The
429 abbreviation code is followed by a series of attribute values.
431 On some architectures, there are alignment constraints on
432 section boundaries. To make it easier to pad debugging
433 information sections to satisfy such constraints, the
434 abbreviation code 0 is reserved. Debugging information entries
435 consisting of only the abbreviation code 0 are considered
438 \subsection{Abbreviations Tables}
439 \label{datarep:abbreviationstables}
441 The abbreviations tables for all compilation units
442 are contained in a separate object file section called
443 \addtoindex{.debug\_abbrev}.
444 As mentioned before, multiple compilation
445 units may share the same abbreviations table.
447 The abbreviations table for a single compilation unit consists
448 of a series of abbreviation declarations. Each declaration
449 specifies the tag and attributes for a particular form of
450 debugging information entry. Each declaration begins with
451 an unsigned LEB128 number representing the abbreviation
452 code itself. It is this code that appears at the beginning
453 of a debugging information entry in the
454 \addtoindex{.debug\_info} or
455 \addtoindex{.debug\_types}
456 section. As described above, the abbreviation
457 code 0 is reserved for null debugging information entries. The
458 abbreviation code is followed by another unsigned LEB128
459 number that encodes the entry’s tag. The encodings for the
460 tag names are given in
461 Table \refersec{tab:tagencodings}.
463 Following the tag encoding is a 1\dash byte value that determines
464 whether a debugging information entry using this abbreviation
465 has child entries or not. If the value is
466 \livetarg{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes},
467 the next physically succeeding entry of any debugging
468 information entry using this abbreviation is the first
469 child of that entry. If the 1\dash byte value following the
470 abbreviation’s tag encoding is
471 \livetarg{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}, the next
472 physically succeeding entry of any debugging information entry
473 using this abbreviation is a sibling of that entry. (Either
474 the first child or sibling entries may be null entries). The
475 encodings for the child determination byte are given in
476 Table \refersec{tab:childdeterminationencodings}
478 Section \refersec{chap:relationshipofdebugginginformationentries},
480 sibling entries is terminated by a null entry.)
482 Finally, the child encoding is followed by a series of
483 attribute specifications. Each attribute specification
484 consists of two parts. The first part is an unsigned LEB128
485 number representing the attribute’s name. The second part
486 is an unsigned LEB128 number representing the attribute’s
487 form. The series of attribute specifications ends with an
488 entry containing 0 for the name and 0 for the form.
491 \livetarg{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect} is a special case. For
492 attributes with this form, the attribute value itself in the
493 \addtoindex{.debug\_info} or
494 \addtoindex{.debug\_types}
495 section begins with an unsigned
496 LEB128 number that represents its form. This allows producers
497 to choose forms for particular attributes
498 \addtoindexx{abbreviations table!dynamic forms in}
500 without having to add a new entry to the abbreviations table.
502 The abbreviations for a given compilation unit end with an
503 entry consisting of a 0 byte for the abbreviation code.
506 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
507 for a depiction of the organization of the
508 debugging information.
510 \subsection{Attribute Encodings}
511 \label{datarep:attributeencodings}
513 The encodings for the attribute names are given in
514 Table \refersec{tab:attributeencodings}.
516 The attribute form governs how the value of the attribute is
517 encoded. There are nine classes of form, listed below. Each
518 class is a set of forms which have related representations
519 and which are given a common interpretation according to the
520 attribute in which the form is used.
522 Form \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} is a member of more than one class,
523 namely \livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr}; the list
524 of classes allowed by the applicable attribute in
525 Table \refersec{tab:attributeencodings}
526 determines the class of the form.
528 \textit{In DWARF V3 the forms \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} were
529 members of either class constant or one of the classes \livelink{chap:lineptr}{lineptr},
530 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr}, depending on context. In
531 DWARF V4 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} are members of class
532 constant in all cases. The new \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} replaces
533 their usage for the other classes.}
535 Each possible form belongs to one or more of the following classes:
538 \item \livelinki{chap:DWATaddressclass}{address}{address class} \\
539 Represented as an object of appropriate size to hold an
540 address on the target machine
541 (\livetarg{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}).
543 encoded in the compilation unit header
544 (see Section \refersec{datarep:compilationunitheader}).
545 This address is relocatable in a relocatable object file and
546 is relocated in an executable file or shared object.
548 \item \livelink{chap:block}{block} \\
549 Blocks come in four forms:
551 \begin{myindentpara}{1cm}
552 A 1\dash byte length followed by 0 to 255 contiguous information
553 bytes (\livetarg{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}).
556 \begin{myindentpara}{1cm}
557 A 2\dash byte length followed by 0 to 65,535 contiguous information
558 bytes (\livetarg{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}).
562 \begin{myindentpara}{1cm}
563 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
564 information bytes (\livetarg{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}).
568 \begin{myindentpara}{1cm}
569 An unsigned LEB128 length followed by the number of bytes
570 specified by the length (\livetarg{chap:DWFORMblock}{DW\-\_FORM\-\_block}).
573 In all forms, the length is the number of information bytes
574 that follow. The information bytes may contain any mixture
575 of relocated (or relocatable) addresses, references to other
576 debugging information entries or data bytes.
579 There are six forms of constants. There are fixed length
580 constant data forms for one, two, four and eight byte values
582 \livetarg{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
583 \livetarg{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
584 \livetarg{chap:DWFORMdata4}{DW\-\_FORM\-\_data4},
585 and \livetarg{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}).
586 There are also variable length constant
587 data forms encoded using LEB128 numbers (see below). Both
588 signed (\livetarg{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}) and unsigned
589 (\livetarg{chap:DWFORMudata}{DW\-\_FORM\-\_udata}) variable
590 length constants are available
592 The data in \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
593 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
594 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
595 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}
596 can be anything. Depending on context, it may
597 be a signed integer, an unsigned integer, a floating\dash point
598 constant, or anything else. A consumer must use context to
599 know how to interpret the bits, which if they are target
600 machine data (such as an integer or floating point constant)
601 will be in target machine byte\dash order.
603 \textit{If one of the \livetarg{chap:DWFORMdata}{DW\-\_FORM\-\_data}<n> forms is used to represent a
604 signed or unsigned integer, it can be hard for a consumer
605 to discover the context necessary to determine which
606 interpretation is intended. Producers are therefore strongly
607 encouraged to use \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata} or
608 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata} for signed and
609 unsigned integers respectively, rather than
610 \livelink{chap:DWFORMdata}{DW\-\_FORM\-\_data} \textless n \textgreater.}
613 \item \livelink{chap:exprloc}{exprloc} \\
614 This is an unsigned LEB128 length followed by the
615 number of information bytes specified by the length
616 (\livetarg{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc}).
617 The information bytes contain a DWARF
619 (see Section \refersec{chap:dwarfexpressions})
620 or location description
621 (see Section \refersec{chap:locationdescriptions}).
623 \item \livelink{chap:flag}{flag} \\
624 A flag \addtoindexx{flag class}
625 is represented explicitly as a single byte of data
626 (\livetarg{chap:DWFORMflag}{DW\-\_FORM\-\_flag}) or
627 implicitly (\livetarg{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present}).
629 first case, if the \nolink{flag} has value zero, it indicates the
630 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
631 it indicates the presence of the attribute. In the second
632 case, the attribute is implicitly indicated as present, and
633 no value is encoded in the debugging information entry itself.
635 \item \livelink{chap:lineptr}{lineptr} \\
636 This is an offset into the
637 \addtoindex{.debug\_line} section
638 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
640 \addtoindex{.debug\_line}
641 section to the first byte of
642 the data making up the line number list for the compilation
644 It is relocatable in a relocatable object file, and
645 relocated in an executable or shared object. In the 32\dash bit
646 DWARF format, this offset is a 4\dash byte unsigned value;
647 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
648 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
651 \item \livelink{chap:loclistptr}{loclistptr} \\
652 This is an offset into the
653 \addtoindex{.debug\_loc}
655 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
657 \addtoindex{.debug\_loc}
658 section to the first byte of
659 the data making up the location list for the compilation
661 It is relocatable in a relocatable object file, and
662 relocated in an executable or shared object. In the 32\dash bit
663 DWARF format, this offset is a 4\dash byte unsigned value;
664 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
665 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
668 \item \livelink{chap:macptr}{macptr} \\
669 This is an offset into the
670 \addtoindex{.debug\_macinfo} section
671 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
672 beginning of the \addtoindex{.debug\_macinfo}
673 section to the first byte of
674 the data making up the macro information list for the compilation
676 It is relocatable in a relocatable object file, and
677 relocated in an executable or shared object. In the 32\dash bit
678 DWARF format, this offset is a 4\dash byte unsigned value;
679 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
680 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
682 \item \livelink{chap:rangelistptr}{rangelistptr} \\
683 This is an offset into the \addtoindex{.debug\_ranges} section
684 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
686 offset from the beginning of the
687 \addtoindex{.debug\_ranges} section
688 to the beginning of the non\dash contiguous address ranges
689 information for the referencing entity.
691 a relocatable object file, and relocated in an executable or
692 shared object. In the 32\dash bit DWARF format, this offset
693 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
694 format, it is an 8\dash byte unsigned value (see Section
695 \refersec{datarep:32bitand64bitdwarfformats}).
698 \textit{Because classes \livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} and \livelink{chap:rangelistptr}{rangelistptr}
699 share a common representation, it is not possible for an
700 attribute to allow more than one of these classes}
705 There are three types of reference.
707 The first type of reference can identify any debugging
708 information entry within the containing unit. This type of
709 reference is an offset from the first byte of the compilation
710 header for the compilation unit containing the reference. There
711 are five forms for this type of reference. There are fixed
712 length forms for one, two, four and eight byte offsets
713 (respectively, \livetarg{chap:DWFORMref1}{DW\-\_FORM\-\_ref1},
714 \livetarg{chap:DWFORMref2}{DW\-\_FORM\-\_ref2},
715 \livetarg{chap:DWFORMref4}{DW\-\_FORM\-\_ref4},
716 and \livetarg{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}).
717 There is also an unsigned variable
718 length offset encoded form that uses unsigned LEB128 numbers
719 (\livetarg{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}).
720 Because this type of reference is within
721 the containing compilation unit no relocation of the value
724 The second type of reference can identify any debugging
725 information entry within a
726 \addtoindex{.debug\_info} section; in particular,
727 it may refer to an entry in a different compilation unit
728 from the unit containing the reference, and may refer to an
729 entry in a different shared object. This type of reference
730 (\livetarg{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}) is an offset from the beginning of the
731 \addtoindex{.debug\_info}
732 section of the target executable or shared object;
733 it is relocatable in a relocatable object file and frequently
734 relocated in an executable file or shared object. For
735 references from one shared object or static executable file
736 to another, the relocation and identification of the target
737 object must be performed by the consumer. In the 32\dash bit DWARF
738 format, this offset is a 4\dash byte unsigned value;
739 in the 64\dash bit DWARF format, it is an 8\dash byte
741 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
743 A debugging information entry that may be referenced by
744 another compilation unit using \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr} must have a
745 global symbolic name.
747 For a reference from one executable or shared object to
748 another, the reference is resolved by the debugger to identify
749 the shared object or executable and the offset into that
750 object’s \addtoindex{.debug\_info}
751 section in the same fashion as the run
752 time loader, either when the debug information is first read,
753 or when the reference is used.
755 The third type of reference can identify any debugging
756 information type entry that has been placed in its own
757 type unit. This type of
758 reference (\livetarg{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) is the
759 64\dash bit type signature
760 (see Section \refersec{datarep:typesignaturecomputation})
764 The use of compilation unit relative references will reduce the
765 number of link\dash time relocations and so speed up linking. The
766 use of the second and third type of reference allows for the
767 sharing of information, such as types, across compilation
770 A reference to any kind of compilation unit identifies the
771 debugging information entry for that unit, not the preceding
775 A string is a sequence of contiguous non\dash null bytes followed by
776 one null byte. A string may be represented immediately in the
777 debugging information entry itself
778 (\livetarg{chap:DWFORMstring}{DW\-\_FORM\-\_string}), or may
779 be represented as an offset into a string table contained in
780 the \addtoindex{.debug\_str} section of the object file
781 (\livetarg{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}). In
782 the 32\dash bit DWARF format, the representation of a
783 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}
784 value is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
785 it is an 8\dash byte unsigned offset
786 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
788 If the \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8} attribute is specified for the
789 compilation unit entry, string values are encoded using the
790 UTF\dash 8 (Unicode Transformation Format\dash 8) from the Universal
791 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
792 the string representation is unspecified.
794 The Unicode Standard Version 3 is fully compatible with
795 ISO/IEC 10646\dash 1:1993. It contains all the same characters
796 and encoding points as ISO/IEC 10646, as well as additional
797 information about the characters and their use.
799 Earlier versions of DWARF did not specify the representation
800 of strings; for compatibility, this version also does
801 not. However, the UTF\dash 8 representation is strongly recommended.
805 In no case does an attribute use one of the classes \livelink{chap:lineptr}{lineptr},
806 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr} to point into either the
807 \addtoindex{.debug\_info} or \addtoindex{.debug\_str} section.
809 The form encodings are listed in
810 Table \refersec{tab:attributeformencodings}.
813 \setlength{\extrarowheight}{0.1cm}
814 \begin{longtable}{l|l}
815 \caption{Tag encodings} \label{tab:tagencodings} \\
816 \hline \\ \bfseries Tag name&\bfseries Value\\ \hline
818 \bfseries Tag name&\bfseries Value \\ \hline
820 \hline \emph{Continued on next page}
824 \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type} &0x01 \\
825 \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type}&0x02 \\
826 \livelink{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point}&0x03 \\
827 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}&0x04 \\
828 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}&0x05 \\
829 \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}&0x08 \\
830 \livelink{chap:DWTAGlabel}{DW\-\_TAG\-\_label}&0x0a \\
831 \livelink{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}&0x0b \\
832 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}&0x0d \\
833 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}&0x0f \\
834 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}&0x10 \\
835 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}&0x11 \\
836 \livelink{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}&0x12 \\
837 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}&0x13 \\
838 \livelink{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}&0x15 \\
839 \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}&0x16 \\
840 \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}&0x17 \\
841 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}&0x18 \\
842 \livelink{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}&0x19 \\
843 \livelink{chap:DWTAGcommonblock}{DW\-\_TAG\-\_common\-\_block}&0x1a \\
844 \livelink{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}&0x1b \\
845 \livelink{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}&0x1c \\
846 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}&0x1d \\
847 \livelink{chap:DWTAGmodule}{DW\-\_TAG\-\_module}&0x1e \\
848 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}&0x1f \\
849 \livelink{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}&0x20 \\
850 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}&0x21 \\
851 \livelink{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}&0x22 \\
852 \livelink{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}&0x23 \\
853 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}&0x24 \\
854 \livelink{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}&0x25 \\
855 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type}&0x26 \\
856 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant}&0x27 \\
857 \livelink{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}&0x28 \\
858 \livelink{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}&0x29 \\
859 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}&0x2a \\
860 \livelink{chap:DWTAGnamelist}{DW\-\_TAG\-\_namelist}&0x2b \\
861 \livelink{chap:DWTAGnamelistitem}{DW\-\_TAG\-\_namelist\-\_item}&0x2c \\
862 \livelink{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}&0x2d \\
863 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}&0x2e \\
864 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}&0x2f \\
865 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}&0x30 \\
866 \livelink{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}&0x31 \\
867 \livelink{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}&0x32 \\
868 \livelink{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part}&0x33 \\
869 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}&0x34 \\
870 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&0x35 \\
871 \livelink{chap:DWTAGdwarfprocedure}{DW\-\_TAG\-\_dwarf\-\_procedure}&0x36 \\
872 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&0x37 \\
873 \livelink{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}&0x38 \\
874 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}&0x39 \\
875 \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}&0x3a \\
876 \livelink{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}&0x3b \\
877 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}&0x3c \\
878 \livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}&0x3d \\
879 \livelink{chap:DWTAGcondition}{DW\-\_TAG\-\_condition}&0x3f \\
880 \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&0x40 \\
881 \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} \ddag &0x41 \\
882 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} \ddag &0x42 \\
883 \livelink{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias} \ddag &0x43 \\
884 \livelink{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user}&0x4080 \\
885 \livelink{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}&0xffff \\
887 \ddag TAG new in \addtoindex{DWARF Version 4}
893 \setlength{\extrarowheight}{0.1cm}
894 \caption{Child determination encodings}
895 \label{tab:childdeterminationencodings}
896 \begin{tabular}{l|l} \hline
897 Child determination name& Value\\ \hline
898 \livelink{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}&0x00 \\
899 \livelink{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes}&0x01 \\ \hline
905 \setlength{\extrarowheight}{0.1cm}
906 \begin{longtable}{l|l|l}
907 \caption{Attribute encodings} \label{tab:attributeencodings} \addtoindexx{attribute encodings} \\
908 \hline \\ \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
910 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
912 \hline \emph{Continued on next page}
916 \livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling}&0x01&reference
917 \addtoindexx{sibling attribute!encoding} \\
918 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}&0x02&\livelink{chap:exprloc}{exprloc},
919 \livelink{chap:loclistptr}{loclistptr}\addtoindex{location attribute!encoding} \\
920 \livelink{chap:DWATname}{DW\-\_AT\-\_name}&0x03&string
921 \addtoindexx{name attribute!encoding} \\
922 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}&0x09&constant
923 \addtoindexx{ordering attribute!encoding} \\
924 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}&0x0b&constant, \livelink{chap:exprloc}{exprloc},
925 reference \addtoindexx{byte size attribute!encoding} \\
926 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}&0x0c&constant,
927 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit offset attribute!encoding} \\
928 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}&0x0d&constant,
929 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit size attribute!encoding} \\
930 \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list}&0x10&\livelink{chap:lineptr}{lineptr}
931 \addtoindex{statement list attribute!encoding} \\
932 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}&0x11&address
933 \addtoindexx{low PC attribute!encoding} \\
934 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}&0x12&address, constant
935 \addtoindexx{high PC attribute!encoding} \\
936 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}&0x13&constant
937 \addtoindexx{language attribute!encoding} \\
938 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}&0x15&reference
939 \addtoindexx{discriminant attribute!encoding} \\
940 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}&0x16&constant
941 \addtoindexx{discriminant value attribute!encoding} \\
942 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}&0x17&constant
943 \addtoindexx{visibility attribute!encoding} \\
944 \livelink{chap:DWATimport}{DW\-\_AT\-\_import}&0x18&reference
945 \addtoindexx{import attribute!encoding} \\
946 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}&0x19&\livelink{chap:exprloc}{exprloc},
947 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{string length attribute!encoding} \\
948 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference}&0x1a&reference
949 \addtoindexx{common reference attribute!encoding} \\
950 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}&0x1b&string
951 \addtoindexx{compilation directory attribute!encoding} \\
952 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}&0x1c&\livelink{chap:block}{block}, constant, string
953 \addtoindexx{constant value attribute!encoding} \\
954 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}&0x1d&reference
955 \addtoindexx{containing type attribute!encoding} \\
956 \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}&0x1e&reference
957 \addtoindexx{default value attribute!encoding} \\
958 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline}&0x20&constant
959 \addtoindexx{inline attribute!encoding} \\
960 \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}&0x21&\livelink{chap:flag}{flag}
961 \addtoindexx{is optional attribute!encoding} \\
962 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}&0x22&constant,
963 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{lower bound attribute!encoding} \\
964 \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer}&0x25&string \addtoindexx{producer attribute!encoding} \\
965 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}&0x27&\livelink{chap:flag}{flag}
966 \addtoindexx{prototyped attribute!encoding} \\
967 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}&0x2a&\livelink{chap:exprloc}{exprloc},
968 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{return address attribute!encoding} \\
969 % FIXME: lower case , not Constant
970 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}&0x2c&Constant,
971 \livelink{chap:rangelistptr}{rangelistptr} \addtoindexx{start scope attribute!encoding} \\
972 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}&0x2e&constant,
973 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit stride attribute!encoding} \\
974 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}&0x2f&constant,
975 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{upper bound attribute!encoding} \\
976 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}&0x31&reference
977 \addtoindexx{abstract origin attribute!encoding} \\
978 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}&0x32&constant
979 \addtoindexx{accessibility attribute!encoding} \\
980 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}&0x33&constant
981 \addtoindexx{address class atribute!encoding} \\
982 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}&0x34&\livelink{chap:flag}{flag}
983 \addtoindexx{artificial attribute!encoding} \\
984 \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types}&0x35&reference
985 \addtoindexx{base types attribute!encoding} \\
986 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}&0x36&constant
987 \addtoindexx{calling convention attribute!encoding} \\
988 \livelink{chap:DWATcount}{DW\-\_AT\-\_count}&0x37&constant, \livelink{chap:exprloc}{exprloc}, reference
989 \addtoindexx{count attribute!encoding} \\
990 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}&0x38&constant,
991 \livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr}
992 \addtoindexx{data member attribute!encoding} \\
993 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column}&0x39&constant
994 \addtoindexx{declaration column attribute!encoding} \\
995 \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}&0x3a&constant
996 \addtoindexx{declaration file attribute!encoding} \\
997 \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}&0x3b&constant
998 \addtoindexx{declaration line attribute!encoding} \\
999 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}&0x3c&\livelink{chap:flag}{flag}
1000 \addtoindexx{declaration attribute!encoding} \\
1001 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}&0x3d&\livelink{chap:block}{block}
1002 \addtoindexx{discriminant list attribute!encoding} \\
1003 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}&0x3e&constant
1004 \addtoindexx{encoding attribute!encoding} \\
1005 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external}&0x3f&\livelink{chap:flag}{flag}
1006 \addtoindexx{external attribute!encoding} \\
1007 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base}&0x40&\livelink{chap:exprloc}{exprloc},
1008 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{frame base attribute!encoding} \\
1009 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}&0x41&reference
1010 \addtoindexx{friend attribute!encoding} \\
1011 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}&0x42&constant
1012 \addtoindexx{identifier case attribute!encoding} \\
1013 \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info}&0x43&\livelink{chap:macptr}{macptr}
1014 \addtoindexx{macro information attribute!encoding} \\
1015 \livelink{chap:DWATnamelistitem}{DW\-\_AT\-\_namelist\-\_item}&0x44&reference
1016 \addtoindexx{name list item attribute!encoding} \\
1017 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority}&0x45&reference
1018 \addtoindexx{priority attribute!encoding} \\
1019 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}&0x46&\livelink{chap:exprloc}{exprloc},
1020 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{segment attribute!encoding} \\
1021 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}&0x47&reference
1022 \addtoindexx{specification attribute!encoding} \\
1023 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}&0x48&\livelink{chap:exprloc}{exprloc},
1024 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{static link attribute!encoding} \\
1025 \livelink{chap:DWATtype}{DW\-\_AT\-\_type}&0x49&reference
1026 \addtoindexx{type attribute!encoding} \\
1027 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}&0x4a&\livelink{chap:exprloc}{exprloc},
1028 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{location list attribute!encoding} \\
1029 \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}&0x4b&\livelink{chap:flag}{flag}
1030 \addtoindexx{variable parameter attribute!encoding} \\
1031 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}&0x4c&constant
1032 \addtoindexx{virtuality attribute!encoding} \\
1033 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}&0x4d&\livelink{chap:exprloc}{exprloc},
1034 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{vtable element location attribute!encoding} \\
1036 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}&0x4e&constant, \livelink{chap:exprloc}{exprloc},
1037 reference \addtoindexx{allocated attribute!encoding} \\
1038 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}&0x4f&constant, \livelink{chap:exprloc}{exprloc},
1039 reference \addtoindexx{associated attribute!encoding} \\
1040 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}&0x50&\livelink{chap:exprloc}{exprloc}
1041 \addtoindexx{data location attribute!encoding} \\
1042 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}&0x51&constant, \livelink{chap:exprloc}{exprloc},
1043 reference \addtoindexx{byte stride attribute!encoding} \\
1044 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}&0x52&address
1045 \addtoindexx{entry pc attribute!encoding} \\
1046 \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}&0x53&\livelink{chap:flag}{flag}
1047 \addtoindexx{use UTF8 attribute!encoding} \\
1048 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}&0x54&reference
1049 \addtoindexx{extension attribute!encoding} \\
1050 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}&0x55&\livelink{chap:rangelistptr}{rangelistptr}
1051 \addtoindexx{ranges attribute!encoding} \\
1052 \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline}&0x56&address, \livelink{chap:flag}{flag},
1053 reference, string \addtoindexx{trampoline attribute!encoding} \\
1054 \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column}&0x57&constant
1055 \addtoindexx{call column attribute!encoding} \\
1056 \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file}&0x58&constant
1057 \addtoindexx{call file attribute!encoding} \\
1058 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line}&0x59&constant
1059 \addtoindexx{call line attribute!encoding} \\
1060 \livelink{chap:DWATdescription}{DW\-\_AT\-\_description}&0x5a&string
1061 \addtoindexx{description attribute!encoding} \\
1062 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}&0x5b&constant
1063 \addtoindexx{binary scale attribute!encoding} \\
1064 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}&0x5c&constant
1065 \addtoindexx{decimal scale attribute!encoding} \\
1066 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} &0x5d&reference
1067 \addtoindexx{small attribute!encoding} \\
1068 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}&0x5e&constant
1069 \addtoindexx{decimal scale attribute!encoding} \\
1070 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}&0x5f&constant
1071 \addtoindexx{digit count attribute!encoding} \\
1072 \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}&0x60&string
1073 \addtoindexx{picture string attribute!encoding} \\
1074 \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}&0x61&\livelink{chap:flag}{flag}
1075 \addtoindexx{mutable attribute!encoding} \\
1077 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}&0x62&\livelink{chap:flag}{flag}
1078 \addtoindexx{thread scaled attribute!encoding} \\
1079 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}&0x63&\livelink{chap:flag}{flag}
1080 \addtoindexx{explicit attribute!encoding} \\
1081 \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}&0x64&reference
1082 \addtoindexx{object pointer attribute!encoding} \\
1083 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}&0x65&constant
1084 \addtoindexx{endianity attribute!encoding} \\
1085 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental}&0x66&\livelink{chap:flag}{flag}
1086 \addtoindexx{elemental attribute!encoding} \\
1087 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure}&0x67&\livelink{chap:flag}{flag}
1088 \addtoindexx{pure attribute!encoding} \\
1089 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}&0x68&\livelink{chap:flag}{flag}
1090 \addtoindexx{recursive attribute!encoding} \\
1091 \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature} \ddag &0x69&reference
1092 \addtoindexx{signature attribute!encoding} \\
1093 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} \ddag &0x6a&\livelink{chap:flag}{flag}
1094 \addtoindexx{main subprogram attribute!encoding} \\
1095 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} \ddag &0x6b&constant
1096 \addtoindexx{data bit offset attribute!encoding} \\
1097 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} \ddag &0x6c&\livelink{chap:flag}{flag}
1098 \addtoindexx{constant expression attribute!encoding} \\
1099 \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class} \ddag &0x6d&\livelink{chap:flag}{flag}
1100 \addtoindexx{enumeration class attribute!encoding} \\
1101 \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} \ddag &0x6e&string
1102 \addtoindexx{linkage name attribute!encoding} \\
1103 \livetarg{chap:DWATlouser}{DW\-\_AT\-\_lo\-\_user}&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1104 \livetarg{chap:DWAThiuser}{DW\-\_AT\-\_hi\-\_user}&0x3fff& --- \addtoindexx{high user attribute encoding} \\
1107 \ddag Attribute new in \addtoindex{DWARF Version 4}
1111 \setlength{\extrarowheight}{0.1cm}
1112 \begin{longtable}{l|l|l}
1113 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1114 \hline \\ \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1116 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1118 \hline \emph{Continued on next page}
1122 \livelink{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}&0x01&address \\
1123 \livelink{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}&0x03&\livelink{chap:block}{block} \\
1124 \livelink{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}&0x04&\livelink{chap:block}{block} \\
1125 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2}&0x05&constant \\
1126 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4}&0x06&constant \\
1127 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}&0x07&constant \\
1128 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string}&0x08&string \\
1129 \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}&0x09&\livelink{chap:block}{block} \\
1130 \livelink{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}&0x0a&\livelink{chap:block}{block} \\
1131 \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1}&0x0b&constant \\
1132 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag}&0x0c&\livelink{chap:flag}{flag} \\
1133 \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}&0x0d&constant \\
1134 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&0x0e&string \\
1135 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata}&0x0f&constant \\
1136 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}&0x10&reference \\
1137 \livelink{chap:DWFORMref1}{DW\-\_FORM\-\_ref1}&0x11&reference \\
1138 \livelink{chap:DWFORMref2}{DW\-\_FORM\-\_ref2}&0x12&reference \\
1139 \livelink{chap:DWFORMref4}{DW\-\_FORM\-\_ref4}&0x13&reference \\
1140 \livelink{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}&0x14&reference \\
1141 \livelink{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}&0x15&reference \\
1142 \livelink{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect}&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1143 \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} \\
1144 \livelink{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc} \ddag &0x18&\livelink{chap:exprloc}{exprloc} \\
1145 \livelink{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present} \ddag &0x19&\livelink{chap:flag}{flag} \\
1146 \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8} \ddag &0x20&reference \\
1149 \ddag FORM new in \addtoindex{DWARF Version 4}
1152 \section{Variable Length Data}
1153 \label{datarep:variablelengthdata}
1154 \addtoindexx{variable length data|see {LEB128}}
1155 \addtoindexx{LEB128 encoding}
1156 Integers may be encoded using ``Little Endian Base 128''
1157 (LEB128) numbers. LEB128 is a scheme for encoding integers
1158 densely that exploits the assumption that most integers are
1161 This encoding is equally suitable whether the target machine
1162 architecture represents data in big\dash\ endian or little\dash endian
1163 order. It is ``little\dash endian'' only in the sense that it
1164 avoids using space to represent the ``big'' end of an
1165 unsigned integer, when the big end is all zeroes or sign
1168 Unsigned LEB128 (ULEB128) numbers are encoded as follows:
1169 start at the low order end of an unsigned integer and chop
1170 it into 7\dash bit chunks. Place each chunk into the low order 7
1171 bits of a byte. Typically, several of the high order bytes
1172 will be zero; discard them. Emit the remaining bytes in a
1173 stream, starting with the low order byte; set the high order
1174 bit on each byte except the last emitted byte. The high bit
1175 of zero on the last byte indicates to the decoder that it
1176 has encountered the last byte.
1178 The integer zero is a special case, consisting of a single
1181 Table \refersec{tab:examplesofunsignedleb128encodings}
1182 gives some examples of unsigned LEB128 numbers. The
1183 0x80 in each case is the high order bit of the byte, indicating
1184 that an additional byte follows.
1187 The encoding for signed, two’s complement LEB128 (SLEB128)
1188 numbers is similar, except that the criterion for discarding
1189 high order bytes is not whether they are zero, but whether
1190 they consist entirely of sign extension bits. Consider the
1191 32\dash bit integer -2. The three high level bytes of the number
1192 are sign extension, thus LEB128 would represent it as a single
1193 byte containing the low order 7 bits, with the high order
1194 bit cleared to indicate the end of the byte stream. Note
1195 that there is nothing within the LEB128 representation that
1196 indicates whether an encoded number is signed or unsigned. The
1197 decoder must know what type of number to expect.
1198 Table \refersec{tab:examplesofunsignedleb128encodings}
1199 gives some examples of unsigned LEB128 numbers and
1200 Table \refersec{tab:examplesofsignedleb128encodings}
1201 gives some examples of signed LEB128 numbers.
1203 Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1204 gives algorithms for encoding and decoding these forms.
1208 \setlength{\extrarowheight}{0.1cm}
1209 \begin{longtable}{l|l|l}
1210 \caption{Examples of unsigned LEB128 encodings} \label{tab:examplesofunsignedleb128encodings} \\
1211 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1213 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1215 \hline \emph{Continued on next page}
1221 128& 0 + 0x80 & 1 \\
1222 129& 1 + 0x80 & 1 \\
1223 130& 2 + 0x80 & 1 \\
1224 12857& 57 + 0x80 & 100 \\
1225 \addtoindex{LEB128 encoding!examples}
1232 \setlength{\extrarowheight}{0.1cm}
1233 \begin{longtable}{l|l|l}
1234 \caption{Examples of signed LEB128 encodings} \label{tab:examplesofsignedleb128encodings} \\
1235 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1237 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1239 \hline \emph{Continued on next page}
1245 127& 127 + 0x80 & 0 \\
1246 -127& 1 + 0x80 & 0x7f \\
1247 128& 0 + 0x80 & 1 \\
1248 -128& 0 + 0x80 & 0x7f \\
1249 129& 1 + 0x80 & 1 \\
1250 -129& -x7f + 0x80 & 0xtc \\
1257 \section{DWARF Expressions and Location Descriptions}
1258 \label{datarep:dwarfexpressionsandlocationdescriptions}
1259 \subsection{DWARF Expressions}
1260 \label{datarep:dwarfexpressions}
1263 \addtoindexx{DWARF Expression!operator encoding}
1264 DWARF expression is stored in a \nolink{block} of contiguous
1265 bytes. The bytes form a sequence of operations. Each operation
1266 is a 1\dash byte code that identifies that operation, followed by
1267 zero or more bytes of additional data. The encodings for the
1268 operations are described in
1269 Table \refersec{tab:dwarfoperationencodings}.
1272 \setlength{\extrarowheight}{0.1cm}
1273 \begin{longtable}{l|l|l|l}
1274 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1275 \hline \\ & &\bfseries No. of &\\
1276 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1278 & &\bfseries No. of &\\
1279 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1281 \hline \emph{Continued on next page}
1286 \livelink{chap:DWOPaddr}{DW\-\_OP\-\_addr}&0x03&1 & constant address \\
1287 & & &(size target specific) \\
1289 \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}&0x06&0 & \\
1292 \livelink{chap:DWOPconst1u}{DW\-\_OP\-\_const1u}&0x08&1&1\dash byte constant \\
1293 \livelink{chap:DWOPconst1s}{DW\-\_OP\-\_const1s}&0x09&1&1\dash byte constant \\
1294 \livelink{chap:DWOPconst2u}{DW\-\_OP\-\_const2u}&0x0a&1&2\dash byte constant \\
1295 \livelink{chap:DWOPconst2s}{DW\-\_OP\-\_const2s}&0x0b&1&2\dash byte constant \\
1296 \livelink{chap:DWOPconst4u}{DW\-\_OP\-\_const4u}&0x0c&1&4\dash byte constant \\
1297 \livelink{chap:DWOPconst4s}{DW\-\_OP\-\_const4s}&0x0d&1&4\dash byte constant \\
1298 \livelink{chap:DWOPconst8u}{DW\-\_OP\-\_const8u}&0x0e&1&8\dash byte constant \\
1299 \livelink{chap:DWOPconst8s}{DW\-\_OP\-\_const8s}&0x0f&1&8\dash byte constant \\
1300 \livelink{chap:DWOPconstu}{DW\-\_OP\-\_constu}&0x10&1&ULEB128 constant \\
1301 \livelink{chap:DWOPconsts}{DW\-\_OP\-\_consts}&0x11&1&SLEB128 constant \\
1302 \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}&0x12&0 & \\
1303 \livelink{chap:DWOPdrop}{DW\-\_OP\-\_drop}&0x13&0 & \\
1304 \livelink{chap:DWOPover}{DW\-\_OP\-\_over}&0x14&0 & \\
1305 \livelink{chap:DWOPpick}{DW\-\_OP\-\_pick}&0x15&1&1\dash byte stack index \\
1306 \livelink{chap:DWOPswap}{DW\-\_OP\-\_swap}&0x16&0 & \\
1307 \livelink{chap:DWOProt}{DW\-\_OP\-\_rot}&0x17&0 & \\
1308 \livelink{chap:DWOPxderef}{DW\-\_OP\-\_xderef}&0x18&0 & \\
1309 \livelink{chap:DWOPabs}{DW\-\_OP\-\_abs}&0x19&0 & \\
1310 \livelink{chap:DWOPand}{DW\-\_OP\-\_and}&0x1a&0 & \\
1311 \livelink{chap:DWOPdiv}{DW\-\_OP\-\_div}&0x1b&0 & \\
1315 \livelink{chap:DWOPminus}{DW\-\_OP\-\_minus}&0x1c&0 & \\
1316 \livelink{chap:DWOPmod}{DW\-\_OP\-\_mod}&0x1d&0 & \\
1317 \livelink{chap:DWOPmul}{DW\-\_OP\-\_mul}&0x1e&0 & \\
1318 \livelink{chap:DWOPneg}{DW\-\_OP\-\_neg}&0x1f&0 & \\
1319 \livelink{chap:DWOPnot}{DW\-\_OP\-\_not}&0x20&0 & \\
1320 \livelink{chap:DWOPor}{DW\-\_OP\-\_or}&0x21&0 & \\
1321 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}&0x22&0 & \\
1322 \livelink{chap:DWOPplusuconst}{DW\-\_OP\-\_plus\-\_uconst}&0x23&1&ULEB128 addend \\
1323 \livelink{chap:DWOPshl}{DW\-\_OP\-\_shl}&0x24&0 & \\
1324 \livelink{chap:DWOPshr}{DW\-\_OP\-\_shr}&0x25&0 & \\
1325 \livelink{chap:DWOPshra}{DW\-\_OP\-\_shra}&0x26&0 & \\
1326 \livelink{chap:DWOPxor}{DW\-\_OP\-\_xor}&0x27&0 & \\
1327 \livelink{chap:DWOPskip}{DW\-\_OP\-\_skip}&0x2f&1&signed 2\dash byte constant \\
1328 \livelink{chap:DWOPbra}{DW\-\_OP\-\_bra}&0x28&1 & signed 2\dash byte constant \\
1329 \livelink{chap:DWOPeq}{DW\-\_OP\-\_eq}&0x29&0 & \\
1330 \livelink{chap:DWOPge}{DW\-\_OP\-\_ge}&0x2a&0 & \\
1331 \livelink{chap:DWOPgt}{DW\-\_OP\-\_gt}&0x2b&0 & \\
1332 \livelink{chap:DWOPle}{DW\-\_OP\-\_le}&0x2c&0 & \\
1333 \livelink{chap:DWOPlt}{DW\-\_OP\-\_lt}&0x2d&0 & \\
1334 \livelink{chap:DWOPne}{DW\-\_OP\-\_ne}&0x2e&0 & \\ \hline
1338 \livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0}&0x30 & 0 & \\
1340 \livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1}&0x31 & 0& literals 0 .. 31 = \\
1341 \ldots & & & (\livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0} + literal) \\
1342 \livelink{chap:DWOPlit31}{DW\-\_OP\-\_lit31}&0x4f & 0 & \\ \hline
1344 \livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} & 0x50 & 0 & \\
1345 \livelink{chap:DWOPreg1}{DW\-\_OP\-\_reg1} & 0x51 & 0® 0 .. 31 = \\
1346 \ldots & & & (\livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} + regnum) \\
1347 \livelink{chap:DWOPreg31}{DW\-\_OP\-\_reg31} & 0x6f & 0 & \\ \hline
1349 \livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} & 0x70 &1 & SLEB128 offset \\
1350 \livelink{chap:DWOPbreg1}{DW\-\_OP\-\_breg1} & 0x71 & 1 &base register 0 .. 31 = \\
1351 ... & & &(\livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} + regnum) \\
1352 \livelink{chap:DWOPbreg31}{DW\-\_OP\-\_breg31} & 0x8f & 1 & \\ \hline
1354 \livelink{chap:DWOPregx}{DW\-\_OP\-\_regx} & 0x90 &1&ULEB128 register \\
1355 \livelink{chap:DWOPfbreg}{DW\-\_OP\-\_fbreg} & 0x91&1&SLEB128 offset \\
1356 \livelink{chap:DWOPbregx}{DW\-\_OP\-\_bregx} & 0x92&2 &ULEB128 register followed \\
1357 & & & by SLEB128 offset \\
1358 \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} & 0x93 &1& ULEB128 size of piece addressed \\
1359 \livelink{chap:DWOPderefsize}{DW\-\_OP\-\_deref\-\_size} & 0x94 &1& 1-byte size of data retrieved \\
1360 \livelink{chap:DWOPxderefsize}{DW\-\_OP\-\_xderef\-\_size} & 0x95&1&1-byte size of data retrieved \\
1361 \livelink{chap:DWOPnop}{DW\-\_OP\-\_nop} & 0x96 &0& \\
1364 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}&0x97&0 & \\
1365 \livelink{chap:DWOPcall2}{DW\-\_OP\-\_call2}&0x98&1& 2\dash byte offset of DIE \\
1366 \livelink{chap:DWOPcall4}{DW\-\_OP\-\_call4}&0x99&1& 4\dash byte offset of DIE \\
1367 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&0x9a&1& 4\dash\ or 8\dash byte\\
1368 &&& offset of DIE \\
1369 \livelink{chap:DWOPformtlsaddress}{DW\-\_OP\-\_form\-\_tls\-\_address}&0x9b &0& \\
1370 \livelink{chap:DWOPcallframecfa}{DW\-\_OP\-\_call\-\_frame\-\_cfa} &0x9c &0& \\
1371 \livelink{chap:DWOPbitpiece}{DW\-\_OP\-\_bit\-\_piece}&0x9d &2&ULEB128 size followed by \\
1373 \livelink{chap:DWOPimplicitvalue}{DW\-\_OP\-\_implicit\-\_value}&0x9e &2&ULEB128 size followed by \\
1374 &&&\nolink{block} of that size\\
1375 \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} &0x9f &0& \\
1376 \livetarg{chap:DWOPlouser}{DW\-\_OP\-\_lo\-\_user} &0xe0 && \\
1377 \livetarg{chap:DWOPhiuser}{DW\-\_OP\-\_hi\-\_user} &0xff && \\
1383 \subsection{Location Descriptions}
1384 \label{datarep:locationdescriptions}
1386 A location description is used to compute the
1387 location of a variable or other entity.
1389 \subsection{Location Lists}
1390 \label{datarep:locationlists}
1392 Each entry in a location list is either a location list entry,
1393 a base address selection entry, or an
1394 \addtoindex{end of list entry!in location list}
1397 A location list entry consists of two address offsets followed
1398 by a 2\dash byte length, followed by a block of contiguous bytes
1399 that contains a DWARF location description. The length
1400 specifies the number of bytes in that block. The two offsets
1401 are the same size as an address on the target machine.
1403 A base address selection entry and an
1404 \addtoindex{end of list entry!in location list}
1405 end of list entry each
1406 consist of two (constant or relocated) address offsets. The two
1407 offsets are the same size as an address on the target machine.
1409 For a location list to be specified, the base address of
1410 \addtoindexx{base address selection entry!in location list}
1411 the corresponding compilation unit must be defined
1412 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1414 \section{Base Type Attribute Encodings}
1415 \label{datarep:basetypeattributeencodings}
1417 The encodings of the
1418 \hypertarget{chap:DWATencodingencodingofbasetype}
1420 \addtoindexx{encoding attribute!encoding}
1422 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
1423 attribute are given in
1424 Table \refersec{tab:basetypeencodingvalues}
1427 \setlength{\extrarowheight}{0.1cm}
1428 \begin{longtable}{l|c}
1429 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1430 \hline \\ \bfseries Base type encoding code name&\bfseries Value \\ \hline
1432 \bfseries Base type encoding code name&\bfseries Value\\ \hline
1434 \hline \emph{Continued on next page}
1439 \livelink{chap:DWATEaddress}{DW\-\_ATE\-\_address}&0x01 \\
1440 \livelink{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}&0x02 \\
1441 \livelink{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}&0x03 \\
1442 \livelink{chap:DWATEfloat}{DW\-\_ATE\-\_float}&0x04 \\
1443 \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed}&0x05 \\
1444 \livelink{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}&0x06 \\
1445 \livelink{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned}&0x07 \\
1446 \livelink{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char}&0x08 \\
1447 \livelink{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}&0x09 \\
1448 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}&0x0a \\
1449 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}&0x0b \\
1450 \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}&0x0c \\
1451 \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed}&0x0d \\
1452 \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}&0x0e \\
1453 \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & 0x0f \\
1454 \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} \ddag & 0x10 \\
1455 \livetarg{chap:DWATElouser}{DW\-\_ATE\-\_lo\-\_user} & 0x80 \\
1456 \livetarg{chap:DWATEhiuser}{DW\-\_ATE\-\_hi\-\_user} & 0xff \\
1459 \ddag Base type encoding new in \addtoindex{DWARF Version 4}
1463 The encodings of the constants used in the
1464 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute
1466 Table \refersec{tab:decimalsignencodings}.
1470 \setlength{\extrarowheight}{0.1cm}
1471 \begin{longtable}{l|c}
1472 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1473 \hline \\ \bfseries Decimal sign code name&\bfseries Value \\ \hline
1475 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1477 \hline \emph{Continued on next page}
1482 \livelink{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & 0x01 \\
1483 \livelink{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & 0x02 \\
1484 \livelink{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & 0x03 \\
1485 \livelink{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate} & 0x04 \\
1486 \livelink{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate} & 0x05 \\
1491 The encodings of the constants used in the
1492 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute are given in
1493 Table \refersec{tab:endianityencodings}.
1496 \setlength{\extrarowheight}{0.1cm}
1497 \begin{longtable}{l|c}
1498 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1499 \hline \\ \bfseries Endian code name&\bfseries Value \\ \hline
1501 \bfseries Endian code name&\bfseries Value\\ \hline
1503 \hline \emph{Continued on next page}
1508 \livelink{chap:DWENDdefault}{DW\-\_END\-\_default} & 0x00 \\
1509 \livelink{chap:DWENDbig}{DW\-\_END\-\_big} & 0x01 \\
1510 \livelink{chap:DWENDlittle}{DW\-\_END\-\_little} & 0x02 \\
1511 \livetarg{chap:DWENDlouser}{DW\-\_END\-\_lo\-\_user} & 0x40 \\
1512 \livetarg{chap:DWENDhiuser}{DW\-\_END\-\_hi\-\_user} & 0xff \\
1517 \section{Accessibility Codes}
1518 \label{datarep:accessibilitycodes}
1519 The encodings of the constants used in the
1520 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1522 \addtoindexx{accessibility attribute!encoding}
1524 Table \refersec{tab:accessibilityencodings}.
1527 \setlength{\extrarowheight}{0.1cm}
1528 \begin{longtable}{l|c}
1529 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1530 \hline \\ \bfseries Accessibility code name&\bfseries Value \\ \hline
1532 \bfseries Accessibility code name&\bfseries Value\\ \hline
1534 \hline \emph{Continued on next page}
1539 \livelink{chap:DWACCESSpublic}{DW\-\_ACCESS\-\_public}&0x01 \\
1540 \livelink{chap:DWACCESSprotected}{DW\-\_ACCESS\-\_protected}&0x02 \\
1541 \livelink{chap:DWACCESSprivate}{DW\-\_ACCESS\-\_private}&0x03 \\
1547 \section{Visibility Codes}
1548 \label{datarep:visibilitycodes}
1549 The encodings of the constants used in the
1550 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility} attribute are given in
1551 Table \refersec{tab:visibilityencodings}.
1554 \setlength{\extrarowheight}{0.1cm}
1555 \begin{longtable}{l|c}
1556 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
1557 \hline \\ \bfseries Visiibility code name&\bfseries Value \\ \hline
1559 \bfseries Visibility code name&\bfseries Value\\ \hline
1561 \hline \emph{Continued on next page}
1566 \livelink{chap:DWVISlocal}{DW\-\_VIS\-\_local}&0x01 \\
1567 \livelink{chap:DWVISexported}{DW\-\_VIS\-\_exported}&0x02 \\
1568 \livelink{chap:DWVISqualified}{DW\-\_VIS\-\_qualified}&0x03 \\
1573 \section{Virtuality Codes}
1574 \label{datarep:vitualitycodes}
1576 The encodings of the constants used in the
1577 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute are given in
1578 Table \refersec{tab:virtualityencodings}.
1581 \setlength{\extrarowheight}{0.1cm}
1582 \begin{longtable}{l|c}
1583 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
1584 \hline \\ \bfseries Virtuality code name&\bfseries Value \\ \hline
1586 \bfseries Virtuality code name&\bfseries Value\\ \hline
1588 \hline \emph{Continued on next page}
1593 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none}&0x00 \\
1594 \livelink{chap:DWVIRTUALITYvirtual}{DW\-\_VIRTUALITY\-\_virtual}&0x01 \\
1595 \livelink{chap:DWVIRTUALITYpurevirtual}{DW\-\_VIRTUALITY\-\_pure\-\_virtual}&0x02 \\
1603 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none} is equivalent to the absence of the
1604 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
1607 \section{Source Languages}
1608 \label{datarep:sourcelanguages}
1610 The encodings of the constants used in the \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
1611 attribute are given in
1612 Table \refersec{tab:languageencodings}.
1614 % If we don't force a following space it looks odd
1616 and their associated values are reserved, but the
1617 languages they represent are not well supported.
1618 Table \refersec{tab:languageencodings}
1619 also shows the default lower bound, if any, assumed for
1620 an omitted \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound} attribute in the context of a
1621 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} debugging information entry for each
1625 \setlength{\extrarowheight}{0.1cm}
1626 \begin{longtable}{l|c|c}
1627 \caption{Language encodings} \label{tab:languageencodings}\\
1628 \hline \\ \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
1630 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
1632 \hline \emph{Continued on next page}
1637 \livelink{chap:DWLANGC89}{DW\-\_LANG\-\_C89}&0x0001&0 \\
1638 \livelink{chap:DWLANGC}{DW\-\_LANG\-\_C}&0x0002&0 \\
1639 \livelink{chap:DWLANGAda83}{DW\-\_LANG\-\_Ada83} \dag &0x0003&1 \addtoindexx{Ada} \\
1640 \livelink{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus} &0x0004&0 \\
1641 \livelink{chap:DWLANGCobol74}{DW\-\_LANG\-\_Cobol74} \dag &0x0005&1 \\
1642 \livelink{chap:DWLANGCobol85}{DW\-\_LANG\-\_Cobol85} \dag &0x0006&1 \\
1643 \livelink{chap:DWLANGFortran77}{DW\-\_LANG\-\_Fortran77}&0x0007&1 \\
1644 \livelink{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90}&0x0008&1 \\
1645 \livelink{chap:DWLANGPascal83}{DW\-\_LANG\-\_Pascal83}&0x0009&1 \\
1646 \livelink{chap:DWLANGModula2}{DW\-\_LANG\-\_Modula2}&0x000a&1 \\
1647 \livelink{chap:DWLANGJava}{DW\-\_LANG\-\_Java}&0x000b&0 \\
1648 \livelink{chap:DWLANGC99}{DW\-\_LANG\-\_C99}&0x000c&0 \\
1649 \livelink{chap:DWLANGAda95}{DW\-\_LANG\-\_Ada95} \dag &0x000d&1 \addtoindexx{Ada} \\
1650 \livelink{chap:DWLANGFortran95}{DW\-\_LANG\-\_Fortran95} &0x000e&1 \\
1651 \livelink{chap:DWLANGPLI}{DW\-\_LANG\-\_PLI} \dag &0x000f&1 \\
1652 \livelink{chap:DWLANGObjC}{DW\-\_LANG\-\_ObjC}&0x0010&0 \\
1653 \livelink{chap:DWLANGObjCplusplus}{DW\-\_LANG\-\_ObjC\-\_plus\-\_plus}&0x0011&0 \\
1654 \livelink{chap:DWLANGUPC}{DW\-\_LANG\-\_UPC}&0x0012&0 \\
1655 \livelink{chap:DWLANGD}{DW\-\_LANG\-\_D}&0x0013&0 \\
1656 \livelink{chap:DWLANGPython}{DW\-\_LANG\-\_Python} \dag &0x0014&0 \\
1657 \livetarg{chap:DWLANGlouser}{DW\-\_LANG\-\_lo\-\_user}&0x8000 & \\
1658 \livetarg{chap:DWLANGhiuser}{DW\-\_LANG\-\_hi\-\_user}&0xffff & \\
1664 \section{Address Class Encodings}
1665 \label{datarep:addressclassencodings}
1667 The value of the common
1668 \addtoindexi{address}{address class!attribute encoding}
1670 \livelink{chap:DWADDRnone}{DW\-\_ADDR\-\_none} is 0.
1673 \section{Identifier Case}
1674 \label{datarep:identifiercase}
1676 The encodings of the constants used in the
1677 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case} attribute are given in
1678 Table \refersec{tab:identifiercaseencodings}.
1681 \setlength{\extrarowheight}{0.1cm}
1682 \begin{longtable}{l|c}
1683 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
1684 \hline \\ \bfseries Identifier case name&\bfseries Value \\ \hline
1686 \bfseries Identifier case name&\bfseries Value\\ \hline
1688 \hline \emph{Continued on next page}
1692 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive}&0x00 \\
1693 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case}&0x01 \\
1694 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case}&0x02 \\
1695 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive}&0x03 \\
1699 \section{Calling Convention Encodings}
1700 \label{datarep:callingconventionencodings}
1701 The encodings of the constants used in the
1702 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention} attribute are given in
1703 Table \refersec{tab:callingconventionencodings}.
1706 \setlength{\extrarowheight}{0.1cm}
1707 \begin{longtable}{l|c}
1708 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
1709 \hline \\ \bfseries Calling Convention name&\bfseries Value \\ \hline
1711 \bfseries Calling Convention name&\bfseries Value\\ \hline
1713 \hline \emph{Continued on next page}
1718 \livelink{chap:DWCCnormal}{DW\-\_CC\-\_normal}&0x01 \\
1719 \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}&0x02 \\
1720 \livelink{chap:DWCCnocall}{DW\-\_CC\-\_nocall}&0x03 \\
1721 \livetarg{chap:DWCClouser}{DW\-\_CC\-\_lo\-\_user}&0x40 \\
1722 \livetarg{chap:DWCChiuser}{DW\-\_CC\-\_hi\-\_user}&0xff \\
1727 \section{Inline Codes}
1728 \label{datarep:inlinecodes}
1730 The encodings of the constants used in
1731 \addtoindexx{inline attribute!encoding}
1733 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute are given in
1734 Table \refersec{tab:inlineencodings}.
1737 \setlength{\extrarowheight}{0.1cm}
1738 \begin{longtable}{l|c}
1739 \caption{Inline encodings} \label{tab:inlineencodings}\\
1740 \hline \\ \bfseries Iline Code name&\bfseries Value \\ \hline
1742 \bfseries Iline Code name&\bfseries Value\\ \hline
1744 \hline \emph{Continued on next page}
1749 \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}&0x00 \\
1750 \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}&0x01 \\
1751 \livelink{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined}&0x02 \\
1752 \livelink{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined}&0x03 \\
1757 % this clearpage is ugly, but the following table came
1758 % out oddly without it.
1760 \section{Array Ordering}
1761 \label{datarep:arrayordering}
1763 The encodings of the constants used in the
1764 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute are given in
1765 Table \refersec{tab:orderingencodings}.
1768 \setlength{\extrarowheight}{0.1cm}
1769 \begin{longtable}{l|c}
1770 \caption{Ordering encodings} \label{tab:orderingencodings}\\
1771 \hline \\ \bfseries Ordering name&\bfseries Value \\ \hline
1773 \bfseries Ordering name&\bfseries Value\\ \hline
1775 \hline \emph{Continued on next page}
1780 \livelink{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}&0x00 \\
1781 \livelink{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major}&0x01 \\
1787 \section{Discriminant Lists}
1788 \label{datarep:discriminantlists}
1790 The descriptors used in
1791 \addtoindexx{discriminant list attribute!encoding}
1793 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute are
1794 encoded as 1\dash byte constants. The
1795 defined values are given in
1796 Table \refersec{tab:discriminantdescriptorencodings}.
1798 % Odd that the 'Name' field captalized here, it is not caps elsewhere.
1800 \setlength{\extrarowheight}{0.1cm}
1801 \begin{longtable}{l|c}
1802 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
1803 \hline \\ \bfseries Descriptor Name&\bfseries Value \\ \hline
1805 \bfseries Descriptor Name&\bfseries Value\\ \hline
1807 \hline \emph{Continued on next page}
1812 \livetarg{chap:DWDSClabel}{DW\-\_DSC\-\_label}&0x00 \\
1813 \livetarg{chap:DWDSCrange}{DW\-\_DSC\-\_range}&0x01 \\
1818 \section{Name Lookup Tables}
1819 \label{datarep:namelookuptables}
1821 Each set of entries in the table of global names contained
1822 in the \addtoindex{.debug\_pubnames} and
1823 \addtoindex{.debug\_pubtypes} sections begins
1824 with a header consisting of:
1827 \begin{enumerate}[1.]
1828 \item unit\_length (initial length) \\
1829 A 4\dash byte or 12\dash byte unsigned integer
1830 \addtoindexx{initial length}
1831 representing the length
1832 of the \addtoindex{.debug\_info}
1833 contribution for that compilation unit,
1834 not including the length field itself. In the 32\dash bit DWARF
1835 format, this is a 4\dash byte unsigned integer (which must be less
1836 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
1837 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
1838 integer that gives the actual length
1839 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1841 \item version (uhalf)
1842 A 2\dash byte unsigned integer representing the version of the
1843 DWARF information\addtoindexx{version number!compilation unit} for the compilation unit
1844 \addtoindexx{version number!name lookup table}
1845 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1846 The value in this field is 4.
1848 % Some say unsigned offset this just says offset: FIXME
1849 \item debug\_info\_offset (section offset) \\
1850 A 4\dash byte or 8\dash byte offset into the
1851 \addtoindex{.debug\_info}
1852 section of the compilation unit header.
1854 the 32\dash bit DWARF format, this is a 4\dash byte unsigned offset;
1855 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned offsets
1856 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1858 \item debug\_info\_length (section length) \\
1859 A 4\dash byte or 8\dash byte length containing the size in bytes of the
1860 contents of the \addtoindex{.debug\_info}
1861 section generated to represent
1862 this compilation unit. In the 32\dash bit DWARF format, this is
1863 a 4\dash byte unsigned length; in the 64\dash bit DWARF format, this
1864 is an 8-byte unsigned length
1865 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1870 This header is followed by a series of tuples. Each tuple
1871 consists of a 4\dash byte or 8\dash byte offset followed by a string
1872 of non\dash null bytes terminated by one null byte.
1874 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
1875 format, it is an 8\dash byte offset.
1876 Each set is terminated by an
1877 offset containing the value 0.
1880 \section{Address Range Table}
1881 \label{datarep:addrssrangetable}
1883 Each set of entries in the table of address ranges contained
1884 in the \addtoindex{.debug\_aranges}
1885 section begins with a header containing:
1887 \begin{enumerate}[1.]
1888 % FIXME The unit length text is not fully consistent across
1891 \item unit\_length (initial length) \\
1892 A 4-byte or 12-byte length containing the length of the
1893 \addtoindexx{initial length}
1894 set of entries for this compilation unit, not including the
1895 length field itself. In the 32-bit DWARF format, this is a
1896 4-byte unsigned integer (which must be less than 0xfffffff0);
1897 in the 64-bit DWARF format, this consists of the 4-byte value
1898 0xffffffff followed by an 8-byte unsigned integer that gives
1900 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1902 \item version (uhalf) \\
1903 A 2\dash byte version identifier
1904 \addtoindexx{version number!address range table} containing the value 2
1905 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1907 \item debug\_info\_offset (section offset) \\
1908 A 4\dash byte or 8\dash byte offset into the
1909 \addtoindex{.debug\_info} section of
1910 the compilation unit header. In the 32\dash bit DWARF format,
1911 this is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
1912 this is an 8\dash byte unsigned offset
1913 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1915 \item address\_size (ubyte) \\
1916 A 1\dash byte unsigned integer containing the size in bytes of an
1917 \addtoindexx{address\_size}
1918 address (or the offset portion of an address for segmented
1919 \addtoindexx{address space!segmented}
1920 addressing) on the target system.
1922 \item segment\_size (ubyte) \\
1923 A 1\dash byte unsigned integer containing the size in bytes of a
1924 segment selector on the target system.
1928 This header is followed by a series of tuples. Each tuple
1929 consists of a segment, an address and a length.
1931 size is given by the segment\_size field of the header; the
1932 address and length size are each given by the address\_size
1933 field of the header.
1934 The first tuple following the header in
1935 each set begins at an offset that is a multiple of the size
1936 of a single tuple (that is, the size of a segment selector
1937 plus twice the size of an address).
1938 The header is padded, if
1939 necessary, to that boundary. Each set of tuples is terminated
1940 by a 0 for the segment, a 0 for the address and 0 for the
1941 length. If the segment\_size field in the header is zero,
1942 the segment selectors are omitted from all tuples, including
1943 the terminating tuple.
1946 \section{Line Number Information}
1947 \label{datarep:linenumberinformation}
1949 The \addtoindexi{version number}{version number!line number information}
1950 in the line number program header is 4
1951 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1953 The boolean values ``true'' and ``false''
1954 used by the line number information program are encoded
1955 as a single byte containing the value 0
1956 for ``false,'' and a non-zero value for ``true.''
1958 The encodings for the standard opcodes are given in
1959 Table \refersec{tab:linenumberstandardopcodeencodings}.
1961 % Odd that the 'Name' field captalized here, it is not caps elsewhere.
1963 \setlength{\extrarowheight}{0.1cm}
1964 \begin{longtable}{l|c}
1965 \caption{Line Number Standard Opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
1966 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
1968 \bfseries Opcode Name&\bfseries Value\\ \hline
1970 \hline \emph{Continued on next page}
1975 \livelink{chap:DWLNScopy}{DW\-\_LNS\-\_copy}&0x01 \\
1976 \livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}&0x02 \\
1977 \livelink{chap:DWLNSadvanceline}{DW\-\_LNS\-\_advance\-\_line}&0x03 \\
1978 \livelink{chap:DWLNSsetfile}{DW\-\_LNS\-\_set\-\_file}&0x04 \\
1979 \livelink{chap:DWLNSsetcolumn}{DW\-\_LNS\-\_set\-\_column}&0x05 \\
1980 \livelink{chap:DWLNSnegatestmt}{DW\-\_LNS\-\_negate\-\_stmt}&0x06 \\
1981 \livelink{chap:DWLNSsetbasicblock}{DW\-\_LNS\-\_set\-\_basic\-\_block}&0x07 \\
1982 \livelink{chap:DWLNSconstaddpc}{DW\-\_LNS\-\_const\-\_add\-\_pc}*0x08 \\
1983 \livelink{chap:DWLNSfixedadvancepc}{DW\-\_LNS\-\_fixed\-\_advance\-\_pc}&0x09 \\
1984 \livelink{chap:DWLNSsetprologueend}{DW\-\_LNS\-\_set\-\_prologue\-\_end}&0x0a \\
1985 \livelink{chap:DWLNSsetepiloguebegin}{DW\-\_LNS\-\_set\-\_epilogue\-\_begin}&0x0b \\
1986 \livelink{chap:DWLNSsetisa}{DW\-\_LNS\-\_set\-\_isa}&0x0c \\
1992 The encodings for the extended opcodes are given in
1993 Table \refersec{tab:linenumberextendedopcodeencodings}.
1996 \setlength{\extrarowheight}{0.1cm}
1997 \begin{longtable}{l|c}
1998 \caption{Line Number Extended Opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
1999 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
2001 \bfseries Opcode Name&\bfseries Value\\ \hline
2003 \hline \emph{Continued on next page}
2008 \livelink{chap:DWLNEendsequence}{DW\-\_LNE\-\_end\-\_sequence}&0x01 \\
2009 \livelink{chap:DWLNEsetaddress}{DW\-\_LNE\-\_set\-\_address}&0x02\\
2010 \livelink{chap:DWLNEdefinefile}{DW\-\_LNE\-\_define\-\_file}&0x03\\
2011 \livelink{chap:DWLNEsetdiscriminator}{DW\-\_LNE\-\_set\-\_discriminator} \ddag &0x04 \\
2012 \livetarg{chap:DWLNElouser}{DW\-\_LNE\-\_lo\-\_user}&0x80 \\
2013 \livetarg{chap:DWLNEhiuser}{DW\-\_LNE\-\_hi\-\_user}&0xff \\
2016 \ddag Extended opcode new in \addtoindex{DWARF Version 4}.
2019 \section{Macro Information}
2020 \label{datarep:macroinformation}
2022 The source line numbers and source file indices encoded in the
2023 macro information section are represented as unsigned LEB128
2024 numbers as are the constants in a
2025 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext} entry.
2027 The macinfo type is encoded as a single byte.
2028 The encodings are given in
2029 Table \refersec{tab:macinfotypeencodings}.
2033 \setlength{\extrarowheight}{0.1cm}
2034 \begin{longtable}{l|c}
2035 \caption{Macinfo Type Encodings} \label{tab:macinfotypeencodings}\\
2036 \hline \\ \bfseries Macinfo Type Name&\bfseries Value \\ \hline
2038 \bfseries Macinfo Type Name&\bfseries Value\\ \hline
2040 \hline \emph{Continued on next page}
2045 \livelink{chap:DWMACINFOdefine}{DW\-\_MACINFO\-\_define}&0x01 \\
2046 \livelink{chap:DWMACINFOundef}{DW\-\_MACINFO\-\_undef}&0x02 \\
2047 \livelink{chap:DWMACINFOstartfile}{DW\-\_MACINFO\-\_start\-\_file}&0x03 \\
2048 \livelink{chap:DWMACINFOendfile}{DW\-\_MACINFO\-\_end\-\_file}&0x04 \\
2049 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext}&0xff \\
2054 \section{Call Frame Information}
2055 \label{datarep:callframeinformation}
2057 In the 32\dash bit DWARF format, the value of the CIE id in the
2058 CIE header is 0xffffffff; in the 64\dash bit DWARF format, the
2059 value is 0xffffffffffffffff.
2061 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2062 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2064 Call frame instructions are encoded in one or more bytes. The
2065 primary opcode is encoded in the high order two bits of
2066 the first byte (that is, opcode = byte >> 6). An operand
2067 or extended opcode may be encoded in the low order 6
2068 bits. Additional operands are encoded in subsequent bytes.
2069 The instructions and their encodings are presented in
2070 Table \refersec{tab:callframeinstructionencodings}.
2073 \setlength{\extrarowheight}{0.1cm}
2074 \begin{longtable}{l|c|c|l|l}
2075 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2076 \hline \\ &\bfseries High 2 &\bfseries Low 6 & & \\
2077 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2079 & \bfseries High 2 &\bfseries Low 6 & &\\
2080 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2082 \hline \emph{Continued on next page}
2087 \livelink{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\-\_loc}&0x1&delta & \\
2088 \livelink{chap:DWCFAoffset}{DW\-\_CFA\-\_offset}&0x2®ister&ULEB128 offset \\
2089 \livelink{chap:DWCFArestore}{DW\-\_CFA\-\_restore}&0x3®ister & & \\
2090 \livelink{chap:DWCFAnop}{DW\-\_CFA\-\_nop}&0&0 & & \\
2091 \livelink{chap:DWCFAsetloc}{DW\-\_CFA\-\_set\-\_loc}&0&0x01&address & \\
2092 \livelink{chap:DWCFAadvanceloc1}{DW\-\_CFA\-\_advance\-\_loc1}&0&0x02&1\dash byte delta & \\
2093 \livelink{chap:DWCFAadvanceloc2}{DW\-\_CFA\-\_advance\-\_loc2}&0&0x03&2\dash byte delta & \\
2094 \livelink{chap:DWCFAadvanceloc4}{DW\-\_CFA\-\_advance\-\_loc4}&0&0x04&4\dash byte delta & \\
2095 \livelink{chap:DWCFAoffsetextended}{DW\-\_CFA\-\_offset\-\_extended}&0&0x05&ULEB128 register&ULEB128 offset \\
2096 \livelink{chap:DWCFArestoreextended}{DW\-\_CFA\-\_restore\-\_extended}&0&0x06&ULEB128 register & \\
2097 \livelink{chap:DWCFAundefined}{DW\-\_CFA\-\_undefined}&0&0x07&ULEB128 register & \\
2098 \livelink{chap:DWCFAsamevalue}{DW\-\_CFA\-\_same\-\_value}&0&0x08 &ULEB128 register & \\
2099 \livelink{chap:DWCFAregister}{DW\-\_CFA\-\_register}&0&0x09&ULEB128 register &ULEB128 offset \\
2100 \livelink{chap:DWCFArememberstate}{DW\-\_CFA\-\_remember\-\_state}&0&0x0a & & \\
2101 \livelink{chap:DWCFArestorestate}{DW\-\_CFA\-\_restore\-\_state}&0&0x0b & & \\
2102 \livelink{chap:DWCFAdefcfa}{DW\-\_CFA\-\_def\-\_cfa}&0&0x0c &ULEB128 register&ULEB128 offset \\
2103 \livelink{chap:DWCFAdefcfaregister}{DW\-\_CFA\-\_def\-\_cfa\-\_register}&0&0x0d&ULEB128 register & \\
2104 \livelink{chap:DWCFAdefcfaoffset}{DW\-\_CFA\-\_def\-\_cfa\-\_offset}&0&0x0e &ULEB128 offset & \\
2105 \livelink{chap:DWCFAdefcfaexpression}{DW\-\_CFA\-\_def\-\_cfa\-\_expression}&0&0x0f &BLOCK \\
2106 \livelink{chap:DWCFAexpression}{DW\-\_CFA\-\_expression}&0&0x10&ULEB128 register & BLOCK \\
2108 \livelink{chap:DWCFAoffsetextendedsf}{DW\-\_CFA\-\_offset\-\_extended\-\_sf}&0&0x11&ULEB128 register&SLEB128 offset \\
2109 \livelink{chap:DWCFAdefcfasf}{DW\-\_CFA\-\_def\-\_cfa\-\_sf}&0&0x12&ULEB128 register&SLEB128 offset \\
2110 \livelink{chap:DWCFAdefcfaoffsetsf}{DW\-\_CFA\-\_def\-\_cfa\-\_offset\-\_sf}&0&0x13&SLEB128 offset & \\
2111 \livelink{chap:DWCFAvaloffset}{DW\-\_CFA\-\_val\-\_offset}&0&0x14&ULEB128&ULEB128 \\
2112 \livelink{chap:DWCFAvaloffsetsf}{DW\-\_CFA\-\_val\-\_offset\-\_sf}&0&0x15&ULEB128&SLEB128 \\
2113 \livelink{chap:DWCFAvalexpression}{DW\-\_CFA\-\_val\-\_expression}&0&0x16&ULEB128&BLOCK \\
2114 \livetarg{chap:DWCFAlouser}{DW\-\_CFA\-\_lo\-\_user}&0&0x1c & & \\
2115 \livetarg{chap:DWCFAhiuser}{DW\-\_CFA\-\_hi\-\_user}&0&0x3f & & \\
2119 \section{Non-continguous Address Ranges}
2120 \label{datarep:noncontiguousaddressranges}
2122 Each entry in a range list
2123 (see Section \refersec{chap:noncontiguousaddressranges})
2125 \addtoindexx{base address selection entry!in range list}
2126 range list entry, a base address selection entry, or an end
2129 A range list entry consists of two relative addresses. The
2130 addresses are the same size as addresses on the target machine.
2132 A base address selection entry and an
2133 \addtoindex{end of list entry!in range list}
2134 end of list entry each
2135 \addtoindexx{base address selection entry!in range list}
2136 consist of two (constant or relocated) addresses. The two
2137 addresses are the same size as addresses on the target machine.
2139 For a range list to be specified, the base address of the
2140 \addtoindexx{base address selection entry!in range list}
2141 corresponding compilation unit must be defined
2142 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2145 \section{Dependencies and Constraints}
2146 \label{datarep:dependenciesandconstraints}
2148 The debugging information in this format is intended to
2150 \addtoindexx{DWARF section names!list of}
2152 the \addtoindex{.debug\_abbrev},
2153 \addtoindex{.debug\_aranges},
2154 \addtoindex{.debug\_frame},
2155 \addtoindex{.debug\_info},
2156 \addtoindex{.debug\_line},
2157 \addtoindex{.debug\_loc},
2158 \addtoindex{.debug\_macinfo},
2159 \addtoindex{.debug\_pubnames},
2160 \addtoindex{.debug\_pubtypes},
2161 \addtoindex{.debug\_ranges},
2162 \addtoindex{.debug\_str}
2164 \addtoindex{.debug\_types}
2165 sections of an object file, or equivalent
2166 separate file or database. The information is not
2167 word\dash aligned. Consequently: •
2170 \item For the 32\dash bit DWARF format and a target architecture with
2171 32\dash bit addresses, an assembler or compiler must provide a way
2172 to produce 2\dash byte and 4\dash byte quantities without alignment
2173 restrictions, and the linker must be able to relocate a
2174 4\dash byte address or section offset that occurs at an arbitrary
2177 \item For the 32\dash bit DWARF format and a target architecture with
2178 64\dash bit addresses, an assembler or compiler must provide a
2179 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2180 alignment restrictions, and the linker must be able to relocate
2181 an 8\dash byte address or 4\dash byte section offset that occurs at an
2182 arbitrary alignment.
2184 \item For the 64\dash bit DWARF format and a target architecture with
2185 32\dash bit addresses, an assembler or compiler must provide a
2186 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2187 alignment restrictions, and the linker must be able to relocate
2188 a 4\dash byte address or 8\dash byte section offset that occurs at an
2189 arbitrary alignment.
2191 \textit{It is expected that this will be required only for very large
2192 32\dash bit programs or by those architectures which support
2193 a mix of 32\dash bit and 64\dash bit code and data within the same
2196 \item For the 64\dash bit DWARF format and a target architecture with
2197 64\dash bit addresses, an assembler or compiler must provide a
2198 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2199 alignment restrictions, and the linker must be able to
2200 relocate an 8\dash byte address or section offset that occurs at
2201 an arbitrary alignment.
2204 \section{Integer Representation Names}
2205 \label{datarep:integerrepresentationnames}
2207 The sizes of the integers used in the lookup by name, lookup
2208 by address, line number and call frame information sections
2210 Table 41 \refersec{tab:integerrepresentationnames}.
2213 \setlength{\extrarowheight}{0.1cm}
2214 \begin{longtable}{c|l}
2215 \caption{Integer Representation Names} \label{tab:integerrepresentationnames}\\
2216 \hline \\ \bfseries Representation Name&\bfseries Representation \\ \hline
2218 \bfseries Representation Name&\bfseries Representation\\ \hline
2220 \hline \emph{Continued on next page}
2225 sbyte& signed, 1\dash byte integer \\
2226 ubyte&unsigned, 1\dash byte integer \\
2227 uhalf&unsigned, 2\dash byte integer \\
2228 uword&unsigned, 4\dash byte integer \\
2233 \section{Type Signature Computation}
2234 \label{datarep:typesignaturecomputation}
2236 A type signature is computed only by the DWARF producer;
2237 it is used by a DWARF consumer to resolve type references to
2238 the type definitions that are contained in type units.
2240 The type signature for a type T0 is formed from the MD5
2241 hash of a flattened description of the type. The flattened
2242 description of the type is a byte sequence derived from the
2243 DWARF encoding of the type as follows:
2245 \begin{enumerate}[1.]
2247 \item Start with an empty sequence S and a list V of visited
2248 types, where V is initialized to a list containing the type
2249 T0 as its single element. Elements in V are indexed from 1,
2252 \item If the debugging information entry represents a type that
2253 is nested inside another type or a namespace, append to S
2254 the type’s context as follows: For each surrounding type
2255 or namespace, beginning with the outermost such construct,
2256 append the letter 'C', the DWARF tag of the construct, and
2257 the name (taken from the \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute) of the type
2258 or namespace (including its trailing null byte).
2260 \item Append to S the letter 'D', followed by the DWARF tag of
2261 the debugging information entry.
2263 \item For each of the following attributes that are present in
2264 the debugging information entry, in the order listed below,
2265 append to S a marker letter (see below), the DWARF attribute
2266 code, and the attribute value.
2269 \item \livelink{chap:DWATname}{DW\-\_AT\-\_name}
2270 \item \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
2271 \item \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
2272 \item \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
2273 \item \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}
2274 \item \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}
2275 \item \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}
2276 \item \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
2277 \item \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
2278 \item \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
2279 \item \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
2280 \item \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
2281 \item \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
2282 \item \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
2283 \item \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
2284 \item \livelink{chap:DWATcount}{DW\-\_AT\-\_count}
2285 \item \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
2286 \item \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2287 \item \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
2288 \item \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
2289 \item \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}
2290 \item \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}
2291 \item \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
2292 \item \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}
2293 \item \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
2294 \item \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
2295 \item \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
2296 \item \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
2297 \item \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}
2298 \item \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}
2299 \item \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}
2300 \item \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}
2301 \item \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
2302 \item \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}
2303 \item \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}
2304 \item \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}
2305 \item \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}
2306 \item \livelink{chap:DWATsmall}{DW\-\_AT\-\_small}
2307 \item \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
2308 \item \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}
2309 \item \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}
2310 \item \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2311 \item \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}
2312 \item \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}
2313 \item \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}
2314 \item \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
2315 \item \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}
2316 \item \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}
2319 Note that except for the initial \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2320 attributes are appended in order according to the alphabetical
2321 spelling of their identifier.
2323 If an implementation defines any vendor-specific attributes,
2324 any such attributes that are essential to the definition of
2325 the type should also be included at the end of the above list,
2326 in their own alphabetical suborder.
2328 An attribute that refers to another type entry T is processed
2329 as follows: (a) If T is in the list V at some V[x], use the
2330 letter 'R' as the marker and use the unsigned LEB128 encoding
2331 of x as the attribute value; otherwise, (b) use the letter 'T'
2332 as the marker, process the type T recursively by performing
2333 Steps 2 through 7, and use the result as the attribute value.
2335 Other attribute values use the letter 'A' as the marker, and
2336 the value consists of the form code (encoded as an unsigned
2337 LEB128 value) followed by the encoding of the value according
2338 to the form code. To ensure reproducibility of the signature,
2339 the set of forms used in the signature computation is limited
2340 to the following: \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata},
2341 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag},
2342 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string},
2343 and \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}.
2345 \item If the tag in Step 3 is one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2346 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2347 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2348 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type},
2349 or \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, and the referenced
2350 type (via the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2351 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) has a
2352 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to S the letter 'N', the DWARF
2353 attribute code (\livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2354 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}), the context of
2355 the type (according to the method in Step 2), the letter 'E',
2356 and the name of the type. For \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, if the referenced
2357 entry is a \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}, the context is omitted and the
2358 name to be used is the ABI-specific name of the subprogram
2359 (e.g., the mangled linker name).
2362 \item 6.If the tag in Step 3 is not one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2363 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2364 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2365 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}, or
2366 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, but has
2367 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, or if the referenced type (via
2368 the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2369 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) does not have a
2370 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, the attribute is processed according to
2371 the method in Step 4 for an attribute that refers to another
2375 \item Visit each child C of the debugging information
2376 entry as follows: If C is a nested type entry or a member
2377 function entry, and has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to
2378 S the letter 'S', the tag of C, and its name; otherwise,
2379 process C recursively by performing Steps 3 through 7,
2380 appending the result to S. Following the last child (or if
2381 there are no children), append a zero byte.
2386 For the purposes of this algorithm, if a debugging information
2388 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
2389 attribute that refers to
2390 another entry D (which has a
2391 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}
2393 then S inherits the attributes and children of D, and S is
2394 processed as if those attributes and children were present in
2395 the entry S. Exception: if a particular attribute is found in
2396 both S and D, the attribute in S is used and the corresponding
2397 one in D is ignored.
2399 DWARF tag and attribute codes are appended to the sequence
2400 as unsigned LEB128 values, using the values defined earlier
2403 \textit{A grammar describing this computation may be found in
2404 Appendix \refersec{app:typesignaturecomputationgrammar}.
2407 \textit{An attribute that refers to another type entry should
2408 be recursively processed or replaced with the name of the
2409 referent (in Step 4, 5 or 6). If neither treatment applies to
2410 an attribute that references another type entry, the entry
2411 that contains that attribute should not be considered for a
2412 separate type unit.}
2414 \textit{If a debugging information entry contains an attribute from
2415 the list above that would require an unsupported form, that
2416 entry should not be considered for a separate type unit.}
2418 \textit{A type should be considered for a separate type unit only
2419 if all of the type entries that it contains or refers to in
2420 Steps 6 and 7 can themselves each be considered for a separate
2423 Where the DWARF producer may reasonably choose two or more
2424 different forms for a given attribute, it should choose
2425 the simplest possible form in computing the signature. (For
2426 example, a constant value should be preferred to a location
2427 expression when possible.)
2429 Once the string S has been formed from the DWARF encoding,
2430 an MD5 hash is computed for the string and the lower 64 bits
2431 are taken as the type signature.
2433 \textit{The string S is intended to be a flattened representation of
2434 the type that uniquely identifies that type (i.e., a different
2435 type is highly unlikely to produce the same string).}
2437 \textit{A debugging information entry should not be placed in a
2438 separate type unit if any of the following apply:}
2442 \item \textit{The entry has an attribute whose value is a location
2443 expression, and the location expression contains a reference to
2444 another debugging information entry (e.g., a \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}
2445 operator), as it is unlikely that the entry will remain
2446 identical across compilation units.}
2448 \item \textit{The entry has an attribute whose value refers
2449 to a code location or a location list.}
2451 \item \textit{The entry has an attribute whose value refers
2452 to another debugging information entry that does not represent
2457 \textit{Certain attributes are not included in the type signature:}
2460 \item \textit{The \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute is not included because it
2461 indicates that the debugging information entry represents an
2462 incomplete declaration, and incomplete declarations should
2463 not be placed in separate type units.}
2465 \item \textit{The \livelink{chap:DWATdescription}{DW\-\_AT\-\_description} attribute is not included because
2466 it does not provide any information unique to the defining
2467 declaration of the type.}
2469 \item \textit{The \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}, \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}, and
2470 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column} attributes are not included because they
2471 may vary from one source file to the next, and would prevent
2472 two otherwise identical type declarations from producing the