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 \hypertarget{chap:DWXXXlohiuser}{}
24 value range for vendor specific extensions consist of the
26 (\DWATlouserMARK{}\DWAThiuserMARK{} DW\_AT,
27 \DWATElouserMARK{}\DWATEhiuserMARK{} DW\_ATE,
28 \DWCClouserMARK{}\DWCChiuserMARK{} DW\_CC,
29 \DWCFAlouserMARK{}\DWCFAhiuserMARK{} DW\_CFA
30 \DWENDlouserMARK{}\DWENDhiuserMARK{} DW\_END,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{} DW\_LANG,
32 \DWLNElouserMARK{}\DWLNEhiuserMARK{} DW\_LNE,
33 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
34 \DWOPlouserMARK{}\DWOPhiuserMARK{} DW\_OP or
35 \DWTAGlouserMARK{}\DWTAGhiuserMARK{} DW\_TAG,
36 respectively) followed by
37 \_lo\_user or \_hi\_user.
38 Values in the range between \textit{prefix}\_lo\_user
39 and \textit{prefix}\_hi\_user inclusive,
40 are reserved for vendor specific extensions. Vendors may
41 use values in this range without conflicting with current or
42 future system\dash defined values. All other values are reserved
43 for use by the system.
45 \textit{For example, for DIE tags, the special
46 labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
48 \textit{There may also be codes for vendor specific extensions
49 between the number of standard line number opcodes and
50 the first special line number opcode. However, since the
51 number of standard opcodes varies with the DWARF version,
52 the range for extensions is also version dependent. Thus,
53 \DWLNSlouserTARG{} and
54 \DWLNShiuserTARG{} symbols are not defined.
57 Vendor defined tags, attributes, base type encodings, location
58 atoms, language names, line number actions, calling conventions
59 and call frame instructions, conventionally use the form
60 \text{prefix\_vendor\_id\_name}, where
61 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
62 character sequence chosen so as to avoid conflicts with
65 To ensure that extensions added by one vendor may be safely
66 ignored by consumers that do not understand those extensions,
67 the following rules should be followed:
68 \begin{enumerate}[1. ]
70 \item New attributes should be added in such a way that a
71 debugger may recognize the format of a new attribute value
72 without knowing the content of that attribute value.
74 \item The semantics of any new attributes should not alter
75 the semantics of previously existing attributes.
77 \item The semantics of any new tags should not conflict with
78 the semantics of previously existing tags.
80 \item Do not add any new forms of attribute value.
85 \section{Reserved Values}
86 \label{datarep:reservedvalues}
87 \subsection{Error Values}
88 \label{datarep:errorvalues}
89 \addtoindexx{reserved values!error}
92 \addtoindexx{error value}
93 a convenience for consumers of DWARF information, the value
94 0 is reserved in the encodings for attribute names, attribute
95 forms, base type encodings, location operations, languages,
96 line number program opcodes, macro information entries and tag
97 names to represent an error condition or unknown value. DWARF
98 does not specify names for these reserved values, since they
99 do not represent valid encodings for the given type and should
100 not appear in DWARF debugging information.
103 \subsection{Initial Length Values}
104 \label{datarep:initiallengthvalues}
105 \addtoindexx{reserved values!initial length}
107 An \livetarg{datarep:initiallengthvalues}{initial length field} is one of the length fields that occur
109 of those DWARF sections that
114 \dotdebugpubnames{}, and
115 \dotdebugpubtypes{}) or the length field
116 that occurs at the beginning of the CIE and FDE structures
117 in the \dotdebugframe{} section.
120 In an \addtoindex{initial length field}, the values \wfffffffzero through
121 \wffffffff are reserved by DWARF to indicate some form of
122 extension relative to \addtoindex{DWARF Version 2}; such values must not
123 be interpreted as a length field. The use of one such value,
124 \xffffffff, is defined below
125 (see Section \refersec{datarep:32bitand64bitdwarfformats});
127 the other values is reserved for possible future extensions.
131 \section{Relocatable, Split, Executable and Shared Objects}
132 \label{datarep:executableobjectsandsharedobjects}
134 \subsection{Relocatable Objects}
136 \subsection{Split DWARF Objects}
137 \label{datarep:splitdwarfobjects}
138 A DWARF producer may partition the debugging
139 information such that the majority of the debugging
140 information can remain in individual object files without
141 being processed by the linker. The first partition contains
142 debugging information that must still be processed by the linker,
143 and includes the following:
146 The line number tables, range tables, frame tables, and
147 accelerated access tables, in the usual sections:
148 \dotdebugline, \dotdebugranges, \dotdebugframe,
149 \dotdebugpubnames, \dotdebugpubtypes{} and \dotdebugaranges,
152 An address table, in the \dotdebugaddr{} section. This table
153 contains all addresses and constants that require
154 link-time relocation, and items in the table can be
155 referenced indirectly from the debugging information via
156 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
157 \DWOPconstx{} operators.
159 A skeleton compilation unit, as described in Section
160 \refersec{chap:skeletoncompilationunitentries},
161 in the \dotdebuginfo{} section.
163 An abbreviations table for the skeleton compilation unit,
164 in the \dotdebugabbrev{} section.
166 A string table, in the \dotdebugstr{} section. The string
167 table is necessary only if the skeleton compilation unit
168 uses either indirect string form, \DWFORMstrp{} or
171 A string offsets table, in the \dotdebugstroffsets{}
172 section. The string offsets table is necessary only if
173 the skeleton compilation unit uses the \DWFORMstrx{} form.
175 The attributes contained in the skeleton compilation
176 unit can be used by a DWARF consumer to find the object file
177 or DWARF object file that contains the second partition.
179 The second partition contains the debugging information that
180 does not need to be processed by the linker. These sections
181 may be left in the object files and ignored by the linker
182 (that is, not combined and copied to the executable object), or
183 they may be placed by the producer in a separate DWARF object
184 file. This partition includes the following:
187 The full compilation unit, in the \dotdebuginfodwo{} section.
188 Attributes in debugging information entries may refer to
189 machine addresses indirectly using the \DWFORMaddrx{} form,
190 and location expressions may do so using the \DWOPaddrx{} and
191 \DWOPconstx{} forms. Attributes may refer to range table
192 entries with an offset relative to a base offset in the
193 range table for the compilation unit.
195 \item Separate type units, in the \dotdebuginfodwo{} section.
198 Abbreviations table(s) for the compilation unit and type
199 units, in the \dotdebugabbrevdwo{} section.
201 \item Location lists, in the \dotdebuglocdwo{} section.
204 A skeleton line table (for the type units), in the
205 \dotdebuglinedwo{} section (see
206 Section \refersec{chap:skeletoncompilationunitentries}).
208 \item Macro information, in the \dotdebugmacrodwo{} section.
210 \item A string table, in the \dotdebugstrdwo{} section.
212 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
216 Except where noted otherwise, all references in this document
217 to a debugging information section (for example, \dotdebuginfo),
218 applies also to the corresponding split DWARF section (for example,
221 \subsection{Executable Objects}
222 \label{chap:executableobjects}
223 The relocated addresses in the debugging information for an
224 executable object are virtual addresses.
226 \subsection{Shared Objects}
227 \label{datarep:sharedobjects}
229 addresses in the debugging information for a shared object
230 are offsets relative to the start of the lowest region of
231 memory loaded from that shared object.
234 \textit{This requirement makes the debugging information for
235 shared objects position independent. Virtual addresses in a
236 shared object may be calculated by adding the offset to the
237 base address at which the object was attached. This offset
238 is available in the run\dash time linker\textquoteright s data structures.}
242 \section{32-Bit and 64-Bit DWARF Formats}
243 \label{datarep:32bitand64bitdwarfformats}
244 \hypertarget{datarep:xxbitdwffmt}{}
245 \addtoindexx{32-bit DWARF format}
246 \addtoindexx{64-bit DWARF format}
247 There are two closely related file formats. In the 32\dash bit DWARF
248 format, all values that represent lengths of DWARF sections
249 and offsets relative to the beginning of DWARF sections are
250 represented using 32\dash bits. In the 64\dash bit DWARF format, all
251 values that represent lengths of DWARF sections and offsets
252 relative to the beginning of DWARF sections are represented
253 using 64\dash bits. A special convention applies to the initial
254 length field of certain DWARF sections, as well as the CIE and
255 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
256 can coexist and be distinguished within a single linked object.
258 The differences between the 32\dash\ and 64\dash bit
260 detailed in the following:
261 \begin{enumerate}[1. ]
263 \item In the 32\dash bit DWARF format, an
264 \addtoindex{initial length field}
266 \addtoindexx{initial length field!encoding}
267 Section \refersec{datarep:initiallengthvalues})
268 is an unsigned 32\dash bit integer (which
269 must be less than \xfffffffzero); in the 64\dash bit DWARF format,
270 an \addtoindex{initial length field} is 96 bits in size,
273 \item The first 32\dash bits have the value \xffffffff.
275 \item The following 64\dash bits contain the actual length
276 represented as an unsigned 64\dash bit integer.
279 \textit{This representation allows a DWARF consumer to dynamically
280 detect that a DWARF section contribution is using the 64\dash bit
281 format and to adapt its processing accordingly.}
283 \item Section offset and section length
284 \hypertarget{datarep:sectionoffsetlength}{}
285 \addtoindexx{section length!use in headers}
287 \addtoindexx{section offset!use in headers}
288 in the headers of DWARF sections (other
289 \addtoindexx{initial length field}
291 \addtoindex{initial length}
292 fields) are listed following. In the 32\dash bit DWARF format these
293 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
295 \addtoindexx{section length!in .debug\_aranges header}
297 \addtoindexx{section length!in .debug\_pubnames header}
299 \addtoindexx{section length!in .debug\_pubtypes header}
300 unsigned integer values.
304 Section &Name & Role \\ \hline
305 \dotdebugaranges{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
306 \dotdebugframe{}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
307 \dotdebugframe{}/FDE & \addtoindex{CIE\_pointer} & offset in \dotdebugframe{} \\
308 \dotdebuginfo{} & \addtoindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
309 \dotdebugline{} & \addtoindex{header\_length} & length of header itself \\
310 \dotdebugpubnames{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
311 & \addtoindex{debug\_info\_length} & length of \dotdebuginfo{} \\
313 \dotdebugpubtypes{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
314 & \addtoindex{debug\_info\_length} & length of \dotdebuginfo{} \\
319 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
320 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
321 union must be accessed to distinguish whether a CIE or FDE is
322 present, consequently, these two fields must exactly overlay
323 each other (both offset and size).
325 \item Within the body of the \dotdebuginfo{}
326 section, certain forms of attribute value depend on the choice
327 of DWARF format as follows. For the 32\dash bit DWARF format,
328 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
329 format, the value is a 64\dash bit unsigned integer.
332 Form & Role \\ \hline
333 \DWFORMrefaddr& offset in \dotdebuginfo{} \\
334 \DWFORMsecoffset& offset in a section other than \\
335 &\dotdebuginfo{} or \dotdebugstr{} \\
336 \DWFORMstrp&offset in \dotdebugstr{} \\
337 \DWOPcallref&offset in \dotdebuginfo{} \\
341 \item Within the body of the \dotdebugpubnames{} and
343 sections, the representation of the first field
344 of each tuple (which represents an offset in the
346 section) depends on the DWARF format as follows: in the
347 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
348 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
351 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
352 sections, the size of entries in the body depend on the DWARF
353 format as follows: in the 32-bit DWARF format, entries are 32-bit
354 unsigned integer values; in the 64-bit DWARF format, they are
355 64-bit unsigned integers.
357 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
358 sections, the contents of the address size fields depends on the
359 DWARF format as follows: in the 32-bit DWARF format, these fields
360 contain 4; in the 64-bit DWARF format these fields contain 8.
364 The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
365 intermixed within a single compilation unit.
367 \textit{Attribute values and section header fields that represent
368 addresses in the target program are not affected by these
371 A DWARF consumer that supports the 64\dash bit DWARF format must
372 support executables in which some compilation units use the
373 32\dash bit format and others use the 64\dash bit format provided that
374 the combination links correctly (that is, provided that there
375 are no link\dash time errors due to truncation or overflow). (An
376 implementation is not required to guarantee detection and
377 reporting of all such errors.)
379 \textit{It is expected that DWARF producing compilers will \emph{not} use
380 the 64\dash bit format \emph{by default}. In most cases, the division of
381 even very large applications into a number of executable and
382 shared objects will suffice to assure that the DWARF sections
383 within each individual linked object are less than 4 GBytes
384 in size. However, for those cases where needed, the 64\dash bit
385 format allows the unusual case to be handled as well. Even
386 in this case, it is expected that only application supplied
387 objects will need to be compiled using the 64\dash bit format;
388 separate 32\dash bit format versions of system supplied shared
389 executable libraries can still be used.}
393 \section{Format of Debugging Information}
394 \label{datarep:formatofdebugginginformation}
396 For each compilation unit compiled with a DWARF producer,
397 a contribution is made to the \dotdebuginfo{} section of
398 the object file. Each such contribution consists of a
399 compilation unit header
400 (see Section \refersec{datarep:compilationunitheader})
402 single \DWTAGcompileunit{} or
403 \DWTAGpartialunit{} debugging
404 information entry, together with its children.
406 For each type defined in a compilation unit, a separate
407 contribution may also be made to the
409 section of the object file. Each
410 such contribution consists of a
411 \addtoindex{type unit} header
412 (see Section \refersec{datarep:typeunitheader})
413 followed by a \DWTAGtypeunit{} entry, together with
416 Each debugging information entry begins with a code that
417 represents an entry in a separate
418 \addtoindex{abbreviations table}. This
419 code is followed directly by a series of attribute values.
421 The appropriate entry in the
422 \addtoindex{abbreviations table} guides the
423 interpretation of the information contained directly in the
424 \dotdebuginfo{} section.
427 Multiple debugging information entries may share the same
428 abbreviation table entry. Each compilation unit is associated
429 with a particular abbreviation table, but multiple compilation
430 units may share the same table.
432 \subsection{Unit Headers}
433 \label{datarep:unitheaders}
434 Unit headers contain a field, \texttt{unit\_type}, whose value indicates the kind of
435 compilation unit that follows. The encodings for the unit type
436 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
440 \setlength{\extrarowheight}{0.1cm}
441 \begin{longtable}{l|l}
442 \caption{Unit header unit kind encodings}
443 \label{tab:unitheaderunitkindencodings}
444 \addtoindexx{Unit header unit kind encodings} \\
445 \hline \bfseries Unit header unit kind encodings&\bfseries Value \\ \hline
447 \bfseries Unit header unit kind encodings&\bfseries Value \\ \hline
449 \hline \emph{Continued on next page}
453 \DWUTcompileTARG &0x01 \\
454 \DWUTtypeTARG &0x02 \\
455 \DWUTpartialTARG &0x03 \\ \hline
459 \subsubsection{Compilation Unit Header}
460 \label{datarep:compilationunitheader}
461 \begin{enumerate}[1. ]
463 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
464 \addttindexx{unit\_length}
465 A 4\dash byte or 12\dash byte
466 \addtoindexx{initial length}
467 unsigned integer representing the length
468 of the \dotdebuginfo{}
469 contribution for that compilation unit,
470 not including the length field itself. In the \thirtytwobitdwarfformat,
471 this is a 4\dash byte unsigned integer (which must be less
472 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
473 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
474 integer that gives the actual length
475 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
477 \item \texttt{version} (\addtoindex{uhalf}) \\
478 A 2\dash byte unsigned integer representing the version of the
479 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
480 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
481 The value in this field is \versiondotdebuginfo.
484 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
485 A 1-byte unsigned integer identifying this unit as a compilation unit.
486 The value of this field is
487 \DWUTcompile{} for a {normal compilation} unit or
488 \DWUTpartial{} for a {partial compilation} unit
489 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
491 \textit{This field is new in \DWARFVersionV.}
494 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
496 \addtoindexx{section offset!in .debug\_info header}
497 4\dash byte or 8\dash byte unsigned offset into the
499 section. This offset associates the compilation unit with a
500 particular set of debugging information entry abbreviations. In
501 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
502 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
503 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
505 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
506 A 1\dash byte unsigned integer representing the size in bytes of
507 \addttindexx{address\_size}
508 an address on the target architecture. If the system uses
509 \addtoindexx{address space!segmented}
510 segmented addressing, this value represents the size of the
511 offset portion of an address.
516 \subsubsection{Type Unit Header}
517 \label{datarep:typeunitheader}
519 The header for the series of debugging information entries
520 contributing to the description of a type that has been
521 placed in its own \addtoindex{type unit}, within the
522 \dotdebuginfo{} section,
523 consists of the following information:
524 \begin{enumerate}[1. ]
526 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
527 \addttindexx{unit\_length}
528 A 4\dash byte or 12\dash byte unsigned integer
529 \addtoindexx{initial length}
530 representing the length
531 of the \dotdebuginfo{} contribution for that type unit,
532 not including the length field itself. In the \thirtytwobitdwarfformat,
533 this is a 4\dash byte unsigned integer (which must be
534 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
535 consists of the 4\dash byte value \wffffffff followed by an
536 8\dash byte unsigned integer that gives the actual length
537 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
540 \item \texttt{version} (\addtoindex{uhalf}) \\
541 A 2\dash byte unsigned integer representing the version of the
542 DWARF information for the
543 type unit\addtoindexx{version number!type unit}
544 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
545 The value in this field is \versiondotdebuginfo.
547 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
548 A 1-byte unsigned integer identifying this unit as a type unit.
549 The value of this field is \DWUTtype{} for a type unit
550 (see Section \refersec{chap:separatetypeunitentries}).
552 \textit{This field is new in \DWARFVersionV.}
555 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
557 \addtoindexx{section offset!in .debug\_info header}
558 4\dash byte or 8\dash byte unsigned offset into the
560 section. This offset associates the type unit with a
561 particular set of debugging information entry abbreviations. In
562 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
563 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
564 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
567 \item \texttt{address\_size} (ubyte) \\
568 A 1\dash byte unsigned integer representing the size
569 \addtoindexx{size of an address}
571 \addttindexx{address\_size}
572 an address on the target architecture. If the system uses
573 \addtoindexx{address space!segmented}
574 segmented addressing, this value represents the size of the
575 offset portion of an address.
577 \item \texttt{type\_signature} (8\dash byte unsigned integer) \\
578 \addtoindexx{type signature}
580 \addttindexx{type\_signature}
581 64\dash bit unique signature (see Section
582 \refersec{datarep:typesignaturecomputation})
583 of the type described in this type
586 \textit{An attribute that refers (using
587 \DWFORMrefsigeight{}) to
588 the primary type contained in this
589 \addtoindex{type unit} uses this value.}
591 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
592 \addttindexx{type\_offset}
593 A 4\dash byte or 8\dash byte unsigned offset
594 \addtoindexx{section offset!in .debug\_info header}
595 relative to the beginning
596 of the \addtoindex{type unit} header.
597 This offset refers to the debugging
598 information entry that describes the type. Because the type
599 may be nested inside a namespace or other structures, and may
600 contain references to other types that have not been placed in
601 separate type units, it is not necessarily either the first or
602 the only entry in the type unit. In the \thirtytwobitdwarfformat,
603 this is a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat,
604 this is an 8\dash byte unsigned length
605 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
609 \subsection{Debugging Information Entry}
610 \label{datarep:debugginginformationentry}
612 Each debugging information entry begins with an
613 unsigned LEB128\addtoindexx{LEB128!unsigned}
614 number containing the abbreviation code for the entry. This
615 code represents an entry within the abbreviations table
616 associated with the compilation unit containing this entry. The
617 abbreviation code is followed by a series of attribute values.
619 On some architectures, there are alignment constraints on
620 section boundaries. To make it easier to pad debugging
621 information sections to satisfy such constraints, the
622 abbreviation code 0 is reserved. Debugging information entries
623 consisting of only the abbreviation code 0 are considered
626 \subsection{Abbreviations Tables}
627 \label{datarep:abbreviationstables}
629 The abbreviations tables for all compilation units
630 are contained in a separate object file section called
632 As mentioned before, multiple compilation
633 units may share the same abbreviations table.
635 The abbreviations table for a single compilation unit consists
636 of a series of abbreviation declarations. Each declaration
637 specifies the tag and attributes for a particular form of
638 debugging information entry. Each declaration begins with
639 an unsigned LEB128\addtoindexx{LEB128!unsigned}
640 number representing the abbreviation
641 code itself. It is this code that appears at the beginning
642 of a debugging information entry in the
644 section. As described above, the abbreviation
645 code 0 is reserved for null debugging information entries. The
646 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
647 number that encodes the entry\textquoteright s tag. The encodings for the
648 tag names are given in
649 Table \refersec{tab:tagencodings}.
652 \setlength{\extrarowheight}{0.1cm}
653 \begin{longtable}{l|l}
655 \caption{Tag encodings} \label{tab:tagencodings} \\
656 \hline \bfseries Tag name&\bfseries Value\\ \hline
658 \bfseries Tag name&\bfseries Value \\ \hline
660 \hline \emph{Continued on next page}
662 \hline \ddag\ \textit{New in DWARF Version 5}
664 \DWTAGarraytype{} &0x01 \\
665 \DWTAGclasstype&0x02 \\
666 \DWTAGentrypoint&0x03 \\
667 \DWTAGenumerationtype&0x04 \\
668 \DWTAGformalparameter&0x05 \\
669 \DWTAGimporteddeclaration&0x08 \\
671 \DWTAGlexicalblock&0x0b \\
673 \DWTAGpointertype&0x0f \\
674 \DWTAGreferencetype&0x10 \\
675 \DWTAGcompileunit&0x11 \\
676 \DWTAGstringtype&0x12 \\
677 \DWTAGstructuretype&0x13 \\
678 \DWTAGsubroutinetype&0x15 \\
679 \DWTAGtypedef&0x16 \\
680 \DWTAGuniontype&0x17 \\
681 \DWTAGunspecifiedparameters&0x18 \\
682 \DWTAGvariant&0x19 \\
683 \DWTAGcommonblock&0x1a \\
684 \DWTAGcommoninclusion&0x1b \\
685 \DWTAGinheritance&0x1c \\
686 \DWTAGinlinedsubroutine&0x1d \\
688 \DWTAGptrtomembertype&0x1f \\
689 \DWTAGsettype&0x20 \\
690 \DWTAGsubrangetype&0x21 \\
691 \DWTAGwithstmt&0x22 \\
692 \DWTAGaccessdeclaration&0x23 \\
693 \DWTAGbasetype&0x24 \\
694 \DWTAGcatchblock&0x25 \\
695 \DWTAGconsttype&0x26 \\
696 \DWTAGconstant&0x27 \\
697 \DWTAGenumerator&0x28 \\
698 \DWTAGfiletype&0x29 \\
700 \DWTAGnamelist&0x2b \\
701 \DWTAGnamelistitem&0x2c \\
702 \DWTAGpackedtype&0x2d \\
703 \DWTAGsubprogram&0x2e \\
704 \DWTAGtemplatetypeparameter&0x2f \\
705 \DWTAGtemplatevalueparameter&0x30 \\
706 \DWTAGthrowntype&0x31 \\
707 \DWTAGtryblock&0x32 \\
708 \DWTAGvariantpart&0x33 \\
709 \DWTAGvariable&0x34 \\
710 \DWTAGvolatiletype&0x35 \\
711 \DWTAGdwarfprocedure&0x36 \\
712 \DWTAGrestricttype&0x37 \\
713 \DWTAGinterfacetype&0x38 \\
714 \DWTAGnamespace&0x39 \\
715 \DWTAGimportedmodule&0x3a \\
716 \DWTAGunspecifiedtype&0x3b \\
717 \DWTAGpartialunit&0x3c \\
718 \DWTAGimportedunit&0x3d \\
719 \DWTAGcondition&\xiiif \\
720 \DWTAGsharedtype&0x40 \\
721 \DWTAGtypeunit & 0x41 \\
722 \DWTAGrvaluereferencetype & 0x42 \\
723 \DWTAGtemplatealias & 0x43 \\
724 \DWTAGcoarraytype~\ddag & 0x44 \\
725 \DWTAGgenericsubrange~\ddag & 0x45 \\
726 \DWTAGdynamictype~\ddag & 0x46 \\
727 \DWTAGatomictype~\ddag & 0x47 \\
728 \DWTAGcallsite~\ddag & 0x48 \\
729 \DWTAGcallsiteparameter~\ddag & 0x49 \\
730 \DWTAGlouser&0x4080 \\
731 \DWTAGhiuser&\xffff \\
735 Following the tag encoding is a 1\dash byte value that determines
736 whether a debugging information entry using this abbreviation
737 has child entries or not. If the value is
739 the next physically succeeding entry of any debugging
740 information entry using this abbreviation is the first
741 child of that entry. If the 1\dash byte value following the
742 abbreviation\textquoteright s tag encoding is
743 \DWCHILDRENnoTARG, the next
744 physically succeeding entry of any debugging information entry
745 using this abbreviation is a sibling of that entry. (Either
746 the first child or sibling entries may be null entries). The
747 encodings for the child determination byte are given in
748 Table \refersec{tab:childdeterminationencodings}
750 Section \refersec{chap:relationshipofdebugginginformationentries},
751 each chain of sibling entries is terminated by a null entry.)
755 \setlength{\extrarowheight}{0.1cm}
756 \begin{longtable}{l|l}
757 \caption{Child determination encodings}
758 \label{tab:childdeterminationencodings}
759 \addtoindexx{Child determination encodings} \\
760 \hline \bfseries Children determination name&\bfseries Value \\ \hline
762 \bfseries Children determination name&\bfseries Value \\ \hline
764 \hline \emph{Continued on next page}
768 \DWCHILDRENno&0x00 \\
769 \DWCHILDRENyes&0x01 \\ \hline
774 Finally, the child encoding is followed by a series of
775 attribute specifications. Each attribute specification
776 consists of two parts. The first part is an
777 unsigned LEB128\addtoindexx{LEB128!unsigned}
778 number representing the attribute\textquoteright s name.
779 The second part is an
780 unsigned LEB128\addtoindexx{LEB128!unsigned}
781 number representing the attribute\textquoteright s form.
782 The series of attribute specifications ends with an
783 entry containing 0 for the name and 0 for the form.
786 \DWFORMindirectTARG{} is a special case. For
787 attributes with this form, the attribute value itself in the
789 section begins with an unsigned
790 LEB128 number that represents its form. This allows producers
791 to choose forms for particular attributes
792 \addtoindexx{abbreviations table!dynamic forms in}
794 without having to add a new entry to the abbreviations table.
796 The abbreviations for a given compilation unit end with an
797 entry consisting of a 0 byte for the abbreviation code.
800 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
801 for a depiction of the organization of the
802 debugging information.}
805 \subsection{Attribute Encodings}
806 \label{datarep:attributeencodings}
808 The encodings for the attribute names are given in
809 Table \refersec{tab:attributeencodings}.
811 The attribute form governs how the value of the attribute is
812 encoded. There are nine classes of form, listed below. Each
813 class is a set of forms which have related representations
814 and which are given a common interpretation according to the
815 attribute in which the form is used.
817 Form \DWFORMsecoffsetTARG{}
819 \addtoindexx{rangelistptr class}
821 \addtoindexx{macptr class}
823 \addtoindexx{loclistptr class}
825 \addtoindexx{lineptr class}
831 \CLASSrangelistptr{} or
833 the list of classes allowed by the applicable attribute in
834 Table \refersec{tab:attributeencodings}
835 determines the class of the form.
839 Each possible form belongs to one or more of the following classes:
842 \item \livelinki{chap:classaddress}{address}{address class} \\
843 \livetarg{datarep:classaddress}{}
844 Represented as either:
846 \item An object of appropriate size to hold an
847 address on the target machine
849 The size is encoded in the compilation unit header
850 (see Section \refersec{datarep:compilationunitheader}).
851 This address is relocatable in a relocatable object file and
852 is relocated in an executable file or shared object.
854 \item An indirect index into a table of addresses (as
855 described in the previous bullet) in the
856 \dotdebugaddr{} section (\DWFORMaddrxTARG).
857 The representation of a \DWFORMaddrxNAME{} value is an unsigned
858 \addtoindex{LEB128} value, which is interpreted as a zero-based
859 index into an array of addresses in the \dotdebugaddr{} section.
860 The index is relative to the value of the \DWATaddrbase{} attribute
861 of the associated compilation unit.
865 \item \livelink{chap:classaddrptr}{addrptr} \\
866 \livetarg{datarep:classaddrptr}{}
867 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
868 consists of an offset from the beginning of the \dotdebugaddr{} section to the
869 beginning of the list of machine addresses information for the
870 referencing entity. It is relocatable in
871 a relocatable object file, and relocated in an executable or
872 shared object. In the \thirtytwobitdwarfformat, this offset
873 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
874 format, it is an 8\dash byte unsigned value (see Section
875 \refersec{datarep:32bitand64bitdwarfformats}).
877 \textit{This class is new in \DWARFVersionV.}
880 \item \livelink{chap:classblock}{block} \\
881 \livetarg{datarep:classblock}{}
882 Blocks come in four forms:
884 \begin{myindentpara}{1cm}
885 A 1\dash byte length followed by 0 to 255 contiguous information
886 bytes (\DWFORMblockoneTARG).
889 \begin{myindentpara}{1cm}
890 A 2\dash byte length followed by 0 to 65,535 contiguous information
891 bytes (\DWFORMblocktwoTARG).
894 \begin{myindentpara}{1cm}
895 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
896 information bytes (\DWFORMblockfourTARG).
899 \begin{myindentpara}{1cm}
900 An unsigned LEB128\addtoindexx{LEB128!unsigned}
901 length followed by the number of bytes
902 specified by the length (\DWFORMblockTARG).
905 In all forms, the length is the number of information bytes
906 that follow. The information bytes may contain any mixture
907 of relocated (or relocatable) addresses, references to other
908 debugging information entries or data bytes.
910 \item \livelinki{chap:classconstant}{constant}{constant class} \\
911 \livetarg{datarep:classconstant}{}
912 There are six forms of constants. There are fixed length
913 constant data forms for one, two, four and eight byte values
918 and \DWFORMdataeightTARG).
919 There are also variable length constant
920 data forms encoded using LEB128 numbers (see below). Both
921 signed (\DWFORMsdataTARG) and unsigned
922 (\DWFORMudataTARG) variable
923 length constants are available
926 The data in \DWFORMdataone,
928 \DWFORMdatafour{} and
930 can be anything. Depending on context, it may
931 be a signed integer, an unsigned integer, a floating\dash point
932 constant, or anything else. A consumer must use context to
933 know how to interpret the bits, which if they are target
934 machine data (such as an integer or floating point constant)
935 will be in target machine byte\dash order.
937 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
938 forms is used to represent a
939 signed or unsigned integer, it can be hard for a consumer
940 to discover the context necessary to determine which
941 interpretation is intended. Producers are therefore strongly
942 encouraged to use \DWFORMsdata{} or
943 \DWFORMudata{} for signed and
944 unsigned integers respectively, rather than
945 \DWFORMdata\textless n\textgreater.}
948 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
949 \livetarg{datarep:classexprloc}{}
950 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
951 number of information bytes specified by the length
952 (\DWFORMexprlocTARG).
953 The information bytes contain a DWARF expression
954 (see Section \refersec{chap:dwarfexpressions})
955 or location description
956 (see Section \refersec{chap:locationdescriptions}).
958 \item \livelinki{chap:classflag}{flag}{flag class} \\
959 \livetarg{datarep:classflag}{}
960 A flag \addtoindexx{flag class}
961 is represented explicitly as a single byte of data
963 implicitly (\DWFORMflagpresentTARG).
965 first case, if the \nolink{flag} has value zero, it indicates the
966 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
967 it indicates the presence of the attribute. In the second
968 case, the attribute is implicitly indicated as present, and
969 no value is encoded in the debugging information entry itself.
971 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
972 \livetarg{datarep:classlineptr}{}
973 This is an offset into
974 \addtoindexx{section offset!in class lineptr value}
976 \dotdebugline{} or \dotdebuglinedwo{} section
978 It consists of an offset from the beginning of the
980 section to the first byte of
981 the data making up the line number list for the compilation
983 It is relocatable in a relocatable object file, and
984 relocated in an executable or shared object. In the
985 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
986 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
987 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
990 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
991 \livetarg{datarep:classloclistptr}{}
992 This is an offset into the
996 It consists of an offset from the
997 \addtoindexx{section offset!in class loclistptr value}
1000 section to the first byte of
1001 the data making up the
1002 \addtoindex{location list} for the compilation unit.
1003 It is relocatable in a relocatable object file, and
1004 relocated in an executable or shared object. In the
1005 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1006 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1007 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1010 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1011 \livetarg{datarep:classmacptr}{}
1013 \addtoindexx{section offset!in class macptr value}
1015 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1017 It consists of an offset from the beginning of the
1018 \dotdebugmacro{} or \dotdebugmacrodwo{}
1019 section to the the header making up the
1020 macro information list for the compilation unit.
1021 It is relocatable in a relocatable object file, and
1022 relocated in an executable or shared object. In the
1023 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1024 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1025 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1028 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1029 \livetarg{datarep:classrangelistptr}{}
1031 \addtoindexx{section offset!in class rangelistptr value}
1032 offset into the \dotdebugranges{} section
1035 offset from the beginning of the
1036 \dotdebugranges{} section
1037 to the beginning of the non\dash contiguous address ranges
1038 information for the referencing entity.
1039 It is relocatable in
1040 a relocatable object file, and relocated in an executable or
1041 shared object. In the \thirtytwobitdwarfformat, this offset
1042 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1043 format, it is an 8\dash byte unsigned value (see Section
1044 \refersec{datarep:32bitand64bitdwarfformats}).
1047 \textit{Because classes
1052 \CLASSrangelistptr{} and
1053 \CLASSstroffsetsptr{}
1054 share a common representation, it is not possible for an
1055 attribute to allow more than one of these classes}
1059 \item \livelinki{chap:classreference}{reference}{reference class} \\
1060 \livetarg{datarep:classreference}{}
1061 There are three types of reference.
1064 \addtoindexx{reference class}
1065 first type of reference can identify any debugging
1066 information entry within the containing unit.
1069 \addtoindexx{section offset!in class reference value}
1070 offset from the first byte of the compilation
1071 header for the compilation unit containing the reference. There
1072 are five forms for this type of reference. There are fixed
1073 length forms for one, two, four and eight byte offsets
1079 and \DWFORMrefeightTARG).
1080 There is also an unsigned variable
1081 length offset encoded form that uses
1082 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1083 (\DWFORMrefudataTARG).
1084 Because this type of reference is within
1085 the containing compilation unit no relocation of the value
1088 The second type of reference can identify any debugging
1089 information entry within a
1090 \dotdebuginfo{} section; in particular,
1091 it may refer to an entry in a different compilation unit
1092 from the unit containing the reference, and may refer to an
1093 entry in a different shared object. This type of reference
1094 (\DWFORMrefaddrTARG)
1095 is an offset from the beginning of the
1097 section of the target executable or shared object;
1098 it is relocatable in a relocatable object file and frequently
1099 relocated in an executable file or shared object. For
1100 references from one shared object or static executable file
1101 to another, the relocation and identification of the target
1102 object must be performed by the consumer. In the
1103 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1104 in the \sixtyfourbitdwarfformat, it is an 8\dash byte
1106 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1108 \textit{A debugging information entry that may be referenced by
1109 another compilation unit using
1110 \DWFORMrefaddr{} must have a
1111 global symbolic name.}
1113 \textit{For a reference from one executable or shared object to
1114 another, the reference is resolved by the debugger to identify
1115 the shared object or executable and the offset into that
1116 object\textquoteright s \dotdebuginfo{}
1117 section in the same fashion as the run
1118 time loader, either when the debug information is first read,
1119 or when the reference is used.}
1121 The third type of reference can identify any debugging
1122 information type entry that has been placed in its own
1123 \addtoindex{type unit}. This type of
1124 reference (\DWFORMrefsigeightTARG) is the
1125 \addtoindexx{type signature}
1126 64\dash bit type signature
1127 (see Section \refersec{datarep:typesignaturecomputation})
1131 \textit{The use of compilation unit relative references will reduce the
1132 number of link\dash time relocations and so speed up linking. The
1133 use of the second and third type of reference allows for the
1134 sharing of information, such as types, across compilation
1137 \textit{A reference to any kind of compilation unit identifies the
1138 debugging information entry for that unit, not the preceding
1141 \item \livelinki{chap:classstring}{string}{string class} \\
1142 \livetarg{datarep:classstring}{}
1143 A string is a sequence of contiguous non\dash null bytes followed by
1145 \addtoindexx{string class}
1146 A string may be represented:
1148 \item immediately in the debugging information entry itself
1149 (\DWFORMstringTARG),
1151 \addtoindexx{section offset!in class string value}
1152 offset into a string table contained in
1153 the \dotdebugstr{} section of the object file
1155 In the \thirtytwobitdwarfformat, the representation of a
1157 value is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
1158 it is an 8\dash byte unsigned offset
1159 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1160 \item as an indirect offset into the string table using an
1161 index into a table of offsets contained in the
1162 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1163 The representation of a \DWFORMstrxNAME{} value is an unsigned
1164 \addtoindex{LEB128} value, which is interpreted as a zero-based
1165 index into an array of offsets in the \dotdebugstroffsets{} section.
1166 The offset entries in the \dotdebugstroffsets{} section have the
1167 same representation as \DWFORMstrp{} values.
1169 Any combination of these three forms may be used within a single compilation.
1171 If the \DWATuseUTFeight{}
1172 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1173 compilation, partial, skeleton or type unit entry, string values are encoded using the
1174 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1175 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
1176 the string representation is unspecified.
1178 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1179 ISO/IEC 10646\dash 1:1993. It contains all the same characters
1180 and encoding points as ISO/IEC 10646, as well as additional
1181 information about the characters and their use.}
1183 \textit{Earlier versions of DWARF did not specify the representation
1184 of strings; for compatibility, this version also does
1185 not. However, the UTF\dash 8 representation is strongly recommended.}
1187 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1188 \livetarg{datarep:classstroffsetsptr}{}
1189 This is an offset into the \dotdebugstroffsets{} section
1190 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1191 \dotdebugstroffsets{} section to the
1192 beginning of the string offsets information for the
1193 referencing entity. It is relocatable in
1194 a relocatable object file, and relocated in an executable or
1195 shared object. In the \thirtytwobitdwarfformat, this offset
1196 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1197 format, it is an 8\dash byte unsigned value (see Section
1198 \refersec{datarep:32bitand64bitdwarfformats}).
1200 \textit{This class is new in \DWARFVersionV.}
1204 In no case does an attribute use one of the classes
1209 \CLASSrangelistptr{} or
1210 \CLASSstroffsetsptr{}
1211 to point into either the
1212 \dotdebuginfo{} or \dotdebugstr{} section.
1214 The form encodings are listed in
1215 Table \refersec{tab:attributeformencodings}.
1219 \setlength{\extrarowheight}{0.1cm}
1220 \begin{longtable}{l|l|l}
1221 \caption{Attribute encodings}
1222 \label{tab:attributeencodings}
1223 \addtoindexx{attribute encodings} \\
1224 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1226 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1228 \hline \emph{Continued on next page}
1230 \hline \ddag\ \textit{New in DWARF Version 5}
1232 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1233 \addtoindexx{sibling attribute!encoding} \\
1234 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1235 \livelink{chap:classloclistptr}{loclistptr}
1236 \addtoindexx{location attribute!encoding} \\
1237 \DWATname&0x03&\livelink{chap:classstring}{string}
1238 \addtoindexx{name attribute!encoding} \\
1239 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1240 \addtoindexx{ordering attribute!encoding} \\
1241 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1242 \livelink{chap:classexprloc}{exprloc},
1243 \livelink{chap:classreference}{reference}
1244 \addtoindexx{byte size attribute!encoding} \\
1245 \DWATbitoffset&0x0c&\livelink{chap:classconstant}{constant},
1246 \livelink{chap:classexprloc}{exprloc},
1247 \livelink{chap:classreference}{reference}
1248 \addtoindexx{bit offset attribute!encoding} \\
1249 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1250 \livelink{chap:classexprloc}{exprloc},
1251 \livelink{chap:classreference}{reference}
1252 \addtoindexx{bit size attribute!encoding} \\
1253 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1254 \addtoindexx{statement list attribute!encoding} \\
1255 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1256 \addtoindexx{low PC attribute!encoding} \\
1257 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1258 \livelink{chap:classconstant}{constant}
1259 \addtoindexx{high PC attribute!encoding} \\
1260 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1261 \addtoindexx{language attribute!encoding} \\
1262 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1263 \addtoindexx{discriminant attribute!encoding} \\
1264 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1265 \addtoindexx{discriminant value attribute!encoding} \\
1266 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1267 \addtoindexx{visibility attribute!encoding} \\
1268 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1269 \addtoindexx{import attribute!encoding} \\
1270 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1271 \livelink{chap:classloclistptr}{loclistptr}
1272 \addtoindexx{string length attribute!encoding} \\
1273 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1274 \addtoindexx{common reference attribute!encoding} \\
1275 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1276 \addtoindexx{compilation directory attribute!encoding} \\
1277 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1278 \livelink{chap:classconstant}{constant},
1279 \livelink{chap:classstring}{string}
1280 \addtoindexx{constant value attribute!encoding} \\
1281 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1282 \addtoindexx{containing type attribute!encoding} \\
1283 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1284 \livelink{chap:classreference}{reference},
1285 \livelink{chap:classflag}{flag}
1286 \addtoindexx{default value attribute!encoding} \\
1287 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1288 \addtoindexx{inline attribute!encoding} \\
1289 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1290 \addtoindexx{is optional attribute!encoding} \\
1291 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1292 \livelink{chap:classexprloc}{exprloc},
1293 \livelink{chap:classreference}{reference}
1294 \addtoindexx{lower bound attribute!encoding} \\
1295 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1296 \addtoindexx{producer attribute!encoding} \\
1297 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1298 \addtoindexx{prototyped attribute!encoding} \\
1299 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1300 \livelink{chap:classloclistptr}{loclistptr}
1301 \addtoindexx{return address attribute!encoding} \\
1302 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1303 \livelink{chap:classrangelistptr}{rangelistptr}
1304 \addtoindexx{start scope attribute!encoding} \\
1305 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1306 \livelink{chap:classexprloc}{exprloc},
1307 \livelink{chap:classreference}{reference}
1308 \addtoindexx{bit stride attribute!encoding} \\
1309 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1310 \livelink{chap:classexprloc}{exprloc},
1311 \livelink{chap:classreference}{reference}
1312 \addtoindexx{upper bound attribute!encoding} \\
1313 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1314 \addtoindexx{abstract origin attribute!encoding} \\
1315 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1316 \addtoindexx{accessibility attribute!encoding} \\
1317 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1318 \addtoindexx{address class attribute!encoding} \\
1319 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1320 \addtoindexx{artificial attribute!encoding} \\
1321 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1322 \addtoindexx{base types attribute!encoding} \\
1323 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1324 \addtoindexx{calling convention attribute!encoding} \\
1325 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1326 \livelink{chap:classexprloc}{exprloc},
1327 \livelink{chap:classreference}{reference}
1328 \addtoindexx{count attribute!encoding} \\
1329 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1330 \livelink{chap:classexprloc}{exprloc},
1331 \livelink{chap:classloclistptr}{loclistptr}
1332 \addtoindexx{data member attribute!encoding} \\
1333 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1334 \addtoindexx{declaration column attribute!encoding} \\
1335 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1336 \addtoindexx{declaration file attribute!encoding} \\
1337 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1338 \addtoindexx{declaration line attribute!encoding} \\
1339 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1340 \addtoindexx{declaration attribute!encoding} \\
1341 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1342 \addtoindexx{discriminant list attribute!encoding} \\
1343 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1344 \addtoindexx{encoding attribute!encoding} \\
1345 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1346 \addtoindexx{external attribute!encoding} \\
1347 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1348 \livelink{chap:classloclistptr}{loclistptr}
1349 \addtoindexx{frame base attribute!encoding} \\
1350 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1351 \addtoindexx{friend attribute!encoding} \\
1352 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1353 \addtoindexx{identifier case attribute!encoding} \\
1354 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1355 Reserved for compatibility and coexistence
1356 with prior DWARF versions.}
1357 &0x43&\livelink{chap:classmacptr}{macptr}
1358 \addtoindexx{macro information attribute (legacy)!encoding} \\
1359 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1360 \addtoindexx{name list item attribute!encoding} \\
1361 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1362 \addtoindexx{priority attribute!encoding} \\
1363 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1364 \livelink{chap:classloclistptr}{loclistptr}
1365 \addtoindexx{segment attribute!encoding} \\
1366 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1367 \addtoindexx{specification attribute!encoding} \\
1368 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1369 \livelink{chap:classloclistptr}{loclistptr}
1370 \addtoindexx{static link attribute!encoding} \\
1371 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1372 \addtoindexx{type attribute!encoding} \\
1373 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1374 \livelink{chap:classloclistptr}{loclistptr}
1375 \addtoindexx{location list attribute!encoding} \\
1376 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1377 \addtoindexx{variable parameter attribute!encoding} \\
1378 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1379 \addtoindexx{virtuality attribute!encoding} \\
1380 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1381 \livelink{chap:classloclistptr}{loclistptr}
1382 \addtoindexx{vtable element location attribute!encoding} \\
1383 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1384 \livelink{chap:classexprloc}{exprloc},
1385 \livelink{chap:classreference}{reference}
1386 \addtoindexx{allocated attribute!encoding} \\
1387 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1388 \livelink{chap:classexprloc}{exprloc},
1389 \livelink{chap:classreference}{reference}
1390 \addtoindexx{associated attribute!encoding} \\
1391 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1392 \addtoindexx{data location attribute!encoding} \\
1393 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1394 \livelink{chap:classexprloc}{exprloc},
1395 \livelink{chap:classreference}{reference}
1396 \addtoindexx{byte stride attribute!encoding} \\
1397 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1398 \livelink{chap:classconstant}{constant}
1399 \addtoindexx{entry pc attribute!encoding} \\
1400 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1401 \addtoindexx{use UTF8 attribute!encoding}\addtoindexx{UTF-8} \\
1402 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1403 \addtoindexx{extension attribute!encoding} \\
1404 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1405 \addtoindexx{ranges attribute!encoding} \\
1406 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1407 \livelink{chap:classflag}{flag},
1408 \livelink{chap:classreference}{reference},
1409 \livelink{chap:classstring}{string}
1410 \addtoindexx{trampoline attribute!encoding} \\
1411 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1412 \addtoindexx{call column attribute!encoding} \\
1413 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1414 \addtoindexx{call file attribute!encoding} \\
1415 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1416 \addtoindexx{call line attribute!encoding} \\
1417 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1418 \addtoindexx{description attribute!encoding} \\
1419 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1420 \addtoindexx{binary scale attribute!encoding} \\
1421 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1422 \addtoindexx{decimal scale attribute!encoding} \\
1423 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1424 \addtoindexx{small attribute!encoding} \\
1425 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1426 \addtoindexx{decimal scale attribute!encoding} \\
1427 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1428 \addtoindexx{digit count attribute!encoding} \\
1429 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1430 \addtoindexx{picture string attribute!encoding} \\
1431 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1432 \addtoindexx{mutable attribute!encoding} \\
1433 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1434 \addtoindexx{thread scaled attribute!encoding} \\
1435 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1436 \addtoindexx{explicit attribute!encoding} \\
1437 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1438 \addtoindexx{object pointer attribute!encoding} \\
1439 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1440 \addtoindexx{endianity attribute!encoding} \\
1441 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1442 \addtoindexx{elemental attribute!encoding} \\
1443 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1444 \addtoindexx{pure attribute!encoding} \\
1445 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1446 \addtoindexx{recursive attribute!encoding} \\
1447 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1448 \addtoindexx{signature attribute!encoding} \\
1449 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1450 \addtoindexx{main subprogram attribute!encoding} \\
1451 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1452 \addtoindexx{data bit offset attribute!encoding} \\
1453 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1454 \addtoindexx{constant expression attribute!encoding} \\
1455 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1456 \addtoindexx{enumeration class attribute!encoding} \\
1457 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1458 \addtoindexx{linkage name attribute!encoding} \\
1459 \DWATstringlengthbitsize{}~\ddag&0x6f&
1460 \livelink{chap:classconstant}{constant}
1461 \addtoindexx{string length attribute!size of length} \\
1462 \DWATstringlengthbytesize{}~\ddag&0x70&
1463 \livelink{chap:classconstant}{constant}
1464 \addtoindexx{string length attribute!size of length} \\
1465 \DWATrank~\ddag&0x71&
1466 \livelink{chap:classconstant}{constant},
1467 \livelink{chap:classexprloc}{exprloc}
1468 \addtoindexx{rank attribute!encoding} \\
1469 \DWATstroffsetsbase~\ddag&0x72&
1470 \livelinki{chap:classstring}{stroffsetsptr}{stroffsetsptr class}
1471 \addtoindexx{string offsets base!encoding} \\
1472 \DWATaddrbase~\ddag &0x73&
1473 \livelinki{chap:DWATaddrbase}{addrptr}{addrptr class}
1474 \addtoindexx{address table base!encoding} \\
1475 \DWATrangesbase~\ddag&0x74&
1476 \livelinki{chap:DWATrangesbase}{rangelistptr}{rangelistptr class}
1477 \addtoindexx{ranges base!encoding} \\
1478 \DWATdwoid~\ddag &0x75&
1479 \livelink{chap:DWATdwoid}{constant}
1480 \addtoindexx{split DWARF object id!encoding} \\
1481 \DWATdwoname~\ddag &0x76&
1482 \livelink{chap:DWATdwoname}{string}
1483 \addtoindexx{split DWARF object file name!encoding} \\
1484 \DWATreference~\ddag &0x77&
1485 \livelink{chap:DWATreference}{flag} \\
1486 \DWATrvaluereference~\ddag &0x78&
1487 \livelink{chap:DWATrvaluereference}{flag} \\
1488 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1489 \addtoindexx{macro information attribute!encoding} \\
1490 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1491 \addtoindexx{all calls summary attribute!encoding}\\
1492 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1493 \addtoindexx{all source calls summary attribute!encoding} \\
1494 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1495 \addtoindexx{all tail calls summary attribute!encoding} \\
1496 \DWATcalldatalocation~\ddag &0x7d&\CLASSexprloc
1497 \addtoindexx{call data location attribute!encoding} \\
1498 \DWATcalldatavalue~\ddag &0x7e&\CLASSexprloc
1499 \addtoindexx{call data value attribute!encoding} \\
1500 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1501 \addtoindexx{call origin attribute!encoding} \\
1502 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1503 \addtoindexx{call parameter attribute!encoding} \\
1504 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1505 \addtoindexx{call pc attribute!encoding} \\
1506 \DWATcallreturnpc~\ddag &0x82 &\CLASSaddress
1507 \addtoindexx{call return pc attribute!encoding} \\
1508 \DWATcalltailcall~\ddag &0x83 &\CLASSflag
1509 \addtoindexx{call tail call attribute!encoding} \\
1510 \DWATcalltarget~\ddag &0x84 &\CLASSexprloc
1511 \addtoindexx{call target attribute!encoding} \\
1512 \DWATcalltargetclobbered~\ddag &0x85 &\CLASSexprloc
1513 \addtoindexx{call target clobbered attribute!encoding} \\
1514 \DWATcallvalue~\ddag &0x86 &\CLASSexprloc
1515 \addtoindexx{call value attribute!encoding} \\
1516 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1517 \addtoindexx{noreturn attribute!encoding} \\
1518 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1519 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1526 \setlength{\extrarowheight}{0.1cm}
1527 \begin{longtable}{l|l|l}
1528 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1529 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1531 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1533 \hline \emph{Continued on next page}
1535 \hline \ddag\ \textit{New in DWARF Version 5}
1538 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1539 \textit{Reserved} &0x02& \\
1540 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1541 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1542 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1543 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1544 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1545 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1546 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1547 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1548 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1549 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1550 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1551 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1552 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1553 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1554 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1555 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1556 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1557 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
1558 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
1559 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1560 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
1561 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
1562 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
1563 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
1564 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
1565 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
1566 \DWFORMrefsigeight &0x20&\livelink{chap:classreference}{reference} \\
1573 \section{Variable Length Data}
1574 \label{datarep:variablelengthdata}
1575 \addtoindexx{variable length data|see {LEB128}}
1577 \addtoindexx{Little Endian Base 128|see{LEB128}}
1578 encoded using \doublequote{Little Endian Base 128}
1579 \addtoindexx{little-endian encoding|see{endian attribute}}
1581 \addtoindexx{LEB128}
1582 LEB128 is a scheme for encoding integers
1583 densely that exploits the assumption that most integers are
1586 \textit{This encoding is equally suitable whether the target machine
1587 architecture represents data in big\dash\ endian or little\dash endian
1588 order. It is \doublequote{little\dash endian} only in the sense that it
1589 avoids using space to represent the \doublequote{big} end of an
1590 unsigned integer, when the big end is all zeroes or sign
1593 Unsigned LEB128\addtoindexx{LEB128!unsigned} (ULEB128) numbers are encoded as follows:
1594 \addtoindexx{LEB128!unsigned, encoding as}
1595 start at the low order end of an unsigned integer and chop
1596 it into 7\dash bit chunks. Place each chunk into the low order 7
1597 bits of a byte. Typically, several of the high order bytes
1598 will be zero; discard them. Emit the remaining bytes in a
1599 stream, starting with the low order byte; set the high order
1600 bit on each byte except the last emitted byte. The high bit
1601 of zero on the last byte indicates to the decoder that it
1602 has encountered the last byte.
1604 The integer zero is a special case, consisting of a single
1607 Table \refersec{tab:examplesofunsignedleb128encodings}
1608 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
1610 0x80 in each case is the high order bit of the byte, indicating
1611 that an additional byte follows.
1614 The encoding for signed, two\textquoteright s complement LEB128 (SLEB128)
1615 \addtoindexx{LEB128!signed, encoding as}
1616 numbers is similar, except that the criterion for discarding
1617 high order bytes is not whether they are zero, but whether
1618 they consist entirely of sign extension bits. Consider the
1619 32\dash bit integer -2. The three high level bytes of the number
1620 are sign extension, thus LEB128 would represent it as a single
1621 byte containing the low order 7 bits, with the high order
1622 bit cleared to indicate the end of the byte stream. Note
1623 that there is nothing within the LEB128 representation that
1624 indicates whether an encoded number is signed or unsigned. The
1625 decoder must know what type of number to expect.
1626 Table \refersec{tab:examplesofunsignedleb128encodings}
1627 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
1628 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
1629 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
1632 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1633 \addtoindexx{LEB128!examples}
1634 gives algorithms for encoding and decoding these forms.}
1638 \setlength{\extrarowheight}{0.1cm}
1639 \begin{longtable}{l|l|l}
1640 \caption{Examples of unsigned LEB128 encodings}
1641 \label{tab:examplesofunsignedleb128encodings}
1642 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
1643 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1645 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1647 \hline \emph{Continued on next page}
1653 128& 0 + 0x80 & 1 \\
1654 129& 1 + 0x80 & 1 \\
1655 130& 2 + 0x80 & 1 \\
1656 12857& 57 + 0x80 & 100 \\
1663 \setlength{\extrarowheight}{0.1cm}
1664 \begin{longtable}{l|l|l}
1665 \caption{Examples of signed LEB128 encodings}
1666 \label{tab:examplesofsignedleb128encodings}
1667 \addtoindexx{LEB128!signed} \\
1668 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1670 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1672 \hline \emph{Continued on next page}
1678 127& 127 + 0x80 & 0 \\
1679 -127& 1 + 0x80 & 0x7f \\
1680 128& 0 + 0x80 & 1 \\
1681 -128& 0 + 0x80 & 0x7f \\
1682 129& 1 + 0x80 & 1 \\
1683 -129& 0x7f + 0x80 & 0x7e \\
1690 \section{DWARF Expressions and Location Descriptions}
1691 \label{datarep:dwarfexpressionsandlocationdescriptions}
1692 \subsection{DWARF Expressions}
1693 \label{datarep:dwarfexpressions}
1696 \addtoindexx{DWARF Expression!operator encoding}
1697 DWARF expression is stored in a \nolink{block} of contiguous
1698 bytes. The bytes form a sequence of operations. Each operation
1699 is a 1\dash byte code that identifies that operation, followed by
1700 zero or more bytes of additional data. The encodings for the
1701 operations are described in
1702 Table \refersec{tab:dwarfoperationencodings}.
1705 \setlength{\extrarowheight}{0.1cm}
1706 \begin{longtable}{l|c|c|l}
1707 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1708 \hline & &\bfseries No. of &\\
1709 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1711 & &\bfseries No. of &\\
1712 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1714 \hline \emph{Continued on next page}
1716 \hline \ddag\ \textit{New in DWARF Version 5}
1719 \DWOPaddr&0x03&1 & constant address \\
1720 & & &(size is target specific) \\
1722 \DWOPderef&0x06&0 & \\
1724 \DWOPconstoneu&0x08&1&1\dash byte constant \\
1725 \DWOPconstones&0x09&1&1\dash byte constant \\
1726 \DWOPconsttwou&0x0a&1&2\dash byte constant \\
1727 \DWOPconsttwos&0x0b&1&2\dash byte constant \\
1728 \DWOPconstfouru&0x0c&1&4\dash byte constant \\
1729 \DWOPconstfours&0x0d&1&4\dash byte constant \\
1730 \DWOPconsteightu&0x0e&1&8\dash byte constant \\
1731 \DWOPconsteights&0x0f&1&8\dash byte constant \\
1732 \DWOPconstu&0x10&1&ULEB128 constant \\
1733 \DWOPconsts&0x11&1&SLEB128 constant \\
1734 \DWOPdup&0x12&0 & \\
1735 \DWOPdrop&0x13&0 & \\
1736 \DWOPover&0x14&0 & \\
1737 \DWOPpick&0x15&1&1\dash byte stack index \\
1738 \DWOPswap&0x16&0 & \\
1739 \DWOProt&0x17&0 & \\
1740 \DWOPxderef&0x18&0 & \\
1741 \DWOPabs&0x19&0 & \\
1742 \DWOPand&0x1a&0 & \\
1743 \DWOPdiv&0x1b&0 & \\
1744 \DWOPminus&0x1c&0 & \\
1745 \DWOPmod&0x1d&0 & \\
1746 \DWOPmul&0x1e&0 & \\
1747 \DWOPneg&0x1f&0 & \\
1748 \DWOPnot&0x20&0 & \\
1750 \DWOPplus&0x22&0 & \\
1751 \DWOPplusuconst&0x23&1&ULEB128 addend \\
1752 \DWOPshl&0x24&0 & \\
1753 \DWOPshr&0x25&0 & \\
1754 \DWOPshra&0x26&0 & \\
1755 \DWOPxor&0x27&0 & \\
1757 \DWOPbra&0x28&1 & signed 2\dash byte constant \\
1764 \DWOPskip&0x2f&1&signed 2\dash byte constant \\ \hline
1766 \DWOPlitzero & 0x30 & 0 & \\
1767 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
1768 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
1769 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
1771 \DWOPregzero & 0x50 & 0 & \\*
1772 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
1773 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
1774 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
1776 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
1777 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
1778 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
1779 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
1781 \DWOPregx{} & 0x90 &1&ULEB128 register \\
1782 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
1783 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
1784 & & &SLEB128 offset \\
1785 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
1786 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
1787 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
1788 \DWOPnop{} & 0x96 &0& \\
1790 \DWOPpushobjectaddress&0x97&0 & \\
1791 \DWOPcalltwo&0x98&1& 2\dash byte offset of DIE \\
1792 \DWOPcallfour&0x99&1& 4\dash byte offset of DIE \\
1793 \DWOPcallref&0x9a&1& 4\dash\ or 8\dash byte offset of DIE \\
1794 \DWOPformtlsaddress&0x9b &0& \\
1795 \DWOPcallframecfa{} &0x9c &0& \\
1796 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
1798 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
1799 &&&\nolink{block} of that size\\
1800 \DWOPstackvalue{} &0x9f &0& \\
1801 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
1802 &&&SLEB128 constant offset \\
1803 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
1804 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
1805 \DWOPentryvalue~\ddag&0xa3&2&ULEV128 size, \\*
1806 &&&\nolink{block} of that size\\
1807 \DWOPlouser{} &0xe0 && \\
1808 \DWOPhiuser{} &\xff && \\
1814 \subsection{Location Descriptions}
1815 \label{datarep:locationdescriptions}
1817 A location description is used to compute the
1818 location of a variable or other entity.
1820 \subsection{Location Lists}
1821 \label{datarep:locationlists}
1823 Each entry in a \addtoindex{location list} is either a location list entry,
1824 a base address selection entry, or an
1825 \addtoindexx{end of list entry!in location list}
1829 \subsubsection{Location List Entries in Non-Split Objects}
1830 A \addtoindex{location list} entry consists of two address offsets followed
1831 by an unsigned 2\dash byte length, followed by a block of contiguous bytes
1832 that contains a DWARF location description. The length
1833 specifies the number of bytes in that block. The two offsets
1834 are the same size as an address on the target machine.
1837 A base address selection entry and an
1838 \addtoindexx{end of list entry!in location list}
1839 end of list entry each
1840 consist of two (constant or relocated) address offsets. The two
1841 offsets are the same size as an address on the target machine.
1843 For a \addtoindex{location list} to be specified, the base address of
1844 \addtoindexx{base address selection entry!in location list}
1845 the corresponding compilation unit must be defined
1846 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1848 \subsubsection{Location List Entries in Split Objects}
1849 An alternate form for location list entries is used in split objects.
1850 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
1851 that follows. The encodings for these constants are given in
1852 Table \refersec{tab:locationlistentryencodingvalues}.
1855 \setlength{\extrarowheight}{0.1cm}
1856 \begin{longtable}{l|c}
1857 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
1858 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
1860 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
1862 \hline \emph{Continued on next page}
1866 \DWLLEendoflistentry & 0x0 \\
1867 \DWLLEbaseaddressselectionentry & 0x01 \\
1868 \DWLLEstartendentry & 0x02 \\
1869 \DWLLEstartlengthentry & 0x03 \\
1870 \DWLLEoffsetpairentry & 0x04 \\
1874 \section{Base Type Attribute Encodings}
1875 \label{datarep:basetypeattributeencodings}
1877 The encodings of the
1878 \hypertarget{chap:DWATencodingencodingofbasetype}{}
1880 \addtoindexx{encoding attribute!encoding}
1883 attribute are given in
1884 Table \refersec{tab:basetypeencodingvalues}
1887 \setlength{\extrarowheight}{0.1cm}
1888 \begin{longtable}{l|c}
1889 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1890 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
1892 \bfseries Base type encoding name&\bfseries Value\\ \hline
1894 \hline \emph{Continued on next page}
1897 \ddag \ \textit{New in \DWARFVersionV}
1899 \DWATEaddress&0x01 \\
1900 \DWATEboolean&0x02 \\
1901 \DWATEcomplexfloat&0x03 \\
1903 \DWATEsigned&0x05 \\
1904 \DWATEsignedchar&0x06 \\
1905 \DWATEunsigned&0x07 \\
1906 \DWATEunsignedchar&0x08 \\
1907 \DWATEimaginaryfloat&0x09 \\
1908 \DWATEpackeddecimal&0x0a \\
1909 \DWATEnumericstring&0x0b \\
1910 \DWATEedited&0x0c \\
1911 \DWATEsignedfixed&0x0d \\
1912 \DWATEunsignedfixed&0x0e \\
1913 \DWATEdecimalfloat & 0x0f \\
1914 \DWATEUTF{} & 0x10 \\
1915 \DWATEUCS~\ddag & 0x11 \\
1916 \DWATEASCII~\ddag & 0x12 \\
1917 \DWATElouser{} & 0x80 \\
1918 \DWATEhiuser{} & \xff \\
1923 The encodings of the constants used in the
1924 \DWATdecimalsign{} attribute
1926 Table \refersec{tab:decimalsignencodings}.
1929 \setlength{\extrarowheight}{0.1cm}
1930 \begin{longtable}{l|c}
1931 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1932 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
1934 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1936 \hline \emph{Continued on next page}
1941 \DWDSunsigned{} & 0x01 \\
1942 \DWDSleadingoverpunch{} & 0x02 \\
1943 \DWDStrailingoverpunch{} & 0x03 \\
1944 \DWDSleadingseparate{} & 0x04 \\
1945 \DWDStrailingseparate{} & 0x05 \\
1951 The encodings of the constants used in the
1952 \DWATendianity{} attribute are given in
1953 Table \refersec{tab:endianityencodings}.
1956 \setlength{\extrarowheight}{0.1cm}
1957 \begin{longtable}{l|c}
1958 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1959 \hline \bfseries Endian code name&\bfseries Value \\ \hline
1961 \bfseries Endian code name&\bfseries Value\\ \hline
1963 \hline \emph{Continued on next page}
1968 \DWENDdefault{} & 0x00 \\
1969 \DWENDbig{} & 0x01 \\
1970 \DWENDlittle{} & 0x02 \\
1971 \DWENDlouser{} & 0x40 \\
1972 \DWENDhiuser{} & \xff \\
1977 \section{Accessibility Codes}
1978 \label{datarep:accessibilitycodes}
1979 The encodings of the constants used in the
1980 \DWATaccessibility{}
1982 \addtoindexx{accessibility attribute!encoding}
1984 Table \refersec{tab:accessibilityencodings}.
1987 \setlength{\extrarowheight}{0.1cm}
1988 \begin{longtable}{l|c}
1989 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1990 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
1992 \bfseries Accessibility code name&\bfseries Value\\ \hline
1994 \hline \emph{Continued on next page}
1999 \DWACCESSpublic&0x01 \\
2000 \DWACCESSprotected&0x02 \\
2001 \DWACCESSprivate&0x03 \\
2007 \section{Visibility Codes}
2008 \label{datarep:visibilitycodes}
2009 The encodings of the constants used in the
2010 \DWATvisibility{} attribute are given in
2011 Table \refersec{tab:visibilityencodings}.
2014 \setlength{\extrarowheight}{0.1cm}
2015 \begin{longtable}{l|c}
2016 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2017 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2019 \bfseries Visibility code name&\bfseries Value\\ \hline
2021 \hline \emph{Continued on next page}
2027 \DWVISexported&0x02 \\
2028 \DWVISqualified&0x03 \\
2033 \section{Virtuality Codes}
2034 \label{datarep:vitualitycodes}
2036 The encodings of the constants used in the
2037 \DWATvirtuality{} attribute are given in
2038 Table \refersec{tab:virtualityencodings}.
2041 \setlength{\extrarowheight}{0.1cm}
2042 \begin{longtable}{l|c}
2043 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2044 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2046 \bfseries Virtuality code name&\bfseries Value\\ \hline
2048 \hline \emph{Continued on next page}
2053 \DWVIRTUALITYnone&0x00 \\
2054 \DWVIRTUALITYvirtual&0x01 \\
2055 \DWVIRTUALITYpurevirtual&0x02 \\
2063 \DWVIRTUALITYnone{} is equivalent to the absence of the
2067 \section{Source Languages}
2068 \label{datarep:sourcelanguages}
2070 The encodings of the constants used
2071 \addtoindexx{language attribute, encoding}
2073 \addtoindexx{language name encoding}
2076 attribute are given in
2077 Table \refersec{tab:languageencodings}.
2079 % If we don't force a following space it looks odd
2081 and their associated values are reserved, but the
2082 languages they represent are not well supported.
2083 Table \refersec{tab:languageencodings}
2085 \addtoindexx{lower bound attribute!default}
2086 default lower bound, if any, assumed for
2087 an omitted \DWATlowerbound{} attribute in the context of a
2088 \DWTAGsubrangetype{} debugging information entry for each
2092 \setlength{\extrarowheight}{0.1cm}
2093 \begin{longtable}{l|c|c}
2094 \caption{Language encodings} \label{tab:languageencodings}\\
2095 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2097 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2099 \hline \emph{Continued on next page}
2102 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2104 \addtoindexx{ISO-defined language names}
2106 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2107 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2108 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2109 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2110 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2111 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2112 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2113 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2114 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2115 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2116 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2117 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2118 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2119 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2120 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2121 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2122 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2123 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2124 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2125 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2126 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2127 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2128 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2129 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2130 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2131 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2132 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2133 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2134 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2135 \DWLANGlouser{} &0x8000 & \\
2136 \DWLANGhiuser{} &\xffff & \\
2141 \section{Address Class Encodings}
2142 \label{datarep:addressclassencodings}
2144 The value of the common
2145 \addtoindexi{address}{address class!attribute encoding}
2150 \section{Identifier Case}
2151 \label{datarep:identifiercase}
2153 The encodings of the constants used in the
2154 \DWATidentifiercase{} attribute are given in
2155 Table \refersec{tab:identifiercaseencodings}.
2158 \setlength{\extrarowheight}{0.1cm}
2159 \begin{longtable}{l|c}
2160 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2161 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2163 \bfseries Identifier case name&\bfseries Value\\ \hline
2165 \hline \emph{Continued on next page}
2169 \DWIDcasesensitive&0x00 \\
2171 \DWIDdowncase&0x02 \\
2172 \DWIDcaseinsensitive&0x03 \\
2176 \section{Calling Convention Encodings}
2177 \label{datarep:callingconventionencodings}
2178 The encodings of the constants used in the
2179 \DWATcallingconvention{} attribute are given in
2180 Table \refersec{tab:callingconventionencodings}.
2183 \setlength{\extrarowheight}{0.1cm}
2184 \begin{longtable}{l|c}
2185 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2186 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2188 \bfseries Calling convention name&\bfseries Value\\ \hline
2190 \hline \emph{Continued on next page}
2196 \DWCCprogram&0x02 \\
2204 \section{Inline Codes}
2205 \label{datarep:inlinecodes}
2207 The encodings of the constants used in
2208 \addtoindexx{inline attribute!encoding}
2210 \DWATinline{} attribute are given in
2211 Table \refersec{tab:inlineencodings}.
2215 \setlength{\extrarowheight}{0.1cm}
2216 \begin{longtable}{l|c}
2217 \caption{Inline encodings} \label{tab:inlineencodings}\\
2218 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2220 \bfseries Inline Code name&\bfseries Value\\ \hline
2222 \hline \emph{Continued on next page}
2227 \DWINLnotinlined&0x00 \\
2228 \DWINLinlined&0x01 \\
2229 \DWINLdeclarednotinlined&0x02 \\
2230 \DWINLdeclaredinlined&0x03 \\
2235 % this clearpage is ugly, but the following table came
2236 % out oddly without it.
2238 \section{Array Ordering}
2239 \label{datarep:arrayordering}
2241 The encodings of the constants used in the
2242 \DWATordering{} attribute are given in
2243 Table \refersec{tab:orderingencodings}.
2247 \setlength{\extrarowheight}{0.1cm}
2248 \begin{longtable}{l|c}
2249 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2250 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2252 \bfseries Ordering name&\bfseries Value\\ \hline
2254 \hline \emph{Continued on next page}
2259 \DWORDrowmajor&0x00 \\
2260 \DWORDcolmajor&0x01 \\
2266 \section{Discriminant Lists}
2267 \label{datarep:discriminantlists}
2269 The descriptors used in
2270 \addtoindexx{discriminant list attribute!encoding}
2272 \DWATdiscrlist{} attribute are
2273 encoded as 1\dash byte constants. The
2274 defined values are given in
2275 Table \refersec{tab:discriminantdescriptorencodings}.
2277 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2279 \setlength{\extrarowheight}{0.1cm}
2280 \begin{longtable}{l|c}
2281 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2282 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2284 \bfseries Descriptor name&\bfseries Value\\ \hline
2286 \hline \emph{Continued on next page}
2298 \section{Name Lookup Tables}
2299 \label{datarep:namelookuptables}
2301 Each set of entries in the table of global names contained
2302 in the \dotdebugpubnames{} and
2303 \dotdebugpubtypes{} sections begins
2304 with a header consisting of:
2305 \begin{enumerate}[1. ]
2307 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2308 \addttindexx{unit\_length}
2309 A 4\dash byte or 12\dash byte unsigned integer
2310 \addtoindexx{initial length}
2311 representing the length
2312 of the \dotdebuginfo{}
2313 contribution for that compilation unit,
2314 not including the length field itself. In the
2315 \thirtytwobitdwarfformat, this is a 4\dash byte unsigned integer (which must be less
2316 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
2317 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
2318 integer that gives the actual length
2319 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2321 \item version (\addtoindex{uhalf}) \\
2322 A 2\dash byte unsigned integer representing the version of the
2323 DWARF information for the name lookup table
2324 \addtoindexx{version number!name lookup table}
2325 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2326 The value in this field is 2.
2329 \item \addtoindex{debug\_info\_offset} (section offset) \\
2331 \addtoindexx{section offset!in name lookup table set of entries}
2332 4\dash byte or 8\dash byte
2334 \dotdebuginfo{} or \dotdebuginfodwo{}
2335 section of the compilation unit header.
2336 In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned offset;
2337 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned offsets
2338 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2340 \item \addtoindex{debug\_info\_length} (\livelink{datarep:sectionoffsetlength}{section length}) \\
2341 \addtoindexx{section length!in .debug\_pubnames header}
2343 \addtoindexx{section length!in .debug\_pubtypes header}
2344 4\dash byte or 8\dash byte length containing the size in bytes of the
2345 contents of the \dotdebuginfo{}
2346 section generated to represent
2347 this compilation unit. In the \thirtytwobitdwarfformat, this is
2348 a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat, this
2349 is an 8-byte unsigned length
2350 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2355 This header is followed by a series of tuples. Each tuple
2356 consists of a 4\dash byte or 8\dash byte offset followed by a string
2357 of non\dash null bytes terminated by one null byte.
2359 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2360 format, it is an 8\dash byte offset.
2361 Each set is terminated by an
2362 offset containing the value 0.
2366 \section{Address Range Table}
2367 \label{datarep:addrssrangetable}
2369 Each set of entries in the table of address ranges contained
2370 in the \dotdebugaranges{}
2371 section begins with a header containing:
2372 \begin{enumerate}[1. ]
2373 % FIXME The unit length text is not fully consistent across
2376 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2377 \addttindexx{unit\_length}
2378 A 4-byte or 12-byte length containing the length of the
2379 \addtoindexx{initial length}
2380 set of entries for this compilation unit, not including the
2381 length field itself. In the \thirtytwobitdwarfformat, this is a
2382 4-byte unsigned integer (which must be less than \xfffffffzero);
2383 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2384 \wffffffff followed by an 8-byte unsigned integer that gives
2386 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2388 \item version (\addtoindex{uhalf}) \\
2389 A 2\dash byte version identifier representing the version of the
2390 DWARF information for the address range table
2391 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2392 This value in this field \addtoindexx{version number!address range table} is 2.
2395 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2397 \addtoindexx{section offset!in .debug\_aranges header}
2398 4\dash byte or 8\dash byte offset into the
2399 \dotdebuginfo{} section of
2400 the compilation unit header. In the \thirtytwobitdwarfformat,
2401 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2402 this is an 8\dash byte unsigned offset
2403 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2405 \item address\_size (ubyte) \\
2406 A 1\dash byte unsigned integer containing the size in bytes of an
2407 \addtoindexx{address\_size}
2409 \addtoindexx{size of an address}
2410 (or the offset portion of an address for segmented
2411 \addtoindexx{address space!segmented}
2412 addressing) on the target system.
2414 \item segment\_size (ubyte) \\
2416 \addtoindexx{segment\_size}
2417 1\dash byte unsigned integer containing the size in bytes of a
2418 segment selector on the target system.
2422 This header is followed by a series of tuples. Each tuple
2423 consists of a segment, an address and a length.
2425 size is given by the \addtoindex{segment\_size} field of the header; the
2426 address and length size are each given by the address\_size
2427 field of the header.
2428 The first tuple following the header in
2429 each set begins at an offset that is a multiple of the size
2430 of a single tuple (that is, the size of a segment selector
2431 plus twice the \addtoindex{size of an address}).
2432 The header is padded, if
2433 necessary, to that boundary. Each set of tuples is terminated
2434 by a 0 for the segment, a 0 for the address and 0 for the
2435 length. If the \addtoindex{segment\_size} field in the header is zero,
2436 the segment selectors are omitted from all tuples, including
2437 the terminating tuple.
2440 \section{Line Number Information}
2441 \label{datarep:linenumberinformation}
2443 The \addtoindexi{version number}{version number!line number information}
2444 in the line number program header is \versiondotdebugline{}
2445 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2447 The boolean values \doublequote{true} and \doublequote{false}
2448 used by the line number information program are encoded
2449 as a single byte containing the value 0
2450 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2452 The encodings for the standard opcodes are given in
2453 \addtoindexx{line number opcodes!standard opcode encoding}
2454 Table \refersec{tab:linenumberstandardopcodeencodings}.
2456 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2458 \setlength{\extrarowheight}{0.1cm}
2459 \begin{longtable}{l|c}
2460 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2461 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2463 \bfseries Opcode name&\bfseries Value\\ \hline
2465 \hline \emph{Continued on next page}
2471 \DWLNSadvancepc&0x02 \\
2472 \DWLNSadvanceline&0x03 \\
2473 \DWLNSsetfile&0x04 \\
2474 \DWLNSsetcolumn&0x05 \\
2475 \DWLNSnegatestmt&0x06 \\
2476 \DWLNSsetbasicblock&0x07 \\
2477 \DWLNSconstaddpc&0x08 \\
2478 \DWLNSfixedadvancepc&0x09 \\
2479 \DWLNSsetprologueend&0x0a \\*
2480 \DWLNSsetepiloguebegin&0x0b \\*
2481 \DWLNSsetisa&0x0c \\*
2488 The encodings for the extended opcodes are given in
2489 \addtoindexx{line number opcodes!extended opcode encoding}
2490 Table \refersec{tab:linenumberextendedopcodeencodings}.
2493 \setlength{\extrarowheight}{0.1cm}
2494 \begin{longtable}{l|c}
2495 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2496 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2498 \bfseries Opcode name&\bfseries Value\\ \hline
2500 \hline \emph{Continued on next page}
2502 \hline \ddag~\textit{New in DWARF Version 5}
2505 \DWLNEendsequence &0x01 \\
2506 \DWLNEsetaddress &0x02 \\
2507 \DWLNEdefinefile &0x03 \\
2508 \DWLNEsetdiscriminator &0x04 \\
2509 \DWLNEdefinefileMDfive~\ddag &0x05 \\
2510 \DWLNElouser &0x80 \\
2511 \DWLNEhiuser &\xff \\
2517 The encodings for the file entry format are given in
2518 \addtoindexx{line number opcodes!file entry format encoding}
2519 Table \refersec{tab:linenumberfileentryformatencodings}.
2522 \setlength{\extrarowheight}{0.1cm}
2523 \begin{longtable}{l|c}
2524 \caption{Line number file entry format \mbox{encodings}} \label{tab:linenumberfileentryformatencodings}\\
2525 \hline \bfseries File entry format name&\bfseries Value \\ \hline
2527 \bfseries File entry format name&\bfseries Value\\ \hline
2529 \hline \emph{Continued on next page}
2534 \DWLNFtimestampsize & 0x01 \\
2535 \DWLNFMDfive & 0x02 \\
2540 \section{Macro Information}
2541 \label{datarep:macroinformation}
2542 The \addtoindexi{version number}{version number!macro information}
2543 in the macro information header is \versiondotdebugmacro{}
2544 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2546 The source line numbers and source file indices encoded in the
2547 macro information section are represented as
2548 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
2550 The macro information entry type is encoded as a single unsigned byte.
2552 \addtoindexx{macro information entry types!encoding}
2554 Table \refersec{tab:macroinfoentrytypeencodings}.
2558 \setlength{\extrarowheight}{0.1cm}
2559 \begin{longtable}{l|c}
2560 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
2561 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
2563 \bfseries Macro information entry type name&\bfseries Value\\ \hline
2565 \hline \emph{Continued on next page}
2570 \DWMACROdefine &0x01 \\
2571 \DWMACROundef &0x02 \\
2572 \DWMACROstartfile &0x03 \\
2573 \DWMACROendfile &0x04 \\
2574 \DWMACROdefineindirect &0x05 \\
2575 \DWMACROundefindirect &0x06 \\
2576 \DWMACROtransparentinclude &0x07 \\
2577 % what about 0x08 thru 0x0a??
2578 \DWMACROdefineindirectx &0x0b \\
2579 \DWMACROundefindirectx &0x0c \\
2580 \DWMACROlouser &0xe0 \\
2581 \DWMACROhiuser &\xff \\
2587 \section{Call Frame Information}
2588 \label{datarep:callframeinformation}
2590 In the \thirtytwobitdwarfformat, the value of the CIE id in the
2591 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
2592 value is \xffffffffffffffff.
2594 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2595 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2597 Call frame instructions are encoded in one or more bytes. The
2598 primary opcode is encoded in the high order two bits of
2599 the first byte (that is, opcode = byte $\gg$ 6). An operand
2600 or extended opcode may be encoded in the low order 6
2601 bits. Additional operands are encoded in subsequent bytes.
2602 The instructions and their encodings are presented in
2603 Table \refersec{tab:callframeinstructionencodings}.
2606 \setlength{\extrarowheight}{0.1cm}
2607 \begin{longtable}{l|c|c|l|l}
2608 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2609 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
2610 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2612 & \bfseries High 2 &\bfseries Low 6 & &\\
2613 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2615 \hline \emph{Continued on next page}
2620 \DWCFAadvanceloc&0x1&delta & \\
2621 \DWCFAoffset&0x2®ister&ULEB128 offset \\
2622 \DWCFArestore&0x3®ister & & \\
2623 \DWCFAnop&0&0 & & \\
2624 \DWCFAsetloc&0&0x01&address & \\
2625 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
2626 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
2627 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
2628 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
2629 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
2630 \DWCFAundefined&0&0x07&ULEB128 register & \\
2631 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
2632 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
2633 \DWCFArememberstate&0&0x0a & & \\
2634 \DWCFArestorestate&0&0x0b & & \\
2635 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
2636 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
2637 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
2638 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
2639 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
2641 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
2642 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
2643 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
2644 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
2645 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
2646 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
2647 \DWCFAlouser&0&0x1c & & \\
2648 \DWCFAhiuser&0&\xiiif & & \\
2652 \section{Non-contiguous Address Ranges}
2653 \label{datarep:noncontiguousaddressranges}
2655 Each entry in a \addtoindex{range list}
2656 (see Section \refersec{chap:noncontiguousaddressranges})
2658 \addtoindexx{base address selection entry!in range list}
2660 \addtoindexx{range list}
2661 a base address selection entry, or an end
2664 A \addtoindex{range list} entry consists of two relative addresses. The
2665 addresses are the same size as addresses on the target machine.
2668 A base address selection entry and an
2669 \addtoindexx{end of list entry!in range list}
2670 end of list entry each
2671 \addtoindexx{base address selection entry!in range list}
2672 consist of two (constant or relocated) addresses. The two
2673 addresses are the same size as addresses on the target machine.
2675 For a \addtoindex{range list} to be specified, the base address of the
2676 \addtoindexx{base address selection entry!in range list}
2677 corresponding compilation unit must be defined
2678 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2680 \section{String Offsets Table}
2681 \label{chap:stringoffsetstable}
2682 Each set of entries in the string offsets table contained in the
2683 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
2684 section begins with a header containing:
2685 \begin{enumerate}[1. ]
2686 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2687 A 4-byte or 12-byte length containing the length of
2688 the set of entries for this compilation unit, not
2689 including the length field itself. In the 32-bit
2690 DWARF format, this is a 4-byte unsigned integer
2691 (which must be less than \xfffffffzero); in the 64-bit
2692 DWARF format, this consists of the 4-byte value
2693 \wffffffff followed by an 8-byte unsigned integer
2694 that gives the actual length (see
2695 Section \refersec{datarep:32bitand64bitdwarfformats}).
2697 \item \texttt{version} (\addtoindex{uhalf}) \\
2698 A 2-byte version identifier containing the value
2699 \versiondotdebugstroffsets{}
2700 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2701 \item \texttt{padding} (\addtoindex{uhalf}) \\
2704 This header is followed by a series of string table offsets
2705 that have the same representation as \DWFORMstrp.
2706 For the 32-bit DWARF format, each offset is 4 bytes long; for
2707 the 64-bit DWARF format, each offset is 8 bytes long.
2709 The \DWATstroffsetsbase{} attribute points to the first
2710 entry following the header. The entries are indexed
2711 sequentially from this base entry, starting from 0.
2713 \section{Address Table}
2714 \label{chap:addresstable}
2715 Each set of entries in the address table contained in the
2716 \dotdebugaddr{} section begins with a header containing:
2717 \begin{enumerate}[1. ]
2718 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2719 A 4-byte or 12-byte length containing the length of
2720 the set of entries for this compilation unit, not
2721 including the length field itself. In the 32-bit
2722 DWARF format, this is a 4-byte unsigned integer
2723 (which must be less than \xfffffffzero); in the 64-bit
2724 DWARF format, this consists of the 4-byte value
2725 \wffffffff followed by an 8-byte unsigned integer
2726 that gives the actual length (see
2727 Section \refersec{datarep:32bitand64bitdwarfformats}).
2730 \item \texttt{version} (\addtoindex{uhalf}) \\
2731 A 2-byte version identifier containing the value
2732 \versiondotdebugaddr{}
2733 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2736 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2737 A 1-byte unsigned integer containing the size in
2738 bytes of an address (or the offset portion of an
2739 address for segmented addressing) on the target
2743 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2744 A 1-byte unsigned integer containing the size in
2745 bytes of a segment selector on the target system.
2748 This header is followed by a series of segment/address pairs.
2749 The segment size is given by the \texttt{segment\_size} field of the
2750 header, and the address size is given by the \texttt{address\_size}
2751 field of the header. If the \texttt{segment\_size} field in the header
2752 is zero, the entries consist only of an addresses.
2754 The \DWATaddrbase{} attribute points to the first entry
2755 following the header. The entries are indexed sequentially
2756 from this base entry, starting from 0.
2758 \section{Range List Table}
2759 \label{app:rangelisttable}
2760 Each set of entries in the range list table contained in the
2761 \dotdebugranges{} section begins with a header containing:
2762 \begin{enumerate}[1. ]
2763 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2764 A 4-byte or 12-byte length containing the length of
2765 the set of entries for this compilation unit, not
2766 including the length field itself. In the 32-bit
2767 DWARF format, this is a 4-byte unsigned integer
2768 (which must be less than \xfffffffzero); in the 64-bit
2769 DWARF format, this consists of the 4-byte value
2770 \wffffffff followed by an 8-byte unsigned integer
2771 that gives the actual length (see
2772 Section \refersec{datarep:32bitand64bitdwarfformats}).
2775 \item \texttt{version} (\addtoindex{uhalf}) \\
2776 A 2-byte version identifier containing the value
2777 \versiondotdebugranges{}
2778 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2781 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2782 A 1-byte unsigned integer containing the size in
2783 bytes of an address (or the offset portion of an
2784 address for segmented addressing) on the target
2788 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2789 A 1-byte unsigned integer containing the size in
2790 bytes of a segment selector on the target system.
2793 This header is followed by a series of range list entries as
2794 described in Section \refersec{chap:locationlists}.
2795 The segment size is given by the
2796 \texttt{segment\_size} field of the header, and the address size is
2797 given by the \texttt{address\_size} field of the header. If the
2798 \texttt{segment\_size} field in the header is zero, the segment
2799 selector is omitted from the range list entries.
2801 The \DWATrangesbase{} attribute points to the first entry
2802 following the header. The entries are referenced by a byte
2803 offset relative to this base address.
2806 \section{Location List Table}
2807 \label{datarep:locationlisttable}
2808 Each set of entries in the location list table contained in the
2809 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
2810 \begin{enumerate}[1. ]
2811 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2812 A 4-byte or 12-byte length containing the length of
2813 the set of entries for this compilation unit, not
2814 including the length field itself. In the 32-bit
2815 DWARF format, this is a 4-byte unsigned integer
2816 (which must be less than \xfffffffzero); in the 64-bit
2817 DWARF format, this consists of the 4-byte value
2818 \wffffffff followed by an 8-byte unsigned integer
2819 that gives the actual length (see
2820 Section \refersec{datarep:32bitand64bitdwarfformats}).
2823 \item \texttt{version} (\addtoindex{uhalf}) \\
2824 A 2-byte version identifier containing the value
2825 \versiondotdebugloc{}
2826 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2829 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2830 A 1-byte unsigned integer containing the size in
2831 bytes of an address (or the offset portion of an
2832 address for segmented addressing) on the target
2836 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2837 A 1-byte unsigned integer containing the size in
2838 bytes of a segment selector on the target system.
2841 This header is followed by a series of location list entries as
2842 described in Section \refersec{chap:locationlists}.
2843 The segment size is given by the
2844 \texttt{segment\_size} field of the header, and the address size is
2845 given by the \texttt{address\_size} field of the header. If the
2846 \texttt{segment\_size} field in the header is zero, the segment
2847 selector is omitted from the range list entries.
2849 The entries are referenced by a byte offset relative to the first
2850 location list following this header.
2853 \section{Dependencies and Constraints}
2854 \label{datarep:dependenciesandconstraints}
2856 The debugging information in this format is intended to
2858 \addtoindexx{DWARF section names!list of}
2868 \dotdebugpubnames{},
2869 \dotdebugpubtypes{},
2873 \dotdebugstroffsets{}
2874 sections of an object file, or equivalent
2875 separate file or database. The information is not
2876 word\dash aligned. Consequently:
2879 \item For the \thirtytwobitdwarfformat{} and a target architecture with
2880 32\dash bit addresses, an assembler or compiler must provide a way
2881 to produce 2\dash byte and 4\dash byte quantities without alignment
2882 restrictions, and the linker must be able to relocate a
2883 4\dash byte address or
2884 \addtoindexx{section offset!alignment of}
2885 section offset that occurs at an arbitrary
2888 \item For the \thirtytwobitdwarfformat{} and a target architecture with
2889 64\dash bit addresses, an assembler or compiler must provide a
2890 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2891 alignment restrictions, and the linker must be able to relocate
2892 an 8\dash byte address or 4\dash byte
2893 \addtoindexx{section offset!alignment of}
2894 section offset that occurs at an
2895 arbitrary alignment.
2897 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
2898 32\dash bit addresses, an assembler or compiler must provide a
2899 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2900 alignment restrictions, and the linker must be able to relocate
2901 a 4\dash byte address or 8\dash byte
2902 \addtoindexx{section offset!alignment of}
2903 section offset that occurs at an
2904 arbitrary alignment.
2906 \textit{It is expected that this will be required only for very large
2907 32\dash bit programs or by those architectures which support
2908 a mix of 32\dash bit and 64\dash bit code and data within the same
2911 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
2912 64\dash bit addresses, an assembler or compiler must provide a
2913 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2914 alignment restrictions, and the linker must be able to
2915 relocate an 8\dash byte address or
2916 \addtoindexx{section offset!alignment of}
2917 section offset that occurs at
2918 an arbitrary alignment.
2921 \section{Integer Representation Names}
2922 \label{datarep:integerrepresentationnames}
2924 The sizes of the integers used in the lookup by name, lookup
2925 by address, line number and call frame information sections
2927 Table \ref{tab:integerrepresentationnames}.
2931 \setlength{\extrarowheight}{0.1cm}
2932 \begin{longtable}{c|l}
2933 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
2934 \hline \bfseries Representation name&\bfseries Representation \\ \hline
2936 \bfseries Representation name&\bfseries Representation\\ \hline
2938 \hline \emph{Continued on next page}
2943 \addtoindex{sbyte}& signed, 1\dash byte integer \\
2944 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
2945 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
2946 \addtoindex{uword}&unsigned, 4\dash byte integer \\
2952 \section{Type Signature Computation}
2953 \label{datarep:typesignaturecomputation}
2955 A type signature is computed only by the DWARF producer;
2956 \addtoindexx{type signature!computation}
2957 it is used by a DWARF consumer to resolve type references to
2958 the type definitions that are contained in
2959 \addtoindexx{type unit}
2962 The type signature for a type T0 is formed from the
2963 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
2964 R.L. Rivest, RFC 1321, April 1992}
2965 hash of a flattened description of the type. The flattened
2966 description of the type is a byte sequence derived from the
2967 DWARF encoding of the type as follows:
2968 \begin{enumerate}[1. ]
2970 \item Start with an empty sequence S and a list V of visited
2971 types, where V is initialized to a list containing the type
2972 T0 as its single element. Elements in V are indexed from 1,
2975 \item If the debugging information entry represents a type that
2976 is nested inside another type or a namespace, append to S
2977 the type\textquoteright s context as follows: For each surrounding type
2978 or namespace, beginning with the outermost such construct,
2979 append the letter 'C', the DWARF tag of the construct, and
2980 the name (taken from
2981 \addtoindexx{name attribute}
2982 the \DWATname{} attribute) of the type
2983 \addtoindexx{name attribute}
2984 or namespace (including its trailing null byte).
2986 \item Append to S the letter 'D', followed by the DWARF tag of
2987 the debugging information entry.
2989 \item For each of the attributes in
2990 Table \refersec{tab:attributesusedintypesignaturecomputation}
2992 the debugging information entry, in the order listed,
2993 append to S a marker letter (see below), the DWARF attribute
2994 code, and the attribute value.
2997 \caption{Attributes used in type signature computation}
2998 \label{tab:attributesusedintypesignaturecomputation}
2999 \simplerule[\textwidth]
3001 \autocols[0pt]{c}{2}{l}{
3016 \DWATcontainingtype,
3020 \DWATdatamemberlocation,
3041 \DWATrvaluereference,
3045 \DWATstringlengthbitsize,
3046 \DWATstringlengthbytesize,
3051 \DWATvariableparameter,
3054 \DWATvtableelemlocation
3057 \simplerule[\textwidth]
3060 Note that except for the initial
3061 \DWATname{} attribute,
3062 \addtoindexx{name attribute}
3063 attributes are appended in order according to the alphabetical
3064 spelling of their identifier.
3066 If an implementation defines any vendor-specific attributes,
3067 any such attributes that are essential to the definition of
3068 the type should also be included at the end of the above list,
3069 in their own alphabetical suborder.
3071 An attribute that refers to another type entry T is processed
3072 as follows: (a) If T is in the list V at some V[x], use the
3073 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3074 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3075 as the marker, process the type T recursively by performing
3076 Steps 2 through 7, and use the result as the attribute value.
3078 Other attribute values use the letter 'A' as the marker, and
3079 the value consists of the form code (encoded as an unsigned
3080 LEB128 value) followed by the encoding of the value according
3081 to the form code. To ensure reproducibility of the signature,
3082 the set of forms used in the signature computation is limited
3090 \item If the tag in Step 3 is one of \DWTAGpointertype,
3091 \DWTAGreferencetype,
3092 \DWTAGrvaluereferencetype,
3093 \DWTAGptrtomembertype,
3094 or \DWTAGfriend, and the referenced
3095 type (via the \DWATtype{} or
3096 \DWATfriend{} attribute) has a
3097 \DWATname{} attribute, append to S the letter 'N', the DWARF
3098 attribute code (\DWATtype{} or
3099 \DWATfriend), the context of
3100 the type (according to the method in Step 2), the letter 'E',
3101 and the name of the type. For \DWTAGfriend, if the referenced
3102 entry is a \DWTAGsubprogram, the context is omitted and the
3103 name to be used is the ABI-specific name of the subprogram
3104 (for example, the mangled linker name).
3107 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3108 \DWTAGreferencetype,
3109 \DWTAGrvaluereferencetype,
3110 \DWTAGptrtomembertype, or
3111 \DWTAGfriend, but has
3112 a \DWATtype{} attribute, or if the referenced type (via
3114 \DWATfriend{} attribute) does not have a
3115 \DWATname{} attribute, the attribute is processed according to
3116 the method in Step 4 for an attribute that refers to another
3120 \item Visit each child C of the debugging information
3121 entry as follows: If C is a nested type entry or a member
3122 function entry, and has
3123 a \DWATname{} attribute, append to
3124 \addtoindexx{name attribute}
3125 S the letter 'S', the tag of C, and its name; otherwise,
3126 process C recursively by performing Steps 3 through 7,
3127 appending the result to S. Following the last child (or if
3128 there are no children), append a zero byte.
3133 For the purposes of this algorithm, if a debugging information
3135 \DWATspecification{}
3136 attribute that refers to
3137 another entry D (which has a
3140 then S inherits the attributes and children of D, and S is
3141 processed as if those attributes and children were present in
3142 the entry S. Exception: if a particular attribute is found in
3143 both S and D, the attribute in S is used and the corresponding
3144 one in D is ignored.
3146 DWARF tag and attribute codes are appended to the sequence
3147 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3148 using the values defined earlier in this chapter.
3150 \textit{A grammar describing this computation may be found in
3151 Appendix \refersec{app:typesignaturecomputationgrammar}.
3154 \textit{An attribute that refers to another type entry should
3155 be recursively processed or replaced with the name of the
3156 referent (in Step 4, 5 or 6). If neither treatment applies to
3157 an attribute that references another type entry, the entry
3158 that contains that attribute should not be considered for a
3159 separate \addtoindex{type unit}.}
3161 \textit{If a debugging information entry contains an attribute from
3162 the list above that would require an unsupported form, that
3163 entry should not be considered for a separate
3164 \addtoindex{type unit}.}
3166 \textit{A type should be considered for a separate
3167 \addtoindex{type unit} only
3168 if all of the type entries that it contains or refers to in
3169 Steps 6 and 7 can themselves each be considered for a separate
3170 \addtoindex{type unit}.}
3173 Where the DWARF producer may reasonably choose two or more
3174 different forms for a given attribute, it should choose
3175 the simplest possible form in computing the signature. (For
3176 example, a constant value should be preferred to a location
3177 expression when possible.)
3179 Once the string S has been formed from the DWARF encoding,
3180 an \MDfive{} hash is computed for the string and the
3181 least significant 64 bits are taken as the type signature.
3183 \textit{The string S is intended to be a flattened representation of
3184 the type that uniquely identifies that type (that is, a different
3185 type is highly unlikely to produce the same string).}
3187 \textit{A debugging information entry should not be placed in a
3188 separate \addtoindex{type unit}
3189 if any of the following apply:}
3193 \item \textit{The entry has an attribute whose value is a location
3194 expression, and the location expression contains a reference to
3195 another debugging information entry (for example, a \DWOPcallref{}
3196 operator), as it is unlikely that the entry will remain
3197 identical across compilation units.}
3199 \item \textit{The entry has an attribute whose value refers
3200 to a code location or a \addtoindex{location list}.}
3202 \item \textit{The entry has an attribute whose value refers
3203 to another debugging information entry that does not represent
3209 \textit{Certain attributes are not included in the type signature:}
3212 \item \textit{The \DWATdeclaration{} attribute is not included because it
3213 indicates that the debugging information entry represents an
3214 incomplete declaration, and incomplete declarations should
3216 \addtoindexx{type unit}
3217 separate type units.}
3219 \item \textit{The \DWATdescription{} attribute is not included because
3220 it does not provide any information unique to the defining
3221 declaration of the type.}
3223 \item \textit{The \DWATdeclfile,
3225 \DWATdeclcolumn{} attributes are not included because they
3226 may vary from one source file to the next, and would prevent
3227 two otherwise identical type declarations from producing the
3228 same \MDfive{} hash.}
3230 \item \textit{The \DWATobjectpointer{} attribute is not included
3231 because the information it provides is not necessary for the
3232 computation of a unique type signature.}
3236 \textit{Nested types and some types referred to by a debugging
3237 information entry are encoded by name rather than by recursively
3238 encoding the type to allow for cases where a complete definition
3239 of the type might not be available in all compilation units.}
3241 \textit{If a type definition contains the definition of a member function,
3242 it cannot be moved as is into a type unit, because the member function
3243 contains attributes that are unique to that compilation unit.
3244 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3245 moving the member function declaration into a separate declaration tree,
3246 and replacing the function definition in the type with a non-defining
3247 declaration of the function (as if the function had been defined out of
3250 An example that illustrates the computation of an \MDfive{} hash may be found in
3251 Appendix \refersec{app:usingtypeunits}.