1 \chapter{Data Representation}
2 \label{datarep:datarepresentation}
4 This section describes the binary representation of the
5 debugging information entry itself, of the attribute types
6 and of other fundamental elements described above.
8 \section{Vendor Extensibility}
9 \label{datarep:vendorextensibility}
10 \addtoindexx{vendor extensibility}
11 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
14 \addtoindexx{extensibility|see{vendor extensibility}}
15 reserve a portion of the DWARF name space and ranges of
16 enumeration values for use for vendor specific extensions,
17 special labels are reserved for tag names, attribute names,
18 base type encodings, location operations, language names,
19 calling conventions and call frame instructions.
21 The labels denoting the beginning and end of the
22 \hypertarget{chap:DWXXXlohiuser}{reserved value range}
23 for vendor specific extensions consist of the
25 (\DWATlouserMARK{}\DWAThiuserMARK{}DW\_AT,
26 \DWATElouserMARK{}\DWATEhiuserMARK{}DW\_ATE,
27 \DWCClouserMARK{}\DWCChiuserMARK{}DW\_CC,
28 \DWCFAlouserMARK{}\DWCFAhiuserMARK{}DW\_CFA,
29 \DWENDlouserMARK{}\DWENDhiuserMARK{}DW\_END,
30 \DWIDXlouserMARK{}\DWIDXhiuserMARK{}DW\_IDX,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{}DW\_LANG,
32 \DWLNCTlouserMARK{}\DWLNCThiuserMARK{}DW\_LNCT,
33 \DWLNElouserMARK{}\DWLNEhiuserMARK{}DW\_LNE,
34 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
35 \DWOPlouserMARK{}\DWOPhiuserMARK{}DW\_OP or
36 \DWTAGlouserMARK{}\DWTAGhiuserMARK{}DW\_TAG)
37 followed by \_lo\_user or \_hi\_user.
38 Values in the range between \textit{prefix}\_lo\_user
39 and \textit{prefix}\_hi\_user inclusive,
40 are reserved for vendor specific extensions. Vendors may
41 use values in this range without conflicting with current or
42 future system\dash defined values. All other values are reserved
43 for use by the system.
45 \textit{For example, for debugging information entry
46 tags, the special labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
48 \textit{There may also be codes for vendor specific extensions
49 between the number of standard line number opcodes and
50 the first special line number opcode. However, since the
51 number of standard opcodes varies with the DWARF version,
52 the range for extensions is also version dependent. Thus,
53 \DWLNSlouserTARG{} and
54 \DWLNShiuserTARG{} symbols are not defined.}
56 Vendor defined tags, attributes, base type encodings, location
57 atoms, language names, line number actions, calling conventions
58 and call frame instructions, conventionally use the form
59 \text{prefix\_vendor\_id\_name}, where
60 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
61 character sequence chosen so as to avoid conflicts with
64 To ensure that extensions added by one vendor may be safely
65 ignored by consumers that do not understand those extensions,
66 the following rules must be followed:
67 \begin{enumerate}[1. ]
69 \item New attributes are added in such a way that a
70 debugger may recognize the format of a new attribute value
71 without knowing the content of that attribute value.
73 \item The semantics of any new attributes do not alter
74 the semantics of previously existing attributes.
76 \item The semantics of any new tags do not conflict with
77 the semantics of previously existing tags.
79 \item New forms of attribute value are not added.
84 \section{Reserved Values}
85 \label{datarep:reservedvalues}
86 \subsection{Error Values}
87 \label{datarep:errorvalues}
88 \addtoindexx{reserved values!error}
91 \addtoindexx{error value}
92 a convenience for consumers of DWARF information, the value
93 0 is reserved in the encodings for attribute names, attribute
94 forms, base type encodings, location operations, languages,
95 line number program opcodes, macro information entries and tag
96 names to represent an error condition or unknown value. DWARF
97 does not specify names for these reserved values, because they
98 do not represent valid encodings for the given type and do
99 not appear in DWARF debugging information.
102 \subsection{Initial Length Values}
103 \label{datarep:initiallengthvalues}
104 \addtoindexx{reserved values!initial length}
106 An \livetarg{datarep:initiallengthvalues}{initial length} field
107 \addtoindexx{initial length field|see{initial length}}
108 is one of the fields that occur at the beginning
109 of those DWARF sections that have a header
119 that occurs at the beginning of the CIE and FDE structures
120 in the \dotdebugframe{} section.
123 In an \addtoindex{initial length} field, the values \wfffffffzero through
124 \wffffffff are reserved by DWARF to indicate some form of
125 extension relative to \DWARFVersionII; such values must not
126 be interpreted as a length field. The use of one such value,
127 \xffffffff, is defined in
128 Section \refersec{datarep:32bitand64bitdwarfformats});
130 the other values is reserved for possible future extensions.
133 \section{Relocatable, Split, Executable, Shared and Package Object Files}
134 \label{datarep:executableobjectsandsharedobjects}
136 \subsection{Relocatable Object Files}
137 \label{datarep:relocatableobjectfiles}
138 A DWARF producer (for example, a compiler) typically generates its
139 debugging information as part of a relocatable object file.
140 Relocatable object files are then combined by a linker to form an
141 executable file. During the linking process, the linker resolves
142 (binds) symbolic references between the various object files, and
143 relocates the contents of each object file into a combined virtual
146 The DWARF debugging information is placed in several sections (see
147 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
148 requires an object file format capable of
149 representing these separate sections. There are symbolic references
150 between these sections, and also between the debugging information
151 sections and the other sections that contain the text and data of the
152 program itself. Many of these references require relocation, and the
153 producer must emit the relocation information appropriate to the
154 object file format and the target processor architecture. These
155 references include the following:
158 \item The compilation unit header (see Section
159 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
160 section contains a reference to the \dotdebugabbrev{} table. This
161 reference requires a relocation so that after linking, it refers to
162 that contribution to the combined \dotdebugabbrev{} section in the
165 \item Debugging information entries may have attributes with the form
166 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
167 These attributes represent locations
168 within the virtual address space of the program, and require
171 \item A DWARF expression may contain a \DWOPaddr{} (see Section
172 \refersec{chap:literalencodings}) which contains a location within
173 the virtual address space of the program, and require relocation.
176 \item Debugging information entries may have attributes with the form
177 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
178 These attributes refer to
179 debugging information in other debugging information sections within
180 the object file, and must be relocated during the linking process.
184 \item Debugging information entries may have attributes with the form
185 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
186 These attributes refer to
187 debugging information entries that may be outside the current
188 compilation unit. These values require both symbolic binding and
191 \item Debugging information entries may have attributes with the form
192 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
193 These attributes refer to strings in
194 the \dotdebugstr{} section. These values require relocation.
196 \item Entries in the \dotdebugaddr{}
198 and \dotdebugaranges{}
199 sections may contain references to locations within the virtual address
200 space of the program, and thus require relocation.
203 \item Entries in the \dotdebugloclists{} and \dotdebugrnglists{} sections may
204 contain references to locations within the virtual address space of the
205 program depending on whether certain kinds of location or range
206 list entries are used, and thus require relocation.
209 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
210 opcode is a reference to a location within the virtual address space
211 of the program, and requires relocation.
213 \item The \dotdebugstroffsets{} section contains a list of string offsets,
214 each of which is an offset of a string in the \dotdebugstr{} section. Each
215 of these offsets requires relocation. Depending on the implementation,
216 these relocations may be implicit (that is, the producer may not need to
217 emit any explicit relocation information for these offsets).
219 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges{} header and
220 the list of compilation units following the \dotdebugnames{} header contain
221 references to the \dotdebuginfo{} section. These references require relocation
222 so that after linking they refer to the correct contribution in the combined
223 \dotdebuginfo{} section in the executable file.
225 \item Frame descriptor entries in the \dotdebugframe{} section
226 (see Section \refersec{chap:structureofcallframeinformation}) contain an
227 \HFNinitiallocation{} field value within the virtual address
228 space of the program and require relocation.
233 \textit{Note that operands of classes
235 \CLASSflag{} do not require relocation. Attribute operands that use
236 forms \DWFORMstring{},
237 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
238 \DWFORMrefudata{} also do not need relocation.}
240 \subsection{Split DWARF Object Files}
241 \label{datarep:splitdwarfobjectfiles}
242 \addtoindexx{split DWARF object file}
243 A DWARF producer may partition the debugging
244 information such that the majority of the debugging
245 information can remain in individual object files without
246 being processed by the linker.
248 \textit{This reduces link time by reducing the amount of information
249 the linker must process.}
252 \subsubsection{First Partition (with Skeleton Unit)}
253 The first partition contains
254 debugging information that must still be processed by the linker,
255 and includes the following:
258 The line number tables,
261 accelerated access tables, in the usual sections:
262 \dotdebugline, \dotdebuglinestr,
263 \dotdebugframe, \dotdebugnames{} and \dotdebugaranges,
267 An address table, in the \dotdebugaddr{} section. This table
268 contains all addresses and constants that require
269 link-time relocation, and items in the table can be
270 referenced indirectly from the debugging information via
271 the \DWFORMaddrx{} form,
273 by the \DWOPaddrx{} and \DWOPconstx{} operators, and
274 by certain of the \texttt{DW\_LLE\_*} location list
275 and \texttt{DW\_RLE\_*} range list entries.
278 A skeleton compilation unit, as described in Section
279 \refersec{chap:skeletoncompilationunitentries},
280 in the \dotdebuginfo{} section.
282 An abbreviations table for the skeleton compilation unit,
283 in the \dotdebugabbrev{} section
285 used by the \dotdebuginfo{} section.
289 A string table, in the \dotdebugstr{} section. The string
290 table is necessary only if the skeleton compilation unit
291 uses either indirect string form, \DWFORMstrp{} or
294 A string offsets table, in the \dotdebugstroffsets{}
297 for strings in the \dotdebugstr{} section.
299 The string offsets table is necessary only if
300 the skeleton compilation unit uses the \DWFORMstrx{} form.
302 The attributes contained in the skeleton compilation
303 unit can be used by a DWARF consumer to find the
304 DWARF object file that contains the second partition.
306 \subsubsection{Second Partition (Unlinked or in a \texttt{.dwo} File)}
307 The second partition contains the debugging information that
308 does not need to be processed by the linker. These sections
309 may be left in the object files and ignored by the linker
310 (that is, not combined and copied to the executable object file), or
311 they may be placed by the producer in a separate DWARF object
312 file. This partition includes the following:
315 The full compilation unit, in the \dotdebuginfodwo{} section.
317 Attributes contained in the full compilation unit
318 may refer to machine addresses indirectly using the \DWFORMaddrx{}
319 form, which accesses the table of addresses specified by the
320 \DWATaddrbase{} attribute in the associated skeleton unit.
321 Location descriptions may similarly do so using the \DWOPaddrx{} and
322 \DWOPconstx{} operations.
326 \item Separate type units, in the \dotdebuginfodwo{} section.
329 Abbreviations table(s) for the compilation unit and type
330 units, in the \dotdebugabbrevdwo{} section
332 used by the \dotdebuginfodwo{} section.
335 \item Location lists, in the
337 \dotdebugloclistsdwo{} section.
341 \item Range lists, in the \dotdebugrnglistsdwo{} section.
345 A \addtoindex{specialized line number table} (for the type units),
346 in the \dotdebuglinedwo{} section.
349 contains only the directory and filename lists needed to
350 interpret \DWATdeclfile{} attributes in the debugging
353 \item Macro information, in the \dotdebugmacrodwo{} section.
355 \item A string table, in the \dotdebugstrdwo{} section.
357 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
360 for the strings in the \dotdebugstrdwo{} section.
364 Except where noted otherwise, all references in this document
365 to a debugging information section (for example, \dotdebuginfo),
366 apply also to the corresponding split DWARF section (for example,
370 Split DWARF object files do not get linked with any other files,
371 therefore references between sections must not make use of
372 normal object file relocation information. As a result, symbolic
373 references within or between sections are not possible.
375 \subsection{Executable Objects}
376 \label{chap:executableobjects}
377 The relocated addresses in the debugging information for an
378 executable object are virtual addresses.
380 The sections containing the debugging information are typically
381 not loaded as part of the memory image of the program (in ELF
382 terminology, the sections are not "allocatable" and are not part
383 of a loadable segment). Therefore, the debugging information
384 sections described in this document are typically linked as if
385 they were each to be loaded at virtual address 0, and references
386 within the debugging information always implicitly indicate which
387 section a particular offset refers to. (For example, a reference
388 of form \DWFORMsecoffset{} may refer to one of several sections,
389 depending on the class allowed by a particular attribute of a
390 debugging information entry, as shown in
391 Table \refersec{tab:attributeencodings}.)
394 \subsection{Shared Object Files}
395 \label{datarep:sharedobjectfiles}
397 addresses in the debugging information for a shared object file
398 are offsets relative to the start of the lowest region of
399 memory loaded from that shared object file.
402 \textit{This requirement makes the debugging information for
403 shared object files position independent. Virtual addresses in a
404 shared object file may be calculated by adding the offset to the
405 base address at which the object file was attached. This offset
406 is available in the run\dash time linker\textquoteright s data structures.}
408 As with executable objects, the sections containing debugging
409 information are typically not loaded as part of the memory image
410 of the shared object, and are typically linked as if they were
411 each to be loaded at virtual address 0.
413 \subsection{DWARF Package Files}
414 \label{datarep:dwarfpackagefiles}
415 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
416 link, and debug an application quickly with less link-time overhead,
417 but a more convenient format is needed for saving the debug
418 information for later debugging of a deployed application. A
419 DWARF package file can be used to collect the debugging
420 information from the object (or separate DWARF object) files
421 produced during the compilation of an application.}
423 \textit{The package file is typically placed in the same directory as the
424 application, and is given the same name with a \doublequote{\texttt{.dwp}}
425 extension.\addtoindexx{\texttt{.dwp} file extension}}
428 A DWARF package file is itself an object file, using the
429 \addtoindexx{package files}
430 \addtoindexx{DWARF package files}
431 same object file format (including \byteorder) as the
432 corresponding application binary. It consists only of a file
433 header, a section table, a number of DWARF debug information
434 sections, and two index sections.
437 Each DWARF package file contains no more than one of each of the
438 following sections, copied from a set of object or DWARF object
439 files, and combined, section by section:
446 \dotdebugstroffsetsdwo
451 The string table section in \dotdebugstrdwo{} contains all the
452 strings referenced from DWARF attributes using the form
453 \DWFORMstrx. Any attribute in a compilation unit or a type
454 unit using this form refers to an entry in that unit's
455 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
456 provides the offset of a string in the \dotdebugstrdwo{}
459 The DWARF package file also contains two index sections that
460 provide a fast way to locate debug information by compilation
461 unit ID for compilation units, or by type
462 signature for type units:
468 \subsubsection{The Compilation Unit (CU) Index Section}
469 The \dotdebugcuindex{} section is a hashed lookup table that maps a
470 compilation unit ID to a set of contributions in the
471 various debug information sections. Each contribution is stored
472 as an offset within its corresponding section and a size.
474 Each \compunitset{} may contain contributions from the
477 \dotdebuginfodwo{} (required)
478 \dotdebugabbrevdwo{} (required)
482 \dotdebugstroffsetsdwo
486 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
487 information from \DWARFVersionIV{} or earlier formats.}
489 \subsubsection{The Type Unit (TU) Index Section}
490 The \dotdebugtuindex{} section is a hashed lookup table that maps a
491 type signature to a set of offsets in the various debug
492 information sections. Each contribution is stored as an offset
493 within its corresponding section and a size.
495 Each \typeunitset{} may contain contributions from the following
498 \dotdebuginfodwo{} (required)
499 \dotdebugabbrevdwo{} (required)
501 \dotdebugstroffsetsdwo
504 \subsubsection{Format of the CU and TU Index Sections}
505 Both index sections have the same format, and serve to map an
506 8-byte signature to a set of contributions to the debug sections.
507 Each index section begins with a header, followed by a hash table of
508 signatures, a parallel table of indexes, a table of offsets, and
509 a table of sizes. The index sections are aligned at 8-byte
510 boundaries in the DWARF package file.
513 The index section header contains the following fields:
514 \begin{enumerate}[1. ]
515 \item \texttt{version} (\HFTuhalf) \\
517 \addtoindexx{version number!CU index information}
518 \addtoindexx{version number!TU index information}
519 This number is specific to the CU and TU index information
520 and is independent of the DWARF version number.
522 The version number is \versiondotdebugcuindex.
524 \item \textit{padding} (\HFTuhalf) \\
525 Reserved to DWARF (must be zero).
526 \item \texttt{section\_count} (\HFTuword) \\
527 The number of entries in the table of section counts that follows.
528 For brevity, the contents of this field is referred to as $N$ below.
530 \item \texttt{unit\_count} (\HFTuword) \\
531 The number of compilation units or type units in the index.
532 For brevity, the contents of this field is referred to as $U$ below.
534 \item \texttt{slot\_count} (\HFTuword) \\
535 The number of slots in the hash table.
536 For brevity, the contents of this field is referred to as $S$ below.
540 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
542 The size of the hash table, $S$, must be $2^k$ such that:
543 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
545 The hash table begins at offset 16 in the section, and consists
546 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
548 % (using the \byteorder{} of the application binary).
550 The parallel table of indices begins immediately after the hash table
551 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
552 consists of an array of $S$ 4-byte slots,
553 % (using the byte order of the application binary),
554 corresponding 1-1 with slots in the hash
555 table. Each entry in the parallel table contains a row index into
556 the tables of offsets and sizes.
558 Unused slots in the hash table have 0 in both the hash table
559 entry and the parallel table entry. While 0 is a valid hash
560 value, the row index in a used slot will always be non-zero.
562 Given an 8-byte compilation unit ID or type signature $X$,
563 an entry in the hash table is located as follows:
564 \begin{enumerate}[1. ]
565 \item Define $REP(X)$ to be the value of $X$ interpreted as an
566 unsigned 64-bit integer in the target byte order.
567 \item Calculate a primary hash $H = REP(X)\ \&\ MASK(k)$, where
568 $MASK(k)$ is a mask with the low-order $k$ bits all set to 1.
569 \item Calculate a secondary hash $H' = (((REP(X)>>32)\ \&\ MASK(k))\ |\ 1)$.
570 \item If the hash table entry at index $H$ matches the signature, use
571 that entry. If the hash table entry at index $H$ is unused (all
572 zeroes), terminate the search: the signature is not present
574 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 4.
577 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
578 guaranteed to stop at an unused slot or find the match.
581 The table of offsets begins immediately following the parallel
582 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
584 This table consists of a single header row containing $N$ fields,
585 each a 4-byte unsigned integer, followed by $U$ data rows, each
586 also containing $N$ fields of 4-byte unsigned integers. The fields
587 in the header row provide a section identifier referring to a
588 debug section; the available section identifiers are shown in
589 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
590 Each data row corresponds to a specific CU
591 or TU in the package file. In the data rows, each field provides
592 an offset to the debug section whose identifier appears in the
593 corresponding field of the header row. The data rows are indexed
597 \textit{Not all sections listed in the table need be included.}
601 \setlength{\extrarowheight}{0.1cm}
602 \begin{longtable}{l|c|l}
603 \caption{DWARF package file section identifier \mbox{encodings}}
604 \label{tab:dwarfpackagefilesectionidentifierencodings}
605 \addtoindexx{DWARF package files!section identifier encodings} \\
606 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
608 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
610 \hline \emph{Continued on next page}
614 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
615 \textit{Reserved} & 2 & \\
616 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
617 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
619 \DWSECTLOCLISTSTARG & 5 & \dotdebugloclistsdwo
621 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
622 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
624 \DWSECTRNGLISTSTARG & 8 & \dotdebugrnglistsdwo
629 The offsets provided by the CU and TU index sections are the
630 base offsets for the contributions made by each CU or TU to the
631 corresponding section in the package file. Each CU and TU header
632 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
633 table for that CU or TU within the contribution to the
634 \dotdebugabbrevdwo{} section for that CU or TU, and are
635 interpreted as relative to the base offset given in the index
636 section. Likewise, offsets into \dotdebuglinedwo{} from
637 \DWATstmtlist{} attributes are interpreted as relative to
638 the base offset for \dotdebuglinedwo{}, and offsets into other debug
639 sections obtained from DWARF attributes are also
640 interpreted as relative to the corresponding base offset.
642 The table of sizes begins immediately following the table of
643 offsets, and provides the sizes of the contributions made by each
644 CU or TU to the corresponding section in the package file.
647 table consists of U data rows, each with N fields of 4-byte
648 unsigned integers. Each data row corresponds to the same CU or TU
649 as the corresponding data row in the table of offsets described
650 above. Within each data row, the N fields also correspond
651 one-to-one with the fields in the corresponding data row of the
652 table of offsets. Each field provides the size of the
653 contribution made by a CU or TU to the corresponding section in
657 For an example, see Figure \refersec{fig:examplecuindexsection}.
659 \subsection{DWARF Supplementary Object Files}
660 \label{datarep:dwarfsupplemetaryobjectfiles}
661 In order to minimize the size of debugging information,
662 it is possible to move duplicate debug information entries,
663 strings and macro entries from several executables or shared
664 object files into a separate
665 \addtoindexi{\textit{supplementary object file}}{supplementary object file}
666 by some post-linking utility; the moved entries and strings can
668 from the debugging information of each of those executable or
671 This facilitates distribution of separate consolidated debug files in
675 A DWARF \addtoindex{supplementary object file} is itself an object file,
676 using the same object
677 file format, \byteorder{}, and size as the corresponding application executables
678 or shared libraries. It consists only of a file header, section table, and
679 a number of DWARF debug information sections. Both the
680 \addtoindex{supplementary object file}
681 and all the executable or shared object files that reference entries or strings in that
682 file must contain a \dotdebugsup{} section that establishes the relationship.
684 The \dotdebugsup{} section contains:
685 \begin{enumerate}[1. ]
686 \item \texttt{version} (\HFTuhalf) \\
687 \addttindexx{version}
688 A 2-byte unsigned integer representing the version of the DWARF
689 information for the compilation unit.
691 The value in this field is \versiondotdebugsup.
693 \item \texttt{is\_supplementary} (\HFTubyte) \\
694 \addttindexx{is\_supplementary}
695 A 1-byte unsigned integer, which contains the value 1 if it is
696 in the \addtoindex{supplementary object file} that other executable or
697 shared object files refer to, or 0 if it is an executable or shared object
698 referring to a \addtoindex{supplementary object file}.
701 \item \texttt{sup\_filename} (null terminated filename string) \\
702 \addttindexx{sup\_filename}
703 If \addttindex{is\_supplementary} is 0, this contains either an absolute
704 filename for the \addtoindex{supplementary object file}, or a filename
705 relative to the object file containing the \dotdebugsup{} section.
706 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
707 is not needed and must be an empty string (a single null byte).
710 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
711 \addttindexx{sup\_checksum\_len}
712 Length of the following \addttindex{sup\_checksum} field;
713 this value can be 0 if no checksum is provided.
715 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
716 \addttindexx{sup\_checksum}
717 An implementation-defined integer constant value that
718 provides unique identification of the supplementary file.
722 Debug information entries that refer to an executable's or shared
723 object's addresses must \emph{not} be moved to supplementary files
724 (the addesses will likely not be the same). Similarly,
725 entries referenced from within location descriptions or using loclistsptr
726 form attributes must not be moved to a \addtoindex{supplementary object file}.
728 Executable or shared object file compilation units can use
729 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
730 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
731 attributes to refer to them and \DWFORMstrpsup{} form attributes to
732 refer to strings that are used by debug information of multiple
733 executables or shared object files. Within the \addtoindex{supplementary object file}'s
734 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
735 not used, and all reference forms referring to some other sections
736 refer to the local sections in the \addtoindex{supplementary object file}.
738 In macro information, \DWMACROdefinesup{} or
739 \DWMACROundefsup{} opcodes can refer to strings in the
740 \dotdebugstr{} section of the \addtoindex{supplementary object file},
741 or \DWMACROimportsup{}
742 can refer to \dotdebugmacro{} section entries. Within the
743 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
744 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
745 opcodes refer to the local \dotdebugstr{} section in that
746 supplementary file, not the one in
747 the executable or shared object file.
751 \section{32-Bit and 64-Bit DWARF Formats}
752 \label{datarep:32bitand64bitdwarfformats}
753 \hypertarget{datarep:xxbitdwffmt}{}
754 \addtoindexx{32-bit DWARF format}
755 \addtoindexx{64-bit DWARF format}
756 There are two closely-related DWARF
757 formats. In the 32-bit DWARF
758 format, all values that represent lengths of DWARF sections
759 and offsets relative to the beginning of DWARF sections are
760 represented using four bytes. In the 64-bit DWARF format, all
761 values that represent lengths of DWARF sections and offsets
762 relative to the beginning of DWARF sections are represented
763 using eight bytes. A special convention applies to the initial
764 length field of certain DWARF sections, as well as the CIE and
765 FDE structures, so that the 32-bit and 64-bit DWARF formats
766 can coexist and be distinguished within a single linked object.
768 Except where noted otherwise, all references in this document
769 to a debugging information section (for example, \dotdebuginfo),
770 apply also to the corresponding split DWARF section (for example,
773 The differences between the 32- and 64-bit DWARF formats are
774 detailed in the following:
775 \begin{enumerate}[1. ]
777 \item In the 32-bit DWARF format, an
778 \addtoindex{initial length} field (see
779 \addtoindexx{initial length!encoding}
780 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
781 is an unsigned 4-byte integer (which
782 must be less than \xfffffffzero); in the 64-bit DWARF format,
783 an \addtoindex{initial length} field is 12 bytes in size,
786 \item The first four bytes have the value \xffffffff.
788 \item The following eight bytes contain the actual length
789 represented as an unsigned 8-byte integer.
792 \textit{This representation allows a DWARF consumer to dynamically
793 detect that a DWARF section contribution is using the 64-bit
794 format and to adapt its processing accordingly.}
797 \item \hypertarget{datarep:sectionoffsetlength}{}
798 Section offset and section length
799 \addtoindexx{section length!use in headers}
801 \addtoindexx{section offset!use in headers}
802 in the headers of DWARF sections (other than initial length
803 \addtoindexx{initial length}
804 fields) are listed following. In the 32-bit DWARF format these
805 are 4-byte unsigned integer values; in the 64-bit DWARF format,
806 they are 8-byte unsigned integer values.
810 Section &Name & Role \\ \hline
811 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
812 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
813 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
814 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
815 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
816 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
822 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
823 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
824 union must be accessed to distinguish whether a CIE or FDE is
825 present, consequently, these two fields must exactly overlay
826 each other (both offset and size).
828 \item Within the body of the \dotdebuginfo{}
829 section, certain forms of attribute value depend on the choice
830 of DWARF format as follows. For the 32-bit DWARF format,
831 the value is a 4-byte unsigned integer; for the 64-bit DWARF
832 format, the value is an 8-byte unsigned integer.
834 \begin{tabular}{lp{6cm}}
835 Form & Role \\ \hline
836 \DWFORMlinestrp & offset in \dotdebuglinestr \\
837 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
838 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
839 \addtoindexx{supplementary object file}
840 \DWFORMsecoffset & offset in a section other than \\
841 & \dotdebuginfo{} or \dotdebugstr{} \\
842 \DWFORMstrp & offset in \dotdebugstr{} \\
843 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
844 \DWOPcallref & offset in \dotdebuginfo{} \\
849 \item Within the body of the \dotdebugline{} section, certain forms of content
850 description depend on the choice of DWARF format as follows: for the
851 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
852 64-bit DWARF format, the value is a 8-byte unsigned integer.
854 \begin{tabular}{lp{6cm}}
855 Form & Role \\ \hline
856 \DWFORMlinestrp & offset in \dotdebuglinestr
860 \item Within the body of the \dotdebugnames{}
861 sections, the representation of each entry in the array of
862 compilation units (CUs) and the array of local type units
863 (TUs), which represents an offset in the
865 section, depends on the DWARF format as follows: in the
866 32-bit DWARF format, each entry is a 4-byte unsigned integer;
867 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
870 \item In the body of the \dotdebugstroffsets{}
871 sections, the size of entries in the body depend on the DWARF
872 format as follows: in the 32-bit DWARF format, entries are 4-byte
873 unsigned integer values; in the 64-bit DWARF format, they are
874 8-byte unsigned integers.
876 \item In the body of the \dotdebugaddr{}
880 the contents of the address size fields depends on the
881 DWARF format as follows: in the 32-bit DWARF format, these fields
882 contain 4; in the 64-bit DWARF format these fields contain 8.
885 \item In the body of the \dotdebugloclists{} and \dotdebugrnglists{}
886 sections, the offsets the follow the header depend on the
887 DWARF format as follows: in the 32-bit DWARF format, offsets are 4-byte
888 unsigned integer values; in the 64-bit DWARF format, they are
889 8-byte unsigned integers.
895 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
896 intermixed within a single compilation unit.
898 \textit{Attribute values and section header fields that represent
899 addresses in the target program are not affected by these
902 A DWARF consumer that supports the 64-bit DWARF format must
903 support executables in which some compilation units use the
904 32-bit format and others use the 64-bit format provided that
905 the combination links correctly (that is, provided that there
906 are no link\dash time errors due to truncation or overflow). (An
907 implementation is not required to guarantee detection and
908 reporting of all such errors.)
910 \textit{It is expected that DWARF producing compilers will \emph{not} use
911 the 64-bit format \emph{by default}. In most cases, the division of
912 even very large applications into a number of executable and
913 shared object files will suffice to assure that the DWARF sections
914 within each individual linked object are less than 4 GBytes
915 in size. However, for those cases where needed, the 64-bit
916 format allows the unusual case to be handled as well. Even
917 in this case, it is expected that only application supplied
918 objects will need to be compiled using the 64-bit format;
919 separate 32-bit format versions of system supplied shared
920 executable libraries can still be used.}
923 \section{Format of Debugging Information}
924 \label{datarep:formatofdebugginginformation}
926 For each compilation unit compiled with a DWARF producer,
927 a contribution is made to the \dotdebuginfo{} section of
928 the object file. Each such contribution consists of a
929 compilation unit header
930 (see Section \refersec{datarep:compilationunitheader})
932 single \DWTAGcompileunit{} or
933 \DWTAGpartialunit{} debugging
934 information entry, together with its children.
936 For each type defined in a compilation unit, a separate
937 contribution may also be made to the
939 section of the object file. Each
940 such contribution consists of a
941 \addtoindex{type unit} header
942 (see Section \refersec{datarep:typeunitheaders})
943 followed by a \DWTAGtypeunit{} entry, together with
946 Each debugging information entry begins with a code that
947 represents an entry in a separate
948 \addtoindex{abbreviations table}. This
949 code is followed directly by a series of attribute values.
951 The appropriate entry in the
952 \addtoindex{abbreviations table} guides the
953 interpretation of the information contained directly in the
954 \dotdebuginfo{} section.
957 Multiple debugging information entries may share the same
958 abbreviation table entry. Each compilation unit is associated
959 with a particular abbreviation table, but multiple compilation
960 units may share the same table.
962 \subsection{Unit Headers}
963 \label{datarep:unitheaders}
964 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
965 compilation unit that follows. The encodings for the unit type
966 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
970 \setlength{\extrarowheight}{0.1cm}
971 \begin{longtable}{l|c}
972 \caption{Unit header unit type encodings}
973 \label{tab:unitheaderunitkindencodings}
974 \addtoindexx{unit header unit type encodings} \\
975 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
977 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
979 \hline \emph{Continued on next page}
981 \hline \ddag\ \textit{New in DWARF Version 5}
983 \DWUTcompileTARG~\ddag &0x01 \\
984 \DWUTtypeTARG~\ddag &0x02 \\
985 \DWUTpartialTARG~\ddag &0x03 \\
986 \DWUTskeletonTARG~\ddag &0x04 \\
987 \DWUTsplitcompileTARG~\ddag &0x05 \\
988 \DWUTsplittypeTARG~\ddag &0x06 \\
989 \DWUTlouserTARG~\ddag &0x80 \\
990 \DWUThiuserTARG~\ddag &\xff \\
995 \textit{All unit headers in a compilation have the same size.
996 Some header types include padding bytes to achieve this.}
999 \subsubsection{Compilation and Partial Unit Headers}
1000 \label{datarep:compilationunitheader}
1001 \begin{enumerate}[1. ]
1003 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1004 \addttindexx{unit\_length}
1006 \addtoindexx{initial length}
1007 unsigned integer representing the length
1008 of the \dotdebuginfo{} contribution for that compilation unit,
1009 not including the length field itself. In the \thirtytwobitdwarfformat,
1010 this is a 4-byte unsigned integer (which must be less
1011 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1012 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1013 integer that gives the actual length
1014 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1016 \item \texttt{version} (\HFTuhalf) \\
1017 \addttindexx{version}
1018 \addtoindexx{version number!compilation unit}
1019 A 2-byte unsigned integer representing the version of the
1020 DWARF information for the compilation unit.
1022 The value in this field is \versiondotdebuginfo.
1024 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1025 for a summary of all version numbers that apply to DWARF sections.}
1028 \item \texttt{unit\_type} (\HFTubyte) \\
1029 \addttindexx{unit\_type}
1030 A 1-byte unsigned integer identifying this unit as a compilation unit.
1031 The value of this field is
1032 \DWUTcompile{} for a full compilation unit or
1033 \DWUTpartial{} for a partial compilation unit
1034 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
1036 \textit{This field is new in \DWARFVersionV.}
1039 \item \texttt{address\_size} (\HFTubyte) \\
1040 \addttindexx{address\_size}
1041 A 1-byte unsigned integer representing the size in bytes of
1042 an address on the target architecture. If the system uses
1043 \addtoindexx{address space!segmented}
1044 segmented addressing, this value represents the size of the
1045 offset portion of an address.
1047 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1049 \addtoindexx{section offset!in .debug\_info header}
1050 4-byte or 8-byte unsigned offset into the
1052 section. This offset associates the compilation unit with a
1053 particular set of debugging information entry abbreviations. In
1054 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1055 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1056 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1058 \item \HFNunitpaddingONE{} (8 bytes) \\
1059 Reserved to DWARF (must be zero).
1062 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1063 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1064 this is 4 bytes in length; in the \sixtyfourbitdwarfformat, this
1065 is 8 bytes in length.
1069 \subsubsection{Skeleton and Split Compilation Unit Headers}
1070 \label{datarep:skeletonandfullcompilationunitheaders}
1071 \begin{enumerate}[1. ]
1073 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1074 \addttindexx{unit\_length}
1076 \addtoindexx{initial length}
1077 unsigned integer representing the length
1078 of the \dotdebuginfo{}
1079 contribution for that compilation unit,
1080 not including the length field itself. In the \thirtytwobitdwarfformat,
1081 this is a 4-byte unsigned integer (which must be less
1082 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1083 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1084 integer that gives the actual length
1085 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1087 \item \texttt{version} (\HFTuhalf) \\
1088 \addttindexx{version}
1089 \addtoindexx{version number!compilation unit}
1090 A 2-byte unsigned integer representing the version of the
1091 DWARF information for the compilation unit.
1093 The value in this field is \versiondotdebuginfo.
1095 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1096 for a summary of all version numbers that apply to DWARF sections.}
1099 \item \texttt{unit\_type} (\HFTubyte) \\
1100 \addttindexx{unit\_type}
1101 A 1-byte unsigned integer identifying this unit as a compilation unit.
1102 The value of this field is
1103 \DWUTskeleton{} for a skeleton compilation unit or
1104 \DWUTsplitcompile{} for a split compilation unit
1105 (see Section \refersec{chap:skeletoncompilationunitentries}).
1107 \textit{This field is new in \DWARFVersionV.}
1110 \item \texttt{address\_size} (\HFTubyte) \\
1111 \addttindexx{address\_size}
1112 A 1-byte unsigned integer representing the size in bytes of
1113 an address on the target architecture. If the system uses
1114 \addtoindexx{address space!segmented}
1115 segmented addressing, this value represents the size of the
1116 offset portion of an address.
1118 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1120 \addtoindexx{section offset!in .debug\_info header}
1121 4-byte or 8-byte unsigned offset into the
1123 section. This offset associates the compilation unit with a
1124 particular set of debugging information entry abbreviations. In
1125 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1126 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1127 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1130 \item \HFNdwoid{} (unit ID) \\
1131 An 8-byte implementation-defined integer constant value,
1132 known as the compilation unit ID, that provides
1133 unique identification of a skeleton compilation
1134 unit and its associated split compilation unit in
1135 the object file named in the \DWATdwoname{} attribute
1136 of the skeleton compilation.
1139 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1140 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1141 this is 4 bytes in length; in the \sixtyfourbitdwarfformat{}, this
1142 is 8 bytes in length.
1146 \subsubsection{Type Unit Headers}
1147 \label{datarep:typeunitheaders}
1148 The header for the series of debugging information entries
1149 contributing to the description of a type that has been
1150 placed in its own \addtoindex{type unit}, within the
1151 \dotdebuginfo{} section,
1152 consists of the following information:
1153 \begin{enumerate}[1. ]
1154 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1155 \addttindexx{unit\_length}
1156 A 4-byte or 12-byte unsigned integer
1157 \addtoindexx{initial length}
1158 representing the length
1159 of the \dotdebuginfo{} contribution for that type unit,
1160 not including the length field itself. In the \thirtytwobitdwarfformat,
1161 this is a 4-byte unsigned integer (which must be
1162 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
1163 consists of the 4-byte value \wffffffff followed by an
1164 8-byte unsigned integer that gives the actual length
1165 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1168 \item \texttt{version} (\HFTuhalf) \\
1169 \addttindexx{version}
1170 \addtoindexx{version number!type unit}
1171 A 2-byte unsigned integer representing the version of the
1172 DWARF information for the type unit.
1174 The value in this field is \versiondotdebuginfo.
1176 \item \texttt{unit\_type} (\HFTubyte) \\
1177 \addttindexx{unit\_type}
1178 A 1-byte unsigned integer identifying this unit as a type unit.
1179 The value of this field is \DWUTtype{} for a non-split type unit
1180 (see Section \refersec{chap:typeunitentries})
1181 or \DWUTsplittype{} for a split type unit.
1183 \textit{This field is new in \DWARFVersionV.}
1186 \item \texttt{address\_size} (\HFTubyte) \\
1187 \addttindexx{address\_size}
1188 A 1-byte unsigned integer representing the size
1189 \addtoindexx{size of an address}
1191 an address on the target architecture. If the system uses
1192 \addtoindexx{address space!segmented}
1193 segmented addressing, this value represents the size of the
1194 offset portion of an address.
1197 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1199 \addtoindexx{section offset!in .debug\_info header}
1200 4-byte or 8-byte unsigned offset into the
1202 section. This offset associates the type unit with a
1203 particular set of debugging information entry abbreviations. In
1204 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1205 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1206 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1208 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1209 \addttindexx{type\_signature}
1210 \addtoindexx{type signature}
1211 A unique 8-byte signature (see Section
1212 \refersec{datarep:typesignaturecomputation})
1213 of the type described in this type
1216 \textit{An attribute that refers (using
1217 \DWFORMrefsigeight{}) to
1218 the primary type contained in this
1219 \addtoindex{type unit} uses this value.}
1222 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1223 \addttindexx{type\_offset}
1224 A 4-byte or 8-byte unsigned offset
1225 \addtoindexx{section offset!in .debug\_info header}
1226 relative to the beginning
1227 of the \addtoindex{type unit} header.
1228 This offset refers to the debugging
1229 information entry that describes the type. Because the type
1230 may be nested inside a namespace or other structures, and may
1231 contain references to other types that have not been placed in
1232 separate type units, it is not necessarily either the first or
1233 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1234 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1235 this is an 8-byte unsigned length
1236 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1240 \subsection{Debugging Information Entry}
1241 \label{datarep:debugginginformationentry}
1243 Each debugging information entry begins with an
1244 unsigned LEB128\addtoindexx{LEB128!unsigned}
1245 number containing the abbreviation code for the entry. This
1246 code represents an entry within the abbreviations table
1247 associated with the compilation unit containing this entry. The
1248 abbreviation code is followed by a series of attribute values.
1250 On some architectures, there are alignment constraints on
1251 section boundaries. To make it easier to pad debugging
1252 information sections to satisfy such constraints, the
1253 abbreviation code 0 is reserved. Debugging information entries
1254 consisting of only the abbreviation code 0 are considered
1257 \subsection{Abbreviations Tables}
1258 \label{datarep:abbreviationstables}
1260 The abbreviations tables for all compilation units
1261 are contained in a separate object file section called
1263 As mentioned before, multiple compilation
1264 units may share the same abbreviations table.
1266 The abbreviations table for a single compilation unit consists
1267 of a series of abbreviation declarations. Each declaration
1268 specifies the tag and attributes for a particular form of
1269 debugging information entry. Each declaration begins with
1270 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1271 number representing the abbreviation
1272 code itself. It is this code that appears at the beginning
1273 of a debugging information entry in the
1275 section. As described above, the abbreviation
1276 code 0 is reserved for null debugging information entries. The
1277 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1278 number that encodes the entry\textquoteright s tag. The encodings for the
1279 tag names are given in
1280 Table \refersec{tab:tagencodings}.
1284 \setlength{\extrarowheight}{0.1cm}
1285 \begin{longtable}{l|c}
1286 \caption{Tag encodings} \label{tab:tagencodings} \\
1287 \hline \bfseries Tag name&\bfseries Value\\ \hline
1289 \bfseries Tag name&\bfseries Value \\ \hline
1291 \hline \emph{Continued on next page}
1293 \hline \ddag\ \textit{New in DWARF Version 5}
1295 \DWTAGarraytype{} &0x01 \\
1296 \DWTAGclasstype&0x02 \\
1297 \DWTAGentrypoint&0x03 \\
1298 \DWTAGenumerationtype&0x04 \\
1299 \DWTAGformalparameter&0x05 \\
1300 \DWTAGimporteddeclaration&0x08 \\
1302 \DWTAGlexicalblock&0x0b \\
1303 \DWTAGmember&0x0d \\
1304 \DWTAGpointertype&0x0f \\
1305 \DWTAGreferencetype&0x10 \\
1306 \DWTAGcompileunit&0x11 \\
1307 \DWTAGstringtype&0x12 \\
1308 \DWTAGstructuretype&0x13 \\
1309 \DWTAGsubroutinetype&0x15 \\
1310 \DWTAGtypedef&0x16 \\
1311 \DWTAGuniontype&0x17 \\
1312 \DWTAGunspecifiedparameters&0x18 \\
1313 \DWTAGvariant&0x19 \\
1314 \DWTAGcommonblock&0x1a \\
1315 \DWTAGcommoninclusion&0x1b \\
1316 \DWTAGinheritance&0x1c \\
1317 \DWTAGinlinedsubroutine&0x1d \\
1318 \DWTAGmodule&0x1e \\
1319 \DWTAGptrtomembertype&0x1f \\
1320 \DWTAGsettype&0x20 \\
1321 \DWTAGsubrangetype&0x21 \\
1322 \DWTAGwithstmt&0x22 \\
1323 \DWTAGaccessdeclaration&0x23 \\
1324 \DWTAGbasetype&0x24 \\
1325 \DWTAGcatchblock&0x25 \\
1326 \DWTAGconsttype&0x26 \\
1327 \DWTAGconstant&0x27 \\
1328 \DWTAGenumerator&0x28 \\
1329 \DWTAGfiletype&0x29 \\
1330 \DWTAGfriend&0x2a \\
1331 \DWTAGnamelist&0x2b \\
1332 \DWTAGnamelistitem&0x2c \\
1333 \DWTAGpackedtype&0x2d \\
1334 \DWTAGsubprogram&0x2e \\
1335 \DWTAGtemplatetypeparameter&0x2f \\
1336 \DWTAGtemplatevalueparameter&0x30 \\
1337 \DWTAGthrowntype&0x31 \\
1338 \DWTAGtryblock&0x32 \\
1339 \DWTAGvariantpart&0x33 \\
1340 \DWTAGvariable&0x34 \\
1341 \DWTAGvolatiletype&0x35 \\
1342 \DWTAGdwarfprocedure&0x36 \\
1343 \DWTAGrestricttype&0x37 \\
1344 \DWTAGinterfacetype&0x38 \\
1345 \DWTAGnamespace&0x39 \\
1346 \DWTAGimportedmodule&0x3a \\
1347 \DWTAGunspecifiedtype&0x3b \\
1348 \DWTAGpartialunit&0x3c \\
1349 \DWTAGimportedunit&0x3d \\
1350 \textit{Reserved}&0x3e\footnote{Code 0x3e is reserved to allow backward compatible support of the
1351 DW\_TAG\_mutable\_type DIE that was defined (only) in \DWARFVersionIII.}
1353 \DWTAGcondition&\xiiif \\
1354 \DWTAGsharedtype&0x40 \\
1355 \DWTAGtypeunit & 0x41 \\
1356 \DWTAGrvaluereferencetype & 0x42 \\
1357 \DWTAGtemplatealias & 0x43 \\
1358 \DWTAGcoarraytype~\ddag & 0x44 \\
1359 \DWTAGgenericsubrange~\ddag & 0x45 \\
1360 \DWTAGdynamictype~\ddag & 0x46 \\
1361 \DWTAGatomictype~\ddag & 0x47 \\
1362 \DWTAGcallsite~\ddag & 0x48 \\
1363 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1364 \DWTAGskeletonunit~\ddag & 0x4a \\
1366 \DWTAGimmutabletype~\ddag & 0x4b
1369 \DWTAGlouser&0x4080 \\
1370 \DWTAGhiuser&\xffff \\
1375 Following the tag encoding is a 1-byte value that determines
1376 whether a debugging information entry using this abbreviation
1377 has child entries or not. If the value is
1379 the next physically succeeding entry of any debugging
1380 information entry using this abbreviation is the first
1381 child of that entry. If the 1-byte value following the
1382 abbreviation\textquoteright s tag encoding is
1383 \DWCHILDRENnoTARG, the next
1384 physically succeeding entry of any debugging information entry
1385 using this abbreviation is a sibling of that entry. (Either
1386 the first child or sibling entries may be null entries). The
1387 encodings for the child determination byte are given in
1388 Table \refersec{tab:childdeterminationencodings}
1390 Section \refersec{chap:relationshipofdebugginginformationentries},
1391 each chain of sibling entries is terminated by a null entry.)
1395 \setlength{\extrarowheight}{0.1cm}
1396 \begin{longtable}{l|c}
1397 \caption{Child determination encodings}
1398 \label{tab:childdeterminationencodings}
1399 \addtoindexx{Child determination encodings} \\
1400 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1402 \bfseries Children determination name&\bfseries Value \\ \hline
1404 \hline \emph{Continued on next page}
1408 \DWCHILDRENno&0x00 \\
1409 \DWCHILDRENyes&0x01 \\ \hline
1414 Finally, the child encoding is followed by a series of
1415 attribute specifications. Each attribute specification
1416 consists of two parts. The first part is an
1417 unsigned LEB128\addtoindexx{LEB128!unsigned}
1418 number representing the attribute\textquoteright s name.
1419 The second part is an
1420 unsigned LEB128\addtoindexx{LEB128!unsigned}
1421 number representing the attribute\textquoteright s form.
1422 The series of attribute specifications ends with an
1423 entry containing 0 for the name and 0 for the form.
1427 \DWFORMindirectTARG{} is a special case. For
1428 attributes with this form, the attribute value itself in the
1430 section begins with an unsigned
1431 LEB128 number that represents its form. This allows producers
1432 to choose forms for particular attributes
1433 \addtoindexx{abbreviations table!dynamic forms in}
1435 without having to add a new entry to the abbreviations table.
1437 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1438 For attributes with this form, the attribute specification contains
1439 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1440 number. The value of this number is used as the value of the
1441 attribute, and no value is stored in the \dotdebuginfo{} section.
1443 The abbreviations for a given compilation unit end with an
1444 entry consisting of a 0 byte for the abbreviation code.
1447 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1448 for a depiction of the organization of the
1449 debugging information.}
1452 \subsection{Attribute Encodings}
1453 \label{datarep:attributeencodings}
1455 The encodings for the attribute names are given in
1456 Table \referfol{tab:attributeencodings}.
1459 \setlength{\extrarowheight}{0.1cm}
1460 \begin{longtable}{l|c|l}
1461 \caption{Attribute encodings}
1462 \label{tab:attributeencodings}
1463 \addtoindexx{attribute encodings} \\
1464 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1466 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1468 \hline \emph{Continued on next page}
1470 \hline \ddag\ \textit{New in DWARF Version 5}
1472 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1473 \addtoindexx{sibling attribute} \\
1474 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1478 \addtoindexx{location attribute} \\
1479 \DWATname&0x03&\livelink{chap:classstring}{string}
1480 \addtoindexx{name attribute} \\
1481 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1482 \addtoindexx{ordering attribute} \\
1483 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1484 \livelink{chap:classexprloc}{exprloc},
1485 \livelink{chap:classreference}{reference}
1486 \addtoindexx{byte size attribute} \\
1487 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1488 DW\_AT\_bit\_offset \mbox{attribute} which was
1489 defined in \DWARFVersionIII{} and earlier.}
1490 &\livelink{chap:classconstant}{constant},
1491 \livelink{chap:classexprloc}{exprloc},
1492 \livelink{chap:classreference}{reference}
1493 \addtoindexx{bit offset attribute (Version 3)}
1494 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1495 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1496 \livelink{chap:classexprloc}{exprloc},
1497 \livelink{chap:classreference}{reference}
1498 \addtoindexx{bit size attribute} \\
1499 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1500 \addtoindexx{statement list attribute} \\
1501 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1502 \addtoindexx{low PC attribute} \\
1503 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1504 \livelink{chap:classconstant}{constant}
1505 \addtoindexx{high PC attribute} \\
1506 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1507 \addtoindexx{language attribute} \\
1508 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1509 \addtoindexx{discriminant attribute} \\
1510 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1511 \addtoindexx{discriminant value attribute} \\
1512 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1513 \addtoindexx{visibility attribute} \\
1514 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1515 \addtoindexx{import attribute} \\
1516 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1520 \addtoindexx{string length attribute} \\
1521 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1522 \addtoindexx{common reference attribute} \\
1523 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1524 \addtoindexx{compilation directory attribute} \\
1525 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1526 \livelink{chap:classconstant}{constant},
1527 \livelink{chap:classstring}{string}
1528 \addtoindexx{constant value attribute} \\
1529 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1530 \addtoindexx{containing type attribute} \\
1531 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1532 \livelink{chap:classreference}{reference},
1533 \livelink{chap:classflag}{flag}
1534 \addtoindexx{default value attribute} \\
1535 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1536 \addtoindexx{inline attribute} \\
1537 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1538 \addtoindexx{is optional attribute} \\
1539 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1540 \livelink{chap:classexprloc}{exprloc},
1541 \livelink{chap:classreference}{reference}
1542 \addtoindexx{lower bound attribute} \\
1543 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1544 \addtoindexx{producer attribute} \\
1545 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1546 \addtoindexx{prototyped attribute} \\
1547 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1551 \addtoindexx{return address attribute} \\
1552 \DWATstartscope&0x2c&
1553 \livelink{chap:classconstant}{constant},
1557 \addtoindexx{start scope attribute} \\
1558 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1559 \livelink{chap:classexprloc}{exprloc},
1560 \livelink{chap:classreference}{reference}
1561 \addtoindexx{bit stride attribute} \\
1562 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1563 \livelink{chap:classexprloc}{exprloc},
1564 \livelink{chap:classreference}{reference}
1565 \addtoindexx{upper bound attribute} \\
1566 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1567 \addtoindexx{abstract origin attribute} \\
1568 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1569 \addtoindexx{accessibility attribute} \\
1570 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1571 \addtoindexx{address class attribute} \\
1572 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1573 \addtoindexx{artificial attribute} \\
1574 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1575 \addtoindexx{base types attribute} \\
1576 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1577 \addtoindexx{calling convention attribute} \\
1578 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1579 \livelink{chap:classexprloc}{exprloc},
1580 \livelink{chap:classreference}{reference}
1581 \addtoindexx{count attribute} \\
1582 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1583 \livelink{chap:classexprloc}{exprloc},
1587 \addtoindexx{data member attribute} \\
1588 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1589 \addtoindexx{declaration column attribute} \\
1590 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1591 \addtoindexx{declaration file attribute} \\
1592 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1593 \addtoindexx{declaration line attribute} \\
1594 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1595 \addtoindexx{declaration attribute} \\
1596 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1597 \addtoindexx{discriminant list attribute} \\
1598 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1599 \addtoindexx{encoding attribute} \\
1600 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1601 \addtoindexx{external attribute} \\
1602 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1606 \addtoindexx{frame base attribute} \\
1607 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1608 \addtoindexx{friend attribute} \\
1609 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1610 \addtoindexx{identifier case attribute} \\
1611 \textit{Reserved}&0x43\footnote{Code 0x43 is reserved to allow backward compatible support of the
1612 DW\_AT\_macro\_info \mbox{attribute} which was
1613 defined in \DWARFVersionIV{} and earlier.}
1614 &\livelink{chap:classmacptr}{macptr}
1615 \addtoindexx{macro information attribute (legacy)!encoding} \\
1616 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1617 \addtoindexx{name list item attribute} \\
1618 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1619 \addtoindexx{priority attribute} \\
1620 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1624 \addtoindexx{segment attribute} \\
1625 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1626 \addtoindexx{specification attribute} \\
1627 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1631 \addtoindexx{static link attribute} \\
1632 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1633 \addtoindexx{type attribute} \\
1634 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1638 \addtoindexx{location list attribute} \\
1639 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1640 \addtoindexx{variable parameter attribute} \\
1641 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1642 \addtoindexx{virtuality attribute} \\
1643 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1647 \addtoindexx{vtable element location attribute} \\
1648 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1649 \livelink{chap:classexprloc}{exprloc},
1650 \livelink{chap:classreference}{reference}
1651 \addtoindexx{allocated attribute} \\
1652 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1653 \livelink{chap:classexprloc}{exprloc},
1654 \livelink{chap:classreference}{reference}
1655 \addtoindexx{associated attribute} \\
1656 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1657 \addtoindexx{data location attribute} \\
1658 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1659 \livelink{chap:classexprloc}{exprloc},
1660 \livelink{chap:classreference}{reference}
1661 \addtoindexx{byte stride attribute} \\
1662 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1663 \livelink{chap:classconstant}{constant}
1664 \addtoindexx{entry PC attribute} \\
1665 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1666 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1667 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1668 \addtoindexx{extension attribute} \\
1673 \addtoindexx{ranges attribute} \\
1674 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1675 \livelink{chap:classflag}{flag},
1676 \livelink{chap:classreference}{reference},
1677 \livelink{chap:classstring}{string}
1678 \addtoindexx{trampoline attribute} \\
1679 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1680 \addtoindexx{call column attribute} \\
1681 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1682 \addtoindexx{call file attribute} \\
1683 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1684 \addtoindexx{call line attribute} \\
1685 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1686 \addtoindexx{description attribute} \\
1687 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1688 \addtoindexx{binary scale attribute} \\
1689 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1690 \addtoindexx{decimal scale attribute} \\
1691 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1692 \addtoindexx{small attribute} \\
1693 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1694 \addtoindexx{decimal scale attribute} \\
1695 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1696 \addtoindexx{digit count attribute} \\
1697 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1698 \addtoindexx{picture string attribute} \\
1699 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1700 \addtoindexx{mutable attribute} \\
1701 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1702 \addtoindexx{thread scaled attribute} \\
1703 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1704 \addtoindexx{explicit attribute} \\
1705 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1706 \addtoindexx{object pointer attribute} \\
1707 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1708 \addtoindexx{endianity attribute} \\
1709 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1710 \addtoindexx{elemental attribute} \\
1711 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1712 \addtoindexx{pure attribute} \\
1713 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1714 \addtoindexx{recursive attribute} \\
1715 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1716 \addtoindexx{signature attribute} \\
1717 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1718 \addtoindexx{main subprogram attribute} \\
1719 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1720 \addtoindexx{data bit offset attribute} \\
1721 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1722 \addtoindexx{constant expression attribute} \\
1723 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1724 \addtoindexx{enumeration class attribute} \\
1725 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1726 \addtoindexx{linkage name attribute} \\
1727 \DWATstringlengthbitsize{}~\ddag&0x6f&
1728 \livelink{chap:classconstant}{constant}
1729 \addtoindexx{string length attribute!size of length} \\
1730 \DWATstringlengthbytesize{}~\ddag&0x70&
1731 \livelink{chap:classconstant}{constant}
1732 \addtoindexx{string length attribute!size of length} \\
1733 \DWATrank~\ddag&0x71&
1734 \livelink{chap:classconstant}{constant},
1735 \livelink{chap:classexprloc}{exprloc}
1736 \addtoindexx{rank attribute} \\
1737 \DWATstroffsetsbase~\ddag&0x72&
1738 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1739 \addtoindexx{string offsets base!encoding} \\
1740 \DWATaddrbase~\ddag &0x73&
1741 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1742 \addtoindexx{address table base!encoding} \\
1744 \DWATrnglistsbase~\ddag&0x74&
1746 \addtoindexx{range list base!encoding}
1748 \textit{Reserved} &0x75& \textit{Unused} \\
1749 \DWATdwoname~\ddag &0x76&
1750 \livelink{chap:classstring}{string}
1751 \addtoindexx{split DWARF object file name!encoding} \\
1752 \DWATreference~\ddag &0x77&
1753 \livelink{chap:classflag}{flag} \\
1754 \DWATrvaluereference~\ddag &0x78&
1755 \livelink{chap:classflag}{flag} \\
1756 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1757 \addtoindexx{macro information attribute} \\
1758 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1759 \addtoindexx{all calls summary attribute} \\
1760 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1761 \addtoindexx{all source calls summary attribute} \\
1762 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1763 \addtoindexx{all tail calls summary attribute} \\
1764 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1765 \addtoindexx{call return PC attribute} \\
1766 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1767 \addtoindexx{call value attribute} \\
1768 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1769 \addtoindexx{call origin attribute} \\
1770 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1771 \addtoindexx{call parameter attribute} \\
1772 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1773 \addtoindexx{call PC attribute} \\
1774 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1775 \addtoindexx{call tail call attribute} \\
1776 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1777 \addtoindexx{call target attribute} \\
1778 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1779 \addtoindexx{call target clobbered attribute} \\
1780 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1781 \addtoindexx{call data location attribute} \\
1782 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1783 \addtoindexx{call data value attribute} \\
1784 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1785 \addtoindexx{noreturn attribute} \\
1786 \DWATalignment~\ddag &0x88 &\CLASSconstant
1787 \addtoindexx{alignment attribute} \\
1788 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1789 \addtoindexx{export symbols attribute} \\
1790 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1791 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1793 \DWATloclistsbase~\ddag &0x8c &\CLASSloclistsptr \addtoindexx{location list base attribute}
1796 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1797 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1803 \subsection{Classes and Forms}
1805 \label{datarep:classesandforms}
1807 Each class is a set of forms which have related representations
1808 and which are given a common interpretation according to the
1809 attribute in which the form is used.
1810 The attribute form governs how the value of an attribute is
1812 The classes and the forms they include are listed below.
1815 Form \DWFORMsecoffsetTARG{}
1816 is a member of more than one class, namely
1820 \CLASSloclist, \CLASSloclistsptr,
1824 \CLASSrnglist{}, \CLASSrnglistsptr,
1827 \CLASSstroffsetsptr;
1829 as a result, it is not possible for an
1830 attribute to allow more than one of these classes.
1832 The list of classes allowed by the applicable attribute in
1833 Table \refersec{tab:attributeencodings}
1834 determines the class of the form.
1837 In the form descriptions that follow, some forms are said
1838 to depend in part on the value of an attribute of the
1839 \definition{\associatedcompilationunit}:
1842 In the case of a \splitDWARFobjectfile{}, the associated
1843 compilation unit is the skeleton compilation unit corresponding
1844 to the containing unit.
1845 \item Otherwise, the associated compilation unit
1846 is the containing unit.
1850 Each possible form belongs to one or more of the following classes
1851 (see Table \refersec{tab:classesofattributevalue} for a summary of
1852 the purpose and general usage of each class):
1856 \item \CLASSaddress \\
1857 \livetarg{datarep:classaddress}{}
1858 Represented as either:
1860 \item An object of appropriate size to hold an
1861 address on the target machine (\DWFORMaddrTARG).
1862 The size is encoded in the compilation unit header
1863 (see Section \refersec{datarep:compilationunitheader}).
1864 This address is relocatable in a relocatable object file and
1865 is relocated in an executable file or shared object file.
1867 \item An indirect index into a table of addresses (as
1868 described in the previous bullet) in the
1869 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1870 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1871 \addtoindex{LEB128} value, which is interpreted as a zero-based
1872 index into an array of addresses in the \dotdebugaddr{} section.
1873 The index is relative to the value of the \DWATaddrbase{} attribute
1874 of the associated compilation unit.
1879 \item \CLASSaddrptr \\
1880 \livetarg{datarep:classaddrptr}{}
1881 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1882 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1883 beginning of the list of machine addresses information for the
1884 referencing entity. It is relocatable in
1885 a relocatable object file, and relocated in an executable or
1886 shared object file. In the \thirtytwobitdwarfformat, this offset
1887 is a 4-byte unsigned value; in the 64-bit DWARF
1888 format, it is an 8-byte unsigned value (see Section
1889 \refersec{datarep:32bitand64bitdwarfformats}).
1891 \textit{This class is new in \DWARFVersionV.}
1894 \item \CLASSblock \\
1895 \livetarg{datarep:classblock}{}
1896 Blocks come in four forms:
1899 A 1-byte length followed by 0 to 255 contiguous information
1900 bytes (\DWFORMblockoneTARG).
1903 A 2-byte length followed by 0 to 65,535 contiguous information
1904 bytes (\DWFORMblocktwoTARG).
1907 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1908 information bytes (\DWFORMblockfourTARG).
1911 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1912 length followed by the number of bytes
1913 specified by the length (\DWFORMblockTARG).
1916 In all forms, the length is the number of information bytes
1917 that follow. The information bytes may contain any mixture
1918 of relocated (or relocatable) addresses, references to other
1919 debugging information entries or data bytes.
1921 \item \CLASSconstant \\
1922 \livetarg{datarep:classconstant}{}
1923 There are eight forms of constants. There are fixed length
1924 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1928 \DWFORMdatafourTARG,
1929 \DWFORMdataeightTARG{} and
1930 \DWFORMdatasixteenTARG).
1931 There are variable length constant
1932 data forms encoded using
1933 signed LEB128 numbers (\DWFORMsdataTARG) and unsigned
1934 LEB128 numbers (\DWFORMudataTARG).
1935 There is also an implicit constant (\DWFORMimplicitconst),
1936 whose value is provided as part of the abbreviation
1940 The data in \DWFORMdataone,
1943 \DWFORMdataeight{} and
1944 \DWFORMdatasixteen{}
1945 can be anything. Depending on context, it may
1946 be a signed integer, an unsigned integer, a floating\dash point
1947 constant, or anything else. A consumer must use context to
1948 know how to interpret the bits, which if they are target
1949 machine data (such as an integer or floating-point constant)
1950 will be in target machine \byteorder.
1952 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1953 forms is used to represent a
1954 signed or unsigned integer, it can be hard for a consumer
1955 to discover the context necessary to determine which
1956 interpretation is intended. Producers are therefore strongly
1957 encouraged to use \DWFORMsdata{} or
1958 \DWFORMudata{} for signed and
1959 unsigned integers respectively, rather than
1960 \DWFORMdata\textless n\textgreater.}
1963 \item \CLASSexprloc \\
1964 \livetarg{datarep:classexprloc}{}
1965 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length
1966 followed by the number of information bytes specified by the
1967 length (\DWFORMexprlocTARG).
1968 The information bytes contain a DWARF expression
1969 (see Section \refersec{chap:dwarfexpressions})
1970 or location description
1971 (see Section \refersec{chap:locationdescriptions}).
1975 \livetarg{datarep:classflag}{}
1976 A flag \addtoindexx{flag class}
1977 is represented explicitly as a single byte of data
1978 (\DWFORMflagTARG) or implicitly (\DWFORMflagpresentTARG). In the
1979 first case, if the \nolink{flag} has value zero, it indicates the
1980 absence of the attribute; if the \nolink{flag} has a non-zero value,
1981 it indicates the presence of the attribute. In the second
1982 case, the attribute is implicitly indicated as present, and
1983 no value is encoded in the debugging information entry itself.
1986 \item \CLASSlineptr \\
1987 \livetarg{datarep:classlineptr}{}
1988 This is an offset into
1989 \addtoindexx{section offset!in class lineptr value}
1991 \dotdebugline{} or \dotdebuglinedwo{} section
1993 It consists of an offset from the beginning of the
1995 section to the first byte of
1996 the data making up the line number list for the compilation
1998 It is relocatable in a relocatable object file, and
1999 relocated in an executable or shared object file. In the
2000 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2001 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2002 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2005 \item \CLASSloclist \\
2006 \livetarg{datarep:classloclist}{}
2007 This is represented as either:
2010 An index into the \dotdebugloclists{} section (\DWFORMloclistxTARG).
2011 The unsigned ULEB operand identifies an offset location
2012 relative to the base of that section (the location of the first offset
2013 in the section, not the first byte of the section). The contents of
2014 that location is then added to the base to determine the location of
2015 the target list of entries.
2017 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2018 The operand consists of a byte
2019 offset\addtoindexx{section offset!in class loclist value}
2020 from the beginning of the \dotdebugloclists{} section.
2021 It is relocatable in a relocatable object file, and
2022 relocated in an executable or shared object file. In the
2023 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2024 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2025 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2028 \textit{This class is new in \DWARFVersionV.}
2031 \item \CLASSloclistsptr \\
2032 \livetarg{datarep:classloclistsptr}{}
2033 This is an offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2034 The operand consists of a byte
2035 offset\addtoindexx{section offset!in class loclistsptr}
2036 from the beginning of the \dotdebugloclists{} section.
2038 It is relocatable in a relocatable object file, and
2039 relocated in an executable or shared object file. In the
2040 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2041 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2042 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2045 \textit{This class is new in \DWARFVersionV.}
2048 \item \CLASSmacptr \\
2049 \livetarg{datarep:classmacptr}{}
2051 \addtoindexx{section offset!in class macptr value}
2053 \dotdebugmacro{} or \dotdebugmacrodwo{} section
2055 It consists of an offset from the beginning of the
2056 \dotdebugmacro{} or \dotdebugmacrodwo{}
2057 section to the the header making up the
2058 macro information list for the compilation unit.
2059 It is relocatable in a relocatable object file, and
2060 relocated in an executable or shared object file. In the
2061 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2062 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2063 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2066 \item \CLASSrnglist \\
2067 \livetarg{datarep:classrnglist}{}
2068 This is represented as either:
2071 An index into the \dotdebugrnglists{} section (\DWFORMrnglistxTARG).
2072 The unsigned ULEB operand identifies an offset location
2073 relative to the base of that section (the location of the first offset
2074 in the section, not the first byte of the section). The contents of
2075 that location is then added to the base to determine the location of
2076 the target range list of entries.
2078 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2079 The operand consists of a byte
2080 offset\addtoindexx{section offset!in class loclist value}
2081 from the beginning of the \dotdebugloclists{} section.
2082 It is relocatable in a relocatable object file, and
2083 relocated in an executable or shared object file. In the
2084 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2085 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2086 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2089 \textit{This class is new in \DWARFVersionV.}
2093 \item \CLASSrnglistsptr \\
2094 \livetarg{datarep:classrnglistsptr}{}
2095 This is an offset\addtoindexx{section offset!in class rnglistsptr}
2096 into the \dotdebugrnglists{} section (\DWFORMsecoffset).
2097 It consists of a byte offset from the beginning of the
2098 \dotdebugrnglists{} section.
2099 It is relocatable in a relocatable object file, and relocated
2100 in an executable or shared object file.
2102 In the \thirtytwobitdwarfformat, this offset
2103 is a 4-byte unsigned value; in the 64-bit DWARF
2104 format, it is an 8-byte unsigned value (see Section
2105 \refersec{datarep:32bitand64bitdwarfformats}).
2108 \textit{This class is new in \DWARFVersionV.}
2114 \item \CLASSreference \\
2115 \livetarg{datarep:classreference}{}
2116 There are four types of reference.\addtoindexx{reference class}
2119 The first type of reference can identify any debugging
2120 information entry within the containing unit.
2121 This type of reference is an
2122 offset\addtoindexx{section offset!in class reference value}
2123 from the first byte of the compilation
2124 header for the compilation unit containing the reference. There
2125 are five forms for this type of reference. There are fixed
2126 length forms for one, two, four and eight byte offsets
2132 and \DWFORMrefeightTARG).
2133 There is also an unsigned variable
2134 length offset encoded form that uses
2135 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
2136 (\DWFORMrefudataTARG).
2137 Because this type of reference is within
2138 the containing compilation unit no relocation of the value
2142 The second type of reference can identify any debugging
2143 information entry within a
2144 \dotdebuginfo{} section; in particular,
2145 it may refer to an entry in a different compilation unit
2146 from the unit containing the reference, and may refer to an
2147 entry in a different shared object file. This type of reference
2148 (\DWFORMrefaddrTARG)
2149 is an offset from the beginning of the
2151 section of the target executable or shared object file, or, for
2152 references within a \addtoindex{supplementary object file},
2153 an offset from the beginning of the local \dotdebuginfo{} section;
2154 it is relocatable in a relocatable object file and frequently
2155 relocated in an executable or shared object file. For
2156 references from one shared object or static executable file
2157 to another, the relocation and identification of the target
2158 object must be performed by the consumer. In the
2159 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2160 in the \sixtyfourbitdwarfformat, it is an 8-byte
2162 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2164 \textit{A debugging information entry that may be referenced by
2165 another compilation unit using
2166 \DWFORMrefaddr{} must have a global symbolic name.}
2168 \textit{For a reference from one executable or shared object file to
2169 another, the reference is resolved by the debugger to identify
2170 the executable or shared object file and the offset into that
2171 file\textquoteright s \dotdebuginfo{}
2172 section in the same fashion as the run
2173 time loader, either when the debug information is first read,
2174 or when the reference is used.}
2177 The third type of reference can identify any debugging
2178 information type entry that has been placed in its own
2179 \addtoindex{type unit}. This type of
2180 reference (\DWFORMrefsigeightTARG) is the
2181 \addtoindexx{type signature}
2182 8-byte type signature
2183 (see Section \refersec{datarep:typesignaturecomputation})
2184 that was computed for the type.
2187 The fourth type of reference is a reference from within the
2188 \dotdebuginfo{} section of the executable or shared object file to
2189 a debugging information entry in the \dotdebuginfo{} section of
2190 a \addtoindex{supplementary object file}.
2191 This type of reference (\DWFORMrefsupTARG) is an offset from the
2192 beginning of the \dotdebuginfo{} section in the
2193 \addtoindex{supplementary object file}.
2195 \textit{The use of compilation unit relative references will reduce the
2196 number of link\dash time relocations and so speed up linking. The
2197 use of the second, third and fourth type of reference allows for the
2198 sharing of information, such as types, across compilation
2199 units, while the fourth type further allows for sharing of information
2200 across compilation units from different executables or shared object files.}
2202 \textit{A reference to any kind of compilation unit identifies the
2203 debugging information entry for that unit, not the preceding
2208 \item \CLASSstring \\
2209 \livetarg{datarep:classstring}{}
2210 A string is a sequence of contiguous non\dash null bytes followed by
2212 \addtoindexx{string class}
2213 A string may be represented:
2215 \setlength{\itemsep}{0em}
2216 \item immediately in the debugging information entry itself
2217 (\DWFORMstringTARG),
2220 \addtoindexx{section offset!in class string value}
2221 offset into a string table contained in
2222 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
2223 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
2224 or as an offset into a string table contained in the
2225 \dotdebugstr{} section of a \addtoindex{supplementary object file}
2226 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
2227 section of a \addtoindex{supplementary object file}
2228 refer to the local \dotdebugstr{} section of that same file.
2229 In the \thirtytwobitdwarfformat, the representation of a
2230 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
2231 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2232 it is an 8-byte unsigned offset
2233 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2236 \item as an indirect offset into the string table using an
2237 index into a table of offsets contained in the
2238 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
2239 The representation of a \DWFORMstrxNAME{} value is an unsigned
2240 \addtoindex{LEB128} value, which is interpreted as a zero-based
2241 index into an array of offsets in the \dotdebugstroffsets{} section.
2242 The offset entries in the \dotdebugstroffsets{} section have the
2243 same representation as \DWFORMstrp{} values.
2245 Any combination of these three forms may be used within a single compilation.
2247 If the \DWATuseUTFeight{}
2248 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
2249 compilation, partial, skeleton or type unit entry, string values are encoded using the
2250 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
2251 Character Set standard (ISO/IEC 10646\dash 1:1993).
2252 \addtoindexx{ISO 10646 character set standard}
2253 Otherwise, the string representation is unspecified.
2255 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
2256 ISO/IEC 10646\dash 1:1993.
2257 \addtoindexx{ISO 10646 character set standard}
2258 It contains all the same characters
2259 and encoding points as ISO/IEC 10646, as well as additional
2260 information about the characters and their use.}
2262 \textit{Earlier versions of DWARF did not specify the representation
2263 of strings; for compatibility, this version also does
2264 not. However, the UTF\dash 8 representation is strongly recommended.}
2267 \item \CLASSstroffsetsptr \\
2268 \livetarg{datarep:classstroffsetsptr}{}
2269 This is an offset into the \dotdebugstroffsets{} section
2270 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2271 \dotdebugstroffsets{} section to the
2272 beginning of the string offsets information for the
2273 referencing entity. It is relocatable in
2274 a relocatable object file, and relocated in an executable or
2275 shared object file. In the \thirtytwobitdwarfformat, this offset
2276 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2277 it is an 8-byte unsigned value (see Section
2278 \refersec{datarep:32bitand64bitdwarfformats}).
2280 \textit{This class is new in \DWARFVersionV.}
2284 In no case does an attribute use one of the classes
2289 \CLASSrnglistsptr{} or
2290 \CLASSstroffsetsptr{}
2291 to point into either the
2292 \dotdebuginfo{} or \dotdebugstr{} section.
2295 \subsection{Form Encodings}
2296 \label{datarep:formencodings}
2298 The form encodings are listed in
2299 Table \referfol{tab:attributeformencodings}.
2303 \setlength{\extrarowheight}{0.1cm}
2304 \begin{longtable}{l|c|l}
2305 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2306 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2308 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2310 \hline \emph{Continued on next page}
2312 \hline \ddag\ \textit{New in DWARF Version 5}
2315 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2316 \textit{Reserved} &0x02& \\
2317 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2318 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2319 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2320 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2321 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2322 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2323 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2324 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2325 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2326 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2327 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2328 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2329 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2330 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2331 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2332 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2333 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2334 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2335 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2336 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2338 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclist, \CLASSloclistsptr, \\
2339 & & \CLASSmacptr, \CLASSrnglist, \CLASSrnglistsptr, \CLASSstroffsetsptr
2342 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2343 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2344 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2345 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2346 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2347 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2348 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2349 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2350 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2351 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2353 \DWFORMloclistx~\ddag \eb &0x22 &\CLASSloclist \\
2355 \DWFORMrnglistx~\ddag \eb &0x23 &\CLASSrnglist \\
2361 \section{Variable Length Data}
2362 \label{datarep:variablelengthdata}
2363 \addtoindexx{variable length data|see {LEB128}}
2365 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2366 encoded using \doublequote{Little-Endian Base 128}
2367 \addtoindexx{little-endian encoding|see{endian attribute}}
2369 \addtoindexx{LEB128}
2370 LEB128 is a scheme for encoding integers
2371 densely that exploits the assumption that most integers are
2374 \textit{This encoding is equally suitable whether the target machine
2375 architecture represents data in big-endian or little-endian
2376 \byteorder. It is \doublequote{little-endian} only in the sense that it
2377 avoids using space to represent the \doublequote{big} end of an
2378 unsigned integer, when the big end is all zeroes or sign
2381 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2382 numbers are encoded as follows:
2383 \addtoindexx{LEB128!unsigned, encoding as}
2384 start at the low order end of an unsigned integer and chop
2385 it into 7-bit chunks. Place each chunk into the low order 7
2386 bits of a byte. Typically, several of the high order bytes
2387 will be zero; discard them. Emit the remaining bytes in a
2388 stream, starting with the low order byte; set the high order
2389 bit on each byte except the last emitted byte. The high bit
2390 of zero on the last byte indicates to the decoder that it
2391 has encountered the last byte.
2393 The integer zero is a special case, consisting of a single
2396 Table \refersec{tab:examplesofunsignedleb128encodings}
2397 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2399 0x80 in each case is the high order bit of the byte, indicating
2400 that an additional byte follows.
2403 The encoding for signed, two\textquoteright{s} complement LEB128
2404 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2405 numbers is similar, except that the criterion for discarding
2406 high order bytes is not whether they are zero, but whether
2407 they consist entirely of sign extension bits. Consider the
2408 4-byte integer -2. The three high level bytes of the number
2409 are sign extension, thus LEB128 would represent it as a single
2410 byte containing the low order 7 bits, with the high order
2411 bit cleared to indicate the end of the byte stream. Note
2412 that there is nothing within the LEB128 representation that
2413 indicates whether an encoded number is signed or unsigned. The
2414 decoder must know what type of number to expect.
2415 Table \refersec{tab:examplesofunsignedleb128encodings}
2416 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2417 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2418 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2421 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2422 \addtoindexx{LEB128!examples}
2423 gives algorithms for encoding and decoding these forms.}
2427 \setlength{\extrarowheight}{0.1cm}
2428 \begin{longtable}{c|c|c}
2429 \caption{Examples of unsigned LEB128 encodings}
2430 \label{tab:examplesofunsignedleb128encodings}
2431 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2432 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2434 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2436 \hline \emph{Continued on next page}
2442 128& 0 + 0x80 & 1 \\
2443 129& 1 + 0x80 & 1 \\
2444 %130& 2 + 0x80 & 1 \\
2445 12857& 57 + 0x80 & 100 \\
2452 \setlength{\extrarowheight}{0.1cm}
2453 \begin{longtable}{c|c|c}
2454 \caption{Examples of signed LEB128 encodings}
2455 \label{tab:examplesofsignedleb128encodings}
2456 \addtoindexx{LEB128!signed} \\
2457 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2459 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2461 \hline \emph{Continued on next page}
2467 127& 127 + 0x80 & 0 \\
2468 -127& 1 + 0x80 & 0x7f \\
2469 128& 0 + 0x80 & 1 \\
2470 -128& 0 + 0x80 & 0x7f \\
2471 129& 1 + 0x80 & 1 \\
2472 -129& 0x7f + 0x80 & 0x7e \\
2479 \section{DWARF Expressions and Location Descriptions}
2480 \label{datarep:dwarfexpressionsandlocationdescriptions}
2481 \subsection{DWARF Expressions}
2482 \label{datarep:dwarfexpressions}
2485 \addtoindexx{DWARF expression!operator encoding}
2486 DWARF expression is stored in a \nolink{block} of contiguous
2487 bytes. The bytes form a sequence of operations. Each operation
2488 is a 1-byte code that identifies that operation, followed by
2489 zero or more bytes of additional data. The encodings for the
2490 operations are described in
2491 Table \refersec{tab:dwarfoperationencodings}.
2494 \setlength{\extrarowheight}{0.1cm}
2495 \begin{longtable}{l|c|c|l}
2496 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2497 \hline & &\bfseries No. of &\\
2498 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2500 & &\bfseries No. of &\\
2501 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2503 \hline \emph{Continued on next page}
2505 \hline \ddag\ \textit{New in DWARF Version 5}
2508 \DWOPaddr&0x03&1 & constant address \\
2509 & & &(size is target specific) \\
2511 \DWOPderef&0x06&0 & \\
2513 \DWOPconstoneu&0x08&1&1-byte constant \\
2514 \DWOPconstones&0x09&1&1-byte constant \\
2515 \DWOPconsttwou&0x0a&1&2-byte constant \\
2516 \DWOPconsttwos&0x0b&1&2-byte constant \\
2517 \DWOPconstfouru&0x0c&1&4-byte constant \\
2518 \DWOPconstfours&0x0d&1&4-byte constant \\
2519 \DWOPconsteightu&0x0e&1&8-byte constant \\
2520 \DWOPconsteights&0x0f&1&8-byte constant \\
2521 \DWOPconstu&0x10&1&ULEB128 constant \\
2522 \DWOPconsts&0x11&1&SLEB128 constant \\
2523 \DWOPdup&0x12&0 & \\
2524 \DWOPdrop&0x13&0 & \\
2525 \DWOPover&0x14&0 & \\
2526 \DWOPpick&0x15&1&1-byte stack index \\
2527 \DWOPswap&0x16&0 & \\
2528 \DWOProt&0x17&0 & \\
2529 \DWOPxderef&0x18&0 & \\
2530 \DWOPabs&0x19&0 & \\
2531 \DWOPand&0x1a&0 & \\
2532 \DWOPdiv&0x1b&0 & \\
2533 \DWOPminus&0x1c&0 & \\
2534 \DWOPmod&0x1d&0 & \\
2535 \DWOPmul&0x1e&0 & \\
2536 \DWOPneg&0x1f&0 & \\
2537 \DWOPnot&0x20&0 & \\
2539 \DWOPplus&0x22&0 & \\
2540 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2541 \DWOPshl&0x24&0 & \\
2542 \DWOPshr&0x25&0 & \\
2543 \DWOPshra&0x26&0 & \\
2544 \DWOPxor&0x27&0 & \\
2546 \DWOPbra&0x28&1 & signed 2-byte constant \\
2553 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2555 \DWOPlitzero & 0x30 & 0 & \\
2556 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2557 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2558 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2560 \DWOPregzero & 0x50 & 0 & \\*
2561 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2562 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2563 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2565 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2566 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2567 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2568 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2570 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2571 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2572 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2573 & & &SLEB128 offset \\
2574 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2575 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2576 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2577 \DWOPnop{} & 0x96 &0& \\
2579 \DWOPpushobjectaddress&0x97&0 & \\
2580 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2581 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2582 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2583 \DWOPformtlsaddress&0x9b &0& \\
2584 \DWOPcallframecfa{} &0x9c &0& \\
2585 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2587 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2588 &&&\nolink{block} of that size\\
2589 \DWOPstackvalue{} &0x9f &0& \\
2590 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2591 &&&SLEB128 constant offset \\
2592 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2593 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2594 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2595 &&&\nolink{block} of that size\\
2596 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2597 & & & 1-byte size, \\*
2598 & & & constant value \\
2599 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2600 &&& ULEB128 constant offset \\
2601 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2602 &&& ULEB128 type entry offset \\
2603 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2604 &&& ULEB128 type entry offset \\
2605 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2606 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2607 \DWOPlouser{} &0xe0 && \\
2608 \DWOPhiuser{} &\xff && \\
2614 \subsection{Location Descriptions}
2615 \label{datarep:locationdescriptions}
2617 A location description is used to compute the
2618 location of a variable or other entity.
2620 \subsection{Location Lists}
2621 \label{datarep:locationlists}
2622 Each entry in a \addtoindex{location list} is either a location list entry,
2625 entry, a default location entry or an
2627 \addtoindexx{end-of-list entry!in location list}
2632 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2633 that follows. The encodings for these constants are given in
2634 Table \refersec{tab:locationlistentryencodingvalues}.
2638 \setlength{\extrarowheight}{0.1cm}
2639 \begin{longtable}{l|c}
2640 \caption{Location list entry encoding values}
2641 \label{tab:locationlistentryencodingvalues} \\
2642 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2644 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2646 \hline \emph{Continued on next page}
2649 \ddag New in \DWARFVersionV
2652 \DWLLEendoflist~\ddag & 0x00 \\
2653 \DWLLEbaseaddressx~\ddag & 0x01 \\
2654 \DWLLEstartxendx~\ddag & 0x02 \\
2655 \DWLLEstartxlength~\ddag & 0x03 \\
2656 \DWLLEoffsetpair~\ddag & 0x04 \\
2657 \DWLLEdefaultlocation~\ddag & 0x05 \\
2658 \DWLLEbaseaddress~\ddag & 0x06 \\
2659 \DWLLEstartend~\ddag & 0x07 \\
2660 \DWLLEstartlength~\ddag & 0x08
2665 \section{Base Type Attribute Encodings}
2666 \label{datarep:basetypeattributeencodings}
2668 The\hypertarget{chap:DWATencodingencodingofbasetype}{}
2669 encodings of the constants used in the
2670 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2672 Table \refersec{tab:basetypeencodingvalues}
2675 \setlength{\extrarowheight}{0.1cm}
2676 \begin{longtable}{l|c}
2677 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2678 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2680 \bfseries Base type encoding name&\bfseries Value\\ \hline
2682 \hline \emph{Continued on next page}
2685 \ddag \ \textit{New in \DWARFVersionV}
2687 \DWATEaddress&0x01 \\
2688 \DWATEboolean&0x02 \\
2689 \DWATEcomplexfloat&0x03 \\
2691 \DWATEsigned&0x05 \\
2692 \DWATEsignedchar&0x06 \\
2693 \DWATEunsigned&0x07 \\
2694 \DWATEunsignedchar&0x08 \\
2695 \DWATEimaginaryfloat&0x09 \\
2696 \DWATEpackeddecimal&0x0a \\
2697 \DWATEnumericstring&0x0b \\
2698 \DWATEedited&0x0c \\
2699 \DWATEsignedfixed&0x0d \\
2700 \DWATEunsignedfixed&0x0e \\
2701 \DWATEdecimalfloat & 0x0f \\
2702 \DWATEUTF{} & 0x10 \\
2703 \DWATEUCS~\ddag & 0x11 \\
2704 \DWATEASCII~\ddag & 0x12 \\
2705 \DWATElouser{} & 0x80 \\
2706 \DWATEhiuser{} & \xff \\
2711 The encodings of the constants used in the
2712 \DWATdecimalsign{} attribute
2714 Table \refersec{tab:decimalsignencodings}.
2717 \setlength{\extrarowheight}{0.1cm}
2718 \begin{longtable}{l|c}
2719 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2720 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2722 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2724 % \hline \emph{Continued on next page}
2728 \DWDSunsigned{} & 0x01 \\
2729 \DWDSleadingoverpunch{} & 0x02 \\
2730 \DWDStrailingoverpunch{} & 0x03 \\
2731 \DWDSleadingseparate{} & 0x04 \\
2732 \DWDStrailingseparate{} & 0x05 \\
2737 The encodings of the constants used in the
2738 \DWATendianity{} attribute are given in
2739 Table \refersec{tab:endianityencodings}.
2742 \setlength{\extrarowheight}{0.1cm}
2743 \begin{longtable}{l|c}
2744 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2745 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2747 \bfseries Endian code name&\bfseries Value\\ \hline
2749 \hline \emph{Continued on next page}
2754 \DWENDdefault{} & 0x00 \\
2755 \DWENDbig{} & 0x01 \\
2756 \DWENDlittle{} & 0x02 \\
2757 \DWENDlouser{} & 0x40 \\
2758 \DWENDhiuser{} & \xff \\
2764 \section{Accessibility Codes}
2765 \label{datarep:accessibilitycodes}
2766 The encodings of the constants used in the
2767 \DWATaccessibility{}
2769 \addtoindexx{accessibility attribute}
2771 Table \refersec{tab:accessibilityencodings}.
2774 \setlength{\extrarowheight}{0.1cm}
2775 \begin{longtable}{l|c}
2776 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2777 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2779 \bfseries Accessibility code name&\bfseries Value\\ \hline
2781 \hline \emph{Continued on next page}
2786 \DWACCESSpublic&0x01 \\
2787 \DWACCESSprotected&0x02 \\
2788 \DWACCESSprivate&0x03 \\
2794 \section{Visibility Codes}
2795 \label{datarep:visibilitycodes}
2796 The encodings of the constants used in the
2797 \DWATvisibility{} attribute are given in
2798 Table \refersec{tab:visibilityencodings}.
2801 \setlength{\extrarowheight}{0.1cm}
2802 \begin{longtable}{l|c}
2803 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2804 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2806 \bfseries Visibility code name&\bfseries Value\\ \hline
2808 \hline \emph{Continued on next page}
2814 \DWVISexported&0x02 \\
2815 \DWVISqualified&0x03 \\
2820 \section{Virtuality Codes}
2821 \label{datarep:vitualitycodes}
2823 The encodings of the constants used in the
2824 \DWATvirtuality{} attribute are given in
2825 Table \refersec{tab:virtualityencodings}.
2828 \setlength{\extrarowheight}{0.1cm}
2829 \begin{longtable}{l|c}
2830 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2831 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2833 \bfseries Virtuality code name&\bfseries Value\\ \hline
2835 \hline \emph{Continued on next page}
2840 \DWVIRTUALITYnone&0x00 \\
2841 \DWVIRTUALITYvirtual&0x01 \\
2842 \DWVIRTUALITYpurevirtual&0x02 \\
2849 \DWVIRTUALITYnone{} is equivalent to the absence of the
2853 \section{Source Languages}
2854 \label{datarep:sourcelanguages}
2856 The encodings of the constants used
2857 \addtoindexx{language attribute, encoding}
2859 \addtoindexx{language name encoding}
2862 attribute are given in
2863 Table \refersec{tab:languageencodings}.
2865 % If we don't force a following space it looks odd
2867 and their associated values are reserved, but the
2868 languages they represent are not well supported.
2869 Table \refersec{tab:languageencodings}
2871 \addtoindexx{lower bound attribute!default}
2872 default lower bound, if any, assumed for
2873 an omitted \DWATlowerbound{} attribute in the context of a
2874 \DWTAGsubrangetype{} debugging information entry for each
2878 \setlength{\extrarowheight}{0.1cm}
2879 \begin{longtable}{l|c|c}
2880 \caption{Language encodings} \label{tab:languageencodings}\\
2881 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2883 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2885 \hline \emph{Continued on next page}
2888 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2890 \addtoindexx{ISO-defined language names}
2892 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2893 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2894 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2895 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++98 (ISO)} \\
2896 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2897 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2898 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2899 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2900 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2901 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2902 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2903 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2904 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2905 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2906 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2907 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2908 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2909 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2910 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2911 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2912 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2913 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2914 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2915 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2916 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++03 (ISO)}\\
2917 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++11 (ISO)} \\
2918 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2919 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2920 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2921 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2922 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2923 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2924 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++14 (ISO)} \\
2925 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2926 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2927 \DWLANGRenderScript{}~\ddag &0x0024 &0 \addtoindexx{RenderScript Kernel Language}
2929 \DWLANGlouser{} &0x8000 & \\
2930 \DWLANGhiuser{} &\xffff & \\
2935 \section{Address Class Encodings}
2936 \label{datarep:addressclassencodings}
2938 The value of the common
2939 \addtoindex{address class} encoding
2943 \section{Identifier Case}
2944 \label{datarep:identifiercase}
2946 The encodings of the constants used in the
2947 \DWATidentifiercase{} attribute are given in
2948 Table \refersec{tab:identifiercaseencodings}.
2952 \setlength{\extrarowheight}{0.1cm}
2953 \begin{longtable}{l|c}
2954 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2955 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2957 \bfseries Identifier case name&\bfseries Value\\ \hline
2959 \hline \emph{Continued on next page}
2963 \DWIDcasesensitive&0x00 \\
2965 \DWIDdowncase&0x02 \\
2966 \DWIDcaseinsensitive&0x03 \\
2970 \section{Calling Convention Encodings}
2971 \label{datarep:callingconventionencodings}
2972 The encodings of the constants used in the
2973 \DWATcallingconvention{} attribute are given in
2974 Table \refersec{tab:callingconventionencodings}.
2977 \setlength{\extrarowheight}{0.1cm}
2978 \begin{longtable}{l|c}
2979 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2980 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2982 \bfseries Calling convention name&\bfseries Value\\ \hline
2984 \hline \emph{Continued on next page}
2986 \hline \ddag\ \textit{New in DWARF Version 5}
2989 \DWCCnormal &0x01 \\
2990 \DWCCprogram&0x02 \\
2991 \DWCCnocall &0x03 \\
2992 \DWCCpassbyreference~\ddag &0x04 \\
2993 \DWCCpassbyvalue~\ddag &0x05 \\
2994 \DWCClouser &0x40 \\
3001 \section{Inline Codes}
3002 \label{datarep:inlinecodes}
3004 The encodings of the constants used in
3005 \addtoindexx{inline attribute}
3007 \DWATinline{} attribute are given in
3008 Table \refersec{tab:inlineencodings}.
3012 \setlength{\extrarowheight}{0.1cm}
3013 \begin{longtable}{l|c}
3014 \caption{Inline encodings} \label{tab:inlineencodings}\\
3015 \hline \bfseries Inline code name&\bfseries Value \\ \hline
3017 \bfseries Inline Code name&\bfseries Value\\ \hline
3019 \hline \emph{Continued on next page}
3024 \DWINLnotinlined&0x00 \\
3025 \DWINLinlined&0x01 \\
3026 \DWINLdeclarednotinlined&0x02 \\
3027 \DWINLdeclaredinlined&0x03 \\
3032 % this clearpage is ugly, but the following table came
3033 % out oddly without it.
3035 \section{Array Ordering}
3036 \label{datarep:arrayordering}
3038 The encodings of the constants used in the
3039 \DWATordering{} attribute are given in
3040 Table \refersec{tab:orderingencodings}.
3044 \setlength{\extrarowheight}{0.1cm}
3045 \begin{longtable}{l|c}
3046 \caption{Ordering encodings} \label{tab:orderingencodings}\\
3047 \hline \bfseries Ordering name&\bfseries Value \\ \hline
3049 \bfseries Ordering name&\bfseries Value\\ \hline
3051 \hline \emph{Continued on next page}
3056 \DWORDrowmajor&0x00 \\
3057 \DWORDcolmajor&0x01 \\
3063 \section{Discriminant Lists}
3064 \label{datarep:discriminantlists}
3066 The descriptors used in
3067 \addtoindexx{discriminant list attribute}
3069 \DWATdiscrlist{} attribute are
3070 encoded as 1-byte constants. The
3071 defined values are given in
3072 Table \refersec{tab:discriminantdescriptorencodings}.
3074 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
3076 \setlength{\extrarowheight}{0.1cm}
3077 \begin{longtable}{l|c}
3078 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
3079 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
3081 \bfseries Descriptor name&\bfseries Value\\ \hline
3083 \hline \emph{Continued on next page}
3095 \section{Name Index Table}
3096 \label{datarep:nameindextable}
3097 The \addtoindexi{version number}{version number!name index table}
3098 in the name index table header is \versiondotdebugnames{}.
3100 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
3103 \setlength{\extrarowheight}{0.1cm}
3104 \begin{longtable}{l|c|l}
3105 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
3106 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3108 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3110 \hline \emph{Continued on next page}
3113 \ddag~\textit{New in \DWARFVersionV}
3115 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
3116 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
3117 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
3118 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
3119 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
3120 \DWIDXlouser~\ddag & 0x2000 & \\
3121 \DWIDXhiuser~\ddag & \xiiifff & \\
3125 The abbreviations table ends with an entry consisting of a single 0
3126 byte for the abbreviation code. The size of the table given by
3127 \texttt{abbrev\_table\_size} may include optional padding following the
3130 \section{Defaulted Member Encodings}
3131 \hypertarget{datarep:defaultedmemberencodings}{}
3133 The encodings of the constants used in the \DWATdefaulted{} attribute
3134 are given in Table \referfol{datarep:defaultedattributeencodings}.
3137 \setlength{\extrarowheight}{0.1cm}
3138 \begin{longtable}{l|c}
3139 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
3140 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
3142 \bfseries Defaulted name &\bfseries Value \\ \hline
3144 \hline \emph{Continued on next page}
3147 \ddag~\textit{New in \DWARFVersionV}
3149 \DWDEFAULTEDno~\ddag & 0x00 \\
3150 \DWDEFAULTEDinclass~\ddag & 0x01 \\
3151 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
3156 \section{Address Range Table}
3157 \label{datarep:addrssrangetable}
3159 Each set of entries in the table of address ranges contained
3160 in the \dotdebugaranges{}
3161 section begins with a header containing:
3162 \begin{enumerate}[1. ]
3163 % FIXME The unit length text is not fully consistent across
3166 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3167 \addttindexx{unit\_length}
3168 A 4-byte or 12-byte length containing the length of the
3169 \addtoindexx{initial length}
3170 set of entries for this compilation unit, not including the
3171 length field itself. In the \thirtytwobitdwarfformat, this is a
3172 4-byte unsigned integer (which must be less than \xfffffffzero);
3173 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
3174 \wffffffff followed by an 8-byte unsigned integer that gives
3176 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3178 \item version (\HFTuhalf) \\
3179 A 2-byte version identifier representing the version of the
3180 DWARF information for the address range table.
3182 This value in this field \addtoindexx{version number!address range table} is 2.
3184 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
3186 \addtoindexx{section offset!in .debug\_aranges header}
3187 4-byte or 8-byte offset into the
3188 \dotdebuginfo{} section of
3189 the compilation unit header. In the \thirtytwobitdwarfformat,
3190 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
3191 this is an 8-byte unsigned offset
3192 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3194 \item \texttt{address\_size} (\HFTubyte) \\
3195 A 1-byte unsigned integer containing the size in bytes of an
3196 \addttindexx{address\_size}
3198 \addtoindexx{size of an address}
3199 (or the offset portion of an address for segmented
3200 \addtoindexx{address space!segmented}
3201 addressing) on the target system.
3203 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3204 A 1-byte unsigned integer containing the size in bytes of a
3205 segment selector on the target system.
3209 This header is followed by a series of tuples. Each tuple
3210 consists of a segment, an address and a length.
3211 The segment selector
3212 size is given by the \HFNsegmentselectorsize{} field of the header; the
3213 address and length size are each given by the \addttindex{address\_size}
3214 field of the header.
3215 The first tuple following the header in
3216 each set begins at an offset that is a multiple of the size
3217 of a single tuple (that is, the size of a segment selector
3218 plus twice the \addtoindex{size of an address}).
3219 The header is padded, if
3220 necessary, to that boundary. Each set of tuples is terminated
3221 by a 0 for the segment, a 0 for the address and 0 for the
3222 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3223 the segment selectors are omitted from all tuples, including
3224 the terminating tuple.
3227 \section{Line Number Information}
3228 \label{datarep:linenumberinformation}
3230 The \addtoindexi{version number}{version number!line number information}
3231 in the line number program header is \versiondotdebugline{}.
3233 The boolean values \doublequote{true} and \doublequote{false}
3234 used by the line number information program are encoded
3235 as a single byte containing the value 0
3236 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3239 The encodings for the standard opcodes are given in
3240 \addtoindexx{line number opcodes!standard opcode encoding}
3241 Table \refersec{tab:linenumberstandardopcodeencodings}.
3244 \setlength{\extrarowheight}{0.1cm}
3245 \begin{longtable}{l|c}
3246 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3247 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3249 \bfseries Opcode name&\bfseries Value\\ \hline
3251 \hline \emph{Continued on next page}
3257 \DWLNSadvancepc&0x02 \\
3258 \DWLNSadvanceline&0x03 \\
3259 \DWLNSsetfile&0x04 \\
3260 \DWLNSsetcolumn&0x05 \\
3261 \DWLNSnegatestmt&0x06 \\
3262 \DWLNSsetbasicblock&0x07 \\
3263 \DWLNSconstaddpc&0x08 \\
3264 \DWLNSfixedadvancepc&0x09 \\
3265 \DWLNSsetprologueend&0x0a \\*
3266 \DWLNSsetepiloguebegin&0x0b \\*
3267 \DWLNSsetisa&0x0c \\*
3273 The encodings for the extended opcodes are given in
3274 \addtoindexx{line number opcodes!extended opcode encoding}
3275 Table \refersec{tab:linenumberextendedopcodeencodings}.
3278 \setlength{\extrarowheight}{0.1cm}
3279 \begin{longtable}{l|c}
3280 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3281 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3283 \bfseries Opcode name&\bfseries Value\\ \hline
3285 \hline \emph{Continued on next page}
3287 \hline %\ddag~\textit{New in DWARF Version 5}
3290 \DWLNEendsequence &0x01 \\
3291 \DWLNEsetaddress &0x02 \\
3292 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3293 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3295 \DWLNEsetdiscriminator &0x04 \\
3296 \DWLNElouser &0x80 \\
3297 \DWLNEhiuser &\xff \\
3303 The encodings for the line number header entry formats are given in
3304 \addtoindexx{line number opcodes!file entry format encoding}
3305 Table \refersec{tab:linenumberheaderentryformatencodings}.
3308 \setlength{\extrarowheight}{0.1cm}
3309 \begin{longtable}{l|c}
3310 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3311 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3313 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3315 \hline \emph{Continued on next page}
3317 \hline \ddag~\textit{New in DWARF Version 5}
3319 \DWLNCTpath~\ddag & 0x1 \\
3320 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3321 \DWLNCTtimestamp~\ddag & 0x3 \\
3322 \DWLNCTsize~\ddag & 0x4 \\
3323 \DWLNCTMDfive~\ddag & 0x5 \\
3324 \DWLNCTlouser~\ddag & 0x2000 \\
3325 \DWLNCThiuser~\ddag & \xiiifff \\
3330 \section{Macro Information}
3331 \label{datarep:macroinformation}
3332 The \addtoindexi{version number}{version number!macro information}
3333 in the macro information header is \versiondotdebugmacro{}.
3335 The source line numbers and source file indices encoded in the
3336 macro information section are represented as
3337 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3340 The macro information entry type is encoded as a single unsigned byte.
3342 \addtoindexx{macro information entry types!encoding}
3344 Table \refersec{tab:macroinfoentrytypeencodings}.
3348 \setlength{\extrarowheight}{0.1cm}
3349 \begin{longtable}{l|c}
3350 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3351 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3353 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3355 \hline \emph{Continued on next page}
3357 \hline \ddag~\textit{New in DWARF Version 5}
3360 \DWMACROdefine~\ddag &0x01 \\
3361 \DWMACROundef~\ddag &0x02 \\
3362 \DWMACROstartfile~\ddag &0x03 \\
3363 \DWMACROendfile~\ddag &0x04 \\
3364 \DWMACROdefinestrp~\ddag &0x05 \\
3365 \DWMACROundefstrp~\ddag &0x06 \\
3366 \DWMACROimport~\ddag &0x07 \\
3367 \DWMACROdefinesup~\ddag &0x08 \\
3368 \DWMACROundefsup~\ddag &0x09 \\
3369 \DWMACROimportsup~\ddag &0x0a \\
3370 \DWMACROdefinestrx~\ddag &0x0b \\
3371 \DWMACROundefstrx~\ddag &0x0c \\
3372 \DWMACROlouser~\ddag &0xe0 \\
3373 \DWMACROhiuser~\ddag &\xff \\
3379 \section{Call Frame Information}
3380 \label{datarep:callframeinformation}
3382 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3383 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3384 value is \xffffffffffffffff.
3386 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3387 is \versiondotdebugframe.
3389 Call frame instructions are encoded in one or more bytes. The
3390 primary opcode is encoded in the high order two bits of
3391 the first byte (that is, opcode = byte $\gg$ 6). An operand
3392 or extended opcode may be encoded in the low order 6
3393 bits. Additional operands are encoded in subsequent bytes.
3394 The instructions and their encodings are presented in
3395 Table \refersec{tab:callframeinstructionencodings}.
3398 \setlength{\extrarowheight}{0.1cm}
3399 \begin{longtable}{l|c|c|l|l}
3400 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3401 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3402 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3404 & \bfseries High 2 &\bfseries Low 6 & &\\
3405 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3407 \hline \emph{Continued on next page}
3412 \DWCFAadvanceloc&0x1&delta & \\
3413 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3414 \DWCFArestore&0x3®ister & & \\
3415 \DWCFAnop&0&0 & & \\
3416 \DWCFAsetloc&0&0x01&address & \\
3417 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3418 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3419 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3420 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3421 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3422 \DWCFAundefined&0&0x07&ULEB128 register & \\
3423 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3424 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3425 \DWCFArememberstate&0&0x0a & & \\
3426 \DWCFArestorestate&0&0x0b & & \\
3427 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3428 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3429 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3430 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3431 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3433 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3434 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3435 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3436 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3437 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3438 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3439 \DWCFAlouser&0&0x1c & & \\
3440 \DWCFAhiuser&0&\xiiif & & \\
3445 \section{Range List Entries for Non-contiguous Address Ranges}
3446 \label{datarep:noncontiguousaddressranges}
3449 Each entry in a \addtoindex{range list}
3450 (see Section \refersec{chap:noncontiguousaddressranges})
3452 \addtoindexx{base address selection entry!in range list}
3454 \addtoindexx{range list}
3455 a base address selection entry, or an end-of-list entry.
3458 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
3459 that follows. The encodings for these constants are given in
3460 Table \refersec{tab:rnglistsentryencodingvalues}.
3465 \setlength{\extrarowheight}{0.1cm}
3466 \begin{longtable}{l|c}
3467 \caption{Range list entry encoding values}
3468 \label{tab:rnglistsentryencodingvalues} \\
3469 \hline \bfseries Range list entry encoding name&\bfseries Value \\ \hline
3471 \bfseries Range list entry encoding name&\bfseries Value\\ \hline
3473 \hline \emph{Continued on next page}
3476 \ddag New in \DWARFVersionV
3479 \DWRLEendoflist~\ddag & 0x00 \\
3480 \DWRLEbaseaddressx~\ddag & 0x01 \\
3481 \DWRLEstartxendx~\ddag & 0x02 \\
3482 \DWRLEstartxlength~\ddag & 0x03 \\
3483 \DWRLEoffsetpair~\ddag & 0x04 \\
3484 \DWRLEbaseaddress~\ddag & 0x05 \\
3485 \DWRLEstartend~\ddag & 0x06 \\
3486 \DWRLEstartlength~\ddag & 0x07
3491 For a \addtoindex{range list} to be specified, the base address of the
3492 \addtoindexx{base address selection entry!in range list}
3493 corresponding compilation unit must be defined
3494 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3497 \section{String Offsets Table}
3498 \label{chap:stringoffsetstable}
3499 Each set of entries in the string offsets table contained in the
3500 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3501 section begins with a header containing:
3502 \begin{enumerate}[1. ]
3503 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3504 \addttindexx{unit\_length}
3505 A 4-byte or 12-byte length containing the length of
3506 the set of entries for this compilation unit, not
3507 including the length field itself. In the 32-bit
3508 DWARF format, this is a 4-byte unsigned integer
3509 (which must be less than \xfffffffzero); in the 64-bit
3510 DWARF format, this consists of the 4-byte value
3511 \wffffffff followed by an 8-byte unsigned integer
3512 that gives the actual length (see
3513 Section \refersec{datarep:32bitand64bitdwarfformats}).
3516 \item \texttt{version} (\HFTuhalf) \\
3517 \addtoindexx{version number!string offsets table}
3518 A 2-byte version identifier containing the value
3519 \versiondotdebugstroffsets{}.
3521 \item \textit{padding} (\HFTuhalf) \\
3522 Reserved to DWARF (must be zero).
3525 This header is followed by a series of string table offsets
3526 that have the same representation as \DWFORMstrp.
3527 For the 32-bit DWARF format, each offset is 4 bytes long; for
3528 the 64-bit DWARF format, each offset is 8 bytes long.
3530 The \DWATstroffsetsbase{} attribute points to the first
3531 entry following the header. The entries are indexed
3532 sequentially from this base entry, starting from 0.
3534 \section{Address Table}
3535 \label{chap:addresstable}
3536 Each set of entries in the address table contained in the
3537 \dotdebugaddr{} section begins with a header containing:
3538 \begin{enumerate}[1. ]
3539 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3540 \addttindexx{unit\_length}
3541 A 4-byte or 12-byte length containing the length of
3542 the set of entries for this compilation unit, not
3543 including the length field itself. In the 32-bit
3544 DWARF format, this is a 4-byte unsigned integer
3545 (which must be less than \xfffffffzero); in the 64-bit
3546 DWARF format, this consists of the 4-byte value
3547 \wffffffff followed by an 8-byte unsigned integer
3548 that gives the actual length (see
3549 Section \refersec{datarep:32bitand64bitdwarfformats}).
3552 \item \texttt{version} (\HFTuhalf) \\
3553 \addtoindexx{version number!address table}
3554 A 2-byte version identifier containing the value
3555 \versiondotdebugaddr{}.
3558 \item \texttt{address\_size} (\HFTubyte) \\
3559 A 1-byte unsigned integer containing the size in
3560 bytes of an address (or the offset portion of an
3561 address for segmented addressing) on the target
3565 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3566 A 1-byte unsigned integer containing the size in
3567 bytes of a segment selector on the target system.
3570 This header is followed by a series of segment/address pairs.
3571 The segment size is given by the \HFNsegmentselectorsize{} field of the
3572 header, and the address size is given by the \addttindex{address\_size}
3573 field of the header. If the \HFNsegmentselectorsize{} field in the header
3574 is zero, the entries consist only of an addresses.
3576 The \DWATaddrbase{} attribute points to the first entry
3577 following the header. The entries are indexed sequentially
3578 from this base entry, starting from 0.
3581 \section{Range List Table}
3582 \label{app:ranglisttable}
3584 Each \dotdebugrnglists{} and \dotdebugrnglistsdwo{} section
3586 begins with a header containing:
3587 \begin{enumerate}[1. ]
3588 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3589 \addttindexx{unit\_length}
3590 A 4-byte or 12-byte length containing the length of
3591 the set of entries for this compilation unit, not
3592 including the length field itself. In the 32-bit
3593 DWARF format, this is a 4-byte unsigned integer
3594 (which must be less than \xfffffffzero); in the 64-bit
3595 DWARF format, this consists of the 4-byte value
3596 \wffffffff followed by an 8-byte unsigned integer
3597 that gives the actual length (see
3598 Section \refersec{datarep:32bitand64bitdwarfformats}).
3601 \item \texttt{version} (\HFTuhalf) \\
3602 \addtoindexx{version number!range list table}
3603 A 2-byte version identifier containing the value
3604 \versiondotdebugrnglists{}.
3607 \item \texttt{address\_size} (\HFTubyte) \\
3608 A 1-byte unsigned integer containing the size in
3609 bytes of an address (or the offset portion of an
3610 address for segmented addressing) on the target
3614 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3615 A 1-byte unsigned integer containing the size in
3616 bytes of a segment selector on the target system.
3619 \item \HFNoffsetentrycount{} (\HFTuword) \\
3620 A 4-byte count of the number of offsets
3621 that follow the header.
3626 Immediately following the header is an array of offsets.
3627 This array is followed by a series of range lists.