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.
8 \section{Vendor Extensibility}
9 \label{datarep:vendorextensibility}
10 \addtoindexx{vendor extensibility}
11 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
14 \addtoindexx{extensibility|see{vendor extensibility}}
15 reserve a portion of the DWARF name space and ranges of
16 enumeration values for use for vendor specific extensions,
17 special labels are reserved for tag names, attribute names,
18 base type encodings, location operations, language names,
19 calling conventions and call frame instructions.
21 The labels denoting the beginning and end of the
22 \hypertarget{chap:DWXXXlohiuser}{reserved value range}
23 for vendor specific extensions consist of the
25 (\DWATlouserMARK{}\DWAThiuserMARK{}DW\_AT,
26 \DWATElouserMARK{}\DWATEhiuserMARK{}DW\_ATE,
27 \DWCClouserMARK{}\DWCChiuserMARK{}DW\_CC,
28 \DWCFAlouserMARK{}\DWCFAhiuserMARK{}DW\_CFA,
29 \DWENDlouserMARK{}\DWENDhiuserMARK{}DW\_END,
30 \DWIDXlouserMARK{}\DWIDXhiuserMARK{}DW\_IDX,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{}DW\_LANG,
32 \DWLNCTlouserMARK{}\DWLNCThiuserMARK{}DW\_LNCT,
33 \DWLNElouserMARK{}\DWLNEhiuserMARK{}DW\_LNE,
34 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
35 \DWOPlouserMARK{}\DWOPhiuserMARK{}DW\_OP or
36 \DWTAGlouserMARK{}\DWTAGhiuserMARK{}DW\_TAG)
37 followed by \_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 debugging information entry
46 tags, the special 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.}
56 Vendor defined tags, attributes, base type encodings, location
57 atoms, language names, line number actions, calling conventions
58 and call frame instructions, conventionally use the form
59 \text{prefix\_vendor\_id\_name}, where
60 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
61 character sequence chosen so as to avoid conflicts with
64 To ensure that extensions added by one vendor may be safely
65 ignored by consumers that do not understand those extensions,
66 the following rules must be followed:
67 \begin{enumerate}[1. ]
69 \item New attributes are added in such a way that a
70 debugger may recognize the format of a new attribute value
71 without knowing the content of that attribute value.
73 \item The semantics of any new attributes do not alter
74 the semantics of previously existing attributes.
76 \item The semantics of any new tags do not conflict with
77 the semantics of previously existing tags.
79 \item New forms of attribute value are not added.
84 \section{Reserved Values}
85 \label{datarep:reservedvalues}
86 \subsection{Error Values}
87 \label{datarep:errorvalues}
88 \addtoindexx{reserved values!error}
91 \addtoindexx{error value}
92 a convenience for consumers of DWARF information, the value
93 0 is reserved in the encodings for attribute names, attribute
94 forms, base type encodings, location operations, languages,
95 line number program opcodes, macro information entries and tag
96 names to represent an error condition or unknown value. DWARF
97 does not specify names for these reserved values, because they
98 do not represent valid encodings for the given type and do
99 not appear in DWARF debugging information.
102 \subsection{Initial Length Values}
103 \label{datarep:initiallengthvalues}
104 \addtoindexx{reserved values!initial length}
106 An \livetarg{datarep:initiallengthvalues}{initial length} field
107 \addtoindexx{initial length field|see{initial length}}
108 is one of the fields that occur at the beginning
109 of those DWARF sections that have a header
119 that occurs at the beginning of the CIE and FDE structures
120 in the \dotdebugframe{} section.
123 In an \addtoindex{initial length} field, the values \wfffffffzero through
124 \wffffffff are reserved by DWARF to indicate some form of
125 extension relative to \DWARFVersionII; such values must not
126 be interpreted as a length field. The use of one such value,
127 \xffffffff, is defined in
128 Section \refersec{datarep:32bitand64bitdwarfformats});
130 the other values is reserved for possible future extensions.
133 \section{Relocatable, Split, Executable, Shared and Package Object Files}
134 \label{datarep:executableobjectsandsharedobjects}
136 \subsection{Relocatable Object Files}
137 \label{datarep:relocatableobjectfiles}
138 A DWARF producer (for example, a compiler) typically generates its
139 debugging information as part of a relocatable object file.
140 Relocatable object files are then combined by a linker to form an
141 executable file. During the linking process, the linker resolves
142 (binds) symbolic references between the various object files, and
143 relocates the contents of each object file into a combined virtual
146 The DWARF debugging information is placed in several sections (see
147 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
148 requires an object file format capable of
149 representing these separate sections. There are symbolic references
150 between these sections, and also between the debugging information
151 sections and the other sections that contain the text and data of the
152 program itself. Many of these references require relocation, and the
153 producer must emit the relocation information appropriate to the
154 object file format and the target processor architecture. These
155 references include the following:
158 \item The compilation unit header (see Section
159 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
160 section contains a reference to the \dotdebugabbrev{} table. This
161 reference requires a relocation so that after linking, it refers to
162 that contribution to the combined \dotdebugabbrev{} section in the
165 \item Debugging information entries may have attributes with the form
166 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
167 These attributes represent locations
168 within the virtual address space of the program, and require
171 \item A DWARF expression may contain a \DWOPaddr{} (see Section
172 \refersec{chap:literalencodings}) which contains a location within
173 the virtual address space of the program, and require relocation.
176 \item Debugging information entries may have attributes with the form
177 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
178 These attributes refer to
179 debugging information in other debugging information sections within
180 the object file, and must be relocated during the linking process.
184 \item Debugging information entries may have attributes with the form
185 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
186 These attributes refer to
187 debugging information entries that may be outside the current
188 compilation unit. These values require both symbolic binding and
191 \item Debugging information entries may have attributes with the form
192 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
193 These attributes refer to strings in
194 the \dotdebugstr{} section. These values require relocation.
196 \item Entries in the \dotdebugaddr{}
198 and \dotdebugaranges{}
199 sections may contain references to locations within the virtual address
200 space of the program, and thus require relocation.
203 \item Entries in the \dotdebugloclists{} and \dotdebugrnglists{} sections may
204 contain references to locations within the virtual address space of the
205 program depending on whether certain kinds of location or range
206 list entries are used, and thus require relocation.
209 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
210 opcode is a reference to a location within the virtual address space
211 of the program, and requires relocation.
213 \item The \dotdebugstroffsets{} section contains a list of string offsets,
214 each of which is an offset of a string in the \dotdebugstr{} section. Each
215 of these offsets requires relocation. Depending on the implementation,
216 these relocations may be implicit (that is, the producer may not need to
217 emit any explicit relocation information for these offsets).
219 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges{} header and
220 the list of compilation units following the \dotdebugnames{} header contain
221 references to the \dotdebuginfo{} section. These references require relocation
222 so that after linking they refer to the correct contribution in the combined
223 \dotdebuginfo{} section in the executable file.
225 \item Frame descriptor entries in the \dotdebugframe{} section
226 (see Section \refersec{chap:structureofcallframeinformation}) contain an
227 \HFNinitiallocation{} field value within the virtual address
228 space of the program and require relocation.
233 \textit{Note that operands of classes
235 \CLASSflag{} do not require relocation. Attribute operands that use
236 forms \DWFORMstring{},
237 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
238 \DWFORMrefudata{} also do not need relocation.}
240 \subsection{Split DWARF Object Files}
241 \label{datarep:splitdwarfobjectfiles}
242 \addtoindexx{split DWARF object file}
243 A DWARF producer may partition the debugging
244 information such that the majority of the debugging
245 information can remain in individual object files without
246 being processed by the linker.
248 \textit{This reduces link time by reducing the amount of information
249 the linker must process.}
252 \subsubsection{First Partition (with Skeleton Unit)}
253 The first partition contains
254 debugging information that must still be processed by the linker,
255 and includes the following:
258 The line number tables,
261 accelerated access tables, in the usual sections:
262 \dotdebugline, \dotdebuglinestr,
263 \dotdebugframe, \dotdebugnames{} and \dotdebugaranges,
267 An address table, in the \dotdebugaddr{} section. This table
268 contains all addresses and constants that require
269 link-time relocation, and items in the table can be
270 referenced indirectly from the debugging information via
271 the \DWFORMaddrx{} form,
273 by the \DWOPaddrx{} and \DWOPconstx{} operators, and
274 by certain of the \texttt{DW\_LLE\_*} location list
275 and \texttt{DW\_RLE\_*} range list entries.
278 A skeleton compilation unit, as described in Section
279 \refersec{chap:skeletoncompilationunitentries},
280 in the \dotdebuginfo{} section.
282 An abbreviations table for the skeleton compilation unit,
283 in the \dotdebugabbrev{} section
285 used by the \dotdebuginfo{} section.
289 A string table, in the \dotdebugstr{} section. The string
290 table is necessary only if the skeleton compilation unit
291 uses either indirect string form, \DWFORMstrp{} or
294 A string offsets table, in the \dotdebugstroffsets{}
297 for strings in the \dotdebugstr{} section.
299 The string offsets table is necessary only if
300 the skeleton compilation unit uses the \DWFORMstrx{} form.
302 The attributes contained in the skeleton compilation
303 unit can be used by a DWARF consumer to find the
304 DWARF object file that contains the second partition.
306 \subsubsection{Second Partition (Unlinked or in a \texttt{.dwo} File)}
307 The second partition contains the debugging information that
308 does not need to be processed by the linker. These sections
309 may be left in the object files and ignored by the linker
310 (that is, not combined and copied to the executable object file), or
311 they may be placed by the producer in a separate DWARF object
312 file. This partition includes the following:
315 The full compilation unit, in the \dotdebuginfodwo{} section.
317 Attributes contained in the full compilation unit
318 may refer to machine addresses indirectly using the \DWFORMaddrx{}
319 form, which accesses the table of addresses specified by the
320 \DWATaddrbase{} attribute in the associated skeleton unit.
321 Location descriptions may similarly do so using the \DWOPaddrx{} and
322 \DWOPconstx{} operations.
326 \item Separate type units, in the \dotdebuginfodwo{} section.
329 Abbreviations table(s) for the compilation unit and type
330 units, in the \dotdebugabbrevdwo{} section
332 used by the \dotdebuginfodwo{} section.
335 \item Location lists, in the
337 \dotdebugloclistsdwo{} section.
341 \item Range lists, in the \dotdebugrnglistsdwo{} section.
345 A \addtoindex{specialized line number table} (for the type units),
346 in the \dotdebuglinedwo{} section.
349 contains only the directory and filename lists needed to
350 interpret \DWATdeclfile{} attributes in the debugging
353 \item Macro information, in the \dotdebugmacrodwo{} section.
355 \item A string table, in the \dotdebugstrdwo{} section.
357 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
360 for the strings in the \dotdebugstrdwo{} section.
364 Except where noted otherwise, all references in this document
365 to a debugging information section (for example, \dotdebuginfo),
366 apply also to the corresponding split DWARF section (for example,
370 Split DWARF object files do not get linked with any other files,
371 therefore references between sections must not make use of
372 normal object file relocation information. As a result, symbolic
373 references within or between sections are not possible.
375 \subsection{Executable Objects}
376 \label{chap:executableobjects}
377 The relocated addresses in the debugging information for an
378 executable object are virtual addresses.
380 The sections containing the debugging information are typically
381 not loaded as part of the memory image of the program (in ELF
382 terminology, the sections are not "allocatable" and are not part
383 of a loadable segment). Therefore, the debugging information
384 sections described in this document are typically linked as if
385 they were each to be loaded at virtual address 0, and references
386 within the debugging information always implicitly indicate which
387 section a particular offset refers to. (For example, a reference
388 of form \DWFORMsecoffset{} may refer to one of several sections,
389 depending on the class allowed by a particular attribute of a
390 debugging information entry, as shown in
391 Table \refersec{tab:attributeencodings}.)
394 \subsection{Shared Object Files}
395 \label{datarep:sharedobjectfiles}
397 addresses in the debugging information for a shared object file
398 are offsets relative to the start of the lowest region of
399 memory loaded from that shared object file.
402 \textit{This requirement makes the debugging information for
403 shared object files position independent. Virtual addresses in a
404 shared object file may be calculated by adding the offset to the
405 base address at which the object file was attached. This offset
406 is available in the run\dash time linker\textquoteright s data structures.}
408 As with executable objects, the sections containing debugging
409 information are typically not loaded as part of the memory image
410 of the shared object, and are typically linked as if they were
411 each to be loaded at virtual address 0.
413 \subsection{DWARF Package Files}
414 \label{datarep:dwarfpackagefiles}
415 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
416 link, and debug an application quickly with less link-time overhead,
417 but a more convenient format is needed for saving the debug
418 information for later debugging of a deployed application. A
419 DWARF package file can be used to collect the debugging
420 information from the object (or separate DWARF object) files
421 produced during the compilation of an application.}
423 \textit{The package file is typically placed in the same directory as the
424 application, and is given the same name with a \doublequote{\texttt{.dwp}}
425 extension.\addtoindexx{\texttt{.dwp} file extension}}
428 A DWARF package file is itself an object file, using the
429 \addtoindexx{package files}
430 \addtoindexx{DWARF package files}
431 same object file format (including \byteorder) as the
432 corresponding application binary. It consists only of a file
433 header, a section table, a number of DWARF debug information
434 sections, and two index sections.
437 Each DWARF package file contains no more than one of each of the
438 following sections, copied from a set of object or DWARF object
439 files, and combined, section by section:
446 \dotdebugstroffsetsdwo
451 The string table section in \dotdebugstrdwo{} contains all the
452 strings referenced from DWARF attributes using the form
453 \DWFORMstrx. Any attribute in a compilation unit or a type
454 unit using this form refers to an entry in that unit's
455 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
456 provides the offset of a string in the \dotdebugstrdwo{}
459 The DWARF package file also contains two index sections that
460 provide a fast way to locate debug information by compilation
461 unit ID for compilation units, or by type
462 signature for type units:
468 \subsubsection{The Compilation Unit (CU) Index Section}
469 The \dotdebugcuindex{} section is a hashed lookup table that maps a
470 compilation unit ID to a set of contributions in the
471 various debug information sections. Each contribution is stored
472 as an offset within its corresponding section and a size.
475 Each \compunitset{} may contain contributions from the
478 \dotdebuginfodwo{} (required)
479 \dotdebugabbrevdwo{} (required)
483 \dotdebugstroffsetsdwo
487 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
488 information from \DWARFVersionIV{} or earlier formats.}
490 \subsubsection{The Type Unit (TU) Index Section}
491 The \dotdebugtuindex{} section is a hashed lookup table that maps a
492 type signature to a set of offsets in the various debug
493 information sections. Each contribution is stored as an offset
494 within its corresponding section and a size.
496 Each \typeunitset{} may contain contributions from the following
499 \dotdebuginfodwo{} (required)
500 \dotdebugabbrevdwo{} (required)
502 \dotdebugstroffsetsdwo
505 \subsubsection{Format of the CU and TU Index Sections}
506 Both index sections have the same format, and serve to map an
507 8-byte signature to a set of contributions to the debug sections.
508 Each index section begins with a header, followed by a hash table of
509 signatures, a parallel table of indexes, a table of offsets, and
510 a table of sizes. The index sections are aligned at 8-byte
511 boundaries in the DWARF package file.
514 The index section header contains the following fields:
515 \begin{enumerate}[1. ]
516 \item \texttt{version} (\HFTuhalf) \\
518 \addtoindexx{version number!CU index information}
519 \addtoindexx{version number!TU index information}
520 This number is specific to the CU and TU index information
521 and is independent of the DWARF version number.
523 The version number is \versiondotdebugcuindex.
525 \item \textit{padding} (\HFTuhalf) \\
526 Reserved to DWARF (must be zero).
529 \item \texttt{section\_count} (\HFTuword) \\
530 The number of entries in the table of section counts that follows.
531 For brevity, the contents of this field is referred to as $N$ below.
533 \item \texttt{unit\_count} (\HFTuword) \\
534 The number of compilation units or type units in the index.
535 For brevity, the contents of this field is referred to as $U$ below.
537 \item \texttt{slot\_count} (\HFTuword) \\
538 The number of slots in the hash table.
539 For brevity, the contents of this field is referred to as $S$ below.
543 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
545 The size of the hash table, $S$, must be $2^k$ such that:
546 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
548 The hash table begins at offset 16 in the section, and consists
549 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
551 % (using the \byteorder{} of the application binary).
553 The parallel table of indices begins immediately after the hash table
554 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
555 consists of an array of $S$ 4-byte slots,
556 % (using the byte order of the application binary),
557 corresponding 1-1 with slots in the hash
558 table. Each entry in the parallel table contains a row index into
559 the tables of offsets and sizes.
561 Unused slots in the hash table have 0 in both the hash table
562 entry and the parallel table entry. While 0 is a valid hash
563 value, the row index in a used slot will always be non-zero.
565 Given an 8-byte compilation unit ID or type signature $X$,
566 an entry in the hash table is located as follows:
567 \begin{enumerate}[1. ]
568 \item Define $REP(X)$ to be the value of $X$ interpreted as an
569 unsigned 64-bit integer in the target byte order.
570 \item Calculate a primary hash $H = REP(X)\ \&\ MASK(k)$, where
571 $MASK(k)$ is a mask with the low-order $k$ bits all set to 1.
572 \item Calculate a secondary hash $H' = (((REP(X)>>32)\ \&\ MASK(k))\ |\ 1)$.
573 \item If the hash table entry at index $H$ matches the signature, use
574 that entry. If the hash table entry at index $H$ is unused (all
575 zeroes), terminate the search: the signature is not present
577 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 4.
580 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
581 guaranteed to stop at an unused slot or find the match.
584 The table of offsets begins immediately following the parallel
585 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
587 This table consists of a single header row containing $N$ fields,
588 each a 4-byte unsigned integer, followed by $U$ data rows, each
589 also containing $N$ fields of 4-byte unsigned integers. The fields
590 in the header row provide a section identifier referring to a
591 debug section; the available section identifiers are shown in
592 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
593 Each data row corresponds to a specific CU
594 or TU in the package file. In the data rows, each field provides
595 an offset to the debug section whose identifier appears in the
596 corresponding field of the header row. The data rows are indexed
600 \textit{Not all sections listed in the table need be included.}
604 \setlength{\extrarowheight}{0.1cm}
605 \begin{longtable}{l|c|l}
606 \caption{DWARF package file section identifier \mbox{encodings}}
607 \label{tab:dwarfpackagefilesectionidentifierencodings}
608 \addtoindexx{DWARF package files!section identifier encodings} \\
609 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
611 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
613 \hline \emph{Continued on next page}
617 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
618 \textit{Reserved} & 2 & \\
619 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
620 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
622 \DWSECTLOCLISTSTARG & 5 & \dotdebugloclistsdwo
624 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
625 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
627 \DWSECTRNGLISTSTARG & 8 & \dotdebugrnglistsdwo
632 The offsets provided by the CU and TU index sections are the
633 base offsets for the contributions made by each CU or TU to the
634 corresponding section in the package file. Each CU and TU header
635 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
636 table for that CU or TU within the contribution to the
637 \dotdebugabbrevdwo{} section for that CU or TU, and are
638 interpreted as relative to the base offset given in the index
639 section. Likewise, offsets into \dotdebuglinedwo{} from
640 \DWATstmtlist{} attributes are interpreted as relative to
641 the base offset for \dotdebuglinedwo{}, and offsets into other debug
642 sections obtained from DWARF attributes are also
643 interpreted as relative to the corresponding base offset.
645 The table of sizes begins immediately following the table of
646 offsets, and provides the sizes of the contributions made by each
647 CU or TU to the corresponding section in the package file.
650 table consists of U data rows, each with N fields of 4-byte
651 unsigned integers. Each data row corresponds to the same CU or TU
652 as the corresponding data row in the table of offsets described
653 above. Within each data row, the N fields also correspond
654 one-to-one with the fields in the corresponding data row of the
655 table of offsets. Each field provides the size of the
656 contribution made by a CU or TU to the corresponding section in
660 For an example, see Figure \refersec{fig:examplecuindexsection}.
662 \subsection{DWARF Supplementary Object Files}
663 \label{datarep:dwarfsupplemetaryobjectfiles}
664 In order to minimize the size of debugging information,
665 it is possible to move duplicate debug information entries,
666 strings and macro entries from several executables or shared
667 object files into a separate
668 \addtoindexi{\textit{supplementary object file}}{supplementary object file}
669 by some post-linking utility; the moved entries and strings can
671 from the debugging information of each of those executable or
674 This facilitates distribution of separate consolidated debug files in
678 A DWARF \addtoindex{supplementary object file} is itself an object file,
679 using the same object
680 file format, \byteorder{}, and size as the corresponding application executables
681 or shared libraries. It consists only of a file header, section table, and
682 a number of DWARF debug information sections. Both the
683 \addtoindex{supplementary object file}
684 and all the executable or shared object files that reference entries or strings in that
685 file must contain a \dotdebugsup{} section that establishes the relationship.
687 The \dotdebugsup{} section contains:
688 \begin{enumerate}[1. ]
689 \item \texttt{version} (\HFTuhalf) \\
690 \addttindexx{version}
691 A 2-byte unsigned integer representing the version of the DWARF
692 information for the compilation unit.
694 The value in this field is \versiondotdebugsup.
696 \item \texttt{is\_supplementary} (\HFTubyte) \\
697 \addttindexx{is\_supplementary}
698 A 1-byte unsigned integer, which contains the value 1 if it is
699 in the \addtoindex{supplementary object file} that other executable or
700 shared object files refer to, or 0 if it is an executable or shared object
701 referring to a \addtoindex{supplementary object file}.
704 \item \texttt{sup\_filename} (null terminated filename string) \\
705 \addttindexx{sup\_filename}
706 If \addttindex{is\_supplementary} is 0, this contains either an absolute
707 filename for the \addtoindex{supplementary object file}, or a filename
708 relative to the object file containing the \dotdebugsup{} section.
709 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
710 is not needed and must be an empty string (a single null byte).
713 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
714 \addttindexx{sup\_checksum\_len}
715 Length of the following \addttindex{sup\_checksum} field;
716 this value can be 0 if no checksum is provided.
718 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
719 \addttindexx{sup\_checksum}
720 An implementation-defined integer constant value that
721 provides unique identification of the supplementary file.
725 Debug information entries that refer to an executable's or shared
726 object's addresses must \emph{not} be moved to supplementary files
727 (the addesses will likely not be the same). Similarly,
728 entries referenced from within location descriptions or using loclistsptr
729 form attributes must not be moved to a \addtoindex{supplementary object file}.
731 Executable or shared object file compilation units can use
732 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
733 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
734 attributes to refer to them and \DWFORMstrpsup{} form attributes to
735 refer to strings that are used by debug information of multiple
736 executables or shared object files. Within the \addtoindex{supplementary object file}'s
737 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
738 not used, and all reference forms referring to some other sections
739 refer to the local sections in the \addtoindex{supplementary object file}.
741 In macro information, \DWMACROdefinesup{} or
742 \DWMACROundefsup{} opcodes can refer to strings in the
743 \dotdebugstr{} section of the \addtoindex{supplementary object file},
744 or \DWMACROimportsup{}
745 can refer to \dotdebugmacro{} section entries. Within the
746 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
747 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
748 opcodes refer to the local \dotdebugstr{} section in that
749 supplementary file, not the one in
750 the executable or shared object file.
754 \section{32-Bit and 64-Bit DWARF Formats}
755 \label{datarep:32bitand64bitdwarfformats}
756 \hypertarget{datarep:xxbitdwffmt}{}
757 \addtoindexx{32-bit DWARF format}
758 \addtoindexx{64-bit DWARF format}
759 There are two closely-related DWARF
760 formats. In the 32-bit DWARF
761 format, all values that represent lengths of DWARF sections
762 and offsets relative to the beginning of DWARF sections are
763 represented using four bytes. In the 64-bit DWARF format, all
764 values that represent lengths of DWARF sections and offsets
765 relative to the beginning of DWARF sections are represented
766 using eight bytes. A special convention applies to the initial
767 length field of certain DWARF sections, as well as the CIE and
768 FDE structures, so that the 32-bit and 64-bit DWARF formats
769 can coexist and be distinguished within a single linked object.
771 Except where noted otherwise, all references in this document
772 to a debugging information section (for example, \dotdebuginfo),
773 apply also to the corresponding split DWARF section (for example,
776 The differences between the 32- and 64-bit DWARF formats are
777 detailed in the following:
778 \begin{enumerate}[1. ]
780 \item In the 32-bit DWARF format, an
781 \addtoindex{initial length} field (see
782 \addtoindexx{initial length!encoding}
783 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
784 is an unsigned 4-byte integer (which
785 must be less than \xfffffffzero); in the 64-bit DWARF format,
786 an \addtoindex{initial length} field is 12 bytes in size,
789 \item The first four bytes have the value \xffffffff.
791 \item The following eight bytes contain the actual length
792 represented as an unsigned 8-byte integer.
795 \textit{This representation allows a DWARF consumer to dynamically
796 detect that a DWARF section contribution is using the 64-bit
797 format and to adapt its processing accordingly.}
800 \item \hypertarget{datarep:sectionoffsetlength}{}
801 Section offset and section length
802 \addtoindexx{section length!use in headers}
804 \addtoindexx{section offset!use in headers}
805 in the headers of DWARF sections (other than initial length
806 \addtoindexx{initial length}
807 fields) are listed following. In the 32-bit DWARF format these
808 are 4-byte unsigned integer values; in the 64-bit DWARF format,
809 they are 8-byte unsigned integer values.
813 Section &Name & Role \\ \hline
814 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
815 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
816 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
817 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
818 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
819 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
825 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
826 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
827 union must be accessed to distinguish whether a CIE or FDE is
828 present, consequently, these two fields must exactly overlay
829 each other (both offset and size).
831 \item Within the body of the \dotdebuginfo{}
832 section, certain forms of attribute value depend on the choice
833 of DWARF format as follows. For the 32-bit DWARF format,
834 the value is a 4-byte unsigned integer; for the 64-bit DWARF
835 format, the value is an 8-byte unsigned integer.
837 \begin{tabular}{lp{6cm}}
838 Form & Role \\ \hline
839 \DWFORMlinestrp & offset in \dotdebuglinestr \\
840 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
841 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
842 \addtoindexx{supplementary object file}
843 \DWFORMsecoffset & offset in a section other than \\
844 & \dotdebuginfo{} or \dotdebugstr{} \\
845 \DWFORMstrp & offset in \dotdebugstr{} \\
846 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
847 \DWOPcallref & offset in \dotdebuginfo{} \\
852 \item Within the body of the \dotdebugline{} section, certain forms of content
853 description depend on the choice of DWARF format as follows: for the
854 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
855 64-bit DWARF format, the value is a 8-byte unsigned integer.
857 \begin{tabular}{lp{6cm}}
858 Form & Role \\ \hline
859 \DWFORMlinestrp & offset in \dotdebuglinestr
863 \item Within the body of the \dotdebugnames{}
864 sections, the representation of each entry in the array of
865 compilation units (CUs) and the array of local type units
866 (TUs), which represents an offset in the
868 section, depends on the DWARF format as follows: in the
869 32-bit DWARF format, each entry is a 4-byte unsigned integer;
870 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
873 \item In the body of the \dotdebugstroffsets{}
874 sections, the size of entries in the body depend on the DWARF
875 format as follows: in the 32-bit DWARF format, entries are 4-byte
876 unsigned integer values; in the 64-bit DWARF format, they are
877 8-byte unsigned integers.
879 \item In the body of the \dotdebugaddr{}
883 the contents of the address size fields depends on the
884 DWARF format as follows: in the 32-bit DWARF format, these fields
885 contain 4; in the 64-bit DWARF format these fields contain 8.
888 \item In the body of the \dotdebugloclists{} and \dotdebugrnglists{}
889 sections, the offsets the follow the header depend on the
890 DWARF format as follows: in the 32-bit DWARF format, offsets are 4-byte
891 unsigned integer values; in the 64-bit DWARF format, they are
892 8-byte unsigned integers.
898 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
899 intermixed within a single compilation unit.
901 \textit{Attribute values and section header fields that represent
902 addresses in the target program are not affected by these
905 A DWARF consumer that supports the 64-bit DWARF format must
906 support executables in which some compilation units use the
907 32-bit format and others use the 64-bit format provided that
908 the combination links correctly (that is, provided that there
909 are no link\dash time errors due to truncation or overflow). (An
910 implementation is not required to guarantee detection and
911 reporting of all such errors.)
913 \textit{It is expected that DWARF producing compilers will \emph{not} use
914 the 64-bit format \emph{by default}. In most cases, the division of
915 even very large applications into a number of executable and
916 shared object files will suffice to assure that the DWARF sections
917 within each individual linked object are less than 4 GBytes
918 in size. However, for those cases where needed, the 64-bit
919 format allows the unusual case to be handled as well. Even
920 in this case, it is expected that only application supplied
921 objects will need to be compiled using the 64-bit format;
922 separate 32-bit format versions of system supplied shared
923 executable libraries can still be used.}
926 \section{Format of Debugging Information}
927 \label{datarep:formatofdebugginginformation}
929 For each compilation unit compiled with a DWARF producer,
930 a contribution is made to the \dotdebuginfo{} section of
931 the object file. Each such contribution consists of a
932 compilation unit header
933 (see Section \refersec{datarep:compilationunitheader})
935 single \DWTAGcompileunit{} or
936 \DWTAGpartialunit{} debugging
937 information entry, together with its children.
939 For each type defined in a compilation unit, a separate
940 contribution may also be made to the
942 section of the object file. Each
943 such contribution consists of a
944 \addtoindex{type unit} header
945 (see Section \refersec{datarep:typeunitheaders})
946 followed by a \DWTAGtypeunit{} entry, together with
949 Each debugging information entry begins with a code that
950 represents an entry in a separate
951 \addtoindex{abbreviations table}. This
952 code is followed directly by a series of attribute values.
954 The appropriate entry in the
955 \addtoindex{abbreviations table} guides the
956 interpretation of the information contained directly in the
957 \dotdebuginfo{} section.
960 Multiple debugging information entries may share the same
961 abbreviation table entry. Each compilation unit is associated
962 with a particular abbreviation table, but multiple compilation
963 units may share the same table.
965 \subsection{Unit Headers}
966 \label{datarep:unitheaders}
967 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
968 compilation unit that follows. The encodings for the unit type
969 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
973 \setlength{\extrarowheight}{0.1cm}
974 \begin{longtable}{l|c}
975 \caption{Unit header unit type encodings}
976 \label{tab:unitheaderunitkindencodings}
977 \addtoindexx{unit header unit type encodings} \\
978 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
980 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
982 \hline \emph{Continued on next page}
984 \hline \ddag\ \textit{New in DWARF Version 5}
986 \DWUTcompileTARG~\ddag &0x01 \\
987 \DWUTtypeTARG~\ddag &0x02 \\
988 \DWUTpartialTARG~\ddag &0x03 \\
989 \DWUTskeletonTARG~\ddag &0x04 \\
990 \DWUTsplitcompileTARG~\ddag &0x05 \\
991 \DWUTsplittypeTARG~\ddag &0x06 \\
992 \DWUTlouserTARG~\ddag &0x80 \\
993 \DWUThiuserTARG~\ddag &\xff \\
998 \textit{All unit headers in a compilation have the same size.
999 Some header types include padding bytes to achieve this.}
1002 \subsubsection{Compilation and Partial Unit Headers}
1003 \label{datarep:compilationunitheader}
1004 \begin{enumerate}[1. ]
1006 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1007 \addttindexx{unit\_length}
1009 \addtoindexx{initial length}
1010 unsigned integer representing the length
1011 of the \dotdebuginfo{} contribution for that compilation unit,
1012 not including the length field itself. In the \thirtytwobitdwarfformat,
1013 this is a 4-byte unsigned integer (which must be less
1014 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1015 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1016 integer that gives the actual length
1017 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1019 \item \texttt{version} (\HFTuhalf) \\
1020 \addttindexx{version}
1021 \addtoindexx{version number!compilation unit}
1022 A 2-byte unsigned integer representing the version of the
1023 DWARF information for the compilation unit.
1025 The value in this field is \versiondotdebuginfo.
1027 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1028 for a summary of all version numbers that apply to DWARF sections.}
1031 \item \texttt{unit\_type} (\HFTubyte) \\
1032 \addttindexx{unit\_type}
1033 A 1-byte unsigned integer identifying this unit as a compilation unit.
1034 The value of this field is
1035 \DWUTcompile{} for a full compilation unit or
1036 \DWUTpartial{} for a partial compilation unit
1037 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
1039 \textit{This field is new in \DWARFVersionV.}
1042 \item \texttt{address\_size} (\HFTubyte) \\
1043 \addttindexx{address\_size}
1044 A 1-byte unsigned integer representing the size in bytes of
1045 an address on the target architecture. If the system uses
1046 \addtoindexx{address space!segmented}
1047 segmented addressing, this value represents the size of the
1048 offset portion of an address.
1050 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1052 \addtoindexx{section offset!in .debug\_info header}
1053 4-byte or 8-byte unsigned offset into the
1055 section. This offset associates the compilation unit with a
1056 particular set of debugging information entry abbreviations. In
1057 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1058 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1059 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1061 \item \HFNunitpaddingONE{} (8 bytes) \\
1062 Reserved to DWARF (must be zero).
1065 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1066 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1067 this is 4 bytes in length; in the \sixtyfourbitdwarfformat, this
1068 is 8 bytes in length.
1072 \subsubsection{Skeleton and Split Compilation Unit Headers}
1073 \label{datarep:skeletonandfullcompilationunitheaders}
1074 \begin{enumerate}[1. ]
1076 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1077 \addttindexx{unit\_length}
1079 \addtoindexx{initial length}
1080 unsigned integer representing the length
1081 of the \dotdebuginfo{}
1082 contribution for that compilation unit,
1083 not including the length field itself. In the \thirtytwobitdwarfformat,
1084 this is a 4-byte unsigned integer (which must be less
1085 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1086 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1087 integer that gives the actual length
1088 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1090 \item \texttt{version} (\HFTuhalf) \\
1091 \addttindexx{version}
1092 \addtoindexx{version number!compilation unit}
1093 A 2-byte unsigned integer representing the version of the
1094 DWARF information for the compilation unit.
1096 The value in this field is \versiondotdebuginfo.
1098 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1099 for a summary of all version numbers that apply to DWARF sections.}
1102 \item \texttt{unit\_type} (\HFTubyte) \\
1103 \addttindexx{unit\_type}
1104 A 1-byte unsigned integer identifying this unit as a compilation unit.
1105 The value of this field is
1106 \DWUTskeleton{} for a skeleton compilation unit or
1107 \DWUTsplitcompile{} for a split compilation unit
1108 (see Section \refersec{chap:skeletoncompilationunitentries}).
1110 \textit{This field is new in \DWARFVersionV.}
1113 \item \texttt{address\_size} (\HFTubyte) \\
1114 \addttindexx{address\_size}
1115 A 1-byte unsigned integer representing the size in bytes of
1116 an address on the target architecture. If the system uses
1117 \addtoindexx{address space!segmented}
1118 segmented addressing, this value represents the size of the
1119 offset portion of an address.
1121 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1123 \addtoindexx{section offset!in .debug\_info header}
1124 4-byte or 8-byte unsigned offset into the
1126 section. This offset associates the compilation unit with a
1127 particular set of debugging information entry abbreviations. In
1128 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1129 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1130 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1133 \item \HFNdwoid{} (unit ID) \\
1134 An 8-byte implementation-defined integer constant value,
1135 known as the compilation unit ID, that provides
1136 unique identification of a skeleton compilation
1137 unit and its associated split compilation unit in
1138 the object file named in the \DWATdwoname{} attribute
1139 of the skeleton compilation.
1142 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1143 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1144 this is 4 bytes in length; in the \sixtyfourbitdwarfformat{}, this
1145 is 8 bytes in length.
1149 \subsubsection{Type Unit Headers}
1150 \label{datarep:typeunitheaders}
1151 The header for the series of debugging information entries
1152 contributing to the description of a type that has been
1153 placed in its own \addtoindex{type unit}, within the
1154 \dotdebuginfo{} section,
1155 consists of the following information:
1156 \begin{enumerate}[1. ]
1157 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1158 \addttindexx{unit\_length}
1159 A 4-byte or 12-byte unsigned integer
1160 \addtoindexx{initial length}
1161 representing the length
1162 of the \dotdebuginfo{} contribution for that type unit,
1163 not including the length field itself. In the \thirtytwobitdwarfformat,
1164 this is a 4-byte unsigned integer (which must be
1165 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
1166 consists of the 4-byte value \wffffffff followed by an
1167 8-byte unsigned integer that gives the actual length
1168 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1171 \item \texttt{version} (\HFTuhalf) \\
1172 \addttindexx{version}
1173 \addtoindexx{version number!type unit}
1174 A 2-byte unsigned integer representing the version of the
1175 DWARF information for the type unit.
1177 The value in this field is \versiondotdebuginfo.
1179 \item \texttt{unit\_type} (\HFTubyte) \\
1180 \addttindexx{unit\_type}
1181 A 1-byte unsigned integer identifying this unit as a type unit.
1182 The value of this field is \DWUTtype{} for a non-split type unit
1183 (see Section \refersec{chap:typeunitentries})
1184 or \DWUTsplittype{} for a split type unit.
1186 \textit{This field is new in \DWARFVersionV.}
1189 \item \texttt{address\_size} (\HFTubyte) \\
1190 \addttindexx{address\_size}
1191 A 1-byte unsigned integer representing the size
1192 \addtoindexx{size of an address}
1194 an address on the target architecture. If the system uses
1195 \addtoindexx{address space!segmented}
1196 segmented addressing, this value represents the size of the
1197 offset portion of an address.
1200 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1202 \addtoindexx{section offset!in .debug\_info header}
1203 4-byte or 8-byte unsigned offset into the
1205 section. This offset associates the type unit with a
1206 particular set of debugging information entry abbreviations. In
1207 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1208 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1209 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1211 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1212 \addttindexx{type\_signature}
1213 \addtoindexx{type signature}
1214 A unique 8-byte signature (see Section
1215 \refersec{datarep:typesignaturecomputation})
1216 of the type described in this type
1219 \textit{An attribute that refers (using
1220 \DWFORMrefsigeight{}) to
1221 the primary type contained in this
1222 \addtoindex{type unit} uses this value.}
1225 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1226 \addttindexx{type\_offset}
1227 A 4-byte or 8-byte unsigned offset
1228 \addtoindexx{section offset!in .debug\_info header}
1229 relative to the beginning
1230 of the \addtoindex{type unit} header.
1231 This offset refers to the debugging
1232 information entry that describes the type. Because the type
1233 may be nested inside a namespace or other structures, and may
1234 contain references to other types that have not been placed in
1235 separate type units, it is not necessarily either the first or
1236 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1237 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1238 this is an 8-byte unsigned length
1239 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1243 \subsection{Debugging Information Entry}
1244 \label{datarep:debugginginformationentry}
1246 Each debugging information entry begins with an
1247 unsigned LEB128\addtoindexx{LEB128!unsigned}
1248 number containing the abbreviation code for the entry. This
1249 code represents an entry within the abbreviations table
1250 associated with the compilation unit containing this entry. The
1251 abbreviation code is followed by a series of attribute values.
1253 On some architectures, there are alignment constraints on
1254 section boundaries. To make it easier to pad debugging
1255 information sections to satisfy such constraints, the
1256 abbreviation code 0 is reserved. Debugging information entries
1257 consisting of only the abbreviation code 0 are considered
1260 \subsection{Abbreviations Tables}
1261 \label{datarep:abbreviationstables}
1263 The abbreviations tables for all compilation units
1264 are contained in a separate object file section called
1266 As mentioned before, multiple compilation
1267 units may share the same abbreviations table.
1269 The abbreviations table for a single compilation unit consists
1270 of a series of abbreviation declarations. Each declaration
1271 specifies the tag and attributes for a particular form of
1272 debugging information entry. Each declaration begins with
1273 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1274 number representing the abbreviation
1275 code itself. It is this code that appears at the beginning
1276 of a debugging information entry in the
1278 section. As described above, the abbreviation
1279 code 0 is reserved for null debugging information entries. The
1280 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1281 number that encodes the entry\textquoteright s tag. The encodings for the
1282 tag names are given in
1283 Table \refersec{tab:tagencodings}.
1287 \setlength{\extrarowheight}{0.1cm}
1288 \begin{longtable}{l|c}
1289 \caption{Tag encodings} \label{tab:tagencodings} \\
1290 \hline \bfseries Tag name&\bfseries Value\\ \hline
1292 \bfseries Tag name&\bfseries Value \\ \hline
1294 \hline \emph{Continued on next page}
1296 \hline \ddag\ \textit{New in DWARF Version 5}
1298 \DWTAGarraytype{} &0x01 \\
1299 \DWTAGclasstype&0x02 \\
1300 \DWTAGentrypoint&0x03 \\
1301 \DWTAGenumerationtype&0x04 \\
1302 \DWTAGformalparameter&0x05 \\
1303 \DWTAGimporteddeclaration&0x08 \\
1305 \DWTAGlexicalblock&0x0b \\
1306 \DWTAGmember&0x0d \\
1307 \DWTAGpointertype&0x0f \\
1308 \DWTAGreferencetype&0x10 \\
1309 \DWTAGcompileunit&0x11 \\
1310 \DWTAGstringtype&0x12 \\
1311 \DWTAGstructuretype&0x13 \\
1312 \DWTAGsubroutinetype&0x15 \\
1313 \DWTAGtypedef&0x16 \\
1314 \DWTAGuniontype&0x17 \\
1315 \DWTAGunspecifiedparameters&0x18 \\
1316 \DWTAGvariant&0x19 \\
1317 \DWTAGcommonblock&0x1a \\
1318 \DWTAGcommoninclusion&0x1b \\
1319 \DWTAGinheritance&0x1c \\
1320 \DWTAGinlinedsubroutine&0x1d \\
1321 \DWTAGmodule&0x1e \\
1322 \DWTAGptrtomembertype&0x1f \\
1323 \DWTAGsettype&0x20 \\
1324 \DWTAGsubrangetype&0x21 \\
1325 \DWTAGwithstmt&0x22 \\
1326 \DWTAGaccessdeclaration&0x23 \\
1327 \DWTAGbasetype&0x24 \\
1328 \DWTAGcatchblock&0x25 \\
1329 \DWTAGconsttype&0x26 \\
1330 \DWTAGconstant&0x27 \\
1331 \DWTAGenumerator&0x28 \\
1332 \DWTAGfiletype&0x29 \\
1333 \DWTAGfriend&0x2a \\
1334 \DWTAGnamelist&0x2b \\
1335 \DWTAGnamelistitem&0x2c \\
1336 \DWTAGpackedtype&0x2d \\
1337 \DWTAGsubprogram&0x2e \\
1338 \DWTAGtemplatetypeparameter&0x2f \\
1339 \DWTAGtemplatevalueparameter&0x30 \\
1340 \DWTAGthrowntype&0x31 \\
1341 \DWTAGtryblock&0x32 \\
1342 \DWTAGvariantpart&0x33 \\
1343 \DWTAGvariable&0x34 \\
1344 \DWTAGvolatiletype&0x35 \\
1345 \DWTAGdwarfprocedure&0x36 \\
1346 \DWTAGrestricttype&0x37 \\
1347 \DWTAGinterfacetype&0x38 \\
1348 \DWTAGnamespace&0x39 \\
1349 \DWTAGimportedmodule&0x3a \\
1350 \DWTAGunspecifiedtype&0x3b \\
1351 \DWTAGpartialunit&0x3c \\
1352 \DWTAGimportedunit&0x3d \\
1353 \textit{Reserved}&0x3e\footnote{Code 0x3e is reserved to allow backward compatible support of the
1354 DW\_TAG\_mutable\_type DIE that was defined (only) in \DWARFVersionIII.}
1356 \DWTAGcondition&\xiiif \\
1357 \DWTAGsharedtype&0x40 \\
1358 \DWTAGtypeunit & 0x41 \\
1359 \DWTAGrvaluereferencetype & 0x42 \\
1360 \DWTAGtemplatealias & 0x43 \\
1361 \DWTAGcoarraytype~\ddag & 0x44 \\
1362 \DWTAGgenericsubrange~\ddag & 0x45 \\
1363 \DWTAGdynamictype~\ddag & 0x46 \\
1364 \DWTAGatomictype~\ddag & 0x47 \\
1365 \DWTAGcallsite~\ddag & 0x48 \\
1366 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1367 \DWTAGskeletonunit~\ddag & 0x4a \\
1369 \DWTAGimmutabletype~\ddag & 0x4b
1372 \DWTAGlouser&0x4080 \\
1373 \DWTAGhiuser&\xffff \\
1378 Following the tag encoding is a 1-byte value that determines
1379 whether a debugging information entry using this abbreviation
1380 has child entries or not. If the value is
1382 the next physically succeeding entry of any debugging
1383 information entry using this abbreviation is the first
1384 child of that entry. If the 1-byte value following the
1385 abbreviation\textquoteright s tag encoding is
1386 \DWCHILDRENnoTARG, the next
1387 physically succeeding entry of any debugging information entry
1388 using this abbreviation is a sibling of that entry. (Either
1389 the first child or sibling entries may be null entries). The
1390 encodings for the child determination byte are given in
1391 Table \refersec{tab:childdeterminationencodings}
1393 Section \refersec{chap:relationshipofdebugginginformationentries},
1394 each chain of sibling entries is terminated by a null entry.)
1398 \setlength{\extrarowheight}{0.1cm}
1399 \begin{longtable}{l|c}
1400 \caption{Child determination encodings}
1401 \label{tab:childdeterminationencodings}
1402 \addtoindexx{Child determination encodings} \\
1403 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1405 \bfseries Children determination name&\bfseries Value \\ \hline
1407 \hline \emph{Continued on next page}
1411 \DWCHILDRENno&0x00 \\
1412 \DWCHILDRENyes&0x01 \\ \hline
1417 Finally, the child encoding is followed by a series of
1418 attribute specifications. Each attribute specification
1419 consists of two parts. The first part is an
1420 unsigned LEB128\addtoindexx{LEB128!unsigned}
1421 number representing the attribute\textquoteright s name.
1422 The second part is an
1423 unsigned LEB128\addtoindexx{LEB128!unsigned}
1424 number representing the attribute\textquoteright s form.
1425 The series of attribute specifications ends with an
1426 entry containing 0 for the name and 0 for the form.
1430 \DWFORMindirectTARG{} is a special case. For
1431 attributes with this form, the attribute value itself in the
1433 section begins with an unsigned
1434 LEB128 number that represents its form. This allows producers
1435 to choose forms for particular attributes
1436 \addtoindexx{abbreviations table!dynamic forms in}
1438 without having to add a new entry to the abbreviations table.
1440 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1441 For attributes with this form, the attribute specification contains
1442 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1443 number. The value of this number is used as the value of the
1444 attribute, and no value is stored in the \dotdebuginfo{} section.
1446 The abbreviations for a given compilation unit end with an
1447 entry consisting of a 0 byte for the abbreviation code.
1450 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1451 for a depiction of the organization of the
1452 debugging information.}
1455 \subsection{Attribute Encodings}
1456 \label{datarep:attributeencodings}
1458 The encodings for the attribute names are given in
1459 Table \referfol{tab:attributeencodings}.
1462 \setlength{\extrarowheight}{0.1cm}
1463 \begin{longtable}{l|c|l}
1464 \caption{Attribute encodings}
1465 \label{tab:attributeencodings}
1466 \addtoindexx{attribute encodings} \\
1467 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1469 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1471 \hline \emph{Continued on next page}
1473 \hline \ddag\ \textit{New in DWARF Version 5}
1475 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1476 \addtoindexx{sibling attribute} \\
1477 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1481 \addtoindexx{location attribute} \\
1482 \DWATname&0x03&\livelink{chap:classstring}{string}
1483 \addtoindexx{name attribute} \\
1484 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1485 \addtoindexx{ordering attribute} \\
1486 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1487 \livelink{chap:classexprloc}{exprloc},
1488 \livelink{chap:classreference}{reference}
1489 \addtoindexx{byte size attribute} \\
1490 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1491 DW\_AT\_bit\_offset \mbox{attribute} which was
1492 defined in \DWARFVersionIII{} and earlier.}
1493 &\livelink{chap:classconstant}{constant},
1494 \livelink{chap:classexprloc}{exprloc},
1495 \livelink{chap:classreference}{reference}
1496 \addtoindexx{bit offset attribute (Version 3)}
1497 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1498 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1499 \livelink{chap:classexprloc}{exprloc},
1500 \livelink{chap:classreference}{reference}
1501 \addtoindexx{bit size attribute} \\
1502 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1503 \addtoindexx{statement list attribute} \\
1504 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1505 \addtoindexx{low PC attribute} \\
1506 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1507 \livelink{chap:classconstant}{constant}
1508 \addtoindexx{high PC attribute} \\
1509 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1510 \addtoindexx{language attribute} \\
1511 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1512 \addtoindexx{discriminant attribute} \\
1513 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1514 \addtoindexx{discriminant value attribute} \\
1515 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1516 \addtoindexx{visibility attribute} \\
1517 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1518 \addtoindexx{import attribute} \\
1519 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1523 \addtoindexx{string length attribute} \\
1524 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1525 \addtoindexx{common reference attribute} \\
1526 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1527 \addtoindexx{compilation directory attribute} \\
1528 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1529 \livelink{chap:classconstant}{constant},
1530 \livelink{chap:classstring}{string}
1531 \addtoindexx{constant value attribute} \\
1532 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1533 \addtoindexx{containing type attribute} \\
1534 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1535 \livelink{chap:classreference}{reference},
1536 \livelink{chap:classflag}{flag}
1537 \addtoindexx{default value attribute} \\
1538 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1539 \addtoindexx{inline attribute} \\
1540 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1541 \addtoindexx{is optional attribute} \\
1542 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1543 \livelink{chap:classexprloc}{exprloc},
1544 \livelink{chap:classreference}{reference}
1545 \addtoindexx{lower bound attribute} \\
1546 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1547 \addtoindexx{producer attribute} \\
1548 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1549 \addtoindexx{prototyped attribute} \\
1550 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1554 \addtoindexx{return address attribute} \\
1555 \DWATstartscope&0x2c&
1556 \livelink{chap:classconstant}{constant},
1560 \addtoindexx{start scope attribute} \\
1561 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1562 \livelink{chap:classexprloc}{exprloc},
1563 \livelink{chap:classreference}{reference}
1564 \addtoindexx{bit stride attribute} \\
1565 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1566 \livelink{chap:classexprloc}{exprloc},
1567 \livelink{chap:classreference}{reference}
1568 \addtoindexx{upper bound attribute} \\
1569 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1570 \addtoindexx{abstract origin attribute} \\
1571 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1572 \addtoindexx{accessibility attribute} \\
1573 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1574 \addtoindexx{address class attribute} \\
1575 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1576 \addtoindexx{artificial attribute} \\
1577 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1578 \addtoindexx{base types attribute} \\
1579 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1580 \addtoindexx{calling convention attribute} \\
1581 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1582 \livelink{chap:classexprloc}{exprloc},
1583 \livelink{chap:classreference}{reference}
1584 \addtoindexx{count attribute} \\
1585 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1586 \livelink{chap:classexprloc}{exprloc},
1590 \addtoindexx{data member attribute} \\
1591 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1592 \addtoindexx{declaration column attribute} \\
1593 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1594 \addtoindexx{declaration file attribute} \\
1595 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1596 \addtoindexx{declaration line attribute} \\
1597 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1598 \addtoindexx{declaration attribute} \\
1599 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1600 \addtoindexx{discriminant list attribute} \\
1601 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1602 \addtoindexx{encoding attribute} \\
1603 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1604 \addtoindexx{external attribute} \\
1605 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1609 \addtoindexx{frame base attribute} \\
1610 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1611 \addtoindexx{friend attribute} \\
1612 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1613 \addtoindexx{identifier case attribute} \\
1614 \textit{Reserved}&0x43\footnote{Code 0x43 is reserved to allow backward compatible support of the
1615 DW\_AT\_macro\_info \mbox{attribute} which was
1616 defined in \DWARFVersionIV{} and earlier.}
1617 &\livelink{chap:classmacptr}{macptr}
1618 \addtoindexx{macro information attribute (legacy)!encoding} \\
1619 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1620 \addtoindexx{name list item attribute} \\
1621 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1622 \addtoindexx{priority attribute} \\
1623 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1627 \addtoindexx{segment attribute} \\
1628 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1629 \addtoindexx{specification attribute} \\
1630 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1634 \addtoindexx{static link attribute} \\
1635 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1636 \addtoindexx{type attribute} \\
1637 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1641 \addtoindexx{location list attribute} \\
1642 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1643 \addtoindexx{variable parameter attribute} \\
1644 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1645 \addtoindexx{virtuality attribute} \\
1646 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1650 \addtoindexx{vtable element location attribute} \\
1651 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1652 \livelink{chap:classexprloc}{exprloc},
1653 \livelink{chap:classreference}{reference}
1654 \addtoindexx{allocated attribute} \\
1655 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1656 \livelink{chap:classexprloc}{exprloc},
1657 \livelink{chap:classreference}{reference}
1658 \addtoindexx{associated attribute} \\
1659 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1660 \addtoindexx{data location attribute} \\
1661 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1662 \livelink{chap:classexprloc}{exprloc},
1663 \livelink{chap:classreference}{reference}
1664 \addtoindexx{byte stride attribute} \\
1665 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1666 \livelink{chap:classconstant}{constant}
1667 \addtoindexx{entry PC attribute} \\
1668 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1669 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1670 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1671 \addtoindexx{extension attribute} \\
1676 \addtoindexx{ranges attribute} \\
1677 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1678 \livelink{chap:classflag}{flag},
1679 \livelink{chap:classreference}{reference},
1680 \livelink{chap:classstring}{string}
1681 \addtoindexx{trampoline attribute} \\
1682 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1683 \addtoindexx{call column attribute} \\
1684 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1685 \addtoindexx{call file attribute} \\
1686 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1687 \addtoindexx{call line attribute} \\
1688 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1689 \addtoindexx{description attribute} \\
1690 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1691 \addtoindexx{binary scale attribute} \\
1692 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1693 \addtoindexx{decimal scale attribute} \\
1694 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1695 \addtoindexx{small attribute} \\
1696 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1697 \addtoindexx{decimal scale attribute} \\
1698 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1699 \addtoindexx{digit count attribute} \\
1700 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1701 \addtoindexx{picture string attribute} \\
1702 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1703 \addtoindexx{mutable attribute} \\
1704 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1705 \addtoindexx{thread scaled attribute} \\
1706 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1707 \addtoindexx{explicit attribute} \\
1708 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1709 \addtoindexx{object pointer attribute} \\
1710 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1711 \addtoindexx{endianity attribute} \\
1712 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1713 \addtoindexx{elemental attribute} \\
1714 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1715 \addtoindexx{pure attribute} \\
1716 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1717 \addtoindexx{recursive attribute} \\
1718 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1719 \addtoindexx{signature attribute} \\
1720 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1721 \addtoindexx{main subprogram attribute} \\
1722 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1723 \addtoindexx{data bit offset attribute} \\
1724 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1725 \addtoindexx{constant expression attribute} \\
1726 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1727 \addtoindexx{enumeration class attribute} \\
1728 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1729 \addtoindexx{linkage name attribute} \\
1730 \DWATstringlengthbitsize{}~\ddag&0x6f&
1731 \livelink{chap:classconstant}{constant}
1732 \addtoindexx{string length attribute!size of length} \\
1733 \DWATstringlengthbytesize{}~\ddag&0x70&
1734 \livelink{chap:classconstant}{constant}
1735 \addtoindexx{string length attribute!size of length} \\
1736 \DWATrank~\ddag&0x71&
1737 \livelink{chap:classconstant}{constant},
1738 \livelink{chap:classexprloc}{exprloc}
1739 \addtoindexx{rank attribute} \\
1740 \DWATstroffsetsbase~\ddag&0x72&
1741 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1742 \addtoindexx{string offsets base!encoding} \\
1743 \DWATaddrbase~\ddag &0x73&
1744 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1745 \addtoindexx{address table base!encoding} \\
1747 \DWATrnglistsbase~\ddag&0x74&
1749 \addtoindexx{range list base!encoding}
1751 \textit{Reserved} &0x75& \textit{Unused} \\
1752 \DWATdwoname~\ddag &0x76&
1753 \livelink{chap:classstring}{string}
1754 \addtoindexx{split DWARF object file name!encoding} \\
1755 \DWATreference~\ddag &0x77&
1756 \livelink{chap:classflag}{flag} \\
1757 \DWATrvaluereference~\ddag &0x78&
1758 \livelink{chap:classflag}{flag} \\
1759 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1760 \addtoindexx{macro information attribute} \\
1761 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1762 \addtoindexx{all calls summary attribute} \\
1763 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1764 \addtoindexx{all source calls summary attribute} \\
1765 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1766 \addtoindexx{all tail calls summary attribute} \\
1767 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1768 \addtoindexx{call return PC attribute} \\
1769 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1770 \addtoindexx{call value attribute} \\
1771 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1772 \addtoindexx{call origin attribute} \\
1773 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1774 \addtoindexx{call parameter attribute} \\
1775 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1776 \addtoindexx{call PC attribute} \\
1777 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1778 \addtoindexx{call tail call attribute} \\
1779 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1780 \addtoindexx{call target attribute} \\
1781 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1782 \addtoindexx{call target clobbered attribute} \\
1783 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1784 \addtoindexx{call data location attribute} \\
1785 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1786 \addtoindexx{call data value attribute} \\
1787 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1788 \addtoindexx{noreturn attribute} \\
1789 \DWATalignment~\ddag &0x88 &\CLASSconstant
1790 \addtoindexx{alignment attribute} \\
1791 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1792 \addtoindexx{export symbols attribute} \\
1793 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1794 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1796 \DWATloclistsbase~\ddag &0x8c &\CLASSloclistsptr \addtoindexx{location list base attribute}
1799 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1800 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1806 \subsection{Classes and Forms}
1808 \label{datarep:classesandforms}
1810 Each class is a set of forms which have related representations
1811 and which are given a common interpretation according to the
1812 attribute in which the form is used.
1813 The attribute form governs how the value of an attribute is
1815 The classes and the forms they include are listed below.
1818 Form \DWFORMsecoffsetTARG{}
1819 is a member of more than one class, namely
1823 \CLASSloclist, \CLASSloclistsptr,
1827 \CLASSrnglist{}, \CLASSrnglistsptr,
1830 \CLASSstroffsetsptr;
1832 as a result, it is not possible for an
1833 attribute to allow more than one of these classes.
1835 The list of classes allowed by the applicable attribute in
1836 Table \refersec{tab:attributeencodings}
1837 determines the class of the form.
1840 In the form descriptions that follow, some forms are said
1841 to depend in part on the value of an attribute of the
1842 \definition{\associatedcompilationunit}:
1845 In the case of a \splitDWARFobjectfile{}, the associated
1846 compilation unit is the skeleton compilation unit corresponding
1847 to the containing unit.
1848 \item Otherwise, the associated compilation unit
1849 is the containing unit.
1853 Each possible form belongs to one or more of the following classes
1854 (see Table \refersec{tab:classesofattributevalue} for a summary of
1855 the purpose and general usage of each class):
1859 \item \CLASSaddress \\
1860 \livetarg{datarep:classaddress}{}
1861 Represented as either:
1863 \item An object of appropriate size to hold an
1864 address on the target machine (\DWFORMaddrTARG).
1865 The size is encoded in the compilation unit header
1866 (see Section \refersec{datarep:compilationunitheader}).
1867 This address is relocatable in a relocatable object file and
1868 is relocated in an executable file or shared object file.
1870 \item An indirect index into a table of addresses (as
1871 described in the previous bullet) in the
1872 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1873 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1874 \addtoindex{LEB128} value, which is interpreted as a zero-based
1875 index into an array of addresses in the \dotdebugaddr{} section.
1876 The index is relative to the value of the \DWATaddrbase{} attribute
1877 of the associated compilation unit.
1882 \item \CLASSaddrptr \\
1883 \livetarg{datarep:classaddrptr}{}
1884 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1885 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1886 beginning of the list of machine addresses information for the
1887 referencing entity. It is relocatable in
1888 a relocatable object file, and relocated in an executable or
1889 shared object file. In the \thirtytwobitdwarfformat, this offset
1890 is a 4-byte unsigned value; in the 64-bit DWARF
1891 format, it is an 8-byte unsigned value (see Section
1892 \refersec{datarep:32bitand64bitdwarfformats}).
1894 \textit{This class is new in \DWARFVersionV.}
1897 \item \CLASSblock \\
1898 \livetarg{datarep:classblock}{}
1899 Blocks come in four forms:
1902 A 1-byte length followed by 0 to 255 contiguous information
1903 bytes (\DWFORMblockoneTARG).
1906 A 2-byte length followed by 0 to 65,535 contiguous information
1907 bytes (\DWFORMblocktwoTARG).
1910 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1911 information bytes (\DWFORMblockfourTARG).
1914 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1915 length followed by the number of bytes
1916 specified by the length (\DWFORMblockTARG).
1919 In all forms, the length is the number of information bytes
1920 that follow. The information bytes may contain any mixture
1921 of relocated (or relocatable) addresses, references to other
1922 debugging information entries or data bytes.
1924 \item \CLASSconstant \\
1925 \livetarg{datarep:classconstant}{}
1926 There are eight forms of constants. There are fixed length
1927 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1931 \DWFORMdatafourTARG,
1932 \DWFORMdataeightTARG{} and
1933 \DWFORMdatasixteenTARG).
1934 There are variable length constant
1935 data forms encoded using
1936 signed LEB128 numbers (\DWFORMsdataTARG) and unsigned
1937 LEB128 numbers (\DWFORMudataTARG).
1938 There is also an implicit constant (\DWFORMimplicitconst),
1939 whose value is provided as part of the abbreviation
1943 The data in \DWFORMdataone,
1946 \DWFORMdataeight{} and
1947 \DWFORMdatasixteen{}
1948 can be anything. Depending on context, it may
1949 be a signed integer, an unsigned integer, a floating\dash point
1950 constant, or anything else. A consumer must use context to
1951 know how to interpret the bits, which if they are target
1952 machine data (such as an integer or floating-point constant)
1953 will be in target machine \byteorder.
1955 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1956 forms is used to represent a
1957 signed or unsigned integer, it can be hard for a consumer
1958 to discover the context necessary to determine which
1959 interpretation is intended. Producers are therefore strongly
1960 encouraged to use \DWFORMsdata{} or
1961 \DWFORMudata{} for signed and
1962 unsigned integers respectively, rather than
1963 \DWFORMdata\textless n\textgreater.}
1966 \item \CLASSexprloc \\
1967 \livetarg{datarep:classexprloc}{}
1968 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length
1969 followed by the number of information bytes specified by the
1970 length (\DWFORMexprlocTARG).
1971 The information bytes contain a DWARF expression
1972 (see Section \refersec{chap:dwarfexpressions})
1973 or location description
1974 (see Section \refersec{chap:locationdescriptions}).
1978 \livetarg{datarep:classflag}{}
1979 A flag \addtoindexx{flag class}
1980 is represented explicitly as a single byte of data
1981 (\DWFORMflagTARG) or implicitly (\DWFORMflagpresentTARG). In the
1982 first case, if the \nolink{flag} has value zero, it indicates the
1983 absence of the attribute; if the \nolink{flag} has a non-zero value,
1984 it indicates the presence of the attribute. In the second
1985 case, the attribute is implicitly indicated as present, and
1986 no value is encoded in the debugging information entry itself.
1989 \item \CLASSlineptr \\
1990 \livetarg{datarep:classlineptr}{}
1991 This is an offset into
1992 \addtoindexx{section offset!in class lineptr value}
1994 \dotdebugline{} or \dotdebuglinedwo{} section
1996 It consists of an offset from the beginning of the
1998 section to the first byte of
1999 the data making up the line number list for the compilation
2001 It is relocatable in a relocatable object file, and
2002 relocated in an executable or shared object file. In the
2003 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2004 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2005 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2009 \item \CLASSloclist \\
2010 \livetarg{datarep:classloclist}{}
2011 This is represented as either:
2014 An index into the \dotdebugloclists{} section (\DWFORMloclistxTARG).
2015 The unsigned ULEB operand identifies an offset location
2016 relative to the base of that section (the location of the first offset
2017 in the section, not the first byte of the section). The contents of
2018 that location is then added to the base to determine the location of
2019 the target list of entries.
2021 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2022 The operand consists of a byte
2023 offset\addtoindexx{section offset!in class loclist value}
2024 from the beginning of the \dotdebugloclists{} section.
2025 It is relocatable in a relocatable object file, and
2026 relocated in an executable or shared object file. In the
2027 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2028 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2029 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2032 \textit{This class is new in \DWARFVersionV.}
2035 \item \CLASSloclistsptr \\
2036 \livetarg{datarep:classloclistsptr}{}
2037 This is an offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2038 The operand consists of a byte
2039 offset\addtoindexx{section offset!in class loclistsptr}
2040 from the beginning of the \dotdebugloclists{} section.
2042 It is relocatable in a relocatable object file, and
2043 relocated in an executable or shared object file. In the
2044 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2045 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2046 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2049 \textit{This class is new in \DWARFVersionV.}
2052 \item \CLASSmacptr \\
2053 \livetarg{datarep:classmacptr}{}
2055 \addtoindexx{section offset!in class macptr value}
2057 \dotdebugmacro{} or \dotdebugmacrodwo{} section
2059 It consists of an offset from the beginning of the
2060 \dotdebugmacro{} or \dotdebugmacrodwo{}
2061 section to the the header making up the
2062 macro information list for the compilation unit.
2063 It is relocatable in a relocatable object file, and
2064 relocated in an executable or shared object file. In the
2065 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2066 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2067 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2071 \item \CLASSrnglist \\
2072 \livetarg{datarep:classrnglist}{}
2073 This is represented as either:
2076 An index into the \dotdebugrnglists{} section (\DWFORMrnglistxTARG).
2077 The unsigned ULEB operand identifies an offset location
2078 relative to the base of that section (the location of the first offset
2079 in the section, not the first byte of the section). The contents of
2080 that location is then added to the base to determine the location of
2081 the target range list of entries.
2083 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2084 The operand consists of a byte
2085 offset\addtoindexx{section offset!in class loclist value}
2086 from the beginning of the \dotdebugloclists{} section.
2087 It is relocatable in a relocatable object file, and
2088 relocated in an executable or shared object file. In the
2089 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2090 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2091 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2094 \textit{This class is new in \DWARFVersionV.}
2098 \item \CLASSrnglistsptr \\
2099 \livetarg{datarep:classrnglistsptr}{}
2100 This is an offset\addtoindexx{section offset!in class rnglistsptr}
2101 into the \dotdebugrnglists{} section (\DWFORMsecoffset).
2102 It consists of a byte offset from the beginning of the
2103 \dotdebugrnglists{} section.
2104 It is relocatable in a relocatable object file, and relocated
2105 in an executable or shared object file.
2107 In the \thirtytwobitdwarfformat, this offset
2108 is a 4-byte unsigned value; in the 64-bit DWARF
2109 format, it is an 8-byte unsigned value (see Section
2110 \refersec{datarep:32bitand64bitdwarfformats}).
2113 \textit{This class is new in \DWARFVersionV.}
2119 \item \CLASSreference \\
2120 \livetarg{datarep:classreference}{}
2121 There are four types of reference.\addtoindexx{reference class}
2124 The first type of reference can identify any debugging
2125 information entry within the containing unit.
2126 This type of reference is an
2127 offset\addtoindexx{section offset!in class reference value}
2128 from the first byte of the compilation
2129 header for the compilation unit containing the reference. There
2130 are five forms for this type of reference. There are fixed
2131 length forms for one, two, four and eight byte offsets
2137 and \DWFORMrefeightTARG).
2138 There is also an unsigned variable
2139 length offset encoded form that uses
2140 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
2141 (\DWFORMrefudataTARG).
2142 Because this type of reference is within
2143 the containing compilation unit no relocation of the value
2147 The second type of reference can identify any debugging
2148 information entry within a
2149 \dotdebuginfo{} section; in particular,
2150 it may refer to an entry in a different compilation unit
2151 from the unit containing the reference, and may refer to an
2152 entry in a different shared object file. This type of reference
2153 (\DWFORMrefaddrTARG)
2154 is an offset from the beginning of the
2156 section of the target executable or shared object file, or, for
2157 references within a \addtoindex{supplementary object file},
2158 an offset from the beginning of the local \dotdebuginfo{} section;
2159 it is relocatable in a relocatable object file and frequently
2160 relocated in an executable or shared object file. For
2161 references from one shared object or static executable file
2162 to another, the relocation and identification of the target
2163 object must be performed by the consumer. In the
2164 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2165 in the \sixtyfourbitdwarfformat, it is an 8-byte
2167 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2169 \textit{A debugging information entry that may be referenced by
2170 another compilation unit using
2171 \DWFORMrefaddr{} must have a global symbolic name.}
2173 \textit{For a reference from one executable or shared object file to
2174 another, the reference is resolved by the debugger to identify
2175 the executable or shared object file and the offset into that
2176 file\textquoteright s \dotdebuginfo{}
2177 section in the same fashion as the run
2178 time loader, either when the debug information is first read,
2179 or when the reference is used.}
2182 The third type of reference can identify any debugging
2183 information type entry that has been placed in its own
2184 \addtoindex{type unit}. This type of
2185 reference (\DWFORMrefsigeightTARG) is the
2186 \addtoindexx{type signature}
2187 8-byte type signature
2188 (see Section \refersec{datarep:typesignaturecomputation})
2189 that was computed for the type.
2192 The fourth type of reference is a reference from within the
2193 \dotdebuginfo{} section of the executable or shared object file to
2194 a debugging information entry in the \dotdebuginfo{} section of
2195 a \addtoindex{supplementary object file}.
2196 This type of reference (\DWFORMrefsupTARG) is an offset from the
2197 beginning of the \dotdebuginfo{} section in the
2198 \addtoindex{supplementary object file}.
2200 \textit{The use of compilation unit relative references will reduce the
2201 number of link\dash time relocations and so speed up linking. The
2202 use of the second, third and fourth type of reference allows for the
2203 sharing of information, such as types, across compilation
2204 units, while the fourth type further allows for sharing of information
2205 across compilation units from different executables or shared object files.}
2207 \textit{A reference to any kind of compilation unit identifies the
2208 debugging information entry for that unit, not the preceding
2213 \item \CLASSstring \\
2214 \livetarg{datarep:classstring}{}
2215 A string is a sequence of contiguous non\dash null bytes followed by
2217 \addtoindexx{string class}
2218 A string may be represented:
2220 \setlength{\itemsep}{0em}
2221 \item immediately in the debugging information entry itself
2222 (\DWFORMstringTARG),
2225 \addtoindexx{section offset!in class string value}
2226 offset into a string table contained in
2227 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
2228 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
2229 or as an offset into a string table contained in the
2230 \dotdebugstr{} section of a \addtoindex{supplementary object file}
2231 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
2232 section of a \addtoindex{supplementary object file}
2233 refer to the local \dotdebugstr{} section of that same file.
2234 In the \thirtytwobitdwarfformat, the representation of a
2235 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
2236 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2237 it is an 8-byte unsigned offset
2238 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2241 \item as an indirect offset into the string table using an
2242 index into a table of offsets contained in the
2243 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
2244 The representation of a \DWFORMstrxNAME{} value is an unsigned
2245 \addtoindex{LEB128} value, which is interpreted as a zero-based
2246 index into an array of offsets in the \dotdebugstroffsets{} section.
2247 The offset entries in the \dotdebugstroffsets{} section have the
2248 same representation as \DWFORMstrp{} values.
2250 Any combination of these three forms may be used within a single compilation.
2252 If the \DWATuseUTFeight{}
2253 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
2254 compilation, partial, skeleton or type unit entry, string values are encoded using the
2255 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
2256 Character Set standard (ISO/IEC 10646\dash 1:1993).
2257 \addtoindexx{ISO 10646 character set standard}
2258 Otherwise, the string representation is unspecified.
2260 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
2261 ISO/IEC 10646\dash 1:1993.
2262 \addtoindexx{ISO 10646 character set standard}
2263 It contains all the same characters
2264 and encoding points as ISO/IEC 10646, as well as additional
2265 information about the characters and their use.}
2268 \textit{Earlier versions of DWARF did not specify the representation
2269 of strings; for compatibility, this version also does
2270 not. However, the UTF\dash 8 representation is strongly recommended.}
2273 \item \CLASSstroffsetsptr \\
2274 \livetarg{datarep:classstroffsetsptr}{}
2275 This is an offset into the \dotdebugstroffsets{} section
2276 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2277 \dotdebugstroffsets{} section to the
2278 beginning of the string offsets information for the
2279 referencing entity. It is relocatable in
2280 a relocatable object file, and relocated in an executable or
2281 shared object file. In the \thirtytwobitdwarfformat, this offset
2282 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2283 it is an 8-byte unsigned value (see Section
2284 \refersec{datarep:32bitand64bitdwarfformats}).
2286 \textit{This class is new in \DWARFVersionV.}
2290 In no case does an attribute use one of the classes
2295 \CLASSrnglistsptr{} or
2296 \CLASSstroffsetsptr{}
2297 to point into either the
2298 \dotdebuginfo{} or \dotdebugstr{} section.
2301 \subsection{Form Encodings}
2302 \label{datarep:formencodings}
2304 The form encodings are listed in
2305 Table \referfol{tab:attributeformencodings}.
2309 \setlength{\extrarowheight}{0.1cm}
2310 \begin{longtable}{l|c|l}
2311 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2312 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2314 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2316 \hline \emph{Continued on next page}
2318 \hline \ddag\ \textit{New in DWARF Version 5}
2321 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2322 \textit{Reserved} &0x02& \\
2323 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2324 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2325 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2326 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2327 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2328 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2329 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2330 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2331 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2332 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2333 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2334 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2335 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2336 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2337 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2338 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2339 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2340 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2341 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2342 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2344 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclist, \CLASSloclistsptr, \\
2345 & & \CLASSmacptr, \CLASSrnglist, \CLASSrnglistsptr, \CLASSstroffsetsptr
2348 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2349 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2350 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2351 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2352 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2353 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2354 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2355 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2356 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2357 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2359 \DWFORMloclistx~\ddag \eb &0x22 &\CLASSloclist \\
2361 \DWFORMrnglistx~\ddag \eb &0x23 &\CLASSrnglist \\
2367 \section{Variable Length Data}
2368 \label{datarep:variablelengthdata}
2369 \addtoindexx{variable length data|see {LEB128}}
2371 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2372 encoded using \doublequote{Little-Endian Base 128}
2373 \addtoindexx{little-endian encoding|see{endian attribute}}
2375 \addtoindexx{LEB128}
2376 LEB128 is a scheme for encoding integers
2377 densely that exploits the assumption that most integers are
2380 \textit{This encoding is equally suitable whether the target machine
2381 architecture represents data in big-endian or little-endian
2382 \byteorder. It is \doublequote{little-endian} only in the sense that it
2383 avoids using space to represent the \doublequote{big} end of an
2384 unsigned integer, when the big end is all zeroes or sign
2387 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2388 numbers are encoded as follows:
2389 \addtoindexx{LEB128!unsigned, encoding as}
2390 start at the low order end of an unsigned integer and chop
2391 it into 7-bit chunks. Place each chunk into the low order 7
2392 bits of a byte. Typically, several of the high order bytes
2393 will be zero; discard them. Emit the remaining bytes in a
2394 stream, starting with the low order byte; set the high order
2395 bit on each byte except the last emitted byte. The high bit
2396 of zero on the last byte indicates to the decoder that it
2397 has encountered the last byte.
2399 The integer zero is a special case, consisting of a single
2402 Table \refersec{tab:examplesofunsignedleb128encodings}
2403 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2405 0x80 in each case is the high order bit of the byte, indicating
2406 that an additional byte follows.
2409 The encoding for signed, two\textquoteright{s} complement LEB128
2410 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2411 numbers is similar, except that the criterion for discarding
2412 high order bytes is not whether they are zero, but whether
2413 they consist entirely of sign extension bits. Consider the
2414 4-byte integer -2. The three high level bytes of the number
2415 are sign extension, thus LEB128 would represent it as a single
2416 byte containing the low order 7 bits, with the high order
2417 bit cleared to indicate the end of the byte stream. Note
2418 that there is nothing within the LEB128 representation that
2419 indicates whether an encoded number is signed or unsigned. The
2420 decoder must know what type of number to expect.
2421 Table \refersec{tab:examplesofunsignedleb128encodings}
2422 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2423 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2424 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2427 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2428 \addtoindexx{LEB128!examples}
2429 gives algorithms for encoding and decoding these forms.}
2433 \setlength{\extrarowheight}{0.1cm}
2434 \begin{longtable}{c|c|c}
2435 \caption{Examples of unsigned LEB128 encodings}
2436 \label{tab:examplesofunsignedleb128encodings}
2437 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2438 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2440 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2442 \hline \emph{Continued on next page}
2448 128& 0 + 0x80 & 1 \\
2449 129& 1 + 0x80 & 1 \\
2450 %130& 2 + 0x80 & 1 \\
2451 12857& 57 + 0x80 & 100 \\
2458 \setlength{\extrarowheight}{0.1cm}
2459 \begin{longtable}{c|c|c}
2460 \caption{Examples of signed LEB128 encodings}
2461 \label{tab:examplesofsignedleb128encodings}
2462 \addtoindexx{LEB128!signed} \\
2463 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2465 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2467 \hline \emph{Continued on next page}
2473 127& 127 + 0x80 & 0 \\
2474 -127& 1 + 0x80 & 0x7f \\
2475 128& 0 + 0x80 & 1 \\
2476 -128& 0 + 0x80 & 0x7f \\
2477 129& 1 + 0x80 & 1 \\
2478 -129& 0x7f + 0x80 & 0x7e \\
2485 \section{DWARF Expressions and Location Descriptions}
2486 \label{datarep:dwarfexpressionsandlocationdescriptions}
2487 \subsection{DWARF Expressions}
2488 \label{datarep:dwarfexpressions}
2491 \addtoindexx{DWARF expression!operator encoding}
2492 DWARF expression is stored in a \nolink{block} of contiguous
2493 bytes. The bytes form a sequence of operations. Each operation
2494 is a 1-byte code that identifies that operation, followed by
2495 zero or more bytes of additional data. The encodings for the
2496 operations are described in
2497 Table \refersec{tab:dwarfoperationencodings}.
2500 \setlength{\extrarowheight}{0.1cm}
2501 \begin{longtable}{l|c|c|l}
2502 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2503 \hline & &\bfseries No. of &\\
2504 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2506 & &\bfseries No. of &\\
2507 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2509 \hline \emph{Continued on next page}
2511 \hline \ddag\ \textit{New in DWARF Version 5}
2514 \DWOPaddr&0x03&1 & constant address \\
2515 & & &(size is target specific) \\
2517 \DWOPderef&0x06&0 & \\
2519 \DWOPconstoneu&0x08&1&1-byte constant \\
2520 \DWOPconstones&0x09&1&1-byte constant \\
2521 \DWOPconsttwou&0x0a&1&2-byte constant \\
2522 \DWOPconsttwos&0x0b&1&2-byte constant \\
2523 \DWOPconstfouru&0x0c&1&4-byte constant \\
2524 \DWOPconstfours&0x0d&1&4-byte constant \\
2525 \DWOPconsteightu&0x0e&1&8-byte constant \\
2526 \DWOPconsteights&0x0f&1&8-byte constant \\
2527 \DWOPconstu&0x10&1&ULEB128 constant \\
2528 \DWOPconsts&0x11&1&SLEB128 constant \\
2529 \DWOPdup&0x12&0 & \\
2530 \DWOPdrop&0x13&0 & \\
2531 \DWOPover&0x14&0 & \\
2532 \DWOPpick&0x15&1&1-byte stack index \\
2533 \DWOPswap&0x16&0 & \\
2534 \DWOProt&0x17&0 & \\
2535 \DWOPxderef&0x18&0 & \\
2536 \DWOPabs&0x19&0 & \\
2537 \DWOPand&0x1a&0 & \\
2538 \DWOPdiv&0x1b&0 & \\
2539 \DWOPminus&0x1c&0 & \\
2540 \DWOPmod&0x1d&0 & \\
2541 \DWOPmul&0x1e&0 & \\
2542 \DWOPneg&0x1f&0 & \\
2543 \DWOPnot&0x20&0 & \\
2545 \DWOPplus&0x22&0 & \\
2546 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2547 \DWOPshl&0x24&0 & \\
2548 \DWOPshr&0x25&0 & \\
2549 \DWOPshra&0x26&0 & \\
2550 \DWOPxor&0x27&0 & \\
2552 \DWOPbra&0x28&1 & signed 2-byte constant \\
2559 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2561 \DWOPlitzero & 0x30 & 0 & \\
2562 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2563 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2564 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2566 \DWOPregzero & 0x50 & 0 & \\*
2567 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2568 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2569 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2571 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2572 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2573 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2574 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2576 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2577 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2578 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2579 & & &SLEB128 offset \\
2580 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2581 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2582 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2583 \DWOPnop{} & 0x96 &0& \\
2585 \DWOPpushobjectaddress&0x97&0 & \\
2586 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2587 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2588 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2589 \DWOPformtlsaddress&0x9b &0& \\
2590 \DWOPcallframecfa{} &0x9c &0& \\
2591 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2593 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2594 &&&\nolink{block} of that size\\
2595 \DWOPstackvalue{} &0x9f &0& \\
2596 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2597 &&&SLEB128 constant offset \\
2598 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2599 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2600 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2601 &&&\nolink{block} of that size\\
2602 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2603 & & & 1-byte size, \\*
2604 & & & constant value \\
2605 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2606 &&& ULEB128 constant offset \\
2607 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2608 &&& ULEB128 type entry offset \\
2609 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2610 &&& ULEB128 type entry offset \\
2611 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2612 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2613 \DWOPlouser{} &0xe0 && \\
2614 \DWOPhiuser{} &\xff && \\
2620 \subsection{Location Descriptions}
2621 \label{datarep:locationdescriptions}
2623 A location description is used to compute the
2624 location of a variable or other entity.
2626 \subsection{Location Lists}
2627 \label{datarep:locationlists}
2628 Each entry in a \addtoindex{location list} is either a location list entry,
2631 entry, a default location entry or an
2633 \addtoindexx{end-of-list entry!in location list}
2638 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2639 that follows. The encodings for these constants are given in
2640 Table \ref{tab:locationlistentryencodingvalues}.
2644 \setlength{\extrarowheight}{0.1cm}
2645 \begin{longtable}{l|c}
2646 \caption{Location list entry encoding values}
2647 \label{tab:locationlistentryencodingvalues} \\
2648 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2650 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2652 \hline \emph{Continued on next page}
2655 \ddag New in \DWARFVersionV
2658 \DWLLEendoflist~\ddag & 0x00 \\
2659 \DWLLEbaseaddressx~\ddag & 0x01 \\
2660 \DWLLEstartxendx~\ddag & 0x02 \\
2661 \DWLLEstartxlength~\ddag & 0x03 \\
2662 \DWLLEoffsetpair~\ddag & 0x04 \\
2663 \DWLLEdefaultlocation~\ddag & 0x05 \\
2664 \DWLLEbaseaddress~\ddag & 0x06 \\
2665 \DWLLEstartend~\ddag & 0x07 \\
2666 \DWLLEstartlength~\ddag & 0x08
2671 \section{Base Type Attribute Encodings}
2672 \label{datarep:basetypeattributeencodings}
2674 The\hypertarget{chap:DWATencodingencodingofbasetype}{}
2675 encodings of the constants used in the
2676 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2678 Table \refersec{tab:basetypeencodingvalues}
2681 \setlength{\extrarowheight}{0.1cm}
2682 \begin{longtable}{l|c}
2683 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2684 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2686 \bfseries Base type encoding name&\bfseries Value\\ \hline
2688 \hline \emph{Continued on next page}
2691 \ddag \ \textit{New in \DWARFVersionV}
2693 \DWATEaddress&0x01 \\
2694 \DWATEboolean&0x02 \\
2695 \DWATEcomplexfloat&0x03 \\
2697 \DWATEsigned&0x05 \\
2698 \DWATEsignedchar&0x06 \\
2699 \DWATEunsigned&0x07 \\
2700 \DWATEunsignedchar&0x08 \\
2701 \DWATEimaginaryfloat&0x09 \\
2702 \DWATEpackeddecimal&0x0a \\
2703 \DWATEnumericstring&0x0b \\
2704 \DWATEedited&0x0c \\
2705 \DWATEsignedfixed&0x0d \\
2706 \DWATEunsignedfixed&0x0e \\
2707 \DWATEdecimalfloat & 0x0f \\
2708 \DWATEUTF{} & 0x10 \\
2709 \DWATEUCS~\ddag & 0x11 \\
2710 \DWATEASCII~\ddag & 0x12 \\
2711 \DWATElouser{} & 0x80 \\
2712 \DWATEhiuser{} & \xff \\
2717 The encodings of the constants used in the
2718 \DWATdecimalsign{} attribute
2720 Table \refersec{tab:decimalsignencodings}.
2723 \setlength{\extrarowheight}{0.1cm}
2724 \begin{longtable}{l|c}
2725 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2726 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2728 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2730 % \hline \emph{Continued on next page}
2734 \DWDSunsigned{} & 0x01 \\
2735 \DWDSleadingoverpunch{} & 0x02 \\
2736 \DWDStrailingoverpunch{} & 0x03 \\
2737 \DWDSleadingseparate{} & 0x04 \\
2738 \DWDStrailingseparate{} & 0x05 \\
2743 The encodings of the constants used in the
2744 \DWATendianity{} attribute are given in
2745 Table \refersec{tab:endianityencodings}.
2748 \setlength{\extrarowheight}{0.1cm}
2749 \begin{longtable}{l|c}
2750 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2751 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2753 \bfseries Endian code name&\bfseries Value\\ \hline
2755 \hline \emph{Continued on next page}
2760 \DWENDdefault{} & 0x00 \\
2761 \DWENDbig{} & 0x01 \\
2762 \DWENDlittle{} & 0x02 \\
2763 \DWENDlouser{} & 0x40 \\
2764 \DWENDhiuser{} & \xff \\
2770 \section{Accessibility Codes}
2771 \label{datarep:accessibilitycodes}
2772 The encodings of the constants used in the
2773 \DWATaccessibility{}
2775 \addtoindexx{accessibility attribute}
2777 Table \refersec{tab:accessibilityencodings}.
2780 \setlength{\extrarowheight}{0.1cm}
2781 \begin{longtable}{l|c}
2782 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2783 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2785 \bfseries Accessibility code name&\bfseries Value\\ \hline
2787 \hline \emph{Continued on next page}
2792 \DWACCESSpublic&0x01 \\
2793 \DWACCESSprotected&0x02 \\
2794 \DWACCESSprivate&0x03 \\
2800 \section{Visibility Codes}
2801 \label{datarep:visibilitycodes}
2802 The encodings of the constants used in the
2803 \DWATvisibility{} attribute are given in
2804 Table \refersec{tab:visibilityencodings}.
2807 \setlength{\extrarowheight}{0.1cm}
2808 \begin{longtable}{l|c}
2809 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2810 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2812 \bfseries Visibility code name&\bfseries Value\\ \hline
2814 \hline \emph{Continued on next page}
2820 \DWVISexported&0x02 \\
2821 \DWVISqualified&0x03 \\
2826 \section{Virtuality Codes}
2827 \label{datarep:vitualitycodes}
2829 The encodings of the constants used in the
2830 \DWATvirtuality{} attribute are given in
2831 Table \refersec{tab:virtualityencodings}.
2834 \setlength{\extrarowheight}{0.1cm}
2835 \begin{longtable}{l|c}
2836 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2837 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2839 \bfseries Virtuality code name&\bfseries Value\\ \hline
2841 \hline \emph{Continued on next page}
2846 \DWVIRTUALITYnone&0x00 \\
2847 \DWVIRTUALITYvirtual&0x01 \\
2848 \DWVIRTUALITYpurevirtual&0x02 \\
2855 \DWVIRTUALITYnone{} is equivalent to the absence of the
2859 \section{Source Languages}
2860 \label{datarep:sourcelanguages}
2862 The encodings of the constants used
2863 \addtoindexx{language attribute, encoding}
2865 \addtoindexx{language name encoding}
2868 attribute are given in
2869 Table \refersec{tab:languageencodings}.
2871 % If we don't force a following space it looks odd
2873 and their associated values are reserved, but the
2874 languages they represent are not well supported.
2875 Table \refersec{tab:languageencodings}
2877 \addtoindexx{lower bound attribute!default}
2878 default lower bound, if any, assumed for
2879 an omitted \DWATlowerbound{} attribute in the context of a
2880 \DWTAGsubrangetype{} debugging information entry for each
2884 \setlength{\extrarowheight}{0.1cm}
2885 \begin{longtable}{l|c|c}
2886 \caption{Language encodings} \label{tab:languageencodings}\\
2887 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2889 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2891 \hline \emph{Continued on next page}
2894 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2896 \addtoindexx{ISO-defined language names}
2898 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2899 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2900 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2901 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++98 (ISO)} \\
2902 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2903 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2904 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2905 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2906 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2907 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2908 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2909 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2910 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2911 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2912 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2913 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2914 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2915 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2916 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2917 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2918 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2919 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2920 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2921 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2922 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++03 (ISO)}\\
2923 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++11 (ISO)} \\
2924 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2925 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2926 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2927 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2928 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2929 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2930 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++14 (ISO)} \\
2931 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2932 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2933 \DWLANGRenderScript{}~\ddag &0x0024 &0 \addtoindexx{RenderScript Kernel Language}
2935 \DWLANGlouser{} &0x8000 & \\
2936 \DWLANGhiuser{} &\xffff & \\
2941 \section{Address Class Encodings}
2942 \label{datarep:addressclassencodings}
2944 The value of the common
2945 \addtoindex{address class} encoding
2949 \section{Identifier Case}
2950 \label{datarep:identifiercase}
2952 The encodings of the constants used in the
2953 \DWATidentifiercase{} attribute are given in
2954 Table \refersec{tab:identifiercaseencodings}.
2958 \setlength{\extrarowheight}{0.1cm}
2959 \begin{longtable}{l|c}
2960 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2961 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2963 \bfseries Identifier case name&\bfseries Value\\ \hline
2965 \hline \emph{Continued on next page}
2969 \DWIDcasesensitive&0x00 \\
2971 \DWIDdowncase&0x02 \\
2972 \DWIDcaseinsensitive&0x03 \\
2976 \section{Calling Convention Encodings}
2977 \label{datarep:callingconventionencodings}
2978 The encodings of the constants used in the
2979 \DWATcallingconvention{} attribute are given in
2980 Table \refersec{tab:callingconventionencodings}.
2983 \setlength{\extrarowheight}{0.1cm}
2984 \begin{longtable}{l|c}
2985 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2986 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2988 \bfseries Calling convention name&\bfseries Value\\ \hline
2990 \hline \emph{Continued on next page}
2992 \hline \ddag\ \textit{New in DWARF Version 5}
2995 \DWCCnormal &0x01 \\
2996 \DWCCprogram&0x02 \\
2997 \DWCCnocall &0x03 \\
2998 \DWCCpassbyreference~\ddag &0x04 \\
2999 \DWCCpassbyvalue~\ddag &0x05 \\
3000 \DWCClouser &0x40 \\
3007 \section{Inline Codes}
3008 \label{datarep:inlinecodes}
3010 The encodings of the constants used in
3011 \addtoindexx{inline attribute}
3013 \DWATinline{} attribute are given in
3014 Table \refersec{tab:inlineencodings}.
3018 \setlength{\extrarowheight}{0.1cm}
3019 \begin{longtable}{l|c}
3020 \caption{Inline encodings} \label{tab:inlineencodings}\\
3021 \hline \bfseries Inline code name&\bfseries Value \\ \hline
3023 \bfseries Inline Code name&\bfseries Value\\ \hline
3025 \hline \emph{Continued on next page}
3030 \DWINLnotinlined&0x00 \\
3031 \DWINLinlined&0x01 \\
3032 \DWINLdeclarednotinlined&0x02 \\
3033 \DWINLdeclaredinlined&0x03 \\
3038 % this clearpage is ugly, but the following table came
3039 % out oddly without it.
3041 \section{Array Ordering}
3042 \label{datarep:arrayordering}
3044 The encodings of the constants used in the
3045 \DWATordering{} attribute are given in
3046 Table \refersec{tab:orderingencodings}.
3050 \setlength{\extrarowheight}{0.1cm}
3051 \begin{longtable}{l|c}
3052 \caption{Ordering encodings} \label{tab:orderingencodings}\\
3053 \hline \bfseries Ordering name&\bfseries Value \\ \hline
3055 \bfseries Ordering name&\bfseries Value\\ \hline
3057 \hline \emph{Continued on next page}
3062 \DWORDrowmajor&0x00 \\
3063 \DWORDcolmajor&0x01 \\
3069 \section{Discriminant Lists}
3070 \label{datarep:discriminantlists}
3072 The descriptors used in
3073 \addtoindexx{discriminant list attribute}
3075 \DWATdiscrlist{} attribute are
3076 encoded as 1-byte constants. The
3077 defined values are given in
3078 Table \refersec{tab:discriminantdescriptorencodings}.
3080 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
3082 \setlength{\extrarowheight}{0.1cm}
3083 \begin{longtable}{l|c}
3084 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
3085 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
3087 \bfseries Descriptor name&\bfseries Value\\ \hline
3089 \hline \emph{Continued on next page}
3101 \section{Name Index Table}
3102 \label{datarep:nameindextable}
3103 The \addtoindexi{version number}{version number!name index table}
3104 in the name index table header is \versiondotdebugnames{}.
3106 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
3109 \setlength{\extrarowheight}{0.1cm}
3110 \begin{longtable}{l|c|l}
3111 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
3112 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3114 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3116 \hline \emph{Continued on next page}
3119 \ddag~\textit{New in \DWARFVersionV}
3121 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
3122 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
3123 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
3124 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
3125 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
3126 \DWIDXlouser~\ddag & 0x2000 & \\
3127 \DWIDXhiuser~\ddag & \xiiifff & \\
3131 The abbreviations table ends with an entry consisting of a single 0
3132 byte for the abbreviation code. The size of the table given by
3133 \texttt{abbrev\_table\_size} may include optional padding following the
3136 \section{Defaulted Member Encodings}
3137 \hypertarget{datarep:defaultedmemberencodings}{}
3139 The encodings of the constants used in the \DWATdefaulted{} attribute
3140 are given in Table \referfol{datarep:defaultedattributeencodings}.
3143 \setlength{\extrarowheight}{0.1cm}
3144 \begin{longtable}{l|c}
3145 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
3146 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
3148 \bfseries Defaulted name &\bfseries Value \\ \hline
3150 \hline \emph{Continued on next page}
3153 \ddag~\textit{New in \DWARFVersionV}
3155 \DWDEFAULTEDno~\ddag & 0x00 \\
3156 \DWDEFAULTEDinclass~\ddag & 0x01 \\
3157 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
3162 \section{Address Range Table}
3163 \label{datarep:addrssrangetable}
3165 Each set of entries in the table of address ranges contained
3166 in the \dotdebugaranges{}
3167 section begins with a header containing:
3168 \begin{enumerate}[1. ]
3169 % FIXME The unit length text is not fully consistent across
3172 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3173 \addttindexx{unit\_length}
3174 A 4-byte or 12-byte length containing the length of the
3175 \addtoindexx{initial length}
3176 set of entries for this compilation unit, not including the
3177 length field itself. In the \thirtytwobitdwarfformat, this is a
3178 4-byte unsigned integer (which must be less than \xfffffffzero);
3179 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
3180 \wffffffff followed by an 8-byte unsigned integer that gives
3182 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3184 \item version (\HFTuhalf) \\
3185 A 2-byte version identifier representing the version of the
3186 DWARF information for the address range table.
3188 This value in this field \addtoindexx{version number!address range table} is 2.
3190 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
3192 \addtoindexx{section offset!in .debug\_aranges header}
3193 4-byte or 8-byte offset into the
3194 \dotdebuginfo{} section of
3195 the compilation unit header. In the \thirtytwobitdwarfformat,
3196 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
3197 this is an 8-byte unsigned offset
3198 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3200 \item \texttt{address\_size} (\HFTubyte) \\
3201 A 1-byte unsigned integer containing the size in bytes of an
3202 \addttindexx{address\_size}
3204 \addtoindexx{size of an address}
3205 (or the offset portion of an address for segmented
3206 \addtoindexx{address space!segmented}
3207 addressing) on the target system.
3209 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3210 A 1-byte unsigned integer containing the size in bytes of a
3211 segment selector on the target system.
3215 This header is followed by a series of tuples. Each tuple
3216 consists of a segment, an address and a length.
3217 The segment selector
3218 size is given by the \HFNsegmentselectorsize{} field of the header; the
3219 address and length size are each given by the \addttindex{address\_size}
3220 field of the header.
3221 The first tuple following the header in
3222 each set begins at an offset that is a multiple of the size
3223 of a single tuple (that is, the size of a segment selector
3224 plus twice the \addtoindex{size of an address}).
3225 The header is padded, if
3226 necessary, to that boundary. Each set of tuples is terminated
3227 by a 0 for the segment, a 0 for the address and 0 for the
3228 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3229 the segment selectors are omitted from all tuples, including
3230 the terminating tuple.
3233 \section{Line Number Information}
3234 \label{datarep:linenumberinformation}
3236 The \addtoindexi{version number}{version number!line number information}
3237 in the line number program header is \versiondotdebugline{}.
3239 The boolean values \doublequote{true} and \doublequote{false}
3240 used by the line number information program are encoded
3241 as a single byte containing the value 0
3242 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3245 The encodings for the standard opcodes are given in
3246 \addtoindexx{line number opcodes!standard opcode encoding}
3247 Table \refersec{tab:linenumberstandardopcodeencodings}.
3250 \setlength{\extrarowheight}{0.1cm}
3251 \begin{longtable}{l|c}
3252 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3253 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3255 \bfseries Opcode name&\bfseries Value\\ \hline
3257 \hline \emph{Continued on next page}
3263 \DWLNSadvancepc&0x02 \\
3264 \DWLNSadvanceline&0x03 \\
3265 \DWLNSsetfile&0x04 \\
3266 \DWLNSsetcolumn&0x05 \\
3267 \DWLNSnegatestmt&0x06 \\
3268 \DWLNSsetbasicblock&0x07 \\
3269 \DWLNSconstaddpc&0x08 \\
3270 \DWLNSfixedadvancepc&0x09 \\
3271 \DWLNSsetprologueend&0x0a \\*
3272 \DWLNSsetepiloguebegin&0x0b \\*
3273 \DWLNSsetisa&0x0c \\*
3279 The encodings for the extended opcodes are given in
3280 \addtoindexx{line number opcodes!extended opcode encoding}
3281 Table \refersec{tab:linenumberextendedopcodeencodings}.
3284 \setlength{\extrarowheight}{0.1cm}
3285 \begin{longtable}{l|c}
3286 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3287 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3289 \bfseries Opcode name&\bfseries Value\\ \hline
3291 \hline \emph{Continued on next page}
3293 \hline %\ddag~\textit{New in DWARF Version 5}
3296 \DWLNEendsequence &0x01 \\
3297 \DWLNEsetaddress &0x02 \\
3298 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3299 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3301 \DWLNEsetdiscriminator &0x04 \\
3302 \DWLNElouser &0x80 \\
3303 \DWLNEhiuser &\xff \\
3309 The encodings for the line number header entry formats are given in
3310 \addtoindexx{line number opcodes!file entry format encoding}
3311 Table \refersec{tab:linenumberheaderentryformatencodings}.
3314 \setlength{\extrarowheight}{0.1cm}
3315 \begin{longtable}{l|c}
3316 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3317 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3319 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3321 \hline \emph{Continued on next page}
3323 \hline \ddag~\textit{New in DWARF Version 5}
3325 \DWLNCTpath~\ddag & 0x1 \\
3326 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3327 \DWLNCTtimestamp~\ddag & 0x3 \\
3328 \DWLNCTsize~\ddag & 0x4 \\
3329 \DWLNCTMDfive~\ddag & 0x5 \\
3330 \DWLNCTlouser~\ddag & 0x2000 \\
3331 \DWLNCThiuser~\ddag & \xiiifff \\
3336 \section{Macro Information}
3337 \label{datarep:macroinformation}
3338 The \addtoindexi{version number}{version number!macro information}
3339 in the macro information header is \versiondotdebugmacro{}.
3341 The source line numbers and source file indices encoded in the
3342 macro information section are represented as
3343 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3346 The macro information entry type is encoded as a single unsigned byte.
3348 \addtoindexx{macro information entry types!encoding}
3350 Table \refersec{tab:macroinfoentrytypeencodings}.
3354 \setlength{\extrarowheight}{0.1cm}
3355 \begin{longtable}{l|c}
3356 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3357 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3359 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3361 \hline \emph{Continued on next page}
3363 \hline \ddag~\textit{New in DWARF Version 5}
3366 \DWMACROdefine~\ddag &0x01 \\
3367 \DWMACROundef~\ddag &0x02 \\
3368 \DWMACROstartfile~\ddag &0x03 \\
3369 \DWMACROendfile~\ddag &0x04 \\
3370 \DWMACROdefinestrp~\ddag &0x05 \\
3371 \DWMACROundefstrp~\ddag &0x06 \\
3372 \DWMACROimport~\ddag &0x07 \\
3373 \DWMACROdefinesup~\ddag &0x08 \\
3374 \DWMACROundefsup~\ddag &0x09 \\
3375 \DWMACROimportsup~\ddag &0x0a \\
3376 \DWMACROdefinestrx~\ddag &0x0b \\
3377 \DWMACROundefstrx~\ddag &0x0c \\
3378 \DWMACROlouser~\ddag &0xe0 \\
3379 \DWMACROhiuser~\ddag &\xff \\
3385 \section{Call Frame Information}
3386 \label{datarep:callframeinformation}
3388 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3389 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3390 value is \xffffffffffffffff.
3392 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3393 is \versiondotdebugframe.
3395 Call frame instructions are encoded in one or more bytes. The
3396 primary opcode is encoded in the high order two bits of
3397 the first byte (that is, opcode = byte $\gg$ 6). An operand
3398 or extended opcode may be encoded in the low order 6
3399 bits. Additional operands are encoded in subsequent bytes.
3400 The instructions and their encodings are presented in
3401 Table \refersec{tab:callframeinstructionencodings}.
3404 \setlength{\extrarowheight}{0.1cm}
3405 \begin{longtable}{l|c|c|l|l}
3406 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3407 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3408 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3410 & \bfseries High 2 &\bfseries Low 6 & &\\
3411 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3413 \hline \emph{Continued on next page}
3418 \DWCFAadvanceloc&0x1&delta & \\
3419 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3420 \DWCFArestore&0x3®ister & & \\
3421 \DWCFAnop&0&0 & & \\
3422 \DWCFAsetloc&0&0x01&address & \\
3423 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3424 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3425 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3426 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3427 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3428 \DWCFAundefined&0&0x07&ULEB128 register & \\
3429 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3430 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3431 \DWCFArememberstate&0&0x0a & & \\
3432 \DWCFArestorestate&0&0x0b & & \\
3433 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3434 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3435 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3436 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3437 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3439 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3440 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3441 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3442 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3443 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3444 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3445 \DWCFAlouser&0&0x1c & & \\
3446 \DWCFAhiuser&0&\xiiif & & \\
3451 \section{Range List Entries for Non-contiguous Address Ranges}
3452 \label{datarep:noncontiguousaddressranges}
3455 Each entry in a \addtoindex{range list}
3456 (see Section \refersec{chap:noncontiguousaddressranges})
3458 \addtoindexx{base address selection entry!in range list}
3460 \addtoindexx{range list}
3461 a base address selection entry, or an end-of-list entry.
3464 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
3465 that follows. The encodings for these constants are given in
3466 Table \refersec{tab:rnglistsentryencodingvalues}.
3471 \setlength{\extrarowheight}{0.1cm}
3472 \begin{longtable}{l|c}
3473 \caption{Range list entry encoding values}
3474 \label{tab:rnglistsentryencodingvalues} \\
3475 \hline \bfseries Range list entry encoding name&\bfseries Value \\ \hline
3477 \bfseries Range list entry encoding name&\bfseries Value\\ \hline
3479 \hline \emph{Continued on next page}
3482 \ddag New in \DWARFVersionV
3485 \DWRLEendoflist~\ddag & 0x00 \\
3486 \DWRLEbaseaddressx~\ddag & 0x01 \\
3487 \DWRLEstartxendx~\ddag & 0x02 \\
3488 \DWRLEstartxlength~\ddag & 0x03 \\
3489 \DWRLEoffsetpair~\ddag & 0x04 \\
3490 \DWRLEbaseaddress~\ddag & 0x05 \\
3491 \DWRLEstartend~\ddag & 0x06 \\
3492 \DWRLEstartlength~\ddag & 0x07
3497 For a \addtoindex{range list} to be specified, the base address of the
3498 \addtoindexx{base address selection entry!in range list}
3499 corresponding compilation unit must be defined
3500 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3503 \section{String Offsets Table}
3504 \label{chap:stringoffsetstable}
3505 Each set of entries in the string offsets table contained in the
3506 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3507 section begins with a header containing:
3508 \begin{enumerate}[1. ]
3509 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3510 \addttindexx{unit\_length}
3511 A 4-byte or 12-byte length containing the length of
3512 the set of entries for this compilation unit, not
3513 including the length field itself. In the 32-bit
3514 DWARF format, this is a 4-byte unsigned integer
3515 (which must be less than \xfffffffzero); in the 64-bit
3516 DWARF format, this consists of the 4-byte value
3517 \wffffffff followed by an 8-byte unsigned integer
3518 that gives the actual length (see
3519 Section \refersec{datarep:32bitand64bitdwarfformats}).
3522 \item \texttt{version} (\HFTuhalf) \\
3523 \addtoindexx{version number!string offsets table}
3524 A 2-byte version identifier containing the value
3525 \versiondotdebugstroffsets{}.
3527 \item \textit{padding} (\HFTuhalf) \\
3528 Reserved to DWARF (must be zero).
3531 This header is followed by a series of string table offsets
3532 that have the same representation as \DWFORMstrp.
3533 For the 32-bit DWARF format, each offset is 4 bytes long; for
3534 the 64-bit DWARF format, each offset is 8 bytes long.
3536 The \DWATstroffsetsbase{} attribute points to the first
3537 entry following the header. The entries are indexed
3538 sequentially from this base entry, starting from 0.
3540 \section{Address Table}
3541 \label{chap:addresstable}
3542 Each set of entries in the address table contained in the
3543 \dotdebugaddr{} section begins with a header containing:
3544 \begin{enumerate}[1. ]
3545 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3546 \addttindexx{unit\_length}
3547 A 4-byte or 12-byte length containing the length of
3548 the set of entries for this compilation unit, not
3549 including the length field itself. In the 32-bit
3550 DWARF format, this is a 4-byte unsigned integer
3551 (which must be less than \xfffffffzero); in the 64-bit
3552 DWARF format, this consists of the 4-byte value
3553 \wffffffff followed by an 8-byte unsigned integer
3554 that gives the actual length (see
3555 Section \refersec{datarep:32bitand64bitdwarfformats}).
3558 \item \texttt{version} (\HFTuhalf) \\
3559 \addtoindexx{version number!address table}
3560 A 2-byte version identifier containing the value
3561 \versiondotdebugaddr{}.
3564 \item \texttt{address\_size} (\HFTubyte) \\
3565 A 1-byte unsigned integer containing the size in
3566 bytes of an address (or the offset portion of an
3567 address for segmented addressing) on the target
3571 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3572 A 1-byte unsigned integer containing the size in
3573 bytes of a segment selector on the target system.
3576 This header is followed by a series of segment/address pairs.
3577 The segment size is given by the \HFNsegmentselectorsize{} field of the
3578 header, and the address size is given by the \addttindex{address\_size}
3579 field of the header. If the \HFNsegmentselectorsize{} field in the header
3580 is zero, the entries consist only of an addresses.
3582 The \DWATaddrbase{} attribute points to the first entry
3583 following the header. The entries are indexed sequentially
3584 from this base entry, starting from 0.
3587 \section{Range List Table}
3588 \label{app:ranglisttable}
3590 Each \dotdebugrnglists{} and \dotdebugrnglistsdwo{} section
3592 begins with a header containing:
3593 \begin{enumerate}[1. ]
3594 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3595 \addttindexx{unit\_length}
3596 A 4-byte or 12-byte length containing the length of
3597 the set of entries for this compilation unit, not
3598 including the length field itself. In the 32-bit
3599 DWARF format, this is a 4-byte unsigned integer
3600 (which must be less than \xfffffffzero); in the 64-bit
3601 DWARF format, this consists of the 4-byte value
3602 \wffffffff followed by an 8-byte unsigned integer
3603 that gives the actual length (see
3604 Section \refersec{datarep:32bitand64bitdwarfformats}).
3607 \item \texttt{version} (\HFTuhalf) \\
3608 \addtoindexx{version number!range list table}
3609 A 2-byte version identifier containing the value
3610 \versiondotdebugrnglists{}.
3613 \item \texttt{address\_size} (\HFTubyte) \\
3614 A 1-byte unsigned integer containing the size in
3615 bytes of an address (or the offset portion of an
3616 address for segmented addressing) on the target
3620 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3621 A 1-byte unsigned integer containing the size in
3622 bytes of a segment selector on the target system.
3625 \item \HFNoffsetentrycount{} (\HFTuword) \\
3626 A 4-byte count of the number of offsets
3627 that follow the header.
3632 Immediately following the header is an array of offsets.
3633 This array is followed by a series of range lists.
3635 There is one offset for each range list. The contents
3636 of the $i$\textsuperscript{th} offset is the offset from the
3637 beginning of the offset array to the location of the
3638 $i$\textsuperscript{th} range list. Range lists are
3639 described in Section \refersec{chap:noncontiguousaddressranges}.
3642 The segment size is given by the
3643 \HFNsegmentselectorsize{} field of the header, and the address size is
3644 given by the \addttindex{address\_size} field of the header. If the
3645 \HFNsegmentselectorsize{} field in the header is zero, the segment
3646 selector is omitted from the range list entries.
3649 The \DWATrnglistsbase{} attribute points to the first offset
3650 following the header. The range lists are referenced
3651 by the index of the position of their corresponding offset in the
3652 array of offsets, which indirectly specifies the offset to the
3657 \section{Location List Table}
3658 \label{datarep:locationlisttable}
3660 Each \dotdebugloclists{} or \dotdebugloclistsdwo{} section
3662 begins with a header containing:
3663 \begin{enumerate}[1. ]
3664 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3665 \addttindexx{unit\_length}
3666 A 4-byte or 12-byte length containing the length of
3667 the set of entries for this compilation unit, not
3668 including the length field itself. In the 32-bit
3669 DWARF format, this is a 4-byte unsigned integer
3670 (which must be less than \xfffffffzero); in the 64-bit
3671 DWARF format, this consists of the 4-byte value
3672 \wffffffff followed by an 8-byte unsigned integer
3673 that gives the actual length (see
3674 Section \refersec{datarep:32bitand64bitdwarfformats}).
3677 \item \texttt{version} (\HFTuhalf) \\
3678 \addtoindexx{version number!location list table}
3679 A 2-byte version identifier containing the value
3680 \versiondotdebugloclists{}.
3683 \item \texttt{address\_size} (\HFTubyte) \\
3684 A 1-byte unsigned integer containing the size in
3685 bytes of an address (or the offset portion of an
3686 address for segmented addressing) on the target
3690 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3691 A 1-byte unsigned integer containing the size in
3692 bytes of a segment selector on the target system.
3695 \item \HFNoffsetentrycount{} (\HFTuword) \\
3696 A 4-byte count of the number of offsets
3697 that follow the header.
3702 Immediately following the header is an array of offsets.
3703 This array is followed by a series of location lists.
3705 There is one offset for each location list. The contents
3706 of the $i$\textsuperscript{th} offset is the offset from the
3707 beginning of the offset array to the location of the
3708 $i$\textsuperscript{th} location list. Location lists are
3709 described in Section \refersec{chap:locationlists}.
3712 The segment size is given by the
3713 \HFNsegmentselectorsize{} field of the header, and the address size is
3714 given by the \HFNaddresssize{} field of the header. If the
3715 \HFNsegmentselectorsize{} field in the header is zero, the segment
3716 selector is omitted from location list entries.
3719 The \DWATloclistsbase{} attribute points to the first offset
3720 following the header. The location lists are referenced
3721 by the index of the position of their corresponding offset in the
3722 array of offsets, which indirectly specifies the offset to the
3727 \section{Dependencies and Constraints}
3728 \label{datarep:dependenciesandconstraints}
3729 The debugging information in this format is intended to
3730 exist in sections of an object file, or an equivalent
3731 separate file or database, having names beginning with
3732 the prefix ".debug\_" (see Appendix
3733 \refersec{app:dwarfsectionversionnumbersinformative}
3734 for a complete list of such names).
3735 Except as specifically specified, this information is not
3736 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3739 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3740 32-bit addresses, an assembler or compiler must provide a way
3741 to produce 2-byte and 4-byte quantities without alignment
3742 restrictions, and the linker must be able to relocate a
3744 \addtoindexx{section offset!alignment of}
3745 section offset that occurs at an arbitrary
3748 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3749 64-bit addresses, an assembler or compiler must provide a
3750 way to produce 2-byte, 4-byte and 8-byte quantities without
3751 alignment restrictions, and the linker must be able to relocate
3752 an 8-byte address or 4-byte
3753 \addtoindexx{section offset!alignment of}
3754 section offset that occurs at an
3755 arbitrary alignment.
3757 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3758 32-bit addresses, an assembler or compiler must provide a
3759 way to produce 2-byte, 4-byte and 8-byte quantities without
3760 alignment restrictions, and the linker must be able to relocate
3761 a 4-byte address or 8-byte
3762 \addtoindexx{section offset!alignment of}
3763 section offset that occurs at an
3764 arbitrary alignment.
3766 \textit{It is expected that this will be required only for very large
3767 32-bit programs or by those architectures which support
3768 a mix of 32-bit and 64-bit code and data within the same
3771 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3772 64-bit addresses, an assembler or compiler must provide a
3773 way to produce 2-byte, 4-byte and 8-byte quantities without
3774 alignment restrictions, and the linker must be able to
3775 relocate an 8-byte address or
3776 \addtoindexx{section offset!alignment of}
3777 section offset that occurs at
3778 an arbitrary alignment.
3782 \section{Integer Representation Names}
3783 \label{datarep:integerrepresentationnames}
3784 The sizes of the integers used in the lookup by name, lookup
3785 by address, line number, call frame information and other sections
3787 Table \ref{tab:integerrepresentationnames}.
3791 \setlength{\extrarowheight}{0.1cm}
3792 \begin{longtable}{c|l}
3793 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3794 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3796 \bfseries Representation name&\bfseries Representation\\ \hline
3798 \hline \emph{Continued on next page}
3803 \HFTsbyte& signed, 1-byte integer \\
3804 \HFTubyte&unsigned, 1-byte integer \\
3805 \HFTuhalf&unsigned, 2-byte integer \\
3806 \HFTuword&unsigned, 4-byte integer \\
3812 \section{Type Signature Computation}
3813 \label{datarep:typesignaturecomputation}
3815 A \addtoindex{type signature} is used by a DWARF consumer
3816 to resolve type references to the type definitions that
3817 are contained in \addtoindex{type unit}s (see Section
3818 \refersec{chap:typeunitentries}).
3820 \textit{A type signature is computed only by a DWARF producer;
3821 \addtoindexx{type signature!computation} a consumer need
3822 only compare two type signatures to check for equality.}
3825 The type signature for a type T0 is formed from the
3826 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3827 R.L. Rivest, RFC 1321, April 1992}
3828 digest of a flattened description of the type. The flattened
3829 description of the type is a byte sequence derived from the
3830 DWARF encoding of the type as follows:
3831 \begin{enumerate}[1. ]
3833 \item Start with an empty sequence S and a list V of visited
3834 types, where V is initialized to a list containing the type
3835 T0 as its single element. Elements in V are indexed from 1,
3838 \item If the debugging information entry represents a type that
3839 is nested inside another type or a namespace, append to S
3840 the type\textquoteright s context as follows: For each surrounding type
3841 or namespace, beginning with the outermost such construct,
3842 append the letter 'C', the DWARF tag of the construct, and
3843 the name (taken from
3844 \addtoindexx{name attribute}
3845 the \DWATname{} attribute) of the type
3846 \addtoindexx{name attribute}
3847 or namespace (including its trailing null byte).
3849 \item Append to S the letter 'D', followed by the DWARF tag of
3850 the debugging information entry.
3852 \item For each of the attributes in
3853 Table \refersec{tab:attributesusedintypesignaturecomputation}
3855 the debugging information entry, in the order listed,
3856 append to S a marker letter (see below), the DWARF attribute
3857 code, and the attribute value.
3860 \caption{Attributes used in type signature computation}
3861 \label{tab:attributesusedintypesignaturecomputation}
3862 \simplerule[\textwidth]
3864 \autocols[0pt]{c}{2}{l}{
3880 \DWATcontainingtype,
3884 \DWATdatamemberlocation,
3905 \DWATrvaluereference,
3909 \DWATstringlengthbitsize,
3910 \DWATstringlengthbytesize,
3915 \DWATvariableparameter,
3918 \DWATvtableelemlocation
3921 \simplerule[\textwidth]
3924 Note that except for the initial
3925 \DWATname{} attribute,
3926 \addtoindexx{name attribute}
3927 attributes are appended in order according to the alphabetical
3928 spelling of their identifier.
3931 If an implementation defines any vendor-specific attributes,
3932 any such attributes that are essential to the definition of
3933 the type are also included at the end of the above list,
3934 in their own alphabetical suborder.
3936 An attribute that refers to another type entry T is processed
3938 \begin{enumerate}[ a)]
3940 If T is in the list V at some V[x], use the
3941 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3942 encoding of x as the attribute value.
3945 Otherwise, append type T to the list V, then
3947 as the marker, process the type T recursively by performing
3948 Steps 2 through 7, and use the result as the attribute value.
3952 Other attribute values use the letter 'A' as the marker, and
3953 the value consists of the form code (encoded as an unsigned
3954 LEB128 value) followed by the encoding of the value according
3955 to the form code. To ensure reproducibility of the signature,
3956 the set of forms used in the signature computation is limited
3964 \item If the tag in Step 3 is one of \DWTAGpointertype,
3965 \DWTAGreferencetype,
3966 \DWTAGrvaluereferencetype,
3967 \DWTAGptrtomembertype,
3968 or \DWTAGfriend, and the referenced
3969 type (via the \DWATtype{} or
3970 \DWATfriend{} attribute) has a
3971 \DWATname{} attribute, append to S the letter 'N', the DWARF
3972 attribute code (\DWATtype{} or
3973 \DWATfriend), the context of
3974 the type (according to the method in Step 2), the letter 'E',
3975 and the name of the type. For \DWTAGfriend, if the referenced
3976 entry is a \DWTAGsubprogram, the context is omitted and the
3977 name to be used is the ABI-specific name of the subprogram
3978 (for example, the mangled linker name).
3981 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3982 \DWTAGreferencetype,
3983 \DWTAGrvaluereferencetype,
3984 \DWTAGptrtomembertype, or
3985 \DWTAGfriend, but has
3986 a \DWATtype{} attribute, or if the referenced type (via
3988 \DWATfriend{} attribute) does not have a
3989 \DWATname{} attribute, the attribute is processed according to
3990 the method in Step 4 for an attribute that refers to another
3994 \item Visit each child C of the debugging information
3995 entry as follows: If C is a nested type entry or a member
3996 function entry, and has
3997 a \DWATname{} attribute, append to
3998 \addtoindexx{name attribute}
3999 S the letter 'S', the tag of C, and its name; otherwise,
4000 process C recursively by performing Steps 3 through 7,
4001 appending the result to S. Following the last child (or if
4002 there are no children), append a zero byte.
4007 For the purposes of this algorithm, if a debugging information
4009 \DWATspecification{}
4010 attribute that refers to
4011 another entry D (which has a
4014 then S inherits the attributes and children of D, and S is
4015 processed as if those attributes and children were present in
4016 the entry S. Exception: if a particular attribute is found in
4017 both S and D, the attribute in S is used and the corresponding
4018 one in D is ignored.
4021 DWARF tag and attribute codes are appended to the sequence
4022 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
4023 using the values defined earlier in this chapter.
4025 \textit{A grammar describing this computation may be found in
4026 Appendix \refersec{app:typesignaturecomputationgrammar}.
4029 \textit{An attribute that refers to another type entry is
4030 recursively processed or replaced with the name of the
4031 referent (in Step 4, 5 or 6). If neither treatment applies to
4032 an attribute that references another type entry, the entry
4033 that contains that attribute is not suitable for a
4034 separate \addtoindex{type unit}.}
4036 \textit{If a debugging information entry contains an attribute from
4037 the list above that would require an unsupported form, that
4038 entry is not suitable for a separate
4039 \addtoindex{type unit}.}
4041 \textit{A type is suitable for a separate
4042 \addtoindex{type unit} only
4043 if all of the type entries that it contains or refers to in
4044 Steps 6 and 7 are themselves suitable for a separate
4045 \addtoindex{type unit}.}
4049 \textit{Where the DWARF producer may reasonably choose two or
4050 more different forms for a given attribute, it should choose
4051 the simplest possible form in computing the signature. (For
4052 example, a constant value should be preferred to a location
4053 expression when possible.)}
4056 Once the string S has been formed from the DWARF encoding,
4057 an 16-byte \MDfive{} digest is computed for the string and the
4058 last eight bytes are taken as the type signature.
4060 \textit{The string S is intended to be a flattened representation of
4061 the type that uniquely identifies that type (that is, a different
4062 type is highly unlikely to produce the same string).}
4065 \textit{A debugging information entry is not be placed in a
4066 separate \addtoindex{type unit}
4067 if any of the following apply:}
4071 \item \textit{The entry has an attribute whose value is a location
4072 description, and the location description
4073 contains a reference to
4074 another debugging information entry (for example, a \DWOPcallref{}
4075 operator), as it is unlikely that the entry will remain
4076 identical across compilation units.}
4078 \item \textit{The entry has an attribute whose value refers
4079 to a code location or a \addtoindex{location list}.}
4081 \item \textit{The entry has an attribute whose value refers
4082 to another debugging information entry that does not represent
4088 \textit{Certain attributes are not included in the type signature:}
4091 \item \textit{The \DWATdeclaration{} attribute is not included because it
4092 indicates that the debugging information entry represents an
4093 incomplete declaration, and incomplete declarations should
4095 \addtoindexx{type unit}
4096 separate type units.}
4098 \item \textit{The \DWATdescription{} attribute is not included because
4099 it does not provide any information unique to the defining
4100 declaration of the type.}
4102 \item \textit{The \DWATdeclfile,
4104 \DWATdeclcolumn{} attributes are not included because they
4105 may vary from one source file to the next, and would prevent
4106 two otherwise identical type declarations from producing the
4107 same \MDfive{} digest.}
4109 \item \textit{The \DWATobjectpointer{} attribute is not included
4110 because the information it provides is not necessary for the
4111 computation of a unique type signature.}
4115 \textit{Nested types and some types referred to by a debugging
4116 information entry are encoded by name rather than by recursively
4117 encoding the type to allow for cases where a complete definition
4118 of the type might not be available in all compilation units.}
4121 \textit{If a type definition contains the definition of a member function,
4122 it cannot be moved as is into a type unit, because the member function
4123 contains attributes that are unique to that compilation unit.
4124 Such a type definition can be moved to a type unit by rewriting the
4125 debugging information entry tree,
4126 moving the member function declaration into a separate declaration tree,
4127 and replacing the function definition in the type with a non-defining
4128 declaration of the function (as if the function had been defined out of
4131 An example that illustrates the computation of an \MDfive{} digest may be found in
4132 Appendix \refersec{app:usingtypeunits}.
4134 \section{Name Table Hash Function}
4135 \label{datarep:nametablehashfunction}
4136 The hash function used for hashing name strings in the accelerated
4137 access name index table (see Section \refersec{chap:acceleratedaccess})
4138 is defined in \addtoindex{C} as shown in
4139 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnoteRR{
4140 This hash function is sometimes known as the
4141 "\addtoindex{Bernstein hash function}" or the
4142 "\addtoindex{DJB hash function}"
4144 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
4145 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
4150 uint32_t /* must be a 32-bit integer type */
4151 hash(unsigned char *str)
4153 uint32_t hash = 5381;
4157 hash = hash * 33 + c;
4163 \caption{Name Table Hash Function Definition}
4164 \label{fig:nametablehashfunctiondefinition}