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, Package and Supplementary 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}
665 \textit{In contrast to split DWARF object files, which allow the compiler to
666 split the debugging information between to files in order to reduce
667 link time and executable size, a supplementary object file permits a
668 post-link utility to analyze many executable and shared object files,
669 and collect any duplicate debugging information into a single file
670 that can be referenced by each of the original files. This facility
671 can be useful for building integrated operating system packages
676 A DWARF \addtoindex{supplementary object file} is itself an object file,
677 using the same object
678 file format, \byteorder{}, and size as the corresponding application executables
679 or shared libraries. It consists only of a file header, section table, and
680 a number of DWARF debug information sections. Both the
681 \addtoindex{supplementary object file}
682 and all the executable or shared object files that reference entries or strings in that
683 file must contain a \dotdebugsup{} section that establishes the relationship.
685 The \dotdebugsup{} section contains:
686 \begin{enumerate}[1. ]
687 \item \texttt{version} (\HFTuhalf) \\
688 \addttindexx{version}
689 A 2-byte unsigned integer representing the version of the DWARF
690 information for the compilation unit.
692 The value in this field is \versiondotdebugsup.
694 \item \texttt{is\_supplementary} (\HFTubyte) \\
695 \addttindexx{is\_supplementary}
696 A 1-byte unsigned integer, which contains the value 1 if it is
697 in the \addtoindex{supplementary object file} that other executable or
698 shared object files refer to, or 0 if it is an executable or shared object
699 referring to a \addtoindex{supplementary object file}.
702 \item \texttt{sup\_filename} (null terminated filename string) \\
703 \addttindexx{sup\_filename}
704 If \addttindex{is\_supplementary} is 0, this contains either an absolute
705 filename for the \addtoindex{supplementary object file}, or a filename
706 relative to the object file containing the \dotdebugsup{} section.
707 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
708 is not needed and must be an empty string (a single null byte).
711 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
712 \addttindexx{sup\_checksum\_len}
713 Length of the following \addttindex{sup\_checksum} field;
714 this value can be 0 if no checksum is provided.
716 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
717 \addttindexx{sup\_checksum}
718 An implementation-defined integer constant value that
719 provides unique identification of the supplementary file.
723 Debug information entries that refer to an executable's or shared
724 object's addresses must \emph{not} be moved to supplementary files
725 (the addesses will likely not be the same). Similarly,
726 entries referenced from within location descriptions or using loclistsptr
727 form attributes must not be moved to a \addtoindex{supplementary object file}.
729 Executable or shared object file compilation units can use
730 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
731 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
732 attributes to refer to them and \DWFORMstrpsup{} form attributes to
733 refer to strings that are used by debug information of multiple
734 executables or shared object files. Within the \addtoindex{supplementary object file}'s
735 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
736 not used, and all reference forms referring to some other sections
737 refer to the local sections in the \addtoindex{supplementary object file}.
739 In macro information, \DWMACROdefinesup{} or
740 \DWMACROundefsup{} opcodes can refer to strings in the
741 \dotdebugstr{} section of the \addtoindex{supplementary object file},
742 or \DWMACROimportsup{}
743 can refer to \dotdebugmacro{} section entries. Within the
744 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
745 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
746 opcodes refer to the local \dotdebugstr{} section in that
747 supplementary file, not the one in
748 the executable or shared object file.
752 \section{32-Bit and 64-Bit DWARF Formats}
753 \label{datarep:32bitand64bitdwarfformats}
754 \hypertarget{datarep:xxbitdwffmt}{}
755 \addtoindexx{32-bit DWARF format}
756 \addtoindexx{64-bit DWARF format}
757 There are two closely-related DWARF
758 formats. In the 32-bit DWARF
759 format, all values that represent lengths of DWARF sections
760 and offsets relative to the beginning of DWARF sections are
761 represented using four bytes. In the 64-bit DWARF format, all
762 values that represent lengths of DWARF sections and offsets
763 relative to the beginning of DWARF sections are represented
764 using eight bytes. A special convention applies to the initial
765 length field of certain DWARF sections, as well as the CIE and
766 FDE structures, so that the 32-bit and 64-bit DWARF formats
767 can coexist and be distinguished within a single linked object.
769 Except where noted otherwise, all references in this document
770 to a debugging information section (for example, \dotdebuginfo),
771 apply also to the corresponding split DWARF section (for example,
774 The differences between the 32- and 64-bit DWARF formats are
775 detailed in the following:
776 \begin{enumerate}[1. ]
778 \item In the 32-bit DWARF format, an
779 \addtoindex{initial length} field (see
780 \addtoindexx{initial length!encoding}
781 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
782 is an unsigned 4-byte integer (which
783 must be less than \xfffffffzero); in the 64-bit DWARF format,
784 an \addtoindex{initial length} field is 12 bytes in size,
787 \item The first four bytes have the value \xffffffff.
789 \item The following eight bytes contain the actual length
790 represented as an unsigned 8-byte integer.
793 \textit{This representation allows a DWARF consumer to dynamically
794 detect that a DWARF section contribution is using the 64-bit
795 format and to adapt its processing accordingly.}
798 \item \hypertarget{datarep:sectionoffsetlength}{}
799 Section offset and section length
800 \addtoindexx{section length!use in headers}
802 \addtoindexx{section offset!use in headers}
803 in the headers of DWARF sections (other than initial length
804 \addtoindexx{initial length}
805 fields) are listed following. In the 32-bit DWARF format these
806 are 4-byte unsigned integer values; in the 64-bit DWARF format,
807 they are 8-byte unsigned integer values.
811 Section &Name & Role \\ \hline
812 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
813 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
814 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
815 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
816 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
817 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
823 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
824 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
825 union must be accessed to distinguish whether a CIE or FDE is
826 present, consequently, these two fields must exactly overlay
827 each other (both offset and size).
829 \item Within the body of the \dotdebuginfo{}
830 section, certain forms of attribute value depend on the choice
831 of DWARF format as follows. For the 32-bit DWARF format,
832 the value is a 4-byte unsigned integer; for the 64-bit DWARF
833 format, the value is an 8-byte unsigned integer.
835 \begin{tabular}{lp{6cm}}
836 Form & Role \\ \hline
837 \DWFORMlinestrp & offset in \dotdebuglinestr \\
838 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
839 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
840 \addtoindexx{supplementary object file}
841 \DWFORMsecoffset & offset in a section other than \\
842 & \dotdebuginfo{} or \dotdebugstr{} \\
843 \DWFORMstrp & offset in \dotdebugstr{} \\
844 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
845 \DWOPcallref & offset in \dotdebuginfo{} \\
850 \item Within the body of the \dotdebugline{} section, certain forms of content
851 description depend on the choice of DWARF format as follows: for the
852 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
853 64-bit DWARF format, the value is a 8-byte unsigned integer.
855 \begin{tabular}{lp{6cm}}
856 Form & Role \\ \hline
857 \DWFORMlinestrp & offset in \dotdebuglinestr
861 \item Within the body of the \dotdebugnames{}
862 sections, the representation of each entry in the array of
863 compilation units (CUs) and the array of local type units
864 (TUs), which represents an offset in the
866 section, depends on the DWARF format as follows: in the
867 32-bit DWARF format, each entry is a 4-byte unsigned integer;
868 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
871 \item In the body of the \dotdebugstroffsets{}
872 sections, the size of entries in the body depend on the DWARF
873 format as follows: in the 32-bit DWARF format, entries are 4-byte
874 unsigned integer values; in the 64-bit DWARF format, they are
875 8-byte unsigned integers.
877 \item In the body of the \dotdebugaddr{}
881 the contents of the address size fields depends on the
882 DWARF format as follows: in the 32-bit DWARF format, these fields
883 contain 4; in the 64-bit DWARF format these fields contain 8.
886 \item In the body of the \dotdebugloclists{} and \dotdebugrnglists{}
887 sections, the offsets the follow the header depend on the
888 DWARF format as follows: in the 32-bit DWARF format, offsets are 4-byte
889 unsigned integer values; in the 64-bit DWARF format, they are
890 8-byte unsigned integers.
896 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
897 intermixed within a single compilation unit.
899 \textit{Attribute values and section header fields that represent
900 addresses in the target program are not affected by these
903 A DWARF consumer that supports the 64-bit DWARF format must
904 support executables in which some compilation units use the
905 32-bit format and others use the 64-bit format provided that
906 the combination links correctly (that is, provided that there
907 are no link\dash time errors due to truncation or overflow). (An
908 implementation is not required to guarantee detection and
909 reporting of all such errors.)
911 \textit{It is expected that DWARF producing compilers will \emph{not} use
912 the 64-bit format \emph{by default}. In most cases, the division of
913 even very large applications into a number of executable and
914 shared object files will suffice to assure that the DWARF sections
915 within each individual linked object are less than 4 GBytes
916 in size. However, for those cases where needed, the 64-bit
917 format allows the unusual case to be handled as well. Even
918 in this case, it is expected that only application supplied
919 objects will need to be compiled using the 64-bit format;
920 separate 32-bit format versions of system supplied shared
921 executable libraries can still be used.}
924 \section{Format of Debugging Information}
925 \label{datarep:formatofdebugginginformation}
927 For each compilation unit compiled with a DWARF producer,
928 a contribution is made to the \dotdebuginfo{} section of
929 the object file. Each such contribution consists of a
930 compilation unit header
931 (see Section \refersec{datarep:compilationunitheader})
933 single \DWTAGcompileunit{} or
934 \DWTAGpartialunit{} debugging
935 information entry, together with its children.
937 For each type defined in a compilation unit, a separate
938 contribution may also be made to the
940 section of the object file. Each
941 such contribution consists of a
942 \addtoindex{type unit} header
943 (see Section \refersec{datarep:typeunitheaders})
944 followed by a \DWTAGtypeunit{} entry, together with
947 Each debugging information entry begins with a code that
948 represents an entry in a separate
949 \addtoindex{abbreviations table}. This
950 code is followed directly by a series of attribute values.
952 The appropriate entry in the
953 \addtoindex{abbreviations table} guides the
954 interpretation of the information contained directly in the
955 \dotdebuginfo{} section.
958 Multiple debugging information entries may share the same
959 abbreviation table entry. Each compilation unit is associated
960 with a particular abbreviation table, but multiple compilation
961 units may share the same table.
963 \subsection{Unit Headers}
964 \label{datarep:unitheaders}
965 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
966 compilation unit that follows. The encodings for the unit type
967 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
971 \setlength{\extrarowheight}{0.1cm}
972 \begin{longtable}{l|c}
973 \caption{Unit header unit type encodings}
974 \label{tab:unitheaderunitkindencodings}
975 \addtoindexx{unit header unit type encodings} \\
976 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
978 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
980 \hline \emph{Continued on next page}
982 \hline \ddag\ \textit{New in DWARF Version 5}
984 \DWUTcompileTARG~\ddag &0x01 \\
985 \DWUTtypeTARG~\ddag &0x02 \\
986 \DWUTpartialTARG~\ddag &0x03 \\
987 \DWUTskeletonTARG~\ddag &0x04 \\
988 \DWUTsplitcompileTARG~\ddag &0x05 \\
989 \DWUTsplittypeTARG~\ddag &0x06 \\
990 \DWUTlouserTARG~\ddag &0x80 \\
991 \DWUThiuserTARG~\ddag &\xff \\
996 \textit{All unit headers in a compilation have the same size.
997 Some header types include padding bytes to achieve this.}
1000 \subsubsection{Compilation and Partial Unit Headers}
1001 \label{datarep:compilationunitheader}
1002 \begin{enumerate}[1. ]
1004 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1005 \addttindexx{unit\_length}
1007 \addtoindexx{initial length}
1008 unsigned integer representing the length
1009 of the \dotdebuginfo{} contribution for that compilation unit,
1010 not including the length field itself. In the \thirtytwobitdwarfformat,
1011 this is a 4-byte unsigned integer (which must be less
1012 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1013 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1014 integer that gives the actual length
1015 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1017 \item \texttt{version} (\HFTuhalf) \\
1018 \addttindexx{version}
1019 \addtoindexx{version number!compilation unit}
1020 A 2-byte unsigned integer representing the version of the
1021 DWARF information for the compilation unit.
1023 The value in this field is \versiondotdebuginfo.
1025 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1026 for a summary of all version numbers that apply to DWARF sections.}
1029 \item \texttt{unit\_type} (\HFTubyte) \\
1030 \addttindexx{unit\_type}
1031 A 1-byte unsigned integer identifying this unit as a compilation unit.
1032 The value of this field is
1033 \DWUTcompile{} for a full compilation unit or
1034 \DWUTpartial{} for a partial compilation unit
1035 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
1037 \textit{This field is new in \DWARFVersionV.}
1040 \item \texttt{address\_size} (\HFTubyte) \\
1041 \addttindexx{address\_size}
1042 A 1-byte unsigned integer representing the size in bytes of
1043 an address on the target architecture. If the system uses
1044 \addtoindexx{address space!segmented}
1045 segmented addressing, this value represents the size of the
1046 offset portion of an address.
1048 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1050 \addtoindexx{section offset!in .debug\_info header}
1051 4-byte or 8-byte unsigned offset into the
1053 section. This offset associates the compilation unit with a
1054 particular set of debugging information entry abbreviations. In
1055 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1056 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1057 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1059 \item \HFNunitpaddingONE{} (8 bytes) \\
1060 Reserved to DWARF (must be zero).
1063 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1064 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1065 this is 4 bytes in length; in the \sixtyfourbitdwarfformat, this
1066 is 8 bytes in length.
1070 \subsubsection{Skeleton and Split Compilation Unit Headers}
1071 \label{datarep:skeletonandfullcompilationunitheaders}
1072 \begin{enumerate}[1. ]
1074 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1075 \addttindexx{unit\_length}
1077 \addtoindexx{initial length}
1078 unsigned integer representing the length
1079 of the \dotdebuginfo{}
1080 contribution for that compilation unit,
1081 not including the length field itself. In the \thirtytwobitdwarfformat,
1082 this is a 4-byte unsigned integer (which must be less
1083 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1084 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1085 integer that gives the actual length
1086 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1088 \item \texttt{version} (\HFTuhalf) \\
1089 \addttindexx{version}
1090 \addtoindexx{version number!compilation unit}
1091 A 2-byte unsigned integer representing the version of the
1092 DWARF information for the compilation unit.
1094 The value in this field is \versiondotdebuginfo.
1096 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1097 for a summary of all version numbers that apply to DWARF sections.}
1100 \item \texttt{unit\_type} (\HFTubyte) \\
1101 \addttindexx{unit\_type}
1102 A 1-byte unsigned integer identifying this unit as a compilation unit.
1103 The value of this field is
1104 \DWUTskeleton{} for a skeleton compilation unit or
1105 \DWUTsplitcompile{} for a split compilation unit
1106 (see Section \refersec{chap:skeletoncompilationunitentries}).
1108 \textit{This field is new in \DWARFVersionV.}
1111 \item \texttt{address\_size} (\HFTubyte) \\
1112 \addttindexx{address\_size}
1113 A 1-byte unsigned integer representing the size in bytes of
1114 an address on the target architecture. If the system uses
1115 \addtoindexx{address space!segmented}
1116 segmented addressing, this value represents the size of the
1117 offset portion of an address.
1119 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1121 \addtoindexx{section offset!in .debug\_info header}
1122 4-byte or 8-byte unsigned offset into the
1124 section. This offset associates the compilation unit with a
1125 particular set of debugging information entry abbreviations. In
1126 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1127 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1128 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1131 \item \HFNdwoid{} (unit ID) \\
1132 An 8-byte implementation-defined integer constant value,
1133 known as the compilation unit ID, that provides
1134 unique identification of a skeleton compilation
1135 unit and its associated split compilation unit in
1136 the object file named in the \DWATdwoname{} attribute
1137 of the skeleton compilation.
1140 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1141 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1142 this is 4 bytes in length; in the \sixtyfourbitdwarfformat{}, this
1143 is 8 bytes in length.
1147 \subsubsection{Type Unit Headers}
1148 \label{datarep:typeunitheaders}
1149 The header for the series of debugging information entries
1150 contributing to the description of a type that has been
1151 placed in its own \addtoindex{type unit}, within the
1152 \dotdebuginfo{} section,
1153 consists of the following information:
1154 \begin{enumerate}[1. ]
1155 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1156 \addttindexx{unit\_length}
1157 A 4-byte or 12-byte unsigned integer
1158 \addtoindexx{initial length}
1159 representing the length
1160 of the \dotdebuginfo{} contribution for that type unit,
1161 not including the length field itself. In the \thirtytwobitdwarfformat,
1162 this is a 4-byte unsigned integer (which must be
1163 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
1164 consists of the 4-byte value \wffffffff followed by an
1165 8-byte unsigned integer that gives the actual length
1166 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1169 \item \texttt{version} (\HFTuhalf) \\
1170 \addttindexx{version}
1171 \addtoindexx{version number!type unit}
1172 A 2-byte unsigned integer representing the version of the
1173 DWARF information for the type unit.
1175 The value in this field is \versiondotdebuginfo.
1177 \item \texttt{unit\_type} (\HFTubyte) \\
1178 \addttindexx{unit\_type}
1179 A 1-byte unsigned integer identifying this unit as a type unit.
1180 The value of this field is \DWUTtype{} for a non-split type unit
1181 (see Section \refersec{chap:typeunitentries})
1182 or \DWUTsplittype{} for a split type unit.
1184 \textit{This field is new in \DWARFVersionV.}
1187 \item \texttt{address\_size} (\HFTubyte) \\
1188 \addttindexx{address\_size}
1189 A 1-byte unsigned integer representing the size
1190 \addtoindexx{size of an address}
1192 an address on the target architecture. If the system uses
1193 \addtoindexx{address space!segmented}
1194 segmented addressing, this value represents the size of the
1195 offset portion of an address.
1198 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1200 \addtoindexx{section offset!in .debug\_info header}
1201 4-byte or 8-byte unsigned offset into the
1203 section. This offset associates the type unit with a
1204 particular set of debugging information entry abbreviations. In
1205 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1206 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1207 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1209 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1210 \addttindexx{type\_signature}
1211 \addtoindexx{type signature}
1212 A unique 8-byte signature (see Section
1213 \refersec{datarep:typesignaturecomputation})
1214 of the type described in this type
1217 \textit{An attribute that refers (using
1218 \DWFORMrefsigeight{}) to
1219 the primary type contained in this
1220 \addtoindex{type unit} uses this value.}
1223 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1224 \addttindexx{type\_offset}
1225 A 4-byte or 8-byte unsigned offset
1226 \addtoindexx{section offset!in .debug\_info header}
1227 relative to the beginning
1228 of the \addtoindex{type unit} header.
1229 This offset refers to the debugging
1230 information entry that describes the type. Because the type
1231 may be nested inside a namespace or other structures, and may
1232 contain references to other types that have not been placed in
1233 separate type units, it is not necessarily either the first or
1234 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1235 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1236 this is an 8-byte unsigned length
1237 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1241 \subsection{Debugging Information Entry}
1242 \label{datarep:debugginginformationentry}
1244 Each debugging information entry begins with an
1245 unsigned LEB128\addtoindexx{LEB128!unsigned}
1246 number containing the abbreviation code for the entry. This
1247 code represents an entry within the abbreviations table
1248 associated with the compilation unit containing this entry. The
1249 abbreviation code is followed by a series of attribute values.
1251 On some architectures, there are alignment constraints on
1252 section boundaries. To make it easier to pad debugging
1253 information sections to satisfy such constraints, the
1254 abbreviation code 0 is reserved. Debugging information entries
1255 consisting of only the abbreviation code 0 are considered
1258 \subsection{Abbreviations Tables}
1259 \label{datarep:abbreviationstables}
1261 The abbreviations tables for all compilation units
1262 are contained in a separate object file section called
1264 As mentioned before, multiple compilation
1265 units may share the same abbreviations table.
1267 The abbreviations table for a single compilation unit consists
1268 of a series of abbreviation declarations. Each declaration
1269 specifies the tag and attributes for a particular form of
1270 debugging information entry. Each declaration begins with
1271 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1272 number representing the abbreviation
1273 code itself. It is this code that appears at the beginning
1274 of a debugging information entry in the
1276 section. As described above, the abbreviation
1277 code 0 is reserved for null debugging information entries. The
1278 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1279 number that encodes the entry\textquoteright s tag. The encodings for the
1280 tag names are given in
1281 Table \refersec{tab:tagencodings}.
1285 \setlength{\extrarowheight}{0.1cm}
1286 \begin{longtable}{l|c}
1287 \caption{Tag encodings} \label{tab:tagencodings} \\
1288 \hline \bfseries Tag name&\bfseries Value\\ \hline
1290 \bfseries Tag name&\bfseries Value \\ \hline
1292 \hline \emph{Continued on next page}
1294 \hline \ddag\ \textit{New in DWARF Version 5}
1296 \DWTAGarraytype{} &0x01 \\
1297 \DWTAGclasstype&0x02 \\
1298 \DWTAGentrypoint&0x03 \\
1299 \DWTAGenumerationtype&0x04 \\
1300 \DWTAGformalparameter&0x05 \\
1301 \DWTAGimporteddeclaration&0x08 \\
1303 \DWTAGlexicalblock&0x0b \\
1304 \DWTAGmember&0x0d \\
1305 \DWTAGpointertype&0x0f \\
1306 \DWTAGreferencetype&0x10 \\
1307 \DWTAGcompileunit&0x11 \\
1308 \DWTAGstringtype&0x12 \\
1309 \DWTAGstructuretype&0x13 \\
1310 \DWTAGsubroutinetype&0x15 \\
1311 \DWTAGtypedef&0x16 \\
1312 \DWTAGuniontype&0x17 \\
1313 \DWTAGunspecifiedparameters&0x18 \\
1314 \DWTAGvariant&0x19 \\
1315 \DWTAGcommonblock&0x1a \\
1316 \DWTAGcommoninclusion&0x1b \\
1317 \DWTAGinheritance&0x1c \\
1318 \DWTAGinlinedsubroutine&0x1d \\
1319 \DWTAGmodule&0x1e \\
1320 \DWTAGptrtomembertype&0x1f \\
1321 \DWTAGsettype&0x20 \\
1322 \DWTAGsubrangetype&0x21 \\
1323 \DWTAGwithstmt&0x22 \\
1324 \DWTAGaccessdeclaration&0x23 \\
1325 \DWTAGbasetype&0x24 \\
1326 \DWTAGcatchblock&0x25 \\
1327 \DWTAGconsttype&0x26 \\
1328 \DWTAGconstant&0x27 \\
1329 \DWTAGenumerator&0x28 \\
1330 \DWTAGfiletype&0x29 \\
1331 \DWTAGfriend&0x2a \\
1332 \DWTAGnamelist&0x2b \\
1333 \DWTAGnamelistitem&0x2c \\
1334 \DWTAGpackedtype&0x2d \\
1335 \DWTAGsubprogram&0x2e \\
1336 \DWTAGtemplatetypeparameter&0x2f \\
1337 \DWTAGtemplatevalueparameter&0x30 \\
1338 \DWTAGthrowntype&0x31 \\
1339 \DWTAGtryblock&0x32 \\
1340 \DWTAGvariantpart&0x33 \\
1341 \DWTAGvariable&0x34 \\
1342 \DWTAGvolatiletype&0x35 \\
1343 \DWTAGdwarfprocedure&0x36 \\
1344 \DWTAGrestricttype&0x37 \\
1345 \DWTAGinterfacetype&0x38 \\
1346 \DWTAGnamespace&0x39 \\
1347 \DWTAGimportedmodule&0x3a \\
1348 \DWTAGunspecifiedtype&0x3b \\
1349 \DWTAGpartialunit&0x3c \\
1350 \DWTAGimportedunit&0x3d \\
1351 \textit{Reserved}&0x3e\footnote{Code 0x3e is reserved to allow backward compatible support of the
1352 DW\_TAG\_mutable\_type DIE that was defined (only) in \DWARFVersionIII.}
1354 \DWTAGcondition&\xiiif \\
1355 \DWTAGsharedtype&0x40 \\
1356 \DWTAGtypeunit & 0x41 \\
1357 \DWTAGrvaluereferencetype & 0x42 \\
1358 \DWTAGtemplatealias & 0x43 \\
1359 \DWTAGcoarraytype~\ddag & 0x44 \\
1360 \DWTAGgenericsubrange~\ddag & 0x45 \\
1361 \DWTAGdynamictype~\ddag & 0x46 \\
1362 \DWTAGatomictype~\ddag & 0x47 \\
1363 \DWTAGcallsite~\ddag & 0x48 \\
1364 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1365 \DWTAGskeletonunit~\ddag & 0x4a \\
1367 \DWTAGimmutabletype~\ddag & 0x4b
1370 \DWTAGlouser&0x4080 \\
1371 \DWTAGhiuser&\xffff \\
1376 Following the tag encoding is a 1-byte value that determines
1377 whether a debugging information entry using this abbreviation
1378 has child entries or not. If the value is
1380 the next physically succeeding entry of any debugging
1381 information entry using this abbreviation is the first
1382 child of that entry. If the 1-byte value following the
1383 abbreviation\textquoteright s tag encoding is
1384 \DWCHILDRENnoTARG, the next
1385 physically succeeding entry of any debugging information entry
1386 using this abbreviation is a sibling of that entry. (Either
1387 the first child or sibling entries may be null entries). The
1388 encodings for the child determination byte are given in
1389 Table \refersec{tab:childdeterminationencodings}
1391 Section \refersec{chap:relationshipofdebugginginformationentries},
1392 each chain of sibling entries is terminated by a null entry.)
1396 \setlength{\extrarowheight}{0.1cm}
1397 \begin{longtable}{l|c}
1398 \caption{Child determination encodings}
1399 \label{tab:childdeterminationencodings}
1400 \addtoindexx{Child determination encodings} \\
1401 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1403 \bfseries Children determination name&\bfseries Value \\ \hline
1405 \hline \emph{Continued on next page}
1409 \DWCHILDRENno&0x00 \\
1410 \DWCHILDRENyes&0x01 \\ \hline
1415 Finally, the child encoding is followed by a series of
1416 attribute specifications. Each attribute specification
1417 consists of two parts. The first part is an
1418 unsigned LEB128\addtoindexx{LEB128!unsigned}
1419 number representing the attribute\textquoteright s name.
1420 The second part is an
1421 unsigned LEB128\addtoindexx{LEB128!unsigned}
1422 number representing the attribute\textquoteright s form.
1423 The series of attribute specifications ends with an
1424 entry containing 0 for the name and 0 for the form.
1428 \DWFORMindirectTARG{} is a special case. For
1429 attributes with this form, the attribute value itself in the
1431 section begins with an unsigned
1432 LEB128 number that represents its form. This allows producers
1433 to choose forms for particular attributes
1434 \addtoindexx{abbreviations table!dynamic forms in}
1436 without having to add a new entry to the abbreviations table.
1438 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1439 For attributes with this form, the attribute specification contains
1440 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1441 number. The value of this number is used as the value of the
1442 attribute, and no value is stored in the \dotdebuginfo{} section.
1444 The abbreviations for a given compilation unit end with an
1445 entry consisting of a 0 byte for the abbreviation code.
1448 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1449 for a depiction of the organization of the
1450 debugging information.}
1453 \subsection{Attribute Encodings}
1454 \label{datarep:attributeencodings}
1456 The encodings for the attribute names are given in
1457 Table \referfol{tab:attributeencodings}.
1460 \setlength{\extrarowheight}{0.1cm}
1461 \begin{longtable}{l|c|l}
1462 \caption{Attribute encodings}
1463 \label{tab:attributeencodings}
1464 \addtoindexx{attribute encodings} \\
1465 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1467 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1469 \hline \emph{Continued on next page}
1471 \hline \ddag\ \textit{New in DWARF Version 5}
1473 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1474 \addtoindexx{sibling attribute} \\
1475 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1479 \addtoindexx{location attribute} \\
1480 \DWATname&0x03&\livelink{chap:classstring}{string}
1481 \addtoindexx{name attribute} \\
1482 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1483 \addtoindexx{ordering attribute} \\
1484 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1485 \livelink{chap:classexprloc}{exprloc},
1486 \livelink{chap:classreference}{reference}
1487 \addtoindexx{byte size attribute} \\
1488 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1489 DW\_AT\_bit\_offset \mbox{attribute} which was
1490 defined in \DWARFVersionIII{} and earlier.}
1491 &\livelink{chap:classconstant}{constant},
1492 \livelink{chap:classexprloc}{exprloc},
1493 \livelink{chap:classreference}{reference}
1494 \addtoindexx{bit offset attribute (Version 3)}
1495 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1496 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1497 \livelink{chap:classexprloc}{exprloc},
1498 \livelink{chap:classreference}{reference}
1499 \addtoindexx{bit size attribute} \\
1500 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1501 \addtoindexx{statement list attribute} \\
1502 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1503 \addtoindexx{low PC attribute} \\
1504 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1505 \livelink{chap:classconstant}{constant}
1506 \addtoindexx{high PC attribute} \\
1507 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1508 \addtoindexx{language attribute} \\
1509 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1510 \addtoindexx{discriminant attribute} \\
1511 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1512 \addtoindexx{discriminant value attribute} \\
1513 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1514 \addtoindexx{visibility attribute} \\
1515 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1516 \addtoindexx{import attribute} \\
1517 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1521 \addtoindexx{string length attribute} \\
1522 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1523 \addtoindexx{common reference attribute} \\
1524 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1525 \addtoindexx{compilation directory attribute} \\
1526 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1527 \livelink{chap:classconstant}{constant},
1528 \livelink{chap:classstring}{string}
1529 \addtoindexx{constant value attribute} \\
1530 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1531 \addtoindexx{containing type attribute} \\
1532 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1533 \livelink{chap:classreference}{reference},
1534 \livelink{chap:classflag}{flag}
1535 \addtoindexx{default value attribute} \\
1536 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1537 \addtoindexx{inline attribute} \\
1538 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1539 \addtoindexx{is optional attribute} \\
1540 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1541 \livelink{chap:classexprloc}{exprloc},
1542 \livelink{chap:classreference}{reference}
1543 \addtoindexx{lower bound attribute} \\
1544 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1545 \addtoindexx{producer attribute} \\
1546 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1547 \addtoindexx{prototyped attribute} \\
1548 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1552 \addtoindexx{return address attribute} \\
1553 \DWATstartscope&0x2c&
1554 \livelink{chap:classconstant}{constant},
1558 \addtoindexx{start scope attribute} \\
1559 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1560 \livelink{chap:classexprloc}{exprloc},
1561 \livelink{chap:classreference}{reference}
1562 \addtoindexx{bit stride attribute} \\
1563 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1564 \livelink{chap:classexprloc}{exprloc},
1565 \livelink{chap:classreference}{reference}
1566 \addtoindexx{upper bound attribute} \\
1567 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1568 \addtoindexx{abstract origin attribute} \\
1569 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1570 \addtoindexx{accessibility attribute} \\
1571 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1572 \addtoindexx{address class attribute} \\
1573 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1574 \addtoindexx{artificial attribute} \\
1575 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1576 \addtoindexx{base types attribute} \\
1577 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1578 \addtoindexx{calling convention attribute} \\
1579 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1580 \livelink{chap:classexprloc}{exprloc},
1581 \livelink{chap:classreference}{reference}
1582 \addtoindexx{count attribute} \\
1583 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1584 \livelink{chap:classexprloc}{exprloc},
1588 \addtoindexx{data member attribute} \\
1589 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1590 \addtoindexx{declaration column attribute} \\
1591 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1592 \addtoindexx{declaration file attribute} \\
1593 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1594 \addtoindexx{declaration line attribute} \\
1595 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1596 \addtoindexx{declaration attribute} \\
1597 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1598 \addtoindexx{discriminant list attribute} \\
1599 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1600 \addtoindexx{encoding attribute} \\
1601 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1602 \addtoindexx{external attribute} \\
1603 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1607 \addtoindexx{frame base attribute} \\
1608 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1609 \addtoindexx{friend attribute} \\
1610 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1611 \addtoindexx{identifier case attribute} \\
1612 \textit{Reserved}&0x43\footnote{Code 0x43 is reserved to allow backward compatible support of the
1613 DW\_AT\_macro\_info \mbox{attribute} which was
1614 defined in \DWARFVersionIV{} and earlier.}
1615 &\livelink{chap:classmacptr}{macptr}
1616 \addtoindexx{macro information attribute (legacy)!encoding} \\
1617 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1618 \addtoindexx{name list item attribute} \\
1619 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1620 \addtoindexx{priority attribute} \\
1621 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1625 \addtoindexx{segment attribute} \\
1626 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1627 \addtoindexx{specification attribute} \\
1628 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1632 \addtoindexx{static link attribute} \\
1633 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1634 \addtoindexx{type attribute} \\
1635 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1639 \addtoindexx{location list attribute} \\
1640 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1641 \addtoindexx{variable parameter attribute} \\
1642 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1643 \addtoindexx{virtuality attribute} \\
1644 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1648 \addtoindexx{vtable element location attribute} \\
1649 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1650 \livelink{chap:classexprloc}{exprloc},
1651 \livelink{chap:classreference}{reference}
1652 \addtoindexx{allocated attribute} \\
1653 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1654 \livelink{chap:classexprloc}{exprloc},
1655 \livelink{chap:classreference}{reference}
1656 \addtoindexx{associated attribute} \\
1657 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1658 \addtoindexx{data location attribute} \\
1659 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1660 \livelink{chap:classexprloc}{exprloc},
1661 \livelink{chap:classreference}{reference}
1662 \addtoindexx{byte stride attribute} \\
1663 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1664 \livelink{chap:classconstant}{constant}
1665 \addtoindexx{entry PC attribute} \\
1666 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1667 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1668 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1669 \addtoindexx{extension attribute} \\
1674 \addtoindexx{ranges attribute} \\
1675 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1676 \livelink{chap:classflag}{flag},
1677 \livelink{chap:classreference}{reference},
1678 \livelink{chap:classstring}{string}
1679 \addtoindexx{trampoline attribute} \\
1680 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1681 \addtoindexx{call column attribute} \\
1682 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1683 \addtoindexx{call file attribute} \\
1684 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1685 \addtoindexx{call line attribute} \\
1686 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1687 \addtoindexx{description attribute} \\
1688 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1689 \addtoindexx{binary scale attribute} \\
1690 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1691 \addtoindexx{decimal scale attribute} \\
1692 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1693 \addtoindexx{small attribute} \\
1694 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1695 \addtoindexx{decimal scale attribute} \\
1696 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1697 \addtoindexx{digit count attribute} \\
1698 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1699 \addtoindexx{picture string attribute} \\
1700 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1701 \addtoindexx{mutable attribute} \\
1702 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1703 \addtoindexx{thread scaled attribute} \\
1704 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1705 \addtoindexx{explicit attribute} \\
1706 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1707 \addtoindexx{object pointer attribute} \\
1708 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1709 \addtoindexx{endianity attribute} \\
1710 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1711 \addtoindexx{elemental attribute} \\
1712 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1713 \addtoindexx{pure attribute} \\
1714 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1715 \addtoindexx{recursive attribute} \\
1716 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1717 \addtoindexx{signature attribute} \\
1718 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1719 \addtoindexx{main subprogram attribute} \\
1720 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1721 \addtoindexx{data bit offset attribute} \\
1722 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1723 \addtoindexx{constant expression attribute} \\
1724 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1725 \addtoindexx{enumeration class attribute} \\
1726 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1727 \addtoindexx{linkage name attribute} \\
1728 \DWATstringlengthbitsize{}~\ddag&0x6f&
1729 \livelink{chap:classconstant}{constant}
1730 \addtoindexx{string length attribute!size of length} \\
1731 \DWATstringlengthbytesize{}~\ddag&0x70&
1732 \livelink{chap:classconstant}{constant}
1733 \addtoindexx{string length attribute!size of length} \\
1734 \DWATrank~\ddag&0x71&
1735 \livelink{chap:classconstant}{constant},
1736 \livelink{chap:classexprloc}{exprloc}
1737 \addtoindexx{rank attribute} \\
1738 \DWATstroffsetsbase~\ddag&0x72&
1739 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1740 \addtoindexx{string offsets base!encoding} \\
1741 \DWATaddrbase~\ddag &0x73&
1742 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1743 \addtoindexx{address table base!encoding} \\
1745 \DWATrnglistsbase~\ddag&0x74&
1747 \addtoindexx{range list base!encoding}
1749 \textit{Reserved} &0x75& \textit{Unused} \\
1750 \DWATdwoname~\ddag &0x76&
1751 \livelink{chap:classstring}{string}
1752 \addtoindexx{split DWARF object file name!encoding} \\
1753 \DWATreference~\ddag &0x77&
1754 \livelink{chap:classflag}{flag} \\
1755 \DWATrvaluereference~\ddag &0x78&
1756 \livelink{chap:classflag}{flag} \\
1757 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1758 \addtoindexx{macro information attribute} \\
1759 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1760 \addtoindexx{all calls summary attribute} \\
1761 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1762 \addtoindexx{all source calls summary attribute} \\
1763 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1764 \addtoindexx{all tail calls summary attribute} \\
1765 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1766 \addtoindexx{call return PC attribute} \\
1767 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1768 \addtoindexx{call value attribute} \\
1769 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1770 \addtoindexx{call origin attribute} \\
1771 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1772 \addtoindexx{call parameter attribute} \\
1773 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1774 \addtoindexx{call PC attribute} \\
1775 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1776 \addtoindexx{call tail call attribute} \\
1777 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1778 \addtoindexx{call target attribute} \\
1779 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1780 \addtoindexx{call target clobbered attribute} \\
1781 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1782 \addtoindexx{call data location attribute} \\
1783 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1784 \addtoindexx{call data value attribute} \\
1785 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1786 \addtoindexx{noreturn attribute} \\
1787 \DWATalignment~\ddag &0x88 &\CLASSconstant
1788 \addtoindexx{alignment attribute} \\
1789 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1790 \addtoindexx{export symbols attribute} \\
1791 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1792 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1794 \DWATloclistsbase~\ddag &0x8c &\CLASSloclistsptr \addtoindexx{location list base attribute}
1797 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1798 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1804 \subsection{Classes and Forms}
1806 \label{datarep:classesandforms}
1808 Each class is a set of forms which have related representations
1809 and which are given a common interpretation according to the
1810 attribute in which the form is used.
1811 The attribute form governs how the value of an attribute is
1813 The classes and the forms they include are listed below.
1816 Form \DWFORMsecoffsetTARG{}
1817 is a member of more than one class, namely
1821 \CLASSloclist, \CLASSloclistsptr,
1825 \CLASSrnglist{}, \CLASSrnglistsptr,
1828 \CLASSstroffsetsptr;
1830 as a result, it is not possible for an
1831 attribute to allow more than one of these classes.
1833 The list of classes allowed by the applicable attribute in
1834 Table \refersec{tab:attributeencodings}
1835 determines the class of the form.
1838 In the form descriptions that follow, some forms are said
1839 to depend in part on the value of an attribute of the
1840 \definition{\associatedcompilationunit}:
1843 In the case of a \splitDWARFobjectfile{}, the associated
1844 compilation unit is the skeleton compilation unit corresponding
1845 to the containing unit.
1846 \item Otherwise, the associated compilation unit
1847 is the containing unit.
1851 Each possible form belongs to one or more of the following classes
1852 (see Table \refersec{tab:classesofattributevalue} for a summary of
1853 the purpose and general usage of each class):
1857 \item \CLASSaddress \\
1858 \livetarg{datarep:classaddress}{}
1859 Represented as either:
1861 \item An object of appropriate size to hold an
1862 address on the target machine (\DWFORMaddrTARG).
1863 The size is encoded in the compilation unit header
1864 (see Section \refersec{datarep:compilationunitheader}).
1865 This address is relocatable in a relocatable object file and
1866 is relocated in an executable file or shared object file.
1868 \item An indirect index into a table of addresses (as
1869 described in the previous bullet) in the
1870 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1871 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1872 \addtoindex{LEB128} value, which is interpreted as a zero-based
1873 index into an array of addresses in the \dotdebugaddr{} section.
1874 The index is relative to the value of the \DWATaddrbase{} attribute
1875 of the associated compilation unit.
1880 \item \CLASSaddrptr \\
1881 \livetarg{datarep:classaddrptr}{}
1882 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1883 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1884 beginning of the list of machine addresses information for the
1885 referencing entity. It is relocatable in
1886 a relocatable object file, and relocated in an executable or
1887 shared object file. In the \thirtytwobitdwarfformat, this offset
1888 is a 4-byte unsigned value; in the 64-bit DWARF
1889 format, it is an 8-byte unsigned value (see Section
1890 \refersec{datarep:32bitand64bitdwarfformats}).
1892 \textit{This class is new in \DWARFVersionV.}
1895 \item \CLASSblock \\
1896 \livetarg{datarep:classblock}{}
1897 Blocks come in four forms:
1900 A 1-byte length followed by 0 to 255 contiguous information
1901 bytes (\DWFORMblockoneTARG).
1904 A 2-byte length followed by 0 to 65,535 contiguous information
1905 bytes (\DWFORMblocktwoTARG).
1908 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1909 information bytes (\DWFORMblockfourTARG).
1912 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1913 length followed by the number of bytes
1914 specified by the length (\DWFORMblockTARG).
1917 In all forms, the length is the number of information bytes
1918 that follow. The information bytes may contain any mixture
1919 of relocated (or relocatable) addresses, references to other
1920 debugging information entries or data bytes.
1922 \item \CLASSconstant \\
1923 \livetarg{datarep:classconstant}{}
1924 There are eight forms of constants. There are fixed length
1925 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1929 \DWFORMdatafourTARG,
1930 \DWFORMdataeightTARG{} and
1931 \DWFORMdatasixteenTARG).
1932 There are variable length constant
1933 data forms encoded using
1934 signed LEB128 numbers (\DWFORMsdataTARG) and unsigned
1935 LEB128 numbers (\DWFORMudataTARG).
1936 There is also an implicit constant (\DWFORMimplicitconst),
1937 whose value is provided as part of the abbreviation
1941 The data in \DWFORMdataone,
1944 \DWFORMdataeight{} and
1945 \DWFORMdatasixteen{}
1946 can be anything. Depending on context, it may
1947 be a signed integer, an unsigned integer, a floating\dash point
1948 constant, or anything else. A consumer must use context to
1949 know how to interpret the bits, which if they are target
1950 machine data (such as an integer or floating-point constant)
1951 will be in target machine \byteorder.
1953 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1954 forms is used to represent a
1955 signed or unsigned integer, it can be hard for a consumer
1956 to discover the context necessary to determine which
1957 interpretation is intended. Producers are therefore strongly
1958 encouraged to use \DWFORMsdata{} or
1959 \DWFORMudata{} for signed and
1960 unsigned integers respectively, rather than
1961 \DWFORMdata\textless n\textgreater.}
1964 \item \CLASSexprloc \\
1965 \livetarg{datarep:classexprloc}{}
1966 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length
1967 followed by the number of information bytes specified by the
1968 length (\DWFORMexprlocTARG).
1969 The information bytes contain a DWARF expression
1970 (see Section \refersec{chap:dwarfexpressions})
1971 or location description
1972 (see Section \refersec{chap:locationdescriptions}).
1976 \livetarg{datarep:classflag}{}
1977 A flag \addtoindexx{flag class}
1978 is represented explicitly as a single byte of data
1979 (\DWFORMflagTARG) or implicitly (\DWFORMflagpresentTARG). In the
1980 first case, if the \nolink{flag} has value zero, it indicates the
1981 absence of the attribute; if the \nolink{flag} has a non-zero value,
1982 it indicates the presence of the attribute. In the second
1983 case, the attribute is implicitly indicated as present, and
1984 no value is encoded in the debugging information entry itself.
1987 \item \CLASSlineptr \\
1988 \livetarg{datarep:classlineptr}{}
1989 This is an offset into
1990 \addtoindexx{section offset!in class lineptr value}
1992 \dotdebugline{} or \dotdebuglinedwo{} section
1994 It consists of an offset from the beginning of the
1996 section to the first byte of
1997 the data making up the line number list for the compilation
1999 It is relocatable in a relocatable object file, and
2000 relocated in an executable or shared object file. In the
2001 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2002 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2003 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2007 \item \CLASSloclist \\
2008 \livetarg{datarep:classloclist}{}
2009 This is represented as either:
2012 An index into the \dotdebugloclists{} section (\DWFORMloclistxTARG).
2013 The unsigned ULEB operand identifies an offset location
2014 relative to the base of that section (the location of the first offset
2015 in the section, not the first byte of the section). The contents of
2016 that location is then added to the base to determine the location of
2017 the target list of entries.
2019 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2020 The operand consists of a byte
2021 offset\addtoindexx{section offset!in class loclist value}
2022 from the beginning of the \dotdebugloclists{} section.
2023 It is relocatable in a relocatable object file, and
2024 relocated in an executable or shared object file. In the
2025 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2026 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2027 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2030 \textit{This class is new in \DWARFVersionV.}
2033 \item \CLASSloclistsptr \\
2034 \livetarg{datarep:classloclistsptr}{}
2035 This is an offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2036 The operand consists of a byte
2037 offset\addtoindexx{section offset!in class loclistsptr}
2038 from the beginning of the \dotdebugloclists{} section.
2040 It is relocatable in a relocatable object file, and
2041 relocated in an executable or shared object file. In the
2042 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2043 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2044 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2047 \textit{This class is new in \DWARFVersionV.}
2050 \item \CLASSmacptr \\
2051 \livetarg{datarep:classmacptr}{}
2053 \addtoindexx{section offset!in class macptr value}
2055 \dotdebugmacro{} or \dotdebugmacrodwo{} section
2057 It consists of an offset from the beginning of the
2058 \dotdebugmacro{} or \dotdebugmacrodwo{}
2059 section to the the header making up the
2060 macro information list for the compilation unit.
2061 It is relocatable in a relocatable object file, and
2062 relocated in an executable or shared object file. In the
2063 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2064 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2065 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2069 \item \CLASSrnglist \\
2070 \livetarg{datarep:classrnglist}{}
2071 This is represented as either:
2074 An index into the \dotdebugrnglists{} section (\DWFORMrnglistxTARG).
2075 The unsigned ULEB operand identifies an offset location
2076 relative to the base of that section (the location of the first offset
2077 in the section, not the first byte of the section). The contents of
2078 that location is then added to the base to determine the location of
2079 the target range list of entries.
2081 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2082 The operand consists of a byte
2083 offset\addtoindexx{section offset!in class loclist value}
2084 from the beginning of the \dotdebugloclists{} section.
2085 It is relocatable in a relocatable object file, and
2086 relocated in an executable or shared object file. In the
2087 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2088 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2089 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2092 \textit{This class is new in \DWARFVersionV.}
2096 \item \CLASSrnglistsptr \\
2097 \livetarg{datarep:classrnglistsptr}{}
2098 This is an offset\addtoindexx{section offset!in class rnglistsptr}
2099 into the \dotdebugrnglists{} section (\DWFORMsecoffset).
2100 It consists of a byte offset from the beginning of the
2101 \dotdebugrnglists{} section.
2102 It is relocatable in a relocatable object file, and relocated
2103 in an executable or shared object file.
2105 In the \thirtytwobitdwarfformat, this offset
2106 is a 4-byte unsigned value; in the 64-bit DWARF
2107 format, it is an 8-byte unsigned value (see Section
2108 \refersec{datarep:32bitand64bitdwarfformats}).
2111 \textit{This class is new in \DWARFVersionV.}
2117 \item \CLASSreference \\
2118 \livetarg{datarep:classreference}{}
2119 There are four types of reference.\addtoindexx{reference class}
2122 The first type of reference can identify any debugging
2123 information entry within the containing unit.
2124 This type of reference is an
2125 offset\addtoindexx{section offset!in class reference value}
2126 from the first byte of the compilation
2127 header for the compilation unit containing the reference. There
2128 are five forms for this type of reference. There are fixed
2129 length forms for one, two, four and eight byte offsets
2135 and \DWFORMrefeightTARG).
2136 There is also an unsigned variable
2137 length offset encoded form that uses
2138 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
2139 (\DWFORMrefudataTARG).
2140 Because this type of reference is within
2141 the containing compilation unit no relocation of the value
2145 The second type of reference can identify any debugging
2146 information entry within a
2147 \dotdebuginfo{} section; in particular,
2148 it may refer to an entry in a different compilation unit
2149 from the unit containing the reference, and may refer to an
2150 entry in a different shared object file. This type of reference
2151 (\DWFORMrefaddrTARG)
2152 is an offset from the beginning of the
2154 section of the target executable or shared object file, or, for
2155 references within a \addtoindex{supplementary object file},
2156 an offset from the beginning of the local \dotdebuginfo{} section;
2157 it is relocatable in a relocatable object file and frequently
2158 relocated in an executable or shared object file. For
2159 references from one shared object or static executable file
2160 to another, the relocation and identification of the target
2161 object must be performed by the consumer. In the
2162 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2163 in the \sixtyfourbitdwarfformat, it is an 8-byte
2165 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2167 \textit{A debugging information entry that may be referenced by
2168 another compilation unit using
2169 \DWFORMrefaddr{} must have a global symbolic name.}
2171 \textit{For a reference from one executable or shared object file to
2172 another, the reference is resolved by the debugger to identify
2173 the executable or shared object file and the offset into that
2174 file\textquoteright s \dotdebuginfo{}
2175 section in the same fashion as the run
2176 time loader, either when the debug information is first read,
2177 or when the reference is used.}
2180 The third type of reference can identify any debugging
2181 information type entry that has been placed in its own
2182 \addtoindex{type unit}. This type of
2183 reference (\DWFORMrefsigeightTARG) is the
2184 \addtoindexx{type signature}
2185 8-byte type signature
2186 (see Section \refersec{datarep:typesignaturecomputation})
2187 that was computed for the type.
2190 The fourth type of reference is a reference from within the
2191 \dotdebuginfo{} section of the executable or shared object file to
2192 a debugging information entry in the \dotdebuginfo{} section of
2193 a \addtoindex{supplementary object file}.
2194 This type of reference (\DWFORMrefsupTARG) is an offset from the
2195 beginning of the \dotdebuginfo{} section in the
2196 \addtoindex{supplementary object file}.
2198 \textit{The use of compilation unit relative references will reduce the
2199 number of link\dash time relocations and so speed up linking. The
2200 use of the second, third and fourth type of reference allows for the
2201 sharing of information, such as types, across compilation
2202 units, while the fourth type further allows for sharing of information
2203 across compilation units from different executables or shared object files.}
2205 \textit{A reference to any kind of compilation unit identifies the
2206 debugging information entry for that unit, not the preceding
2211 \item \CLASSstring \\
2212 \livetarg{datarep:classstring}{}
2213 A string is a sequence of contiguous non\dash null bytes followed by
2215 \addtoindexx{string class}
2216 A string may be represented:
2218 \setlength{\itemsep}{0em}
2219 \item immediately in the debugging information entry itself
2220 (\DWFORMstringTARG),
2223 \addtoindexx{section offset!in class string value}
2224 offset into a string table contained in
2225 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
2226 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
2227 or as an offset into a string table contained in the
2228 \dotdebugstr{} section of a \addtoindex{supplementary object file}
2229 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
2230 section of a \addtoindex{supplementary object file}
2231 refer to the local \dotdebugstr{} section of that same file.
2232 In the \thirtytwobitdwarfformat, the representation of a
2233 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
2234 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2235 it is an 8-byte unsigned offset
2236 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2239 \item as an indirect offset into the string table using an
2240 index into a table of offsets contained in the
2241 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
2242 The representation of a \DWFORMstrxNAME{} value is an unsigned
2243 \addtoindex{LEB128} value, which is interpreted as a zero-based
2244 index into an array of offsets in the \dotdebugstroffsets{} section.
2245 The offset entries in the \dotdebugstroffsets{} section have the
2246 same representation as \DWFORMstrp{} values.
2248 Any combination of these three forms may be used within a single compilation.
2250 If the \DWATuseUTFeight{}
2251 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
2252 compilation, partial, skeleton or type unit entry, string values are encoded using the
2253 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
2254 Character Set standard (ISO/IEC 10646\dash 1:1993).
2255 \addtoindexx{ISO 10646 character set standard}
2256 Otherwise, the string representation is unspecified.
2258 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
2259 ISO/IEC 10646\dash 1:1993.
2260 \addtoindexx{ISO 10646 character set standard}
2261 It contains all the same characters
2262 and encoding points as ISO/IEC 10646, as well as additional
2263 information about the characters and their use.}
2266 \textit{Earlier versions of DWARF did not specify the representation
2267 of strings; for compatibility, this version also does
2268 not. However, the UTF\dash 8 representation is strongly recommended.}
2271 \item \CLASSstroffsetsptr \\
2272 \livetarg{datarep:classstroffsetsptr}{}
2273 This is an offset into the \dotdebugstroffsets{} section
2274 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2275 \dotdebugstroffsets{} section to the
2276 beginning of the string offsets information for the
2277 referencing entity. It is relocatable in
2278 a relocatable object file, and relocated in an executable or
2279 shared object file. In the \thirtytwobitdwarfformat, this offset
2280 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2281 it is an 8-byte unsigned value (see Section
2282 \refersec{datarep:32bitand64bitdwarfformats}).
2284 \textit{This class is new in \DWARFVersionV.}
2288 In no case does an attribute use one of the classes
2293 \CLASSrnglistsptr{} or
2294 \CLASSstroffsetsptr{}
2295 to point into either the
2296 \dotdebuginfo{} or \dotdebugstr{} section.
2299 \subsection{Form Encodings}
2300 \label{datarep:formencodings}
2302 The form encodings are listed in
2303 Table \referfol{tab:attributeformencodings}.
2307 \setlength{\extrarowheight}{0.1cm}
2308 \begin{longtable}{l|c|l}
2309 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2310 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2312 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2314 \hline \emph{Continued on next page}
2316 \hline \ddag\ \textit{New in DWARF Version 5}
2319 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2320 \textit{Reserved} &0x02& \\
2321 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2322 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2323 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2324 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2325 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2326 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2327 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2328 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2329 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2330 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2331 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2332 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2333 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2334 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2335 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2336 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2337 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2338 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2339 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2340 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2342 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclist, \CLASSloclistsptr, \\
2343 & & \CLASSmacptr, \CLASSrnglist, \CLASSrnglistsptr, \CLASSstroffsetsptr
2346 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2347 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2348 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2349 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2350 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2351 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2352 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2353 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2354 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2355 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2357 \DWFORMloclistx~\ddag \eb &0x22 &\CLASSloclist \\
2359 \DWFORMrnglistx~\ddag \eb &0x23 &\CLASSrnglist \\
2365 \section{Variable Length Data}
2366 \label{datarep:variablelengthdata}
2367 \addtoindexx{variable length data|see {LEB128}}
2369 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2370 encoded using \doublequote{Little-Endian Base 128}
2371 \addtoindexx{little-endian encoding|see{endian attribute}}
2373 \addtoindexx{LEB128}
2374 LEB128 is a scheme for encoding integers
2375 densely that exploits the assumption that most integers are
2378 \textit{This encoding is equally suitable whether the target machine
2379 architecture represents data in big-endian or little-endian
2380 \byteorder. It is \doublequote{little-endian} only in the sense that it
2381 avoids using space to represent the \doublequote{big} end of an
2382 unsigned integer, when the big end is all zeroes or sign
2385 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2386 numbers are encoded as follows:
2387 \addtoindexx{LEB128!unsigned, encoding as}
2388 start at the low order end of an unsigned integer and chop
2389 it into 7-bit chunks. Place each chunk into the low order 7
2390 bits of a byte. Typically, several of the high order bytes
2391 will be zero; discard them. Emit the remaining bytes in a
2392 stream, starting with the low order byte; set the high order
2393 bit on each byte except the last emitted byte. The high bit
2394 of zero on the last byte indicates to the decoder that it
2395 has encountered the last byte.
2397 The integer zero is a special case, consisting of a single
2400 Table \refersec{tab:examplesofunsignedleb128encodings}
2401 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2403 0x80 in each case is the high order bit of the byte, indicating
2404 that an additional byte follows.
2407 The encoding for signed, two\textquoteright{s} complement LEB128
2408 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2409 numbers is similar, except that the criterion for discarding
2410 high order bytes is not whether they are zero, but whether
2411 they consist entirely of sign extension bits. Consider the
2412 4-byte integer -2. The three high level bytes of the number
2413 are sign extension, thus LEB128 would represent it as a single
2414 byte containing the low order 7 bits, with the high order
2415 bit cleared to indicate the end of the byte stream. Note
2416 that there is nothing within the LEB128 representation that
2417 indicates whether an encoded number is signed or unsigned. The
2418 decoder must know what type of number to expect.
2419 Table \refersec{tab:examplesofunsignedleb128encodings}
2420 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2421 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2422 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2425 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2426 \addtoindexx{LEB128!examples}
2427 gives algorithms for encoding and decoding these forms.}
2431 \setlength{\extrarowheight}{0.1cm}
2432 \begin{longtable}{c|c|c}
2433 \caption{Examples of unsigned LEB128 encodings}
2434 \label{tab:examplesofunsignedleb128encodings}
2435 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2436 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2438 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2440 \hline \emph{Continued on next page}
2446 128& 0 + 0x80 & 1 \\
2447 129& 1 + 0x80 & 1 \\
2448 %130& 2 + 0x80 & 1 \\
2449 12857& 57 + 0x80 & 100 \\
2456 \setlength{\extrarowheight}{0.1cm}
2457 \begin{longtable}{c|c|c}
2458 \caption{Examples of signed LEB128 encodings}
2459 \label{tab:examplesofsignedleb128encodings}
2460 \addtoindexx{LEB128!signed} \\
2461 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2463 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2465 \hline \emph{Continued on next page}
2471 127& 127 + 0x80 & 0 \\
2472 -127& 1 + 0x80 & 0x7f \\
2473 128& 0 + 0x80 & 1 \\
2474 -128& 0 + 0x80 & 0x7f \\
2475 129& 1 + 0x80 & 1 \\
2476 -129& 0x7f + 0x80 & 0x7e \\
2483 \section{DWARF Expressions and Location Descriptions}
2484 \label{datarep:dwarfexpressionsandlocationdescriptions}
2485 \subsection{DWARF Expressions}
2486 \label{datarep:dwarfexpressions}
2489 \addtoindexx{DWARF expression!operator encoding}
2490 DWARF expression is stored in a \nolink{block} of contiguous
2491 bytes. The bytes form a sequence of operations. Each operation
2492 is a 1-byte code that identifies that operation, followed by
2493 zero or more bytes of additional data. The encodings for the
2494 operations are described in
2495 Table \refersec{tab:dwarfoperationencodings}.
2498 \setlength{\extrarowheight}{0.1cm}
2499 \begin{longtable}{l|c|c|l}
2500 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2501 \hline & &\bfseries No. of &\\
2502 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2504 & &\bfseries No. of &\\
2505 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2507 \hline \emph{Continued on next page}
2509 \hline \ddag\ \textit{New in DWARF Version 5}
2512 \DWOPaddr&0x03&1 & constant address \\
2513 & & &(size is target specific) \\
2515 \DWOPderef&0x06&0 & \\
2517 \DWOPconstoneu&0x08&1&1-byte constant \\
2518 \DWOPconstones&0x09&1&1-byte constant \\
2519 \DWOPconsttwou&0x0a&1&2-byte constant \\
2520 \DWOPconsttwos&0x0b&1&2-byte constant \\
2521 \DWOPconstfouru&0x0c&1&4-byte constant \\
2522 \DWOPconstfours&0x0d&1&4-byte constant \\
2523 \DWOPconsteightu&0x0e&1&8-byte constant \\
2524 \DWOPconsteights&0x0f&1&8-byte constant \\
2525 \DWOPconstu&0x10&1&ULEB128 constant \\
2526 \DWOPconsts&0x11&1&SLEB128 constant \\
2527 \DWOPdup&0x12&0 & \\
2528 \DWOPdrop&0x13&0 & \\
2529 \DWOPover&0x14&0 & \\
2530 \DWOPpick&0x15&1&1-byte stack index \\
2531 \DWOPswap&0x16&0 & \\
2532 \DWOProt&0x17&0 & \\
2533 \DWOPxderef&0x18&0 & \\
2534 \DWOPabs&0x19&0 & \\
2535 \DWOPand&0x1a&0 & \\
2536 \DWOPdiv&0x1b&0 & \\
2537 \DWOPminus&0x1c&0 & \\
2538 \DWOPmod&0x1d&0 & \\
2539 \DWOPmul&0x1e&0 & \\
2540 \DWOPneg&0x1f&0 & \\
2541 \DWOPnot&0x20&0 & \\
2543 \DWOPplus&0x22&0 & \\
2544 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2545 \DWOPshl&0x24&0 & \\
2546 \DWOPshr&0x25&0 & \\
2547 \DWOPshra&0x26&0 & \\
2548 \DWOPxor&0x27&0 & \\
2550 \DWOPbra&0x28&1 & signed 2-byte constant \\
2557 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2559 \DWOPlitzero & 0x30 & 0 & \\
2560 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2561 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2562 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2564 \DWOPregzero & 0x50 & 0 & \\*
2565 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2566 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2567 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2569 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2570 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2571 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2572 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2574 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2575 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2576 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2577 & & &SLEB128 offset \\
2578 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2579 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2580 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2581 \DWOPnop{} & 0x96 &0& \\
2583 \DWOPpushobjectaddress&0x97&0 & \\
2584 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2585 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2586 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2587 \DWOPformtlsaddress&0x9b &0& \\
2588 \DWOPcallframecfa{} &0x9c &0& \\
2589 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2591 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2592 &&&\nolink{block} of that size\\
2593 \DWOPstackvalue{} &0x9f &0& \\
2594 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2595 &&&SLEB128 constant offset \\
2596 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2597 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2598 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2599 &&&\nolink{block} of that size\\
2600 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2601 & & & 1-byte size, \\*
2602 & & & constant value \\
2603 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2604 &&& ULEB128 constant offset \\
2605 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2606 &&& ULEB128 type entry offset \\
2607 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2608 &&& ULEB128 type entry offset \\
2609 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2610 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2611 \DWOPlouser{} &0xe0 && \\
2612 \DWOPhiuser{} &\xff && \\
2618 \subsection{Location Descriptions}
2619 \label{datarep:locationdescriptions}
2621 A location description is used to compute the
2622 location of a variable or other entity.
2624 \subsection{Location Lists}
2625 \label{datarep:locationlists}
2626 Each entry in a \addtoindex{location list} is either a location list entry,
2629 entry, a default location entry or an
2631 \addtoindexx{end-of-list entry!in location list}
2636 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2637 that follows. The encodings for these constants are given in
2638 Table \ref{tab:locationlistentryencodingvalues}.
2642 \setlength{\extrarowheight}{0.1cm}
2643 \begin{longtable}{l|c}
2644 \caption{Location list entry encoding values}
2645 \label{tab:locationlistentryencodingvalues} \\
2646 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2648 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2650 \hline \emph{Continued on next page}
2653 \ddag New in \DWARFVersionV
2656 \DWLLEendoflist~\ddag & 0x00 \\
2657 \DWLLEbaseaddressx~\ddag & 0x01 \\
2658 \DWLLEstartxendx~\ddag & 0x02 \\
2659 \DWLLEstartxlength~\ddag & 0x03 \\
2660 \DWLLEoffsetpair~\ddag & 0x04 \\
2661 \DWLLEdefaultlocation~\ddag & 0x05 \\
2662 \DWLLEbaseaddress~\ddag & 0x06 \\
2663 \DWLLEstartend~\ddag & 0x07 \\
2664 \DWLLEstartlength~\ddag & 0x08
2669 \section{Base Type Attribute Encodings}
2670 \label{datarep:basetypeattributeencodings}
2672 The\hypertarget{chap:DWATencodingencodingofbasetype}{}
2673 encodings of the constants used in the
2674 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2676 Table \refersec{tab:basetypeencodingvalues}
2679 \setlength{\extrarowheight}{0.1cm}
2680 \begin{longtable}{l|c}
2681 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2682 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2684 \bfseries Base type encoding name&\bfseries Value\\ \hline
2686 \hline \emph{Continued on next page}
2689 \ddag \ \textit{New in \DWARFVersionV}
2691 \DWATEaddress&0x01 \\
2692 \DWATEboolean&0x02 \\
2693 \DWATEcomplexfloat&0x03 \\
2695 \DWATEsigned&0x05 \\
2696 \DWATEsignedchar&0x06 \\
2697 \DWATEunsigned&0x07 \\
2698 \DWATEunsignedchar&0x08 \\
2699 \DWATEimaginaryfloat&0x09 \\
2700 \DWATEpackeddecimal&0x0a \\
2701 \DWATEnumericstring&0x0b \\
2702 \DWATEedited&0x0c \\
2703 \DWATEsignedfixed&0x0d \\
2704 \DWATEunsignedfixed&0x0e \\
2705 \DWATEdecimalfloat & 0x0f \\
2706 \DWATEUTF{} & 0x10 \\
2707 \DWATEUCS~\ddag & 0x11 \\
2708 \DWATEASCII~\ddag & 0x12 \\
2709 \DWATElouser{} & 0x80 \\
2710 \DWATEhiuser{} & \xff \\
2715 The encodings of the constants used in the
2716 \DWATdecimalsign{} attribute
2718 Table \refersec{tab:decimalsignencodings}.
2721 \setlength{\extrarowheight}{0.1cm}
2722 \begin{longtable}{l|c}
2723 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2724 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2726 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2728 % \hline \emph{Continued on next page}
2732 \DWDSunsigned{} & 0x01 \\
2733 \DWDSleadingoverpunch{} & 0x02 \\
2734 \DWDStrailingoverpunch{} & 0x03 \\
2735 \DWDSleadingseparate{} & 0x04 \\
2736 \DWDStrailingseparate{} & 0x05 \\
2741 The encodings of the constants used in the
2742 \DWATendianity{} attribute are given in
2743 Table \refersec{tab:endianityencodings}.
2746 \setlength{\extrarowheight}{0.1cm}
2747 \begin{longtable}{l|c}
2748 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2749 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2751 \bfseries Endian code name&\bfseries Value\\ \hline
2753 \hline \emph{Continued on next page}
2758 \DWENDdefault{} & 0x00 \\
2759 \DWENDbig{} & 0x01 \\
2760 \DWENDlittle{} & 0x02 \\
2761 \DWENDlouser{} & 0x40 \\
2762 \DWENDhiuser{} & \xff \\
2768 \section{Accessibility Codes}
2769 \label{datarep:accessibilitycodes}
2770 The encodings of the constants used in the
2771 \DWATaccessibility{}
2773 \addtoindexx{accessibility attribute}
2775 Table \refersec{tab:accessibilityencodings}.
2778 \setlength{\extrarowheight}{0.1cm}
2779 \begin{longtable}{l|c}
2780 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2781 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2783 \bfseries Accessibility code name&\bfseries Value\\ \hline
2785 \hline \emph{Continued on next page}
2790 \DWACCESSpublic&0x01 \\
2791 \DWACCESSprotected&0x02 \\
2792 \DWACCESSprivate&0x03 \\
2798 \section{Visibility Codes}
2799 \label{datarep:visibilitycodes}
2800 The encodings of the constants used in the
2801 \DWATvisibility{} attribute are given in
2802 Table \refersec{tab:visibilityencodings}.
2805 \setlength{\extrarowheight}{0.1cm}
2806 \begin{longtable}{l|c}
2807 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2808 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2810 \bfseries Visibility code name&\bfseries Value\\ \hline
2812 \hline \emph{Continued on next page}
2818 \DWVISexported&0x02 \\
2819 \DWVISqualified&0x03 \\
2824 \section{Virtuality Codes}
2825 \label{datarep:vitualitycodes}
2827 The encodings of the constants used in the
2828 \DWATvirtuality{} attribute are given in
2829 Table \refersec{tab:virtualityencodings}.
2832 \setlength{\extrarowheight}{0.1cm}
2833 \begin{longtable}{l|c}
2834 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2835 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2837 \bfseries Virtuality code name&\bfseries Value\\ \hline
2839 \hline \emph{Continued on next page}
2844 \DWVIRTUALITYnone&0x00 \\
2845 \DWVIRTUALITYvirtual&0x01 \\
2846 \DWVIRTUALITYpurevirtual&0x02 \\
2853 \DWVIRTUALITYnone{} is equivalent to the absence of the
2857 \section{Source Languages}
2858 \label{datarep:sourcelanguages}
2860 The encodings of the constants used
2861 \addtoindexx{language attribute, encoding}
2863 \addtoindexx{language name encoding}
2866 attribute are given in
2867 Table \refersec{tab:languageencodings}.
2869 % If we don't force a following space it looks odd
2871 and their associated values are reserved, but the
2872 languages they represent are not well supported.
2873 Table \refersec{tab:languageencodings}
2875 \addtoindexx{lower bound attribute!default}
2876 default lower bound, if any, assumed for
2877 an omitted \DWATlowerbound{} attribute in the context of a
2878 \DWTAGsubrangetype{} debugging information entry for each
2882 \setlength{\extrarowheight}{0.1cm}
2883 \begin{longtable}{l|c|c}
2884 \caption{Language encodings} \label{tab:languageencodings}\\
2885 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2887 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2889 \hline \emph{Continued on next page}
2892 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2894 \addtoindexx{ISO-defined language names}
2896 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2897 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2898 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2899 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++98 (ISO)} \\
2900 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2901 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2902 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2903 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2904 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2905 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2906 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2907 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2908 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2909 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2910 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2911 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2912 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2913 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2914 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2915 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2916 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2917 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2918 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2919 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2920 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++03 (ISO)}\\
2921 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++11 (ISO)} \\
2922 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2923 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2924 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2925 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2926 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2927 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2928 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++14 (ISO)} \\
2929 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2930 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2931 \DWLANGRenderScript{}~\ddag &0x0024 &0 \addtoindexx{RenderScript Kernel Language}
2933 \DWLANGlouser{} &0x8000 & \\
2934 \DWLANGhiuser{} &\xffff & \\
2939 \section{Address Class Encodings}
2940 \label{datarep:addressclassencodings}
2942 The value of the common
2943 \addtoindex{address class} encoding
2947 \section{Identifier Case}
2948 \label{datarep:identifiercase}
2950 The encodings of the constants used in the
2951 \DWATidentifiercase{} attribute are given in
2952 Table \refersec{tab:identifiercaseencodings}.
2956 \setlength{\extrarowheight}{0.1cm}
2957 \begin{longtable}{l|c}
2958 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2959 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2961 \bfseries Identifier case name&\bfseries Value\\ \hline
2963 \hline \emph{Continued on next page}
2967 \DWIDcasesensitive&0x00 \\
2969 \DWIDdowncase&0x02 \\
2970 \DWIDcaseinsensitive&0x03 \\
2974 \section{Calling Convention Encodings}
2975 \label{datarep:callingconventionencodings}
2976 The encodings of the constants used in the
2977 \DWATcallingconvention{} attribute are given in
2978 Table \refersec{tab:callingconventionencodings}.
2981 \setlength{\extrarowheight}{0.1cm}
2982 \begin{longtable}{l|c}
2983 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2984 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2986 \bfseries Calling convention name&\bfseries Value\\ \hline
2988 \hline \emph{Continued on next page}
2990 \hline \ddag\ \textit{New in DWARF Version 5}
2993 \DWCCnormal &0x01 \\
2994 \DWCCprogram&0x02 \\
2995 \DWCCnocall &0x03 \\
2996 \DWCCpassbyreference~\ddag &0x04 \\
2997 \DWCCpassbyvalue~\ddag &0x05 \\
2998 \DWCClouser &0x40 \\
3005 \section{Inline Codes}
3006 \label{datarep:inlinecodes}
3008 The encodings of the constants used in
3009 \addtoindexx{inline attribute}
3011 \DWATinline{} attribute are given in
3012 Table \refersec{tab:inlineencodings}.
3016 \setlength{\extrarowheight}{0.1cm}
3017 \begin{longtable}{l|c}
3018 \caption{Inline encodings} \label{tab:inlineencodings}\\
3019 \hline \bfseries Inline code name&\bfseries Value \\ \hline
3021 \bfseries Inline Code name&\bfseries Value\\ \hline
3023 \hline \emph{Continued on next page}
3028 \DWINLnotinlined&0x00 \\
3029 \DWINLinlined&0x01 \\
3030 \DWINLdeclarednotinlined&0x02 \\
3031 \DWINLdeclaredinlined&0x03 \\
3036 % this clearpage is ugly, but the following table came
3037 % out oddly without it.
3039 \section{Array Ordering}
3040 \label{datarep:arrayordering}
3042 The encodings of the constants used in the
3043 \DWATordering{} attribute are given in
3044 Table \refersec{tab:orderingencodings}.
3048 \setlength{\extrarowheight}{0.1cm}
3049 \begin{longtable}{l|c}
3050 \caption{Ordering encodings} \label{tab:orderingencodings}\\
3051 \hline \bfseries Ordering name&\bfseries Value \\ \hline
3053 \bfseries Ordering name&\bfseries Value\\ \hline
3055 \hline \emph{Continued on next page}
3060 \DWORDrowmajor&0x00 \\
3061 \DWORDcolmajor&0x01 \\
3067 \section{Discriminant Lists}
3068 \label{datarep:discriminantlists}
3070 The descriptors used in
3071 \addtoindexx{discriminant list attribute}
3073 \DWATdiscrlist{} attribute are
3074 encoded as 1-byte constants. The
3075 defined values are given in
3076 Table \refersec{tab:discriminantdescriptorencodings}.
3078 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
3080 \setlength{\extrarowheight}{0.1cm}
3081 \begin{longtable}{l|c}
3082 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
3083 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
3085 \bfseries Descriptor name&\bfseries Value\\ \hline
3087 \hline \emph{Continued on next page}
3099 \section{Name Index Table}
3100 \label{datarep:nameindextable}
3101 The \addtoindexi{version number}{version number!name index table}
3102 in the name index table header is \versiondotdebugnames{}.
3104 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
3107 \setlength{\extrarowheight}{0.1cm}
3108 \begin{longtable}{l|c|l}
3109 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
3110 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3112 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3114 \hline \emph{Continued on next page}
3117 \ddag~\textit{New in \DWARFVersionV}
3119 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
3120 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
3121 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
3122 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
3123 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
3124 \DWIDXlouser~\ddag & 0x2000 & \\
3125 \DWIDXhiuser~\ddag & \xiiifff & \\
3129 The abbreviations table ends with an entry consisting of a single 0
3130 byte for the abbreviation code. The size of the table given by
3131 \texttt{abbrev\_table\_size} may include optional padding following the
3134 \section{Defaulted Member Encodings}
3135 \hypertarget{datarep:defaultedmemberencodings}{}
3137 The encodings of the constants used in the \DWATdefaulted{} attribute
3138 are given in Table \referfol{datarep:defaultedattributeencodings}.
3141 \setlength{\extrarowheight}{0.1cm}
3142 \begin{longtable}{l|c}
3143 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
3144 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
3146 \bfseries Defaulted name &\bfseries Value \\ \hline
3148 \hline \emph{Continued on next page}
3151 \ddag~\textit{New in \DWARFVersionV}
3153 \DWDEFAULTEDno~\ddag & 0x00 \\
3154 \DWDEFAULTEDinclass~\ddag & 0x01 \\
3155 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
3160 \section{Address Range Table}
3161 \label{datarep:addrssrangetable}
3163 Each set of entries in the table of address ranges contained
3164 in the \dotdebugaranges{}
3165 section begins with a header containing:
3166 \begin{enumerate}[1. ]
3167 % FIXME The unit length text is not fully consistent across
3170 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3171 \addttindexx{unit\_length}
3172 A 4-byte or 12-byte length containing the length of the
3173 \addtoindexx{initial length}
3174 set of entries for this compilation unit, not including the
3175 length field itself. In the \thirtytwobitdwarfformat, this is a
3176 4-byte unsigned integer (which must be less than \xfffffffzero);
3177 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
3178 \wffffffff followed by an 8-byte unsigned integer that gives
3180 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3182 \item version (\HFTuhalf) \\
3183 A 2-byte version identifier representing the version of the
3184 DWARF information for the address range table.
3186 This value in this field \addtoindexx{version number!address range table} is 2.
3188 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
3190 \addtoindexx{section offset!in .debug\_aranges header}
3191 4-byte or 8-byte offset into the
3192 \dotdebuginfo{} section of
3193 the compilation unit header. In the \thirtytwobitdwarfformat,
3194 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
3195 this is an 8-byte unsigned offset
3196 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3198 \item \texttt{address\_size} (\HFTubyte) \\
3199 A 1-byte unsigned integer containing the size in bytes of an
3200 \addttindexx{address\_size}
3202 \addtoindexx{size of an address}
3203 (or the offset portion of an address for segmented
3204 \addtoindexx{address space!segmented}
3205 addressing) on the target system.
3207 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3208 A 1-byte unsigned integer containing the size in bytes of a
3209 segment selector on the target system.
3213 This header is followed by a series of tuples. Each tuple
3214 consists of a segment, an address and a length.
3215 The segment selector
3216 size is given by the \HFNsegmentselectorsize{} field of the header; the
3217 address and length size are each given by the \addttindex{address\_size}
3218 field of the header.
3219 The first tuple following the header in
3220 each set begins at an offset that is a multiple of the size
3221 of a single tuple (that is, the size of a segment selector
3222 plus twice the \addtoindex{size of an address}).
3223 The header is padded, if
3224 necessary, to that boundary. Each set of tuples is terminated
3225 by a 0 for the segment, a 0 for the address and 0 for the
3226 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3227 the segment selectors are omitted from all tuples, including
3228 the terminating tuple.
3231 \section{Line Number Information}
3232 \label{datarep:linenumberinformation}
3234 The \addtoindexi{version number}{version number!line number information}
3235 in the line number program header is \versiondotdebugline{}.
3237 The boolean values \doublequote{true} and \doublequote{false}
3238 used by the line number information program are encoded
3239 as a single byte containing the value 0
3240 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3243 The encodings for the standard opcodes are given in
3244 \addtoindexx{line number opcodes!standard opcode encoding}
3245 Table \refersec{tab:linenumberstandardopcodeencodings}.
3248 \setlength{\extrarowheight}{0.1cm}
3249 \begin{longtable}{l|c}
3250 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3251 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3253 \bfseries Opcode name&\bfseries Value\\ \hline
3255 \hline \emph{Continued on next page}
3261 \DWLNSadvancepc&0x02 \\
3262 \DWLNSadvanceline&0x03 \\
3263 \DWLNSsetfile&0x04 \\
3264 \DWLNSsetcolumn&0x05 \\
3265 \DWLNSnegatestmt&0x06 \\
3266 \DWLNSsetbasicblock&0x07 \\
3267 \DWLNSconstaddpc&0x08 \\
3268 \DWLNSfixedadvancepc&0x09 \\
3269 \DWLNSsetprologueend&0x0a \\*
3270 \DWLNSsetepiloguebegin&0x0b \\*
3271 \DWLNSsetisa&0x0c \\*
3277 The encodings for the extended opcodes are given in
3278 \addtoindexx{line number opcodes!extended opcode encoding}
3279 Table \refersec{tab:linenumberextendedopcodeencodings}.
3282 \setlength{\extrarowheight}{0.1cm}
3283 \begin{longtable}{l|c}
3284 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3285 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3287 \bfseries Opcode name&\bfseries Value\\ \hline
3289 \hline \emph{Continued on next page}
3291 \hline %\ddag~\textit{New in DWARF Version 5}
3294 \DWLNEendsequence &0x01 \\
3295 \DWLNEsetaddress &0x02 \\
3296 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3297 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3299 \DWLNEsetdiscriminator &0x04 \\
3300 \DWLNElouser &0x80 \\
3301 \DWLNEhiuser &\xff \\
3307 The encodings for the line number header entry formats are given in
3308 \addtoindexx{line number opcodes!file entry format encoding}
3309 Table \refersec{tab:linenumberheaderentryformatencodings}.
3312 \setlength{\extrarowheight}{0.1cm}
3313 \begin{longtable}{l|c}
3314 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3315 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3317 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3319 \hline \emph{Continued on next page}
3321 \hline \ddag~\textit{New in DWARF Version 5}
3323 \DWLNCTpath~\ddag & 0x1 \\
3324 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3325 \DWLNCTtimestamp~\ddag & 0x3 \\
3326 \DWLNCTsize~\ddag & 0x4 \\
3327 \DWLNCTMDfive~\ddag & 0x5 \\
3328 \DWLNCTlouser~\ddag & 0x2000 \\
3329 \DWLNCThiuser~\ddag & \xiiifff \\
3334 \section{Macro Information}
3335 \label{datarep:macroinformation}
3336 The \addtoindexi{version number}{version number!macro information}
3337 in the macro information header is \versiondotdebugmacro{}.
3339 The source line numbers and source file indices encoded in the
3340 macro information section are represented as
3341 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3344 The macro information entry type is encoded as a single unsigned byte.
3346 \addtoindexx{macro information entry types!encoding}
3348 Table \refersec{tab:macroinfoentrytypeencodings}.
3352 \setlength{\extrarowheight}{0.1cm}
3353 \begin{longtable}{l|c}
3354 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3355 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3357 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3359 \hline \emph{Continued on next page}
3361 \hline \ddag~\textit{New in DWARF Version 5}
3364 \DWMACROdefine~\ddag &0x01 \\
3365 \DWMACROundef~\ddag &0x02 \\
3366 \DWMACROstartfile~\ddag &0x03 \\
3367 \DWMACROendfile~\ddag &0x04 \\
3368 \DWMACROdefinestrp~\ddag &0x05 \\
3369 \DWMACROundefstrp~\ddag &0x06 \\
3370 \DWMACROimport~\ddag &0x07 \\
3371 \DWMACROdefinesup~\ddag &0x08 \\
3372 \DWMACROundefsup~\ddag &0x09 \\
3373 \DWMACROimportsup~\ddag &0x0a \\
3374 \DWMACROdefinestrx~\ddag &0x0b \\
3375 \DWMACROundefstrx~\ddag &0x0c \\
3376 \DWMACROlouser~\ddag &0xe0 \\
3377 \DWMACROhiuser~\ddag &\xff \\
3383 \section{Call Frame Information}
3384 \label{datarep:callframeinformation}
3386 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3387 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3388 value is \xffffffffffffffff.
3390 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3391 is \versiondotdebugframe.
3393 Call frame instructions are encoded in one or more bytes. The
3394 primary opcode is encoded in the high order two bits of
3395 the first byte (that is, opcode = byte $\gg$ 6). An operand
3396 or extended opcode may be encoded in the low order 6
3397 bits. Additional operands are encoded in subsequent bytes.
3398 The instructions and their encodings are presented in
3399 Table \refersec{tab:callframeinstructionencodings}.
3402 \setlength{\extrarowheight}{0.1cm}
3403 \begin{longtable}{l|c|c|l|l}
3404 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3405 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3406 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3408 & \bfseries High 2 &\bfseries Low 6 & &\\
3409 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3411 \hline \emph{Continued on next page}
3416 \DWCFAadvanceloc&0x1&delta & \\
3417 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3418 \DWCFArestore&0x3®ister & & \\
3419 \DWCFAnop&0&0 & & \\
3420 \DWCFAsetloc&0&0x01&address & \\
3421 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3422 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3423 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3424 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3425 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3426 \DWCFAundefined&0&0x07&ULEB128 register & \\
3427 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3428 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3429 \DWCFArememberstate&0&0x0a & & \\
3430 \DWCFArestorestate&0&0x0b & & \\
3431 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3432 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3433 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3434 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3435 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3437 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3438 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3439 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3440 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3441 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3442 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3443 \DWCFAlouser&0&0x1c & & \\
3444 \DWCFAhiuser&0&\xiiif & & \\
3449 \section{Range List Entries for Non-contiguous Address Ranges}
3450 \label{datarep:noncontiguousaddressranges}
3453 Each entry in a \addtoindex{range list}
3454 (see Section \refersec{chap:noncontiguousaddressranges})
3456 \addtoindexx{base address selection entry!in range list}
3458 \addtoindexx{range list}
3459 a base address selection entry, or an end-of-list entry.
3462 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
3463 that follows. The encodings for these constants are given in
3464 Table \refersec{tab:rnglistsentryencodingvalues}.
3469 \setlength{\extrarowheight}{0.1cm}
3470 \begin{longtable}{l|c}
3471 \caption{Range list entry encoding values}
3472 \label{tab:rnglistsentryencodingvalues} \\
3473 \hline \bfseries Range list entry encoding name&\bfseries Value \\ \hline
3475 \bfseries Range list entry encoding name&\bfseries Value\\ \hline
3477 \hline \emph{Continued on next page}
3480 \ddag New in \DWARFVersionV
3483 \DWRLEendoflist~\ddag & 0x00 \\
3484 \DWRLEbaseaddressx~\ddag & 0x01 \\
3485 \DWRLEstartxendx~\ddag & 0x02 \\
3486 \DWRLEstartxlength~\ddag & 0x03 \\
3487 \DWRLEoffsetpair~\ddag & 0x04 \\
3488 \DWRLEbaseaddress~\ddag & 0x05 \\
3489 \DWRLEstartend~\ddag & 0x06 \\
3490 \DWRLEstartlength~\ddag & 0x07
3495 For a \addtoindex{range list} to be specified, the base address of the
3496 \addtoindexx{base address selection entry!in range list}
3497 corresponding compilation unit must be defined
3498 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3501 \section{String Offsets Table}
3502 \label{chap:stringoffsetstable}
3503 Each set of entries in the string offsets table contained in the
3504 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3505 section begins with a header containing:
3506 \begin{enumerate}[1. ]
3507 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3508 \addttindexx{unit\_length}
3509 A 4-byte or 12-byte length containing the length of
3510 the set of entries for this compilation unit, not
3511 including the length field itself. In the 32-bit
3512 DWARF format, this is a 4-byte unsigned integer
3513 (which must be less than \xfffffffzero); in the 64-bit
3514 DWARF format, this consists of the 4-byte value
3515 \wffffffff followed by an 8-byte unsigned integer
3516 that gives the actual length (see
3517 Section \refersec{datarep:32bitand64bitdwarfformats}).
3520 \item \texttt{version} (\HFTuhalf) \\
3521 \addtoindexx{version number!string offsets table}
3522 A 2-byte version identifier containing the value
3523 \versiondotdebugstroffsets{}.
3525 \item \textit{padding} (\HFTuhalf) \\
3526 Reserved to DWARF (must be zero).
3529 This header is followed by a series of string table offsets
3530 that have the same representation as \DWFORMstrp.
3531 For the 32-bit DWARF format, each offset is 4 bytes long; for
3532 the 64-bit DWARF format, each offset is 8 bytes long.
3534 The \DWATstroffsetsbase{} attribute points to the first
3535 entry following the header. The entries are indexed
3536 sequentially from this base entry, starting from 0.
3538 \section{Address Table}
3539 \label{chap:addresstable}
3540 Each set of entries in the address table contained in the
3541 \dotdebugaddr{} section begins with a header containing:
3542 \begin{enumerate}[1. ]
3543 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3544 \addttindexx{unit\_length}
3545 A 4-byte or 12-byte length containing the length of
3546 the set of entries for this compilation unit, not
3547 including the length field itself. In the 32-bit
3548 DWARF format, this is a 4-byte unsigned integer
3549 (which must be less than \xfffffffzero); in the 64-bit
3550 DWARF format, this consists of the 4-byte value
3551 \wffffffff followed by an 8-byte unsigned integer
3552 that gives the actual length (see
3553 Section \refersec{datarep:32bitand64bitdwarfformats}).
3556 \item \texttt{version} (\HFTuhalf) \\
3557 \addtoindexx{version number!address table}
3558 A 2-byte version identifier containing the value
3559 \versiondotdebugaddr{}.
3562 \item \texttt{address\_size} (\HFTubyte) \\
3563 A 1-byte unsigned integer containing the size in
3564 bytes of an address (or the offset portion of an
3565 address for segmented addressing) on the target
3569 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3570 A 1-byte unsigned integer containing the size in
3571 bytes of a segment selector on the target system.
3574 This header is followed by a series of segment/address pairs.
3575 The segment size is given by the \HFNsegmentselectorsize{} field of the
3576 header, and the address size is given by the \addttindex{address\_size}
3577 field of the header. If the \HFNsegmentselectorsize{} field in the header
3578 is zero, the entries consist only of an addresses.
3580 The \DWATaddrbase{} attribute points to the first entry
3581 following the header. The entries are indexed sequentially
3582 from this base entry, starting from 0.
3585 \section{Range List Table}
3586 \label{app:ranglisttable}
3588 Each \dotdebugrnglists{} and \dotdebugrnglistsdwo{} section
3590 begins with a header containing:
3591 \begin{enumerate}[1. ]
3592 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3593 \addttindexx{unit\_length}
3594 A 4-byte or 12-byte length containing the length of
3595 the set of entries for this compilation unit, not
3596 including the length field itself. In the 32-bit
3597 DWARF format, this is a 4-byte unsigned integer
3598 (which must be less than \xfffffffzero); in the 64-bit
3599 DWARF format, this consists of the 4-byte value
3600 \wffffffff followed by an 8-byte unsigned integer
3601 that gives the actual length (see
3602 Section \refersec{datarep:32bitand64bitdwarfformats}).
3605 \item \texttt{version} (\HFTuhalf) \\
3606 \addtoindexx{version number!range list table}
3607 A 2-byte version identifier containing the value
3608 \versiondotdebugrnglists{}.
3611 \item \texttt{address\_size} (\HFTubyte) \\
3612 A 1-byte unsigned integer containing the size in
3613 bytes of an address (or the offset portion of an
3614 address for segmented addressing) on the target
3618 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3619 A 1-byte unsigned integer containing the size in
3620 bytes of a segment selector on the target system.
3623 \item \HFNoffsetentrycount{} (\HFTuword) \\
3624 A 4-byte count of the number of offsets
3625 that follow the header.
3630 Immediately following the header is an array of offsets.
3631 This array is followed by a series of range lists.
3633 There is one offset for each range list. The contents
3634 of the $i$\textsuperscript{th} offset is the offset from the
3635 beginning of the offset array to the location of the
3636 $i$\textsuperscript{th} range list. Range lists are
3637 described in Section \refersec{chap:noncontiguousaddressranges}.
3640 The segment size is given by the
3641 \HFNsegmentselectorsize{} field of the header, and the address size is
3642 given by the \addttindex{address\_size} field of the header. If the
3643 \HFNsegmentselectorsize{} field in the header is zero, the segment
3644 selector is omitted from the range list entries.
3647 The \DWATrnglistsbase{} attribute points to the first offset
3648 following the header. The range lists are referenced
3649 by the index of the position of their corresponding offset in the
3650 array of offsets, which indirectly specifies the offset to the
3655 \section{Location List Table}
3656 \label{datarep:locationlisttable}
3658 Each \dotdebugloclists{} or \dotdebugloclistsdwo{} section
3660 begins with a header containing:
3661 \begin{enumerate}[1. ]
3662 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3663 \addttindexx{unit\_length}
3664 A 4-byte or 12-byte length containing the length of
3665 the set of entries for this compilation unit, not
3666 including the length field itself. In the 32-bit
3667 DWARF format, this is a 4-byte unsigned integer
3668 (which must be less than \xfffffffzero); in the 64-bit
3669 DWARF format, this consists of the 4-byte value
3670 \wffffffff followed by an 8-byte unsigned integer
3671 that gives the actual length (see
3672 Section \refersec{datarep:32bitand64bitdwarfformats}).
3675 \item \texttt{version} (\HFTuhalf) \\
3676 \addtoindexx{version number!location list table}
3677 A 2-byte version identifier containing the value
3678 \versiondotdebugloclists{}.
3681 \item \texttt{address\_size} (\HFTubyte) \\
3682 A 1-byte unsigned integer containing the size in
3683 bytes of an address (or the offset portion of an
3684 address for segmented addressing) on the target
3688 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3689 A 1-byte unsigned integer containing the size in
3690 bytes of a segment selector on the target system.
3693 \item \HFNoffsetentrycount{} (\HFTuword) \\
3694 A 4-byte count of the number of offsets
3695 that follow the header.
3700 Immediately following the header is an array of offsets.
3701 This array is followed by a series of location lists.
3703 There is one offset for each location list. The contents
3704 of the $i$\textsuperscript{th} offset is the offset from the
3705 beginning of the offset array to the location of the
3706 $i$\textsuperscript{th} location list. Location lists are
3707 described in Section \refersec{chap:locationlists}.
3710 The segment size is given by the
3711 \HFNsegmentselectorsize{} field of the header, and the address size is
3712 given by the \HFNaddresssize{} field of the header. If the
3713 \HFNsegmentselectorsize{} field in the header is zero, the segment
3714 selector is omitted from location list entries.
3717 The \DWATloclistsbase{} attribute points to the first offset
3718 following the header. The location lists are referenced
3719 by the index of the position of their corresponding offset in the
3720 array of offsets, which indirectly specifies the offset to the
3725 \section{Dependencies and Constraints}
3726 \label{datarep:dependenciesandconstraints}
3727 The debugging information in this format is intended to
3728 exist in sections of an object file, or an equivalent
3729 separate file or database, having names beginning with
3730 the prefix ".debug\_" (see Appendix
3731 \refersec{app:dwarfsectionversionnumbersinformative}
3732 for a complete list of such names).
3733 Except as specifically specified, this information is not
3734 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3737 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3738 32-bit addresses, an assembler or compiler must provide a way
3739 to produce 2-byte and 4-byte quantities without alignment
3740 restrictions, and the linker must be able to relocate a
3742 \addtoindexx{section offset!alignment of}
3743 section offset that occurs at an arbitrary
3746 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3747 64-bit addresses, an assembler or compiler must provide a
3748 way to produce 2-byte, 4-byte and 8-byte quantities without
3749 alignment restrictions, and the linker must be able to relocate
3750 an 8-byte address or 4-byte
3751 \addtoindexx{section offset!alignment of}
3752 section offset that occurs at an
3753 arbitrary alignment.
3755 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3756 32-bit addresses, an assembler or compiler must provide a
3757 way to produce 2-byte, 4-byte and 8-byte quantities without
3758 alignment restrictions, and the linker must be able to relocate
3759 a 4-byte address or 8-byte
3760 \addtoindexx{section offset!alignment of}
3761 section offset that occurs at an
3762 arbitrary alignment.
3764 \textit{It is expected that this will be required only for very large
3765 32-bit programs or by those architectures which support
3766 a mix of 32-bit and 64-bit code and data within the same
3769 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3770 64-bit addresses, an assembler or compiler must provide a
3771 way to produce 2-byte, 4-byte and 8-byte quantities without
3772 alignment restrictions, and the linker must be able to
3773 relocate an 8-byte address or
3774 \addtoindexx{section offset!alignment of}
3775 section offset that occurs at
3776 an arbitrary alignment.
3780 \section{Integer Representation Names}
3781 \label{datarep:integerrepresentationnames}
3782 The sizes of the integers used in the lookup by name, lookup
3783 by address, line number, call frame information and other sections
3785 Table \ref{tab:integerrepresentationnames}.
3789 \setlength{\extrarowheight}{0.1cm}
3790 \begin{longtable}{c|l}
3791 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3792 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3794 \bfseries Representation name&\bfseries Representation\\ \hline
3796 \hline \emph{Continued on next page}
3801 \HFTsbyte& signed, 1-byte integer \\
3802 \HFTubyte&unsigned, 1-byte integer \\
3803 \HFTuhalf&unsigned, 2-byte integer \\
3804 \HFTuword&unsigned, 4-byte integer \\
3810 \section{Type Signature Computation}
3811 \label{datarep:typesignaturecomputation}
3813 A \addtoindex{type signature} is used by a DWARF consumer
3814 to resolve type references to the type definitions that
3815 are contained in \addtoindex{type unit}s (see Section
3816 \refersec{chap:typeunitentries}).
3818 \textit{A type signature is computed only by a DWARF producer;
3819 \addtoindexx{type signature!computation} a consumer need
3820 only compare two type signatures to check for equality.}
3823 The type signature for a type T0 is formed from the
3824 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3825 R.L. Rivest, RFC 1321, April 1992}
3826 digest of a flattened description of the type. The flattened
3827 description of the type is a byte sequence derived from the
3828 DWARF encoding of the type as follows:
3829 \begin{enumerate}[1. ]
3831 \item Start with an empty sequence S and a list V of visited
3832 types, where V is initialized to a list containing the type
3833 T0 as its single element. Elements in V are indexed from 1,
3836 \item If the debugging information entry represents a type that
3837 is nested inside another type or a namespace, append to S
3838 the type\textquoteright s context as follows: For each surrounding type
3839 or namespace, beginning with the outermost such construct,
3840 append the letter 'C', the DWARF tag of the construct, and
3841 the name (taken from
3842 \addtoindexx{name attribute}
3843 the \DWATname{} attribute) of the type
3844 \addtoindexx{name attribute}
3845 or namespace (including its trailing null byte).
3847 \item Append to S the letter 'D', followed by the DWARF tag of
3848 the debugging information entry.
3850 \item For each of the attributes in
3851 Table \refersec{tab:attributesusedintypesignaturecomputation}
3853 the debugging information entry, in the order listed,
3854 append to S a marker letter (see below), the DWARF attribute
3855 code, and the attribute value.
3858 \caption{Attributes used in type signature computation}
3859 \label{tab:attributesusedintypesignaturecomputation}
3860 \simplerule[\textwidth]
3862 \autocols[0pt]{c}{2}{l}{
3878 \DWATcontainingtype,
3882 \DWATdatamemberlocation,
3903 \DWATrvaluereference,
3907 \DWATstringlengthbitsize,
3908 \DWATstringlengthbytesize,
3913 \DWATvariableparameter,
3916 \DWATvtableelemlocation
3919 \simplerule[\textwidth]
3922 Note that except for the initial
3923 \DWATname{} attribute,
3924 \addtoindexx{name attribute}
3925 attributes are appended in order according to the alphabetical
3926 spelling of their identifier.
3929 If an implementation defines any vendor-specific attributes,
3930 any such attributes that are essential to the definition of
3931 the type are also included at the end of the above list,
3932 in their own alphabetical suborder.
3934 An attribute that refers to another type entry T is processed
3936 \begin{enumerate}[ a)]
3938 If T is in the list V at some V[x], use the
3939 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3940 encoding of x as the attribute value.
3943 Otherwise, append type T to the list V, then
3945 as the marker, process the type T recursively by performing
3946 Steps 2 through 7, and use the result as the attribute value.
3950 Other attribute values use the letter 'A' as the marker, and
3951 the value consists of the form code (encoded as an unsigned
3952 LEB128 value) followed by the encoding of the value according
3953 to the form code. To ensure reproducibility of the signature,
3954 the set of forms used in the signature computation is limited
3962 \item If the tag in Step 3 is one of \DWTAGpointertype,
3963 \DWTAGreferencetype,
3964 \DWTAGrvaluereferencetype,
3965 \DWTAGptrtomembertype,
3966 or \DWTAGfriend, and the referenced
3967 type (via the \DWATtype{} or
3968 \DWATfriend{} attribute) has a
3969 \DWATname{} attribute, append to S the letter 'N', the DWARF
3970 attribute code (\DWATtype{} or
3971 \DWATfriend), the context of
3972 the type (according to the method in Step 2), the letter 'E',
3973 and the name of the type. For \DWTAGfriend, if the referenced
3974 entry is a \DWTAGsubprogram, the context is omitted and the
3975 name to be used is the ABI-specific name of the subprogram
3976 (for example, the mangled linker name).
3979 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3980 \DWTAGreferencetype,
3981 \DWTAGrvaluereferencetype,
3982 \DWTAGptrtomembertype, or
3983 \DWTAGfriend, but has
3984 a \DWATtype{} attribute, or if the referenced type (via
3986 \DWATfriend{} attribute) does not have a
3987 \DWATname{} attribute, the attribute is processed according to
3988 the method in Step 4 for an attribute that refers to another
3992 \item Visit each child C of the debugging information
3993 entry as follows: If C is a nested type entry or a member
3994 function entry, and has
3995 a \DWATname{} attribute, append to
3996 \addtoindexx{name attribute}
3997 S the letter 'S', the tag of C, and its name; otherwise,
3998 process C recursively by performing Steps 3 through 7,
3999 appending the result to S. Following the last child (or if
4000 there are no children), append a zero byte.
4005 For the purposes of this algorithm, if a debugging information
4007 \DWATspecification{}
4008 attribute that refers to
4009 another entry D (which has a
4012 then S inherits the attributes and children of D, and S is
4013 processed as if those attributes and children were present in
4014 the entry S. Exception: if a particular attribute is found in
4015 both S and D, the attribute in S is used and the corresponding
4016 one in D is ignored.
4019 DWARF tag and attribute codes are appended to the sequence
4020 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
4021 using the values defined earlier in this chapter.
4023 \textit{A grammar describing this computation may be found in
4024 Appendix \refersec{app:typesignaturecomputationgrammar}.
4027 \textit{An attribute that refers to another type entry is
4028 recursively processed or replaced with the name of the
4029 referent (in Step 4, 5 or 6). If neither treatment applies to
4030 an attribute that references another type entry, the entry
4031 that contains that attribute is not suitable for a
4032 separate \addtoindex{type unit}.}
4034 \textit{If a debugging information entry contains an attribute from
4035 the list above that would require an unsupported form, that
4036 entry is not suitable for a separate
4037 \addtoindex{type unit}.}
4039 \textit{A type is suitable for a separate
4040 \addtoindex{type unit} only
4041 if all of the type entries that it contains or refers to in
4042 Steps 6 and 7 are themselves suitable for a separate
4043 \addtoindex{type unit}.}
4047 \textit{Where the DWARF producer may reasonably choose two or
4048 more different forms for a given attribute, it should choose
4049 the simplest possible form in computing the signature. (For
4050 example, a constant value should be preferred to a location
4051 expression when possible.)}
4054 Once the string S has been formed from the DWARF encoding,
4055 an 16-byte \MDfive{} digest is computed for the string and the
4056 last eight bytes are taken as the type signature.
4058 \textit{The string S is intended to be a flattened representation of
4059 the type that uniquely identifies that type (that is, a different
4060 type is highly unlikely to produce the same string).}
4063 \textit{A debugging information entry is not be placed in a
4064 separate \addtoindex{type unit}
4065 if any of the following apply:}
4069 \item \textit{The entry has an attribute whose value is a location
4070 description, and the location description
4071 contains a reference to
4072 another debugging information entry (for example, a \DWOPcallref{}
4073 operator), as it is unlikely that the entry will remain
4074 identical across compilation units.}
4076 \item \textit{The entry has an attribute whose value refers
4077 to a code location or a \addtoindex{location list}.}
4079 \item \textit{The entry has an attribute whose value refers
4080 to another debugging information entry that does not represent
4086 \textit{Certain attributes are not included in the type signature:}
4089 \item \textit{The \DWATdeclaration{} attribute is not included because it
4090 indicates that the debugging information entry represents an
4091 incomplete declaration, and incomplete declarations should
4093 \addtoindexx{type unit}
4094 separate type units.}
4096 \item \textit{The \DWATdescription{} attribute is not included because
4097 it does not provide any information unique to the defining
4098 declaration of the type.}
4100 \item \textit{The \DWATdeclfile,
4102 \DWATdeclcolumn{} attributes are not included because they
4103 may vary from one source file to the next, and would prevent
4104 two otherwise identical type declarations from producing the
4105 same \MDfive{} digest.}
4107 \item \textit{The \DWATobjectpointer{} attribute is not included
4108 because the information it provides is not necessary for the
4109 computation of a unique type signature.}
4113 \textit{Nested types and some types referred to by a debugging
4114 information entry are encoded by name rather than by recursively
4115 encoding the type to allow for cases where a complete definition
4116 of the type might not be available in all compilation units.}
4119 \textit{If a type definition contains the definition of a member function,
4120 it cannot be moved as is into a type unit, because the member function
4121 contains attributes that are unique to that compilation unit.
4122 Such a type definition can be moved to a type unit by rewriting the
4123 debugging information entry tree,
4124 moving the member function declaration into a separate declaration tree,
4125 and replacing the function definition in the type with a non-defining
4126 declaration of the function (as if the function had been defined out of
4129 An example that illustrates the computation of an \MDfive{} digest may be found in
4130 Appendix \refersec{app:usingtypeunits}.
4132 \section{Name Table Hash Function}
4133 \label{datarep:nametablehashfunction}
4134 The hash function used for hashing name strings in the accelerated
4135 access name index table (see Section \refersec{chap:acceleratedaccess})
4136 is defined in \addtoindex{C} as shown in
4137 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnoteRR{
4138 This hash function is sometimes known as the
4139 "\addtoindex{Bernstein hash function}" or the
4140 "\addtoindex{DJB hash function}"
4142 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
4143 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
4148 uint32_t /* must be a 32-bit integer type */
4149 hash(unsigned char *str)
4151 uint32_t hash = 5381;
4155 hash = hash * 33 + c;
4161 \caption{Name Table Hash Function Definition}
4162 \label{fig:nametablehashfunctiondefinition}