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
113 \dotdebugnames{}) or the length field
114 that occurs at the beginning of the CIE and FDE structures
115 in the \dotdebugframe{} section.
118 In an \addtoindex{initial length} field, the values \wfffffffzero through
119 \wffffffff are reserved by DWARF to indicate some form of
120 extension relative to \DWARFVersionII; such values must not
121 be interpreted as a length field. The use of one such value,
122 \xffffffff, is defined in
123 Section \refersec{datarep:32bitand64bitdwarfformats});
125 the other values is reserved for possible future extensions.
128 \section{Relocatable, Split, Executable, Shared and Package Object Files}
129 \label{datarep:executableobjectsandsharedobjects}
131 \subsection{Relocatable Object Files}
132 \label{datarep:relocatableobjectfiles}
133 A DWARF producer (for example, a compiler) typically generates its
134 debugging information as part of a relocatable object file.
135 Relocatable object files are then combined by a linker to form an
136 executable file. During the linking process, the linker resolves
137 (binds) symbolic references between the various object files, and
138 relocates the contents of each object file into a combined virtual
141 The DWARF debugging information is placed in several sections (see
142 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
143 requires an object file format capable of
144 representing these separate sections. There are symbolic references
145 between these sections, and also between the debugging information
146 sections and the other sections that contain the text and data of the
147 program itself. Many of these references require relocation, and the
148 producer must emit the relocation information appropriate to the
149 object file format and the target processor architecture. These
150 references include the following:
153 \item The compilation unit header (see Section
154 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
155 section contains a reference to the \dotdebugabbrev{} table. This
156 reference requires a relocation so that after linking, it refers to
157 that contribution to the combined \dotdebugabbrev{} section in the
160 \item Debugging information entries may have attributes with the form
161 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
162 These attributes represent locations
163 within the virtual address space of the program, and require
166 \item A DWARF expression may contain a \DWOPaddr{} (see Section
167 \refersec{chap:literalencodings}) which contains a location within
168 the virtual address space of the program, and require relocation.
171 \item Debugging information entries may have attributes with the form
172 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
173 These attributes refer to
174 debugging information in other debugging information sections within
175 the object file, and must be relocated during the linking process.
177 However, if a \DWATrangesbase{} attribute is present, the offset in
178 a \DWATranges{} attribute (which uses form \DWFORMsecoffset) is
179 relative to the given base offset--no relocation is involved.
181 \item Debugging information entries may have attributes with the form
182 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
183 These attributes refer to
184 debugging information entries that may be outside the current
185 compilation unit. These values require both symbolic binding and
188 \item Debugging information entries may have attributes with the form
189 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
190 These attributes refer to strings in
191 the \dotdebugstr{} section. These values require relocation.
193 \item Entries in the \dotdebugaddr, \dotdebugloc{}, \dotdebugranges{}
194 and \dotdebugaranges{}
195 sections contain references to locations within the virtual address
196 space of the program, and require relocation.
198 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
199 opcode is a reference to a location within the virtual address space
200 of the program, and requires relocation.
202 \item The \dotdebugstroffsets{} section contains a list of string offsets,
203 each of which is an offset of a string in the \dotdebugstr{} section. Each
204 of these offsets requires relocation. Depending on the implementation,
205 these relocations may be implicit (that is, the producer may not need to
206 emit any explicit relocation information for these offsets).
208 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges{} header and
209 the list of compilation units following the \dotdebugnames{} header contain
210 references to the \dotdebuginfo{} section. These references require relocation
211 so that after linking they refer to the correct contribution in the combined
212 \dotdebuginfo{} section in the executable file.
214 \item Frame descriptor entries in the \dotdebugframe{} section
215 (see Section \refersec{chap:structureofcallframeinformation}) contain an
216 \HFNinitiallocation{} field value within the virtual address
217 space of the program and require relocation.
222 \textit{Note that operands of classes
224 \CLASSflag{} do not require relocation. Attribute operands that use
225 forms \DWFORMstring{},
226 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
227 \DWFORMrefudata{} also do not need relocation.}
229 \subsection{Split DWARF Object Files}
230 \label{datarep:splitdwarfobjectfiles}
231 \addtoindexx{split DWARF object file}
232 A DWARF producer may partition the debugging
233 information such that the majority of the debugging
234 information can remain in individual object files without
235 being processed by the linker.
237 \textit{This reduces link time by reducing the amount of information
238 the linker must process.}
241 \subsubsection{First Partition (with Skeleton Unit)}
242 The first partition contains
243 debugging information that must still be processed by the linker,
244 and includes the following:
247 The line number tables, range tables, frame tables, and
248 accelerated access tables, in the usual sections:
249 \dotdebugline, \dotdebuglinestr, \dotdebugranges, \dotdebugframe,
250 \dotdebugnames{} and \dotdebugaranges,
254 An address table, in the \dotdebugaddr{} section. This table
255 contains all addresses and constants that require
256 link-time relocation, and items in the table can be
257 referenced indirectly from the debugging information via
258 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
259 \DWOPconstx{} operators.
261 A skeleton compilation unit, as described in Section
262 \refersec{chap:skeletoncompilationunitentries},
263 in the \dotdebuginfo{} section.
265 An abbreviations table for the skeleton compilation unit,
266 in the \dotdebugabbrev{} section
268 used by the \dotdebuginfo{} section.
272 A string table, in the \dotdebugstr{} section. The string
273 table is necessary only if the skeleton compilation unit
274 uses either indirect string form, \DWFORMstrp{} or
277 A string offsets table, in the \dotdebugstroffsets{}
280 for strings in the \dotdebugstr{} section.
282 The string offsets table is necessary only if
283 the skeleton compilation unit uses the \DWFORMstrx{} form.
285 The attributes contained in the skeleton compilation
286 unit can be used by a DWARF consumer to find the
287 DWARF object file that contains the second partition.
289 \subsubsection{Second Partition (Unlinked or in a \texttt{.dwo} File)}
290 The second partition contains the debugging information that
291 does not need to be processed by the linker. These sections
292 may be left in the object files and ignored by the linker
293 (that is, not combined and copied to the executable object file), or
294 they may be placed by the producer in a separate DWARF object
295 file. This partition includes the following:
298 The full compilation unit, in the \dotdebuginfodwo{} section.
301 Attributes contained in the full compilation unit
302 may refer to machine addresses indirectly using the \DWFORMaddrx{}
303 form, which accesses the table of addresses specified by the
304 \DWATaddrbase{} attribute in the associated skeleton unit.
305 Location descriptions may similarly do so using the \DWOPaddrx{} and
306 \DWOPconstx{} operations.
309 \DWATranges{} attributes contained in the full compilation unit
310 may refer to range table entries with a \DWFORMsecoffset{} offset
311 relative to the base offset specified by the \DWATrangesbase{}
312 attribute in the associated skeleton unit.
315 \item Separate type units, in the \dotdebuginfodwo{} section.
318 Abbreviations table(s) for the compilation unit and type
319 units, in the \dotdebugabbrevdwo{} section
321 used by the \dotdebuginfodwo{} section.
324 \item Location lists, in the \dotdebuglocdwo{} section.
327 A \addtoindex{specialized line number table} (for the type units),
328 in the \dotdebuglinedwo{} section. This table
329 contains only the directory and filename lists needed to
330 interpret \DWATdeclfile{} attributes in the debugging
333 \item Macro information, in the \dotdebugmacrodwo{} section.
335 \item A string table, in the \dotdebugstrdwo{} section.
337 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
340 for the strings in the \dotdebugstrdwo{} section.
344 Except where noted otherwise, all references in this document
345 to a debugging information section (for example, \dotdebuginfo),
346 apply also to the corresponding split DWARF section (for example,
350 Split DWARF object files do not get linked with any other files,
351 therefore references between sections must not make use of
352 normal object file relocation information. As a result, symbolic
353 references within or between sections are not possible.
355 \subsection{Executable Objects}
356 \label{chap:executableobjects}
357 The relocated addresses in the debugging information for an
358 executable object are virtual addresses.
360 The sections containing the debugging information are typically
361 not loaded as part of the memory image of the program (in ELF
362 terminology, the sections are not "allocatable" and are not part
363 of a loadable segment). Therefore, the debugging information
364 sections described in this document are typically linked as if
365 they were each to be loaded at virtual address 0, and references
366 within the debugging information always implicitly indicate which
367 section a particular offset refers to. (For example, a reference
368 of form \DWFORMsecoffset{} may refer to one of several sections,
369 depending on the class allowed by a particular attribute of a
370 debugging information entry, as shown in
371 Table \refersec{tab:attributeencodings}.)
374 \subsection{Shared Object Files}
375 \label{datarep:sharedobjectfiles}
377 addresses in the debugging information for a shared object file
378 are offsets relative to the start of the lowest region of
379 memory loaded from that shared object file.
382 \textit{This requirement makes the debugging information for
383 shared object files position independent. Virtual addresses in a
384 shared object file may be calculated by adding the offset to the
385 base address at which the object file was attached. This offset
386 is available in the run\dash time linker\textquoteright s data structures.}
388 As with executable objects, the sections containing debugging
389 information are typically not loaded as part of the memory image
390 of the shared object, and are typically linked as if they were
391 each to be loaded at virtual address 0.
393 \subsection{DWARF Package Files}
394 \label{datarep:dwarfpackagefiles}
395 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
396 link, and debug an application quickly with less link-time overhead,
397 but a more convenient format is needed for saving the debug
398 information for later debugging of a deployed application. A
399 DWARF package file can be used to collect the debugging
400 information from the object (or separate DWARF object) files
401 produced during the compilation of an application.}
403 \textit{The package file is typically placed in the same directory as the
404 application, and is given the same name with a \doublequote{\texttt{.dwp}}
405 extension.\addtoindexx{\texttt{.dwp} file extension}}
408 A DWARF package file is itself an object file, using the
409 \addtoindexx{package files}
410 \addtoindexx{DWARF package files}
411 same object file format (including \byteorder) as the
412 corresponding application binary. It consists only of a file
413 header, a section table, a number of DWARF debug information
414 sections, and two index sections.
417 Each DWARF package file contains no more than one of each of the
418 following sections, copied from a set of object or DWARF object
419 files, and combined, section by section:
425 \dotdebugstroffsetsdwo
430 The string table section in \dotdebugstrdwo{} contains all the
431 strings referenced from DWARF attributes using the form
432 \DWFORMstrx. Any attribute in a compilation unit or a type
433 unit using this form refers to an entry in that unit's
434 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
435 provides the offset of a string in the \dotdebugstrdwo{}
438 The DWARF package file also contains two index sections that
439 provide a fast way to locate debug information by compilation
440 unit ID for compilation units, or by type
441 signature for type units:
447 \subsubsection{The Compilation Unit (CU) Index Section}
448 The \dotdebugcuindex{} section is a hashed lookup table that maps a
449 compilation unit ID to a set of contributions in the
450 various debug information sections. Each contribution is stored
451 as an offset within its corresponding section and a size.
453 Each \compunitset{} may contain contributions from the
456 \dotdebuginfodwo{} (required)
457 \dotdebugabbrevdwo{} (required)
460 \dotdebugstroffsetsdwo
464 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
465 information from \DWARFVersionIV{} or earlier formats.}
467 \subsubsection{The Type Unit (TU) Index Section}
468 The \dotdebugtuindex{} section is a hashed lookup table that maps a
469 type signature to a set of offsets into the various debug
470 information sections. Each contribution is stored as an offset
471 within its corresponding section and a size.
473 Each \typeunitset{} may contain contributions from the following
476 \dotdebuginfodwo{} (required)
477 \dotdebugabbrevdwo{} (required)
479 \dotdebugstroffsetsdwo
482 \subsubsection{Format of the CU and TU Index Sections}
483 Both index sections have the same format, and serve to map an
484 8-byte signature to a set of contributions to the debug sections.
485 Each index section begins with a header, followed by a hash table of
486 signatures, a parallel table of indexes, a table of offsets, and
487 a table of sizes. The index sections are aligned at 8-byte
488 boundaries in the DWARF package file.
491 The index section header contains the following fields:
492 \begin{enumerate}[1. ]
493 \item \texttt{version} (\HFTuhalf) \\
495 \addtoindexx{version number!CU index information}
496 \addtoindexx{version number!TU index information}
497 This number is specific to the CU and TU index information
498 and is independent of the DWARF version number.
500 The version number is \versiondotdebugcuindex.
502 \item \textit{padding} (\HFTuhalf) \\
503 Reserved to DWARF (must be zero).
504 \item \texttt{section\_count} (\HFTuword) \\
505 The number of entries in the table of section counts that follows.
506 For brevity, the contents of this field is referred to as $N$ below.
508 \item \texttt{unit\_count} (\HFTuword) \\
509 The number of compilation units or type units in the index.
510 For brevity, the contents of this field is referred to as $U$ below.
512 \item \texttt{slot\_count} (\HFTuword) \\
513 The number of slots in the hash table.
514 For brevity, the contents of this field is referred to as $S$ below.
518 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
520 The size of the hash table, $S$, must be $2^k$ such that:
521 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
523 The hash table begins at offset 16 in the section, and consists
524 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
526 % (using the \byteorder{} of the application binary).
528 The parallel table of indices begins immediately after the hash table
529 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
530 consists of an array of $S$ 4-byte slots,
531 % (using the byte order of the application binary),
532 corresponding 1-1 with slots in the hash
533 table. Each entry in the parallel table contains a row index into
534 the tables of offsets and sizes.
536 Unused slots in the hash table have 0 in both the hash table
537 entry and the parallel table entry. While 0 is a valid hash
538 value, the row index in a used slot will always be non-zero.
540 Given an 8-byte compilation unit ID or type signature $X$,
541 an entry in the hash table is located as follows:
542 \begin{enumerate}[1. ]
543 \item Define $REP(X)$ to be the value of $X$ interpreted as an
544 unsigned 64-bit integer in the target byte order.
545 \item Calculate a primary hash $H = REP(X)\ \&\ MASK(k)$, where
546 $MASK(k)$ is a mask with the low-order $k$ bits all set to 1.
547 \item Calculate a secondary hash $H' = (((REP(X)>>32)\ \&\ MASK(k))\ |\ 1)$.
548 \item If the hash table entry at index $H$ matches the signature, use
549 that entry. If the hash table entry at index $H$ is unused (all
550 zeroes), terminate the search: the signature is not present
552 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 4.
555 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
556 guaranteed to stop at an unused slot or find the match.
559 The table of offsets begins immediately following the parallel
560 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
562 This table consists of a single header row containing $N$ fields,
563 each a 4-byte unsigned integer, followed by $U$ data rows, each
564 also containing $N$ fields of 4-byte unsigned integers. The fields
565 in the header row provide a section identifier referring to a
566 debug section; the available section identifiers are shown in
567 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
568 Each data row corresponds to a specific CU
569 or TU in the package file. In the data rows, each field provides
570 an offset to the debug section whose identifier appears in the
571 corresponding field of the header row. The data rows are indexed
575 \textit{Not all sections listed in the table need be included.}
579 \setlength{\extrarowheight}{0.1cm}
580 \begin{longtable}{l|c|l}
581 \caption{DWARF package file section identifier \mbox{encodings}}
582 \label{tab:dwarfpackagefilesectionidentifierencodings}
583 \addtoindexx{DWARF package files!section identifier encodings} \\
584 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
586 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
588 \hline \emph{Continued on next page}
592 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
593 \textit{Reserved} & 2 & \\
594 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
595 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
596 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
597 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
598 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
599 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
603 The offsets provided by the CU and TU index sections are the
604 base offsets for the contributions made by each CU or TU to the
605 corresponding section in the package file. Each CU and TU header
606 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
607 table for that CU or TU within the contribution to the
608 \dotdebugabbrevdwo{} section for that CU or TU, and are
609 interpreted as relative to the base offset given in the index
610 section. Likewise, offsets into \dotdebuglinedwo{} from
611 \DWATstmtlist{} attributes are interpreted as relative to
612 the base offset for \dotdebuglinedwo{}, and offsets into other debug
613 sections obtained from DWARF attributes are also
614 interpreted as relative to the corresponding base offset.
616 The table of sizes begins immediately following the table of
617 offsets, and provides the sizes of the contributions made by each
618 CU or TU to the corresponding section in the package file.
621 table consists of U data rows, each with N fields of 4-byte
622 unsigned integers. Each data row corresponds to the same CU or TU
623 as the corresponding data row in the table of offsets described
624 above. Within each data row, the N fields also correspond
625 one-to-one with the fields in the corresponding data row of the
626 table of offsets. Each field provides the size of the
627 contribution made by a CU or TU to the corresponding section in
631 For an example, see Figure \refersec{fig:examplecuindexsection}.
633 \subsection{DWARF Supplementary Object Files}
634 \label{datarep:dwarfsupplemetaryobjectfiles}
635 In order to minimize the size of debugging information,
636 it is possible to move duplicate debug information entries,
637 strings and macro entries from several executables or shared
638 object files into a separate
639 \addtoindexi{\textit{supplementary object file}}{supplementary object file}
640 by some post-linking utility; the moved entries and strings can
642 from the debugging information of each of those executable or
645 This facilitates distribution of separate consolidated debug files in
649 A DWARF \addtoindex{supplementary object file} is itself an object file,
650 using the same object
651 file format, \byteorder{}, and size as the corresponding application executables
652 or shared libraries. It consists only of a file header, section table, and
653 a number of DWARF debug information sections. Both the
654 \addtoindex{supplementary object file}
655 and all the executable or shared object files that reference entries or strings in that
656 file must contain a \dotdebugsup{} section that establishes the relationship.
658 The \dotdebugsup{} section contains:
659 \begin{enumerate}[1. ]
660 \item \texttt{version} (\HFTuhalf) \\
661 \addttindexx{version}
662 A 2-byte unsigned integer representing the version of the DWARF
663 information for the compilation unit.
665 The value in this field is \versiondotdebugsup.
667 \item \texttt{is\_supplementary} (\HFTubyte) \\
668 \addttindexx{is\_supplementary}
669 A 1-byte unsigned integer, which contains the value 1 if it is
670 in the \addtoindex{supplementary object file} that other executable or
671 shared object files refer to, or 0 if it is an executable or shared object
672 referring to a \addtoindex{supplementary object file}.
675 \item \texttt{sup\_filename} (null terminated filename string) \\
676 \addttindexx{sup\_filename}
677 If \addttindex{is\_supplementary} is 0, this contains either an absolute
678 filename for the \addtoindex{supplementary object file}, or a filename
679 relative to the object file containing the \dotdebugsup{} section.
680 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
681 is not needed and must be an empty string (a single null byte).
684 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
685 \addttindexx{sup\_checksum\_len}
686 Length of the following \addttindex{sup\_checksum} field;
687 this value can be 0 if no checksum is provided.
689 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
690 \addttindexx{sup\_checksum}
691 An implementation-defined integer constant value that
692 provides unique identification of the supplementary file.
696 Debug information entries that refer to an executable's or shared
697 object's addresses must \emph{not} be moved to supplementary files
698 (the addesses will likely not be the same). Similarly,
699 entries referenced from within location descriptions or using loclistptr
700 form attributes must not be moved to a \addtoindex{supplementary object file}.
702 Executable or shared object file compilation units can use
703 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
704 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
705 attributes to refer to them and \DWFORMstrpsup{} form attributes to
706 refer to strings that are used by debug information of multiple
707 executables or shared object files. Within the \addtoindex{supplementary object file}'s
708 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
709 not used, and all reference forms referring to some other sections
710 refer to the local sections in the \addtoindex{supplementary object file}.
712 In macro information, \DWMACROdefinesup{} or
713 \DWMACROundefsup{} opcodes can refer to strings in the
714 \dotdebugstr{} section of the \addtoindex{supplementary object file},
715 or \DWMACROimportsup{}
716 can refer to \dotdebugmacro{} section entries. Within the
717 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
718 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
719 opcodes refer to the local \dotdebugstr{} section in that
720 supplementary file, not the one in
721 the executable or shared object file.
725 \section{32-Bit and 64-Bit DWARF Formats}
726 \label{datarep:32bitand64bitdwarfformats}
727 \hypertarget{datarep:xxbitdwffmt}{}
728 \addtoindexx{32-bit DWARF format}
729 \addtoindexx{64-bit DWARF format}
730 There are two closely-related DWARF
731 formats. In the 32-bit DWARF
732 format, all values that represent lengths of DWARF sections
733 and offsets relative to the beginning of DWARF sections are
734 represented using four bytes. In the 64-bit DWARF format, all
735 values that represent lengths of DWARF sections and offsets
736 relative to the beginning of DWARF sections are represented
737 using eight bytes. A special convention applies to the initial
738 length field of certain DWARF sections, as well as the CIE and
739 FDE structures, so that the 32-bit and 64-bit DWARF formats
740 can coexist and be distinguished within a single linked object.
742 Except where noted otherwise, all references in this document
743 to a debugging information section (for example, \dotdebuginfo),
744 apply also to the corresponding split DWARF section (for example,
747 The differences between the 32- and 64-bit DWARF formats are
748 detailed in the following:
749 \begin{enumerate}[1. ]
751 \item In the 32-bit DWARF format, an
752 \addtoindex{initial length} field (see
753 \addtoindexx{initial length!encoding}
754 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
755 is an unsigned 4-byte integer (which
756 must be less than \xfffffffzero); in the 64-bit DWARF format,
757 an \addtoindex{initial length} field is 12 bytes in size,
760 \item The first four bytes have the value \xffffffff.
762 \item The following eight bytes contain the actual length
763 represented as an unsigned 8-byte integer.
766 \textit{This representation allows a DWARF consumer to dynamically
767 detect that a DWARF section contribution is using the 64-bit
768 format and to adapt its processing accordingly.}
771 \item \hypertarget{datarep:sectionoffsetlength}{}
772 Section offset and section length
773 \addtoindexx{section length!use in headers}
775 \addtoindexx{section offset!use in headers}
776 in the headers of DWARF sections (other than initial length
777 \addtoindexx{initial length}
778 fields) are listed following. In the 32-bit DWARF format these
779 are 4-byte unsigned integer values; in the 64-bit DWARF format,
780 they are 8-byte unsigned integer values.
784 Section &Name & Role \\ \hline
785 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
786 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
787 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
788 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
789 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
790 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
796 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
797 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
798 union must be accessed to distinguish whether a CIE or FDE is
799 present, consequently, these two fields must exactly overlay
800 each other (both offset and size).
802 \item Within the body of the \dotdebuginfo{}
803 section, certain forms of attribute value depend on the choice
804 of DWARF format as follows. For the 32-bit DWARF format,
805 the value is a 4-byte unsigned integer; for the 64-bit DWARF
806 format, the value is an 8-byte unsigned integer.
808 \begin{tabular}{lp{6cm}}
809 Form & Role \\ \hline
810 \DWFORMlinestrp & offset in \dotdebuglinestr \\
811 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
812 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
813 \addtoindexx{supplementary object file}
814 \DWFORMsecoffset & offset in a section other than \\
815 & \dotdebuginfo{} or \dotdebugstr{} \\
816 \DWFORMstrp & offset in \dotdebugstr{} \\
817 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
818 \DWOPcallref & offset in \dotdebuginfo{} \\
823 \item Within the body of the \dotdebugline{} section, certain forms of content
824 description depend on the choice of DWARF format as follows: for the
825 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
826 64-bit DWARF format, the value is a 8-byte unsigned integer.
828 \begin{tabular}{lp{6cm}}
829 Form & Role \\ \hline
830 \DWFORMlinestrp & offset in \dotdebuglinestr
834 \item Within the body of the \dotdebugnames{}
835 sections, the representation of each entry in the array of
836 compilation units (CUs) and the array of local type units
837 (TUs), which represents an offset in the
839 section, depends on the DWARF format as follows: in the
840 32-bit DWARF format, each entry is a 4-byte unsigned integer;
841 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
844 \item In the body of the \dotdebugstroffsets{}
845 sections, the size of entries in the body depend on the DWARF
846 format as follows: in the 32-bit DWARF format, entries are 4-byte
847 unsigned integer values; in the 64-bit DWARF format, they are
848 8-byte unsigned integers.
850 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
851 sections, the contents of the address size fields depends on the
852 DWARF format as follows: in the 32-bit DWARF format, these fields
853 contain 4; in the 64-bit DWARF format these fields contain 8.
857 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
858 intermixed within a single compilation unit.
860 \textit{Attribute values and section header fields that represent
861 addresses in the target program are not affected by these
864 A DWARF consumer that supports the 64-bit DWARF format must
865 support executables in which some compilation units use the
866 32-bit format and others use the 64-bit format provided that
867 the combination links correctly (that is, provided that there
868 are no link\dash time errors due to truncation or overflow). (An
869 implementation is not required to guarantee detection and
870 reporting of all such errors.)
872 \textit{It is expected that DWARF producing compilers will \emph{not} use
873 the 64-bit format \emph{by default}. In most cases, the division of
874 even very large applications into a number of executable and
875 shared object files will suffice to assure that the DWARF sections
876 within each individual linked object are less than 4 GBytes
877 in size. However, for those cases where needed, the 64-bit
878 format allows the unusual case to be handled as well. Even
879 in this case, it is expected that only application supplied
880 objects will need to be compiled using the 64-bit format;
881 separate 32-bit format versions of system supplied shared
882 executable libraries can still be used.}
885 \section{Format of Debugging Information}
886 \label{datarep:formatofdebugginginformation}
888 For each compilation unit compiled with a DWARF producer,
889 a contribution is made to the \dotdebuginfo{} section of
890 the object file. Each such contribution consists of a
891 compilation unit header
892 (see Section \refersec{datarep:compilationunitheader})
894 single \DWTAGcompileunit{} or
895 \DWTAGpartialunit{} debugging
896 information entry, together with its children.
898 For each type defined in a compilation unit, a separate
899 contribution may also be made to the
901 section of the object file. Each
902 such contribution consists of a
903 \addtoindex{type unit} header
904 (see Section \refersec{datarep:typeunitheaders})
905 followed by a \DWTAGtypeunit{} entry, together with
908 Each debugging information entry begins with a code that
909 represents an entry in a separate
910 \addtoindex{abbreviations table}. This
911 code is followed directly by a series of attribute values.
913 The appropriate entry in the
914 \addtoindex{abbreviations table} guides the
915 interpretation of the information contained directly in the
916 \dotdebuginfo{} section.
919 Multiple debugging information entries may share the same
920 abbreviation table entry. Each compilation unit is associated
921 with a particular abbreviation table, but multiple compilation
922 units may share the same table.
924 \subsection{Unit Headers}
925 \label{datarep:unitheaders}
926 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
927 compilation unit that follows. The encodings for the unit type
928 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
932 \setlength{\extrarowheight}{0.1cm}
933 \begin{longtable}{l|c}
934 \caption{Unit header unit type encodings}
935 \label{tab:unitheaderunitkindencodings}
936 \addtoindexx{unit header unit type encodings} \\
937 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
939 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
941 \hline \emph{Continued on next page}
943 \hline \ddag\ \textit{New in DWARF Version 5}
945 \DWUTcompileTARG~\ddag &0x01 \\
946 \DWUTtypeTARG~\ddag &0x02 \\
947 \DWUTpartialTARG~\ddag &0x03 \\
948 \DWUTskeletonTARG~\ddag &0x04 \\
949 \DWUTsplitcompileTARG~\ddag &0x05 \\
950 \DWUTsplittypeTARG~\ddag &0x06 \\
951 \DWUTlouserTARG~\ddag &0x80 \\
952 \DWUThiuserTARG~\ddag &\xff
958 \textit{All unit headers in a compilation have the same size.
959 Some header types include padding bytes to achieve this.}
962 \subsubsection{Compilation and Partial Unit Headers}
963 \label{datarep:compilationunitheader}
964 \begin{enumerate}[1. ]
966 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
967 \addttindexx{unit\_length}
969 \addtoindexx{initial length}
970 unsigned integer representing the length
971 of the \dotdebuginfo{} contribution for that compilation unit,
972 not including the length field itself. In the \thirtytwobitdwarfformat,
973 this is a 4-byte unsigned integer (which must be less
974 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
975 of the 4-byte value \wffffffff followed by an 8-byte unsigned
976 integer that gives the actual length
977 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
979 \item \texttt{version} (\HFTuhalf) \\
980 \addttindexx{version}
981 \addtoindexx{version number!compilation unit}
982 A 2-byte unsigned integer representing the version of the
983 DWARF information for the compilation unit.
985 The value in this field is \versiondotdebuginfo.
987 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
988 for a summary of all version numbers that apply to DWARF sections.}
991 \item \texttt{unit\_type} (\HFTubyte) \\
992 \addttindexx{unit\_type}
993 A 1-byte unsigned integer identifying this unit as a compilation unit.
994 The value of this field is
995 \DWUTcompile{} for a full compilation unit or
996 \DWUTpartial{} for a partial compilation unit
997 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
999 \textit{This field is new in \DWARFVersionV.}
1002 \item \texttt{address\_size} (\HFTubyte) \\
1003 \addttindexx{address\_size}
1004 A 1-byte unsigned integer representing the size in bytes of
1005 an address on the target architecture. If the system uses
1006 \addtoindexx{address space!segmented}
1007 segmented addressing, this value represents the size of the
1008 offset portion of an address.
1010 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1012 \addtoindexx{section offset!in .debug\_info header}
1013 4-byte or 8-byte unsigned offset into the
1015 section. This offset associates the compilation unit with a
1016 particular set of debugging information entry abbreviations. In
1017 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1018 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1019 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1021 \item \HFNunitpaddingONE{} (8 bytes) \\
1022 Reserved to DWARF (must be zero).
1025 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1026 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1027 this is 4 bytes in length; in the \sixtyfourbitdwarfformat this
1028 is 8 bytes in length.
1032 \subsubsection{Skeleton and Split Compilation Unit Headers}
1033 \label{datarep:skeletonandfullcompilationunitheaders}
1034 \begin{enumerate}[1. ]
1036 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1037 \addttindexx{unit\_length}
1039 \addtoindexx{initial length}
1040 unsigned integer representing the length
1041 of the \dotdebuginfo{}
1042 contribution for that compilation unit,
1043 not including the length field itself. In the \thirtytwobitdwarfformat,
1044 this is a 4-byte unsigned integer (which must be less
1045 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1046 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1047 integer that gives the actual length
1048 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1050 \item \texttt{version} (\HFTuhalf) \\
1051 \addttindexx{version}
1052 \addtoindexx{version number!compilation unit}
1053 A 2-byte unsigned integer representing the version of the
1054 DWARF information for the compilation unit.
1056 The value in this field is \versiondotdebuginfo.
1058 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1059 for a summary of all version numbers that apply to DWARF sections.}
1062 \item \texttt{unit\_type} (\HFTubyte) \\
1063 \addttindexx{unit\_type}
1064 A 1-byte unsigned integer identifying this unit as a compilation unit.
1065 The value of this field is
1066 \DWUTskeleton{} for a skeleton compilation unit or
1067 \DWUTsplitcompile{} for a split compilation unit
1068 (see Section \refersec{chap:skeletoncompilationunitentries}).
1070 \textit{This field is new in \DWARFVersionV.}
1073 \item \texttt{address\_size} (\HFTubyte) \\
1074 \addttindexx{address\_size}
1075 A 1-byte unsigned integer representing the size in bytes of
1076 an address on the target architecture. If the system uses
1077 \addtoindexx{address space!segmented}
1078 segmented addressing, this value represents the size of the
1079 offset portion of an address.
1081 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1083 \addtoindexx{section offset!in .debug\_info header}
1084 4-byte or 8-byte unsigned offset into the
1086 section. This offset associates the compilation unit with a
1087 particular set of debugging information entry abbreviations. In
1088 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1089 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1090 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1093 \item \HFNdwoid{} (unit ID) \\
1094 An 8-byte implementation-defined integer constant value,
1095 known as the compilation unit ID, that provides
1096 unique identification of a skeleton compilation
1097 unit and its associated split compilation unit in
1098 the object file named in the \DWATdwoname{} attribute
1099 of the skeleton compilation.
1102 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1103 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1104 this is 4 bytes in length; in the \sixtyfourbitdwarfformat this
1105 is 8 bytes in length.
1109 \subsubsection{Type Unit Headers}
1110 \label{datarep:typeunitheaders}
1111 The header for the series of debugging information entries
1112 contributing to the description of a type that has been
1113 placed in its own \addtoindex{type unit}, within the
1114 \dotdebuginfo{} section,
1115 consists of the following information:
1116 \begin{enumerate}[1. ]
1117 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1118 \addttindexx{unit\_length}
1119 A 4-byte or 12-byte unsigned integer
1120 \addtoindexx{initial length}
1121 representing the length
1122 of the \dotdebuginfo{} contribution for that type unit,
1123 not including the length field itself. In the \thirtytwobitdwarfformat,
1124 this is a 4-byte unsigned integer (which must be
1125 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
1126 consists of the 4-byte value \wffffffff followed by an
1127 8-byte unsigned integer that gives the actual length
1128 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1131 \item \texttt{version} (\HFTuhalf) \\
1132 \addttindexx{version}
1133 \addtoindexx{version number!type unit}
1134 A 2-byte unsigned integer representing the version of the
1135 DWARF information for the type unit.
1137 The value in this field is \versiondotdebuginfo.
1139 \item \texttt{unit\_type} (\HFTubyte) \\
1140 \addttindexx{unit\_type}
1141 A 1-byte unsigned integer identifying this unit as a type unit.
1142 The value of this field is \DWUTtype{} for a non-split type unit
1143 (see Section \refersec{chap:typeunitentries})
1144 or \DWUTsplittype{} for a split type unit.
1146 \textit{This field is new in \DWARFVersionV.}
1149 \item \texttt{address\_size} (\HFTubyte) \\
1150 \addttindexx{address\_size}
1151 A 1-byte unsigned integer representing the size
1152 \addtoindexx{size of an address}
1154 an address on the target architecture. If the system uses
1155 \addtoindexx{address space!segmented}
1156 segmented addressing, this value represents the size of the
1157 offset portion of an address.
1160 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1162 \addtoindexx{section offset!in .debug\_info header}
1163 4-byte or 8-byte unsigned offset into the
1165 section. This offset associates the type unit with a
1166 particular set of debugging information entry abbreviations. In
1167 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1168 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1169 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1171 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1172 \addttindexx{type\_signature}
1173 \addtoindexx{type signature}
1174 A unique 8-byte signature (see Section
1175 \refersec{datarep:typesignaturecomputation})
1176 of the type described in this type
1179 \textit{An attribute that refers (using
1180 \DWFORMrefsigeight{}) to
1181 the primary type contained in this
1182 \addtoindex{type unit} uses this value.}
1185 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1186 \addttindexx{type\_offset}
1187 A 4-byte or 8-byte unsigned offset
1188 \addtoindexx{section offset!in .debug\_info header}
1189 relative to the beginning
1190 of the \addtoindex{type unit} header.
1191 This offset refers to the debugging
1192 information entry that describes the type. Because the type
1193 may be nested inside a namespace or other structures, and may
1194 contain references to other types that have not been placed in
1195 separate type units, it is not necessarily either the first or
1196 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1197 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1198 this is an 8-byte unsigned length
1199 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1203 \subsection{Debugging Information Entry}
1204 \label{datarep:debugginginformationentry}
1206 Each debugging information entry begins with an
1207 unsigned LEB128\addtoindexx{LEB128!unsigned}
1208 number containing the abbreviation code for the entry. This
1209 code represents an entry within the abbreviations table
1210 associated with the compilation unit containing this entry. The
1211 abbreviation code is followed by a series of attribute values.
1213 On some architectures, there are alignment constraints on
1214 section boundaries. To make it easier to pad debugging
1215 information sections to satisfy such constraints, the
1216 abbreviation code 0 is reserved. Debugging information entries
1217 consisting of only the abbreviation code 0 are considered
1220 \subsection{Abbreviations Tables}
1221 \label{datarep:abbreviationstables}
1223 The abbreviations tables for all compilation units
1224 are contained in a separate object file section called
1226 As mentioned before, multiple compilation
1227 units may share the same abbreviations table.
1229 The abbreviations table for a single compilation unit consists
1230 of a series of abbreviation declarations. Each declaration
1231 specifies the tag and attributes for a particular form of
1232 debugging information entry. Each declaration begins with
1233 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1234 number representing the abbreviation
1235 code itself. It is this code that appears at the beginning
1236 of a debugging information entry in the
1238 section. As described above, the abbreviation
1239 code 0 is reserved for null debugging information entries. The
1240 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1241 number that encodes the entry\textquoteright s tag. The encodings for the
1242 tag names are given in
1243 Table \refersec{tab:tagencodings}.
1247 \setlength{\extrarowheight}{0.1cm}
1248 \begin{longtable}{l|c}
1249 \caption{Tag encodings} \label{tab:tagencodings} \\
1250 \hline \bfseries Tag name&\bfseries Value\\ \hline
1252 \bfseries Tag name&\bfseries Value \\ \hline
1254 \hline \emph{Continued on next page}
1256 \hline \ddag\ \textit{New in DWARF Version 5}
1258 \DWTAGarraytype{} &0x01 \\
1259 \DWTAGclasstype&0x02 \\
1260 \DWTAGentrypoint&0x03 \\
1261 \DWTAGenumerationtype&0x04 \\
1262 \DWTAGformalparameter&0x05 \\
1263 \DWTAGimporteddeclaration&0x08 \\
1265 \DWTAGlexicalblock&0x0b \\
1266 \DWTAGmember&0x0d \\
1267 \DWTAGpointertype&0x0f \\
1268 \DWTAGreferencetype&0x10 \\
1269 \DWTAGcompileunit&0x11 \\
1270 \DWTAGstringtype&0x12 \\
1271 \DWTAGstructuretype&0x13 \\
1272 \DWTAGsubroutinetype&0x15 \\
1273 \DWTAGtypedef&0x16 \\
1274 \DWTAGuniontype&0x17 \\
1275 \DWTAGunspecifiedparameters&0x18 \\
1276 \DWTAGvariant&0x19 \\
1277 \DWTAGcommonblock&0x1a \\
1278 \DWTAGcommoninclusion&0x1b \\
1279 \DWTAGinheritance&0x1c \\
1280 \DWTAGinlinedsubroutine&0x1d \\
1281 \DWTAGmodule&0x1e \\
1282 \DWTAGptrtomembertype&0x1f \\
1283 \DWTAGsettype&0x20 \\
1284 \DWTAGsubrangetype&0x21 \\
1285 \DWTAGwithstmt&0x22 \\
1286 \DWTAGaccessdeclaration&0x23 \\
1287 \DWTAGbasetype&0x24 \\
1288 \DWTAGcatchblock&0x25 \\
1289 \DWTAGconsttype&0x26 \\
1290 \DWTAGconstant&0x27 \\
1291 \DWTAGenumerator&0x28 \\
1292 \DWTAGfiletype&0x29 \\
1293 \DWTAGfriend&0x2a \\
1294 \DWTAGnamelist&0x2b \\
1295 \DWTAGnamelistitem&0x2c \\
1296 \DWTAGpackedtype&0x2d \\
1297 \DWTAGsubprogram&0x2e \\
1298 \DWTAGtemplatetypeparameter&0x2f \\
1299 \DWTAGtemplatevalueparameter&0x30 \\
1300 \DWTAGthrowntype&0x31 \\
1301 \DWTAGtryblock&0x32 \\
1302 \DWTAGvariantpart&0x33 \\
1303 \DWTAGvariable&0x34 \\
1304 \DWTAGvolatiletype&0x35 \\
1305 \DWTAGdwarfprocedure&0x36 \\
1306 \DWTAGrestricttype&0x37 \\
1307 \DWTAGinterfacetype&0x38 \\
1308 \DWTAGnamespace&0x39 \\
1309 \DWTAGimportedmodule&0x3a \\
1310 \DWTAGunspecifiedtype&0x3b \\
1311 \DWTAGpartialunit&0x3c \\
1312 \DWTAGimportedunit&0x3d \\
1313 \textit{Reserved}&0x3e\footnote{Code 0x3e is reserved to allow backward compatible support of the
1314 DW\_TAG\_mutable\_type DIE that was defined (only) in \DWARFVersionIII.}
1316 \DWTAGcondition&\xiiif \\
1317 \DWTAGsharedtype&0x40 \\
1318 \DWTAGtypeunit & 0x41 \\
1319 \DWTAGrvaluereferencetype & 0x42 \\
1320 \DWTAGtemplatealias & 0x43 \\
1321 \DWTAGcoarraytype~\ddag & 0x44 \\
1322 \DWTAGgenericsubrange~\ddag & 0x45 \\
1323 \DWTAGdynamictype~\ddag & 0x46 \\
1324 \DWTAGatomictype~\ddag & 0x47 \\
1325 \DWTAGcallsite~\ddag & 0x48 \\
1326 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1327 \DWTAGskeletonunit~\ddag & 0x4a
1329 \DWTAGlouser&0x4080 \\
1330 \DWTAGhiuser&\xffff \\
1335 Following the tag encoding is a 1-byte value that determines
1336 whether a debugging information entry using this abbreviation
1337 has child entries or not. If the value is
1339 the next physically succeeding entry of any debugging
1340 information entry using this abbreviation is the first
1341 child of that entry. If the 1-byte value following the
1342 abbreviation\textquoteright s tag encoding is
1343 \DWCHILDRENnoTARG, the next
1344 physically succeeding entry of any debugging information entry
1345 using this abbreviation is a sibling of that entry. (Either
1346 the first child or sibling entries may be null entries). The
1347 encodings for the child determination byte are given in
1348 Table \refersec{tab:childdeterminationencodings}
1350 Section \refersec{chap:relationshipofdebugginginformationentries},
1351 each chain of sibling entries is terminated by a null entry.)
1355 \setlength{\extrarowheight}{0.1cm}
1356 \begin{longtable}{l|c}
1357 \caption{Child determination encodings}
1358 \label{tab:childdeterminationencodings}
1359 \addtoindexx{Child determination encodings} \\
1360 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1362 \bfseries Children determination name&\bfseries Value \\ \hline
1364 \hline \emph{Continued on next page}
1368 \DWCHILDRENno&0x00 \\
1369 \DWCHILDRENyes&0x01 \\ \hline
1374 Finally, the child encoding is followed by a series of
1375 attribute specifications. Each attribute specification
1376 consists of two parts. The first part is an
1377 unsigned LEB128\addtoindexx{LEB128!unsigned}
1378 number representing the attribute\textquoteright s name.
1379 The second part is an
1380 unsigned LEB128\addtoindexx{LEB128!unsigned}
1381 number representing the attribute\textquoteright s form.
1382 The series of attribute specifications ends with an
1383 entry containing 0 for the name and 0 for the form.
1387 \DWFORMindirectTARG{} is a special case. For
1388 attributes with this form, the attribute value itself in the
1390 section begins with an unsigned
1391 LEB128 number that represents its form. This allows producers
1392 to choose forms for particular attributes
1393 \addtoindexx{abbreviations table!dynamic forms in}
1395 without having to add a new entry to the abbreviations table.
1397 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1398 For attributes with this form, the attribute specification contains
1399 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1400 number. The value of this number is used as the value of the
1401 attribute, and no value is stored in the \dotdebuginfo{} section.
1403 The abbreviations for a given compilation unit end with an
1404 entry consisting of a 0 byte for the abbreviation code.
1407 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1408 for a depiction of the organization of the
1409 debugging information.}
1412 \subsection{Attribute Encodings}
1413 \label{datarep:attributeencodings}
1415 The encodings for the attribute names are given in
1416 Table \referfol{tab:attributeencodings}.
1419 \setlength{\extrarowheight}{0.1cm}
1420 \begin{longtable}{l|c|l}
1421 \caption{Attribute encodings}
1422 \label{tab:attributeencodings}
1423 \addtoindexx{attribute encodings} \\
1424 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1426 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1428 \hline \emph{Continued on next page}
1430 \hline \ddag\ \textit{New in DWARF Version 5}
1432 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1433 \addtoindexx{sibling attribute} \\
1434 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1435 \livelink{chap:classloclistptr}{loclistptr}
1436 \addtoindexx{location attribute} \\
1437 \DWATname&0x03&\livelink{chap:classstring}{string}
1438 \addtoindexx{name attribute} \\
1439 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1440 \addtoindexx{ordering attribute} \\
1441 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1442 \livelink{chap:classexprloc}{exprloc},
1443 \livelink{chap:classreference}{reference}
1444 \addtoindexx{byte size attribute} \\
1445 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1446 DW\_AT\_bit\_offset \mbox{attribute} which was
1447 defined in \DWARFVersionIII{} and earlier.}
1448 &\livelink{chap:classconstant}{constant},
1449 \livelink{chap:classexprloc}{exprloc},
1450 \livelink{chap:classreference}{reference}
1451 \addtoindexx{bit offset attribute (Version 3)}
1452 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1453 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1454 \livelink{chap:classexprloc}{exprloc},
1455 \livelink{chap:classreference}{reference}
1456 \addtoindexx{bit size attribute} \\
1457 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1458 \addtoindexx{statement list attribute} \\
1459 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1460 \addtoindexx{low PC attribute} \\
1461 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1462 \livelink{chap:classconstant}{constant}
1463 \addtoindexx{high PC attribute} \\
1464 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1465 \addtoindexx{language attribute} \\
1466 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1467 \addtoindexx{discriminant attribute} \\
1468 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1469 \addtoindexx{discriminant value attribute} \\
1470 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1471 \addtoindexx{visibility attribute} \\
1472 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1473 \addtoindexx{import attribute} \\
1474 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1475 \livelink{chap:classloclistptr}{loclistptr}
1476 \addtoindexx{string length attribute} \\
1477 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1478 \addtoindexx{common reference attribute} \\
1479 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1480 \addtoindexx{compilation directory attribute} \\
1481 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1482 \livelink{chap:classconstant}{constant},
1483 \livelink{chap:classstring}{string}
1484 \addtoindexx{constant value attribute} \\
1485 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1486 \addtoindexx{containing type attribute} \\
1487 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1488 \livelink{chap:classreference}{reference},
1489 \livelink{chap:classflag}{flag}
1490 \addtoindexx{default value attribute} \\
1491 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1492 \addtoindexx{inline attribute} \\
1493 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1494 \addtoindexx{is optional attribute} \\
1495 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1496 \livelink{chap:classexprloc}{exprloc},
1497 \livelink{chap:classreference}{reference}
1498 \addtoindexx{lower bound attribute} \\
1499 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1500 \addtoindexx{producer attribute} \\
1501 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1502 \addtoindexx{prototyped attribute} \\
1503 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1504 \livelink{chap:classloclistptr}{loclistptr}
1505 \addtoindexx{return address attribute} \\
1506 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1507 \livelink{chap:classrangelistptr}{rangelistptr}
1508 \addtoindexx{start scope attribute} \\
1509 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1510 \livelink{chap:classexprloc}{exprloc},
1511 \livelink{chap:classreference}{reference}
1512 \addtoindexx{bit stride attribute} \\
1513 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1514 \livelink{chap:classexprloc}{exprloc},
1515 \livelink{chap:classreference}{reference}
1516 \addtoindexx{upper bound attribute} \\
1517 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1518 \addtoindexx{abstract origin attribute} \\
1519 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1520 \addtoindexx{accessibility attribute} \\
1521 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1522 \addtoindexx{address class attribute} \\
1523 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1524 \addtoindexx{artificial attribute} \\
1525 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1526 \addtoindexx{base types attribute} \\
1527 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1528 \addtoindexx{calling convention attribute} \\
1529 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1530 \livelink{chap:classexprloc}{exprloc},
1531 \livelink{chap:classreference}{reference}
1532 \addtoindexx{count attribute} \\
1533 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1534 \livelink{chap:classexprloc}{exprloc},
1535 \livelink{chap:classloclistptr}{loclistptr}
1536 \addtoindexx{data member attribute} \\
1537 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1538 \addtoindexx{declaration column attribute} \\
1539 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1540 \addtoindexx{declaration file attribute} \\
1541 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1542 \addtoindexx{declaration line attribute} \\
1543 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1544 \addtoindexx{declaration attribute} \\
1545 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1546 \addtoindexx{discriminant list attribute} \\
1547 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1548 \addtoindexx{encoding attribute} \\
1549 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1550 \addtoindexx{external attribute} \\
1551 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1552 \livelink{chap:classloclistptr}{loclistptr}
1553 \addtoindexx{frame base attribute} \\
1554 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1555 \addtoindexx{friend attribute} \\
1556 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1557 \addtoindexx{identifier case attribute} \\
1558 \textit{Reserved}&0x43\footnote{Code 0x43 is reserved to allow backward compatible support of the
1559 DW\_AT\_macro\_info \mbox{attribute} which was
1560 defined in \DWARFVersionIV{} and earlier.}
1561 &\livelink{chap:classmacptr}{macptr}
1562 \addtoindexx{macro information attribute (legacy)!encoding} \\
1563 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1564 \addtoindexx{name list item attribute} \\
1565 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1566 \addtoindexx{priority attribute} \\
1567 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1568 \livelink{chap:classloclistptr}{loclistptr}
1569 \addtoindexx{segment attribute} \\
1570 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1571 \addtoindexx{specification attribute} \\
1572 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1573 \livelink{chap:classloclistptr}{loclistptr}
1574 \addtoindexx{static link attribute} \\
1575 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1576 \addtoindexx{type attribute} \\
1577 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1578 \livelink{chap:classloclistptr}{loclistptr}
1579 \addtoindexx{location list attribute} \\
1580 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1581 \addtoindexx{variable parameter attribute} \\
1582 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1583 \addtoindexx{virtuality attribute} \\
1584 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1585 \livelink{chap:classloclistptr}{loclistptr}
1586 \addtoindexx{vtable element location attribute} \\
1587 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1588 \livelink{chap:classexprloc}{exprloc},
1589 \livelink{chap:classreference}{reference}
1590 \addtoindexx{allocated attribute} \\
1591 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1592 \livelink{chap:classexprloc}{exprloc},
1593 \livelink{chap:classreference}{reference}
1594 \addtoindexx{associated attribute} \\
1595 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1596 \addtoindexx{data location attribute} \\
1597 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1598 \livelink{chap:classexprloc}{exprloc},
1599 \livelink{chap:classreference}{reference}
1600 \addtoindexx{byte stride attribute} \\
1601 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1602 \livelink{chap:classconstant}{constant}
1603 \addtoindexx{entry PC attribute} \\
1604 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1605 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1606 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1607 \addtoindexx{extension attribute} \\
1608 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1609 \addtoindexx{ranges attribute} \\
1610 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1611 \livelink{chap:classflag}{flag},
1612 \livelink{chap:classreference}{reference},
1613 \livelink{chap:classstring}{string}
1614 \addtoindexx{trampoline attribute} \\
1615 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1616 \addtoindexx{call column attribute} \\
1617 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1618 \addtoindexx{call file attribute} \\
1619 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1620 \addtoindexx{call line attribute} \\
1621 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1622 \addtoindexx{description attribute} \\
1623 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1624 \addtoindexx{binary scale attribute} \\
1625 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1626 \addtoindexx{decimal scale attribute} \\
1627 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1628 \addtoindexx{small attribute} \\
1629 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1630 \addtoindexx{decimal scale attribute} \\
1631 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1632 \addtoindexx{digit count attribute} \\
1633 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1634 \addtoindexx{picture string attribute} \\
1635 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1636 \addtoindexx{mutable attribute} \\
1637 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1638 \addtoindexx{thread scaled attribute} \\
1639 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1640 \addtoindexx{explicit attribute} \\
1641 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1642 \addtoindexx{object pointer attribute} \\
1643 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1644 \addtoindexx{endianity attribute} \\
1645 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1646 \addtoindexx{elemental attribute} \\
1647 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1648 \addtoindexx{pure attribute} \\
1649 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1650 \addtoindexx{recursive attribute} \\
1651 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1652 \addtoindexx{signature attribute} \\
1653 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1654 \addtoindexx{main subprogram attribute} \\
1655 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1656 \addtoindexx{data bit offset attribute} \\
1657 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1658 \addtoindexx{constant expression attribute} \\
1659 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1660 \addtoindexx{enumeration class attribute} \\
1661 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1662 \addtoindexx{linkage name attribute} \\
1663 \DWATstringlengthbitsize{}~\ddag&0x6f&
1664 \livelink{chap:classconstant}{constant}
1665 \addtoindexx{string length attribute!size of length} \\
1666 \DWATstringlengthbytesize{}~\ddag&0x70&
1667 \livelink{chap:classconstant}{constant}
1668 \addtoindexx{string length attribute!size of length} \\
1669 \DWATrank~\ddag&0x71&
1670 \livelink{chap:classconstant}{constant},
1671 \livelink{chap:classexprloc}{exprloc}
1672 \addtoindexx{rank attribute} \\
1673 \DWATstroffsetsbase~\ddag&0x72&
1674 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1675 \addtoindexx{string offsets base!encoding} \\
1676 \DWATaddrbase~\ddag &0x73&
1677 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1678 \addtoindexx{address table base!encoding} \\
1679 \DWATrangesbase~\ddag&0x74&
1680 \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class}
1681 \addtoindexx{ranges base!encoding} \\
1682 \textit{Reserved} &0x75& \textit{Unused} \\
1683 \DWATdwoname~\ddag &0x76&
1684 \livelink{chap:classstring}{string}
1685 \addtoindexx{split DWARF object file name!encoding} \\
1686 \DWATreference~\ddag &0x77&
1687 \livelink{chap:classflag}{flag} \\
1688 \DWATrvaluereference~\ddag &0x78&
1689 \livelink{chap:classflag}{flag} \\
1690 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1691 \addtoindexx{macro information attribute} \\
1692 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1693 \addtoindexx{all calls summary attribute} \\
1694 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1695 \addtoindexx{all source calls summary attribute} \\
1696 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1697 \addtoindexx{all tail calls summary attribute} \\
1698 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1699 \addtoindexx{call return PC attribute} \\
1700 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1701 \addtoindexx{call value attribute} \\
1702 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1703 \addtoindexx{call origin attribute} \\
1704 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1705 \addtoindexx{call parameter attribute} \\
1706 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1707 \addtoindexx{call PC attribute} \\
1708 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1709 \addtoindexx{call tail call attribute} \\
1710 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1711 \addtoindexx{call target attribute} \\
1712 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1713 \addtoindexx{call target clobbered attribute} \\
1714 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1715 \addtoindexx{call data location attribute} \\
1716 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1717 \addtoindexx{call data value attribute} \\
1718 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1719 \addtoindexx{noreturn attribute} \\
1720 \DWATalignment~\ddag &0x88 &\CLASSconstant
1721 \addtoindexx{alignment attribute} \\
1722 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1723 \addtoindexx{export symbols attribute} \\
1724 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1725 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1726 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1727 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1732 The attribute form governs how the value of the attribute is
1733 encoded. There are nine classes of form, listed below. Each
1734 class is a set of forms which have related representations
1735 and which are given a common interpretation according to the
1736 attribute in which the form is used.
1738 Form \DWFORMsecoffsetTARG{}
1740 \addtoindexx{rangelistptr class}
1742 \addtoindexx{macptr class}
1744 \addtoindexx{loclistptr class}
1746 \addtoindexx{lineptr class}
1752 \CLASSrangelistptr{} or
1753 \CLASSstroffsetsptr;
1754 the list of classes allowed by the applicable attribute in
1755 Table \refersec{tab:attributeencodings}
1756 determines the class of the form.
1759 In the form descriptions that follow, some forms are said
1760 to depend in part on the value of an attribute of the
1761 \definition{\associatedcompilationunit}:
1764 In the case of a \splitDWARFobjectfile{}, the associated
1765 compilation unit is the skeleton compilation unit corresponding
1766 to the containing unit.
1767 \item Otherwise, the associated compilation unit
1768 is the containing unit.
1772 Each possible form belongs to one or more of the following classes
1773 (see Table \refersec{tab:classesofattributevalue} for a summary of
1774 the purpose and general usage of each class):
1777 \item \livelinki{chap:classaddress}{address}{address class} \\
1778 \livetarg{datarep:classaddress}{}
1779 Represented as either:
1781 \item An object of appropriate size to hold an
1782 address on the target machine
1784 The size is encoded in the compilation unit header
1785 (see Section \refersec{datarep:compilationunitheader}).
1786 This address is relocatable in a relocatable object file and
1787 is relocated in an executable file or shared object file.
1789 \item An indirect index into a table of addresses (as
1790 described in the previous bullet) in the
1791 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1792 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1793 \addtoindex{LEB128} value, which is interpreted as a zero-based
1794 index into an array of addresses in the \dotdebugaddr{} section.
1795 The index is relative to the value of the \DWATaddrbase{} attribute
1796 of the associated compilation unit.
1801 \item \livelink{chap:classaddrptr}{addrptr} \\
1802 \livetarg{datarep:classaddrptr}{}
1803 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1804 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1805 beginning of the list of machine addresses information for the
1806 referencing entity. It is relocatable in
1807 a relocatable object file, and relocated in an executable or
1808 shared object file. In the \thirtytwobitdwarfformat, this offset
1809 is a 4-byte unsigned value; in the 64-bit DWARF
1810 format, it is an 8-byte unsigned value (see Section
1811 \refersec{datarep:32bitand64bitdwarfformats}).
1813 \textit{This class is new in \DWARFVersionV.}
1816 \item \livelink{chap:classblock}{block} \\
1817 \livetarg{datarep:classblock}{}
1818 Blocks come in four forms:
1821 A 1-byte length followed by 0 to 255 contiguous information
1822 bytes (\DWFORMblockoneTARG).
1825 A 2-byte length followed by 0 to 65,535 contiguous information
1826 bytes (\DWFORMblocktwoTARG).
1829 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1830 information bytes (\DWFORMblockfourTARG).
1833 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1834 length followed by the number of bytes
1835 specified by the length (\DWFORMblockTARG).
1838 In all forms, the length is the number of information bytes
1839 that follow. The information bytes may contain any mixture
1840 of relocated (or relocatable) addresses, references to other
1841 debugging information entries or data bytes.
1843 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1844 \livetarg{datarep:classconstant}{}
1845 There are eight forms of constants. There are fixed length
1846 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1850 \DWFORMdatafourTARG,
1851 \DWFORMdataeightTARG{} and
1852 \DWFORMdatasixteenTARG).
1853 There are variable length constant
1854 data forms encoded using
1855 signed LEB128 numbers (\DWFORMsdataTARG) and unsigned
1856 LEB128 numbers (\DWFORMudataTARG).
1857 There is also an implicit constant (\DWFORMimplicitconst),
1858 whose value is provided as part of the abbreviation
1862 The data in \DWFORMdataone,
1865 \DWFORMdataeight{} and
1866 \DWFORMdatasixteen{}
1867 can be anything. Depending on context, it may
1868 be a signed integer, an unsigned integer, a floating\dash point
1869 constant, or anything else. A consumer must use context to
1870 know how to interpret the bits, which if they are target
1871 machine data (such as an integer or floating-point constant)
1872 will be in target machine \byteorder.
1874 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1875 forms is used to represent a
1876 signed or unsigned integer, it can be hard for a consumer
1877 to discover the context necessary to determine which
1878 interpretation is intended. Producers are therefore strongly
1879 encouraged to use \DWFORMsdata{} or
1880 \DWFORMudata{} for signed and
1881 unsigned integers respectively, rather than
1882 \DWFORMdata\textless n\textgreater.}
1885 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1886 \livetarg{datarep:classexprloc}{}
1887 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1888 number of information bytes specified by the length
1889 (\DWFORMexprlocTARG).
1890 The information bytes contain a DWARF expression
1891 (see Section \refersec{chap:dwarfexpressions})
1892 or location description
1893 (see Section \refersec{chap:locationdescriptions}).
1896 \item \livelinki{chap:classflag}{flag}{flag class} \\
1897 \livetarg{datarep:classflag}{}
1898 A flag \addtoindexx{flag class}
1899 is represented explicitly as a single byte of data
1900 (\DWFORMflagTARG) or
1901 implicitly (\DWFORMflagpresentTARG).
1903 first case, if the \nolink{flag} has value zero, it indicates the
1904 absence of the attribute; if the \nolink{flag} has a non-zero value,
1905 it indicates the presence of the attribute. In the second
1906 case, the attribute is implicitly indicated as present, and
1907 no value is encoded in the debugging information entry itself.
1910 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1911 \livetarg{datarep:classlineptr}{}
1912 This is an offset into
1913 \addtoindexx{section offset!in class lineptr value}
1915 \dotdebugline{} or \dotdebuglinedwo{} section
1917 It consists of an offset from the beginning of the
1919 section to the first byte of
1920 the data making up the line number list for the compilation
1922 It is relocatable in a relocatable object file, and
1923 relocated in an executable or shared object file. In the
1924 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1925 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1926 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1929 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1930 \livetarg{datarep:classloclistptr}{}
1931 This is an offset into the
1935 It consists of an offset from the
1936 \addtoindexx{section offset!in class loclistptr value}
1939 section to the first byte of
1940 the data making up the
1941 \addtoindex{location list} for the compilation unit.
1942 It is relocatable in a relocatable object file, and
1943 relocated in an executable or shared object file. In the
1944 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1945 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1946 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1949 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1950 \livetarg{datarep:classmacptr}{}
1952 \addtoindexx{section offset!in class macptr value}
1954 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1956 It consists of an offset from the beginning of the
1957 \dotdebugmacro{} or \dotdebugmacrodwo{}
1958 section to the the header making up the
1959 macro information list for the compilation unit.
1960 It is relocatable in a relocatable object file, and
1961 relocated in an executable or shared object file. In the
1962 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1963 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1964 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1967 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1968 \livetarg{datarep:classrangelistptr}{}
1970 \addtoindexx{section offset!in class rangelistptr value}
1971 offset into the \dotdebugranges{} section
1974 offset from the beginning of the
1975 \dotdebugranges{} section
1976 to the beginning of the non-contiguous address ranges
1977 information for the referencing entity.
1978 It is relocatable in
1979 a relocatable object file, and relocated in an executable or
1981 However, if a \DWATrangesbase{} attribute applies, the offset
1982 is relative to the base offset given by \DWATrangesbase.
1983 In the \thirtytwobitdwarfformat, this offset
1984 is a 4-byte unsigned value; in the 64-bit DWARF
1985 format, it is an 8-byte unsigned value (see Section
1986 \refersec{datarep:32bitand64bitdwarfformats}).
1989 \textit{Because classes
1994 \CLASSrangelistptr{} and
1995 \CLASSstroffsetsptr{}
1996 share a common representation, it is not possible for an
1997 attribute to allow more than one of these classes}
2001 \item \livelinki{chap:classreference}{reference}{reference class} \\
2002 \livetarg{datarep:classreference}{}
2003 There are four types of reference.
2006 \addtoindexx{reference class}
2007 first type of reference can identify any debugging
2008 information entry within the containing unit.
2011 \addtoindexx{section offset!in class reference value}
2012 offset from the first byte of the compilation
2013 header for the compilation unit containing the reference. There
2014 are five forms for this type of reference. There are fixed
2015 length forms for one, two, four and eight byte offsets
2021 and \DWFORMrefeightTARG).
2022 There is also an unsigned variable
2023 length offset encoded form that uses
2024 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
2025 (\DWFORMrefudataTARG).
2026 Because this type of reference is within
2027 the containing compilation unit no relocation of the value
2030 The second type of reference can identify any debugging
2031 information entry within a
2032 \dotdebuginfo{} section; in particular,
2033 it may refer to an entry in a different compilation unit
2034 from the unit containing the reference, and may refer to an
2035 entry in a different shared object file. This type of reference
2036 (\DWFORMrefaddrTARG)
2037 is an offset from the beginning of the
2039 section of the target executable or shared object file, or, for
2040 references within a \addtoindex{supplementary object file},
2041 an offset from the beginning of the local \dotdebuginfo{} section;
2042 it is relocatable in a relocatable object file and frequently
2043 relocated in an executable or shared object file. For
2044 references from one shared object or static executable file
2045 to another, the relocation and identification of the target
2046 object must be performed by the consumer. In the
2047 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2048 in the \sixtyfourbitdwarfformat, it is an 8-byte
2050 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2052 \textit{A debugging information entry that may be referenced by
2053 another compilation unit using
2054 \DWFORMrefaddr{} must have a global symbolic name.}
2056 \textit{For a reference from one executable or shared object file to
2057 another, the reference is resolved by the debugger to identify
2058 the executable or shared object file and the offset into that
2059 file\textquoteright s \dotdebuginfo{}
2060 section in the same fashion as the run
2061 time loader, either when the debug information is first read,
2062 or when the reference is used.}
2064 The third type of reference can identify any debugging
2065 information type entry that has been placed in its own
2066 \addtoindex{type unit}. This type of
2067 reference (\DWFORMrefsigeightTARG) is the
2068 \addtoindexx{type signature}
2069 8-byte type signature
2070 (see Section \refersec{datarep:typesignaturecomputation})
2071 that was computed for the type.
2073 The fourth type of reference is a reference from within the
2074 \dotdebuginfo{} section of the executable or shared object file to
2075 a debugging information entry in the \dotdebuginfo{} section of
2076 a \addtoindex{supplementary object file}.
2077 This type of reference (\DWFORMrefsupTARG) is an offset from the
2078 beginning of the \dotdebuginfo{} section in the
2079 \addtoindex{supplementary object file}.
2081 \textit{The use of compilation unit relative references will reduce the
2082 number of link\dash time relocations and so speed up linking. The
2083 use of the second, third and fourth type of reference allows for the
2084 sharing of information, such as types, across compilation
2085 units, while the fourth type further allows for sharing of information
2086 across compilation units from different executables or shared object files.}
2088 \textit{A reference to any kind of compilation unit identifies the
2089 debugging information entry for that unit, not the preceding
2093 \item \livelinki{chap:classstring}{string}{string class} \\
2094 \livetarg{datarep:classstring}{}
2095 A string is a sequence of contiguous non\dash null bytes followed by
2097 \addtoindexx{string class}
2098 A string may be represented:
2100 \setlength{\itemsep}{0em}
2101 \item immediately in the debugging information entry itself
2102 (\DWFORMstringTARG),
2105 \addtoindexx{section offset!in class string value}
2106 offset into a string table contained in
2107 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
2108 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
2109 or as an offset into a string table contained in the
2110 \dotdebugstr{} section of a \addtoindex{supplementary object file}
2111 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
2112 section of a \addtoindex{supplementary object file}
2113 refer to the local \dotdebugstr{} section of that same file.
2114 In the \thirtytwobitdwarfformat, the representation of a
2115 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
2116 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2117 it is an 8-byte unsigned offset
2118 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2121 \item as an indirect offset into the string table using an
2122 index into a table of offsets contained in the
2123 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
2124 The representation of a \DWFORMstrxNAME{} value is an unsigned
2125 \addtoindex{LEB128} value, which is interpreted as a zero-based
2126 index into an array of offsets in the \dotdebugstroffsets{} section.
2127 The offset entries in the \dotdebugstroffsets{} section have the
2128 same representation as \DWFORMstrp{} values.
2130 Any combination of these three forms may be used within a single compilation.
2132 If the \DWATuseUTFeight{}
2133 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
2134 compilation, partial, skeleton or type unit entry, string values are encoded using the
2135 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
2136 Character Set standard (ISO/IEC 10646\dash 1:1993).
2137 \addtoindexx{ISO 10646 character set standard}
2138 Otherwise, the string representation is unspecified.
2140 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
2141 ISO/IEC 10646\dash 1:1993.
2142 \addtoindexx{ISO 10646 character set standard}
2143 It contains all the same characters
2144 and encoding points as ISO/IEC 10646, as well as additional
2145 information about the characters and their use.}
2147 \textit{Earlier versions of DWARF did not specify the representation
2148 of strings; for compatibility, this version also does
2149 not. However, the UTF\dash 8 representation is strongly recommended.}
2152 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
2153 \livetarg{datarep:classstroffsetsptr}{}
2154 This is an offset into the \dotdebugstroffsets{} section
2155 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2156 \dotdebugstroffsets{} section to the
2157 beginning of the string offsets information for the
2158 referencing entity. It is relocatable in
2159 a relocatable object file, and relocated in an executable or
2160 shared object file. In the \thirtytwobitdwarfformat, this offset
2161 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2162 it is an 8-byte unsigned value (see Section
2163 \refersec{datarep:32bitand64bitdwarfformats}).
2165 \textit{This class is new in \DWARFVersionV.}
2169 In no case does an attribute use one of the classes
2174 \CLASSrangelistptr{} or
2175 \CLASSstroffsetsptr{}
2176 to point into either the
2177 \dotdebuginfo{} or \dotdebugstr{} section.
2179 The form encodings are listed in
2180 Table \referfol{tab:attributeformencodings}.
2184 \setlength{\extrarowheight}{0.1cm}
2185 \begin{longtable}{l|c|l}
2186 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2187 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2189 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2191 \hline \emph{Continued on next page}
2193 \hline \ddag\ \textit{New in DWARF Version 5}
2196 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2197 \textit{Reserved} &0x02& \\
2198 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2199 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2200 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2201 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2202 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2203 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2204 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2205 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2206 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2207 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2208 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2209 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2210 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2211 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2212 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2213 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2214 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2215 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2216 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2217 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2218 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
2219 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
2220 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2221 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2222 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2223 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2224 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2225 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2226 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2227 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2228 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2229 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2235 \section{Variable Length Data}
2236 \label{datarep:variablelengthdata}
2237 \addtoindexx{variable length data|see {LEB128}}
2239 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2240 encoded using \doublequote{Little-Endian Base 128}
2241 \addtoindexx{little-endian encoding|see{endian attribute}}
2243 \addtoindexx{LEB128}
2244 LEB128 is a scheme for encoding integers
2245 densely that exploits the assumption that most integers are
2248 \textit{This encoding is equally suitable whether the target machine
2249 architecture represents data in big-endian or little-endian
2250 \byteorder. It is \doublequote{little-endian} only in the sense that it
2251 avoids using space to represent the \doublequote{big} end of an
2252 unsigned integer, when the big end is all zeroes or sign
2255 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2256 numbers are encoded as follows:
2257 \addtoindexx{LEB128!unsigned, encoding as}
2258 start at the low order end of an unsigned integer and chop
2259 it into 7-bit chunks. Place each chunk into the low order 7
2260 bits of a byte. Typically, several of the high order bytes
2261 will be zero; discard them. Emit the remaining bytes in a
2262 stream, starting with the low order byte; set the high order
2263 bit on each byte except the last emitted byte. The high bit
2264 of zero on the last byte indicates to the decoder that it
2265 has encountered the last byte.
2267 The integer zero is a special case, consisting of a single
2270 Table \refersec{tab:examplesofunsignedleb128encodings}
2271 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2273 0x80 in each case is the high order bit of the byte, indicating
2274 that an additional byte follows.
2277 The encoding for signed, two\textquoteright{s} complement LEB128
2278 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2279 numbers is similar, except that the criterion for discarding
2280 high order bytes is not whether they are zero, but whether
2281 they consist entirely of sign extension bits. Consider the
2282 4-byte integer -2. The three high level bytes of the number
2283 are sign extension, thus LEB128 would represent it as a single
2284 byte containing the low order 7 bits, with the high order
2285 bit cleared to indicate the end of the byte stream. Note
2286 that there is nothing within the LEB128 representation that
2287 indicates whether an encoded number is signed or unsigned. The
2288 decoder must know what type of number to expect.
2289 Table \refersec{tab:examplesofunsignedleb128encodings}
2290 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2291 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2292 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2295 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2296 \addtoindexx{LEB128!examples}
2297 gives algorithms for encoding and decoding these forms.}
2301 \setlength{\extrarowheight}{0.1cm}
2302 \begin{longtable}{c|c|c}
2303 \caption{Examples of unsigned LEB128 encodings}
2304 \label{tab:examplesofunsignedleb128encodings}
2305 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2306 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2308 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2310 \hline \emph{Continued on next page}
2316 128& 0 + 0x80 & 1 \\
2317 129& 1 + 0x80 & 1 \\
2318 %130& 2 + 0x80 & 1 \\
2319 12857& 57 + 0x80 & 100 \\
2326 \setlength{\extrarowheight}{0.1cm}
2327 \begin{longtable}{c|c|c}
2328 \caption{Examples of signed LEB128 encodings}
2329 \label{tab:examplesofsignedleb128encodings}
2330 \addtoindexx{LEB128!signed} \\
2331 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2333 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2335 \hline \emph{Continued on next page}
2341 127& 127 + 0x80 & 0 \\
2342 -127& 1 + 0x80 & 0x7f \\
2343 128& 0 + 0x80 & 1 \\
2344 -128& 0 + 0x80 & 0x7f \\
2345 129& 1 + 0x80 & 1 \\
2346 -129& 0x7f + 0x80 & 0x7e \\
2353 \section{DWARF Expressions and Location Descriptions}
2354 \label{datarep:dwarfexpressionsandlocationdescriptions}
2355 \subsection{DWARF Expressions}
2356 \label{datarep:dwarfexpressions}
2359 \addtoindexx{DWARF expression!operator encoding}
2360 DWARF expression is stored in a \nolink{block} of contiguous
2361 bytes. The bytes form a sequence of operations. Each operation
2362 is a 1-byte code that identifies that operation, followed by
2363 zero or more bytes of additional data. The encodings for the
2364 operations are described in
2365 Table \refersec{tab:dwarfoperationencodings}.
2368 \setlength{\extrarowheight}{0.1cm}
2369 \begin{longtable}{l|c|c|l}
2370 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2371 \hline & &\bfseries No. of &\\
2372 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2374 & &\bfseries No. of &\\
2375 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2377 \hline \emph{Continued on next page}
2379 \hline \ddag\ \textit{New in DWARF Version 5}
2382 \DWOPaddr&0x03&1 & constant address \\
2383 & & &(size is target specific) \\
2385 \DWOPderef&0x06&0 & \\
2387 \DWOPconstoneu&0x08&1&1-byte constant \\
2388 \DWOPconstones&0x09&1&1-byte constant \\
2389 \DWOPconsttwou&0x0a&1&2-byte constant \\
2390 \DWOPconsttwos&0x0b&1&2-byte constant \\
2391 \DWOPconstfouru&0x0c&1&4-byte constant \\
2392 \DWOPconstfours&0x0d&1&4-byte constant \\
2393 \DWOPconsteightu&0x0e&1&8-byte constant \\
2394 \DWOPconsteights&0x0f&1&8-byte constant \\
2395 \DWOPconstu&0x10&1&ULEB128 constant \\
2396 \DWOPconsts&0x11&1&SLEB128 constant \\
2397 \DWOPdup&0x12&0 & \\
2398 \DWOPdrop&0x13&0 & \\
2399 \DWOPover&0x14&0 & \\
2400 \DWOPpick&0x15&1&1-byte stack index \\
2401 \DWOPswap&0x16&0 & \\
2402 \DWOProt&0x17&0 & \\
2403 \DWOPxderef&0x18&0 & \\
2404 \DWOPabs&0x19&0 & \\
2405 \DWOPand&0x1a&0 & \\
2406 \DWOPdiv&0x1b&0 & \\
2407 \DWOPminus&0x1c&0 & \\
2408 \DWOPmod&0x1d&0 & \\
2409 \DWOPmul&0x1e&0 & \\
2410 \DWOPneg&0x1f&0 & \\
2411 \DWOPnot&0x20&0 & \\
2413 \DWOPplus&0x22&0 & \\
2414 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2415 \DWOPshl&0x24&0 & \\
2416 \DWOPshr&0x25&0 & \\
2417 \DWOPshra&0x26&0 & \\
2418 \DWOPxor&0x27&0 & \\
2420 \DWOPbra&0x28&1 & signed 2-byte constant \\
2427 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2429 \DWOPlitzero & 0x30 & 0 & \\
2430 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2431 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2432 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2434 \DWOPregzero & 0x50 & 0 & \\*
2435 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2436 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2437 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2439 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2440 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2441 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2442 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2444 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2445 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2446 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2447 & & &SLEB128 offset \\
2448 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2449 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2450 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2451 \DWOPnop{} & 0x96 &0& \\
2453 \DWOPpushobjectaddress&0x97&0 & \\
2454 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2455 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2456 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2457 \DWOPformtlsaddress&0x9b &0& \\
2458 \DWOPcallframecfa{} &0x9c &0& \\
2459 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2461 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2462 &&&\nolink{block} of that size\\
2463 \DWOPstackvalue{} &0x9f &0& \\
2464 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2465 &&&SLEB128 constant offset \\
2466 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2467 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2468 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2469 &&&\nolink{block} of that size\\
2470 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2471 & & & 1-byte size, \\*
2472 & & & constant value \\
2473 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2474 &&& ULEB128 constant offset \\
2475 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2476 &&& ULEB128 type entry offset \\
2477 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2478 &&& ULEB128 type entry offset \\
2479 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2480 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2481 \DWOPlouser{} &0xe0 && \\
2482 \DWOPhiuser{} &\xff && \\
2488 \subsection{Location Descriptions}
2489 \label{datarep:locationdescriptions}
2491 A location description is used to compute the
2492 location of a variable or other entity.
2494 \subsection{Location Lists}
2495 \label{datarep:locationlists}
2497 Each entry in a \addtoindex{location list} is either a location list entry,
2498 a base address selection entry, or an
2499 \addtoindexx{end-of-list entry!in location list}
2503 \subsubsection{Location List Entries in Non-Split Objects}
2504 A \addtoindex{location list} entry consists of two address offsets followed
2505 by an unsigned 2-byte length, followed by a block of contiguous bytes
2506 that contains a DWARF location description. The length
2507 specifies the number of bytes in that block. The two offsets
2508 are the same size as an address on the target machine.
2511 A base address selection entry and an
2512 \addtoindexx{end-of-list entry!in location list}
2513 end-of-list entry each
2514 consist of two (constant or relocated) address offsets. The two
2515 offsets are the same size as an address on the target machine.
2517 For a \addtoindex{location list} to be specified, the base address of
2518 \addtoindexx{base address selection entry!in location list}
2519 the corresponding compilation unit must be defined
2520 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
2522 \subsubsection{Location List Entries in Split Objects}
2523 \label{datarep:locationlistentriesinsplitobjects}
2524 An alternate form for location list entries is used in split objects.
2525 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2526 that follows. The encodings for these constants are given in
2527 Table \refersec{tab:locationlistentryencodingvalues}.
2531 \setlength{\extrarowheight}{0.1cm}
2532 \begin{longtable}{l|c}
2533 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2534 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2536 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2538 \hline \emph{Continued on next page}
2542 \DWLLEendoflistentry & 0x0 \\
2543 \DWLLEbaseaddressselectionentry & 0x01 \\
2544 \DWLLEstartendentry & 0x02 \\
2545 \DWLLEstartlengthentry & 0x03 \\
2546 \DWLLEoffsetpairentry & 0x04 \\
2550 \section{Base Type Attribute Encodings}
2551 \label{datarep:basetypeattributeencodings}
2553 The\hypertarget{chap:DWATencodingencodingofbasetype}{}
2554 encodings of the constants used in the
2555 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2557 Table \refersec{tab:basetypeencodingvalues}
2560 \setlength{\extrarowheight}{0.1cm}
2561 \begin{longtable}{l|c}
2562 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2563 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2565 \bfseries Base type encoding name&\bfseries Value\\ \hline
2567 \hline \emph{Continued on next page}
2570 \ddag \ \textit{New in \DWARFVersionV}
2572 \DWATEaddress&0x01 \\
2573 \DWATEboolean&0x02 \\
2574 \DWATEcomplexfloat&0x03 \\
2576 \DWATEsigned&0x05 \\
2577 \DWATEsignedchar&0x06 \\
2578 \DWATEunsigned&0x07 \\
2579 \DWATEunsignedchar&0x08 \\
2580 \DWATEimaginaryfloat&0x09 \\
2581 \DWATEpackeddecimal&0x0a \\
2582 \DWATEnumericstring&0x0b \\
2583 \DWATEedited&0x0c \\
2584 \DWATEsignedfixed&0x0d \\
2585 \DWATEunsignedfixed&0x0e \\
2586 \DWATEdecimalfloat & 0x0f \\
2587 \DWATEUTF{} & 0x10 \\
2588 \DWATEUCS~\ddag & 0x11 \\
2589 \DWATEASCII~\ddag & 0x12 \\
2590 \DWATElouser{} & 0x80 \\
2591 \DWATEhiuser{} & \xff \\
2596 The encodings of the constants used in the
2597 \DWATdecimalsign{} attribute
2599 Table \refersec{tab:decimalsignencodings}.
2602 \setlength{\extrarowheight}{0.1cm}
2603 \begin{longtable}{l|c}
2604 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2605 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2607 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2609 % \hline \emph{Continued on next page}
2613 \DWDSunsigned{} & 0x01 \\
2614 \DWDSleadingoverpunch{} & 0x02 \\
2615 \DWDStrailingoverpunch{} & 0x03 \\
2616 \DWDSleadingseparate{} & 0x04 \\
2617 \DWDStrailingseparate{} & 0x05 \\
2622 The encodings of the constants used in the
2623 \DWATendianity{} attribute are given in
2624 Table \refersec{tab:endianityencodings}.
2627 \setlength{\extrarowheight}{0.1cm}
2628 \begin{longtable}{l|c}
2629 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2630 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2632 \bfseries Endian code name&\bfseries Value\\ \hline
2634 \hline \emph{Continued on next page}
2639 \DWENDdefault{} & 0x00 \\
2640 \DWENDbig{} & 0x01 \\
2641 \DWENDlittle{} & 0x02 \\
2642 \DWENDlouser{} & 0x40 \\
2643 \DWENDhiuser{} & \xff \\
2649 \section{Accessibility Codes}
2650 \label{datarep:accessibilitycodes}
2651 The encodings of the constants used in the
2652 \DWATaccessibility{}
2654 \addtoindexx{accessibility attribute}
2656 Table \refersec{tab:accessibilityencodings}.
2659 \setlength{\extrarowheight}{0.1cm}
2660 \begin{longtable}{l|c}
2661 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2662 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2664 \bfseries Accessibility code name&\bfseries Value\\ \hline
2666 \hline \emph{Continued on next page}
2671 \DWACCESSpublic&0x01 \\
2672 \DWACCESSprotected&0x02 \\
2673 \DWACCESSprivate&0x03 \\
2679 \section{Visibility Codes}
2680 \label{datarep:visibilitycodes}
2681 The encodings of the constants used in the
2682 \DWATvisibility{} attribute are given in
2683 Table \refersec{tab:visibilityencodings}.
2686 \setlength{\extrarowheight}{0.1cm}
2687 \begin{longtable}{l|c}
2688 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2689 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2691 \bfseries Visibility code name&\bfseries Value\\ \hline
2693 \hline \emph{Continued on next page}
2699 \DWVISexported&0x02 \\
2700 \DWVISqualified&0x03 \\
2705 \section{Virtuality Codes}
2706 \label{datarep:vitualitycodes}
2708 The encodings of the constants used in the
2709 \DWATvirtuality{} attribute are given in
2710 Table \refersec{tab:virtualityencodings}.
2713 \setlength{\extrarowheight}{0.1cm}
2714 \begin{longtable}{l|c}
2715 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2716 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2718 \bfseries Virtuality code name&\bfseries Value\\ \hline
2720 \hline \emph{Continued on next page}
2725 \DWVIRTUALITYnone&0x00 \\
2726 \DWVIRTUALITYvirtual&0x01 \\
2727 \DWVIRTUALITYpurevirtual&0x02 \\
2734 \DWVIRTUALITYnone{} is equivalent to the absence of the
2738 \section{Source Languages}
2739 \label{datarep:sourcelanguages}
2741 The encodings of the constants used
2742 \addtoindexx{language attribute, encoding}
2744 \addtoindexx{language name encoding}
2747 attribute are given in
2748 Table \refersec{tab:languageencodings}.
2750 % If we don't force a following space it looks odd
2752 and their associated values are reserved, but the
2753 languages they represent are not well supported.
2754 Table \refersec{tab:languageencodings}
2756 \addtoindexx{lower bound attribute!default}
2757 default lower bound, if any, assumed for
2758 an omitted \DWATlowerbound{} attribute in the context of a
2759 \DWTAGsubrangetype{} debugging information entry for each
2763 \setlength{\extrarowheight}{0.1cm}
2764 \begin{longtable}{l|c|c}
2765 \caption{Language encodings} \label{tab:languageencodings}\\
2766 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2768 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2770 \hline \emph{Continued on next page}
2773 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2775 \addtoindexx{ISO-defined language names}
2777 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2778 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2779 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2780 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++98 (ISO)} \\
2781 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2782 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2783 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2784 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2785 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2786 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2787 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2788 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2789 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2790 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2791 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2792 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2793 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2794 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2795 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2796 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2797 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2798 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2799 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2800 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2801 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++03 (ISO)}\\
2802 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++11 (ISO)} \\
2803 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2804 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2805 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2806 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2807 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2808 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2809 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++14 (ISO)} \\
2810 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2811 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2812 \DWLANGRenderScript{}~\ddag &0x0024 &0 \addtoindexx{RenderScript Kernel Language}
2814 \DWLANGlouser{} &0x8000 & \\
2815 \DWLANGhiuser{} &\xffff & \\
2820 \section{Address Class Encodings}
2821 \label{datarep:addressclassencodings}
2823 The value of the common
2824 \addtoindex{address class} encoding
2828 \section{Identifier Case}
2829 \label{datarep:identifiercase}
2831 The encodings of the constants used in the
2832 \DWATidentifiercase{} attribute are given in
2833 Table \refersec{tab:identifiercaseencodings}.
2837 \setlength{\extrarowheight}{0.1cm}
2838 \begin{longtable}{l|c}
2839 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2840 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2842 \bfseries Identifier case name&\bfseries Value\\ \hline
2844 \hline \emph{Continued on next page}
2848 \DWIDcasesensitive&0x00 \\
2850 \DWIDdowncase&0x02 \\
2851 \DWIDcaseinsensitive&0x03 \\
2855 \section{Calling Convention Encodings}
2856 \label{datarep:callingconventionencodings}
2857 The encodings of the constants used in the
2858 \DWATcallingconvention{} attribute are given in
2859 Table \refersec{tab:callingconventionencodings}.
2862 \setlength{\extrarowheight}{0.1cm}
2863 \begin{longtable}{l|c}
2864 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2865 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2867 \bfseries Calling convention name&\bfseries Value\\ \hline
2869 \hline \emph{Continued on next page}
2871 \hline \ddag\ \textit{New in DWARF Version 5}
2874 \DWCCnormal &0x01 \\
2875 \DWCCprogram&0x02 \\
2876 \DWCCnocall &0x03 \\
2877 \DWCCpassbyreference~\ddag &0x04 \\
2878 \DWCCpassbyvalue~\ddag &0x05 \\
2879 \DWCClouser &0x40 \\
2886 \section{Inline Codes}
2887 \label{datarep:inlinecodes}
2889 The encodings of the constants used in
2890 \addtoindexx{inline attribute}
2892 \DWATinline{} attribute are given in
2893 Table \refersec{tab:inlineencodings}.
2897 \setlength{\extrarowheight}{0.1cm}
2898 \begin{longtable}{l|c}
2899 \caption{Inline encodings} \label{tab:inlineencodings}\\
2900 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2902 \bfseries Inline Code name&\bfseries Value\\ \hline
2904 \hline \emph{Continued on next page}
2909 \DWINLnotinlined&0x00 \\
2910 \DWINLinlined&0x01 \\
2911 \DWINLdeclarednotinlined&0x02 \\
2912 \DWINLdeclaredinlined&0x03 \\
2917 % this clearpage is ugly, but the following table came
2918 % out oddly without it.
2920 \section{Array Ordering}
2921 \label{datarep:arrayordering}
2923 The encodings of the constants used in the
2924 \DWATordering{} attribute are given in
2925 Table \refersec{tab:orderingencodings}.
2929 \setlength{\extrarowheight}{0.1cm}
2930 \begin{longtable}{l|c}
2931 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2932 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2934 \bfseries Ordering name&\bfseries Value\\ \hline
2936 \hline \emph{Continued on next page}
2941 \DWORDrowmajor&0x00 \\
2942 \DWORDcolmajor&0x01 \\
2948 \section{Discriminant Lists}
2949 \label{datarep:discriminantlists}
2951 The descriptors used in
2952 \addtoindexx{discriminant list attribute}
2954 \DWATdiscrlist{} attribute are
2955 encoded as 1-byte constants. The
2956 defined values are given in
2957 Table \refersec{tab:discriminantdescriptorencodings}.
2959 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2961 \setlength{\extrarowheight}{0.1cm}
2962 \begin{longtable}{l|c}
2963 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2964 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2966 \bfseries Descriptor name&\bfseries Value\\ \hline
2968 \hline \emph{Continued on next page}
2980 \section{Name Index Table}
2981 \label{datarep:nameindextable}
2982 The \addtoindexi{version number}{version number!name index table}
2983 in the name index table header is \versiondotdebugnames{}.
2985 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
2988 \setlength{\extrarowheight}{0.1cm}
2989 \begin{longtable}{l|c|l}
2990 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
2991 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
2993 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
2995 \hline \emph{Continued on next page}
2998 \ddag~\textit{New in \DWARFVersionV}
3000 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
3001 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
3002 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
3003 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
3004 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
3005 \DWIDXlouser~\ddag & 0x2000 & \\
3006 \DWIDXhiuser~\ddag & \xiiifff & \\
3010 The abbreviations table ends with an entry consisting of a single 0
3011 byte for the abbreviation code. The size of the table given by
3012 \texttt{abbrev\_table\_size} may include optional padding following the
3015 \section{Defaulted Member Encodings}
3016 \hypertarget{datarep:defaultedmemberencodings}{}
3018 The encodings of the constants used in the \DWATdefaulted{} attribute
3019 are given in Table \referfol{datarep:defaultedattributeencodings}.
3022 \setlength{\extrarowheight}{0.1cm}
3023 \begin{longtable}{l|c}
3024 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
3025 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
3027 \bfseries Defaulted name &\bfseries Value \\ \hline
3029 \hline \emph{Continued on next page}
3032 \ddag~\textit{New in \DWARFVersionV}
3034 \DWDEFAULTEDno~\ddag & 0x00 \\
3035 \DWDEFAULTEDinclass~\ddag & 0x01 \\
3036 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
3041 \section{Address Range Table}
3042 \label{datarep:addrssrangetable}
3044 Each set of entries in the table of address ranges contained
3045 in the \dotdebugaranges{}
3046 section begins with a header containing:
3047 \begin{enumerate}[1. ]
3048 % FIXME The unit length text is not fully consistent across
3051 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3052 \addttindexx{unit\_length}
3053 A 4-byte or 12-byte length containing the length of the
3054 \addtoindexx{initial length}
3055 set of entries for this compilation unit, not including the
3056 length field itself. In the \thirtytwobitdwarfformat, this is a
3057 4-byte unsigned integer (which must be less than \xfffffffzero);
3058 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
3059 \wffffffff followed by an 8-byte unsigned integer that gives
3061 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3063 \item version (\HFTuhalf) \\
3064 A 2-byte version identifier representing the version of the
3065 DWARF information for the address range table.
3067 This value in this field \addtoindexx{version number!address range table} is 2.
3069 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
3071 \addtoindexx{section offset!in .debug\_aranges header}
3072 4-byte or 8-byte offset into the
3073 \dotdebuginfo{} section of
3074 the compilation unit header. In the \thirtytwobitdwarfformat,
3075 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
3076 this is an 8-byte unsigned offset
3077 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3079 \item \texttt{address\_size} (\HFTubyte) \\
3080 A 1-byte unsigned integer containing the size in bytes of an
3081 \addttindexx{address\_size}
3083 \addtoindexx{size of an address}
3084 (or the offset portion of an address for segmented
3085 \addtoindexx{address space!segmented}
3086 addressing) on the target system.
3088 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3089 A 1-byte unsigned integer containing the size in bytes of a
3090 segment selector on the target system.
3094 This header is followed by a series of tuples. Each tuple
3095 consists of a segment, an address and a length.
3096 The segment selector
3097 size is given by the \HFNsegmentselectorsize{} field of the header; the
3098 address and length size are each given by the \addttindex{address\_size}
3099 field of the header.
3100 The first tuple following the header in
3101 each set begins at an offset that is a multiple of the size
3102 of a single tuple (that is, the size of a segment selector
3103 plus twice the \addtoindex{size of an address}).
3104 The header is padded, if
3105 necessary, to that boundary. Each set of tuples is terminated
3106 by a 0 for the segment, a 0 for the address and 0 for the
3107 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3108 the segment selectors are omitted from all tuples, including
3109 the terminating tuple.
3112 \section{Line Number Information}
3113 \label{datarep:linenumberinformation}
3115 The \addtoindexi{version number}{version number!line number information}
3116 in the line number program header is \versiondotdebugline{}.
3118 The boolean values \doublequote{true} and \doublequote{false}
3119 used by the line number information program are encoded
3120 as a single byte containing the value 0
3121 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3124 The encodings for the standard opcodes are given in
3125 \addtoindexx{line number opcodes!standard opcode encoding}
3126 Table \refersec{tab:linenumberstandardopcodeencodings}.
3129 \setlength{\extrarowheight}{0.1cm}
3130 \begin{longtable}{l|c}
3131 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3132 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3134 \bfseries Opcode name&\bfseries Value\\ \hline
3136 \hline \emph{Continued on next page}
3142 \DWLNSadvancepc&0x02 \\
3143 \DWLNSadvanceline&0x03 \\
3144 \DWLNSsetfile&0x04 \\
3145 \DWLNSsetcolumn&0x05 \\
3146 \DWLNSnegatestmt&0x06 \\
3147 \DWLNSsetbasicblock&0x07 \\
3148 \DWLNSconstaddpc&0x08 \\
3149 \DWLNSfixedadvancepc&0x09 \\
3150 \DWLNSsetprologueend&0x0a \\*
3151 \DWLNSsetepiloguebegin&0x0b \\*
3152 \DWLNSsetisa&0x0c \\*
3158 The encodings for the extended opcodes are given in
3159 \addtoindexx{line number opcodes!extended opcode encoding}
3160 Table \refersec{tab:linenumberextendedopcodeencodings}.
3163 \setlength{\extrarowheight}{0.1cm}
3164 \begin{longtable}{l|c}
3165 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3166 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3168 \bfseries Opcode name&\bfseries Value\\ \hline
3170 \hline \emph{Continued on next page}
3172 \hline %\ddag~\textit{New in DWARF Version 5}
3175 \DWLNEendsequence &0x01 \\
3176 \DWLNEsetaddress &0x02 \\
3177 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3178 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3180 \DWLNEsetdiscriminator &0x04 \\
3181 \DWLNElouser &0x80 \\
3182 \DWLNEhiuser &\xff \\
3188 The encodings for the line number header entry formats are given in
3189 \addtoindexx{line number opcodes!file entry format encoding}
3190 Table \refersec{tab:linenumberheaderentryformatencodings}.
3193 \setlength{\extrarowheight}{0.1cm}
3194 \begin{longtable}{l|c}
3195 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3196 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3198 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3200 \hline \emph{Continued on next page}
3202 \hline \ddag~\textit{New in DWARF Version 5}
3204 \DWLNCTpath~\ddag & 0x1 \\
3205 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3206 \DWLNCTtimestamp~\ddag & 0x3 \\
3207 \DWLNCTsize~\ddag & 0x4 \\
3208 \DWLNCTMDfive~\ddag & 0x5 \\
3209 \DWLNCTlouser~\ddag & 0x2000 \\
3210 \DWLNCThiuser~\ddag & \xiiifff \\
3215 \section{Macro Information}
3216 \label{datarep:macroinformation}
3217 The \addtoindexi{version number}{version number!macro information}
3218 in the macro information header is \versiondotdebugmacro{}.
3220 The source line numbers and source file indices encoded in the
3221 macro information section are represented as
3222 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3225 The macro information entry type is encoded as a single unsigned byte.
3227 \addtoindexx{macro information entry types!encoding}
3229 Table \refersec{tab:macroinfoentrytypeencodings}.
3233 \setlength{\extrarowheight}{0.1cm}
3234 \begin{longtable}{l|c}
3235 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3236 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3238 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3240 \hline \emph{Continued on next page}
3242 \hline \ddag~\textit{New in DWARF Version 5}
3245 \DWMACROdefine~\ddag &0x01 \\
3246 \DWMACROundef~\ddag &0x02 \\
3247 \DWMACROstartfile~\ddag &0x03 \\
3248 \DWMACROendfile~\ddag &0x04 \\
3249 \DWMACROdefinestrp~\ddag &0x05 \\
3250 \DWMACROundefstrp~\ddag &0x06 \\
3251 \DWMACROimport~\ddag &0x07 \\
3252 \DWMACROdefinesup~\ddag &0x08 \\
3253 \DWMACROundefsup~\ddag &0x09 \\
3254 \DWMACROimportsup~\ddag &0x0a \\
3255 \DWMACROdefinestrx~\ddag &0x0b \\
3256 \DWMACROundefstrx~\ddag &0x0c \\
3257 \DWMACROlouser~\ddag &0xe0 \\
3258 \DWMACROhiuser~\ddag &\xff \\
3264 \section{Call Frame Information}
3265 \label{datarep:callframeinformation}
3267 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3268 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3269 value is \xffffffffffffffff.
3271 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3272 is \versiondotdebugframe.
3274 Call frame instructions are encoded in one or more bytes. The
3275 primary opcode is encoded in the high order two bits of
3276 the first byte (that is, opcode = byte $\gg$ 6). An operand
3277 or extended opcode may be encoded in the low order 6
3278 bits. Additional operands are encoded in subsequent bytes.
3279 The instructions and their encodings are presented in
3280 Table \refersec{tab:callframeinstructionencodings}.
3283 \setlength{\extrarowheight}{0.1cm}
3284 \begin{longtable}{l|c|c|l|l}
3285 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3286 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3287 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3289 & \bfseries High 2 &\bfseries Low 6 & &\\
3290 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3292 \hline \emph{Continued on next page}
3297 \DWCFAadvanceloc&0x1&delta & \\
3298 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3299 \DWCFArestore&0x3®ister & & \\
3300 \DWCFAnop&0&0 & & \\
3301 \DWCFAsetloc&0&0x01&address & \\
3302 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3303 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3304 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3305 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3306 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3307 \DWCFAundefined&0&0x07&ULEB128 register & \\
3308 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3309 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3310 \DWCFArememberstate&0&0x0a & & \\
3311 \DWCFArestorestate&0&0x0b & & \\
3312 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3313 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3314 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3315 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3316 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3318 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3319 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3320 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3321 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3322 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3323 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3324 \DWCFAlouser&0&0x1c & & \\
3325 \DWCFAhiuser&0&\xiiif & & \\
3329 \section{Non-contiguous Address Ranges}
3330 \label{datarep:noncontiguousaddressranges}
3332 Each entry in a \addtoindex{range list}
3333 (see Section \refersec{chap:noncontiguousaddressranges})
3335 \addtoindexx{base address selection entry!in range list}
3337 \addtoindexx{range list}
3338 a base address selection entry, or an end-of-list entry.
3340 A \addtoindex{range list} entry consists of two relative addresses. The
3341 addresses are the same size as addresses on the target machine.
3344 A base address selection entry and an
3345 \addtoindexx{end-of-list entry!in range list}
3346 end-of-list entry each
3347 \addtoindexx{base address selection entry!in range list}
3348 consist of two (constant or relocated) addresses. The two
3349 addresses are the same size as addresses on the target machine.
3351 For a \addtoindex{range list} to be specified, the base address of the
3352 \addtoindexx{base address selection entry!in range list}
3353 corresponding compilation unit must be defined
3354 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3357 \section{String Offsets Table}
3358 \label{chap:stringoffsetstable}
3359 Each set of entries in the string offsets table contained in the
3360 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3361 section begins with a header containing:
3362 \begin{enumerate}[1. ]
3363 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3364 \addttindexx{unit\_length}
3365 A 4-byte or 12-byte length containing the length of
3366 the set of entries for this compilation unit, not
3367 including the length field itself. In the 32-bit
3368 DWARF format, this is a 4-byte unsigned integer
3369 (which must be less than \xfffffffzero); in the 64-bit
3370 DWARF format, this consists of the 4-byte value
3371 \wffffffff followed by an 8-byte unsigned integer
3372 that gives the actual length (see
3373 Section \refersec{datarep:32bitand64bitdwarfformats}).
3376 \item \texttt{version} (\HFTuhalf) \\
3377 \addtoindexx{version number!string offsets table}
3378 A 2-byte version identifier containing the value
3379 \versiondotdebugstroffsets{}.
3381 \item \textit{padding} (\HFTuhalf) \\
3382 Reserved to DWARF (must be zero).
3385 This header is followed by a series of string table offsets
3386 that have the same representation as \DWFORMstrp.
3387 For the 32-bit DWARF format, each offset is 4 bytes long; for
3388 the 64-bit DWARF format, each offset is 8 bytes long.
3390 The \DWATstroffsetsbase{} attribute points to the first
3391 entry following the header. The entries are indexed
3392 sequentially from this base entry, starting from 0.
3394 \section{Address Table}
3395 \label{chap:addresstable}
3396 Each set of entries in the address table contained in the
3397 \dotdebugaddr{} section begins with a header containing:
3398 \begin{enumerate}[1. ]
3399 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3400 \addttindexx{unit\_length}
3401 A 4-byte or 12-byte length containing the length of
3402 the set of entries for this compilation unit, not
3403 including the length field itself. In the 32-bit
3404 DWARF format, this is a 4-byte unsigned integer
3405 (which must be less than \xfffffffzero); in the 64-bit
3406 DWARF format, this consists of the 4-byte value
3407 \wffffffff followed by an 8-byte unsigned integer
3408 that gives the actual length (see
3409 Section \refersec{datarep:32bitand64bitdwarfformats}).
3412 \item \texttt{version} (\HFTuhalf) \\
3413 \addtoindexx{version number!address table}
3414 A 2-byte version identifier containing the value
3415 \versiondotdebugaddr{}.
3418 \item \texttt{address\_size} (\HFTubyte) \\
3419 A 1-byte unsigned integer containing the size in
3420 bytes of an address (or the offset portion of an
3421 address for segmented addressing) on the target
3425 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3426 A 1-byte unsigned integer containing the size in
3427 bytes of a segment selector on the target system.
3430 This header is followed by a series of segment/address pairs.
3431 The segment size is given by the \HFNsegmentselectorsize{} field of the
3432 header, and the address size is given by the \addttindex{address\_size}
3433 field of the header. If the \HFNsegmentselectorsize{} field in the header
3434 is zero, the entries consist only of an addresses.
3436 The \DWATaddrbase{} attribute points to the first entry
3437 following the header. The entries are indexed sequentially
3438 from this base entry, starting from 0.
3441 \section{Range List Table}
3442 \label{app:rangelisttable}
3443 Each set of entries in the range list table contained in the
3444 \dotdebugranges{} section begins with a header containing:
3445 \begin{enumerate}[1. ]
3446 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3447 \addttindexx{unit\_length}
3448 A 4-byte or 12-byte length containing the length of
3449 the set of entries for this compilation unit, not
3450 including the length field itself. In the 32-bit
3451 DWARF format, this is a 4-byte unsigned integer
3452 (which must be less than \xfffffffzero); in the 64-bit
3453 DWARF format, this consists of the 4-byte value
3454 \wffffffff followed by an 8-byte unsigned integer
3455 that gives the actual length (see
3456 Section \refersec{datarep:32bitand64bitdwarfformats}).
3459 \item \texttt{version} (\HFTuhalf) \\
3460 \addtoindexx{version number!range list table}
3461 A 2-byte version identifier containing the value
3462 \versiondotdebugranges{}.
3465 \item \texttt{address\_size} (\HFTubyte) \\
3466 A 1-byte unsigned integer containing the size in
3467 bytes of an address (or the offset portion of an
3468 address for segmented addressing) on the target
3472 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3473 A 1-byte unsigned integer containing the size in
3474 bytes of a segment selector on the target system.
3477 This header is followed by a series of range list entries as
3478 described in Section \refersec{chap:noncontiguousaddressranges}.
3479 The segment size is given by the
3480 \HFNsegmentselectorsize{} field of the header, and the address size is
3481 given by the \addttindex{address\_size} field of the header. If the
3482 \HFNsegmentselectorsize{} field in the header is zero, the segment
3483 selector is omitted from the range list entries.
3485 The \DWATrangesbase{} attribute points to the first entry
3486 following the header. The entries are referenced by a byte
3487 offset relative to this base address.
3490 \section{Location List Table}
3491 \label{datarep:locationlisttable}
3492 Each set of entries in the location list table contained in the
3493 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3494 \begin{enumerate}[1. ]
3495 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3496 \addttindexx{unit\_length}
3497 A 4-byte or 12-byte length containing the length of
3498 the set of entries for this compilation unit, not
3499 including the length field itself. In the 32-bit
3500 DWARF format, this is a 4-byte unsigned integer
3501 (which must be less than \xfffffffzero); in the 64-bit
3502 DWARF format, this consists of the 4-byte value
3503 \wffffffff followed by an 8-byte unsigned integer
3504 that gives the actual length (see
3505 Section \refersec{datarep:32bitand64bitdwarfformats}).
3508 \item \texttt{version} (\HFTuhalf) \\
3509 \addtoindexx{version number!location list table}
3510 A 2-byte version identifier containing the value
3511 \versiondotdebugloc{}.
3514 \item \texttt{address\_size} (\HFTubyte) \\
3515 A 1-byte unsigned integer containing the size in
3516 bytes of an address (or the offset portion of an
3517 address for segmented addressing) on the target
3521 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3522 A 1-byte unsigned integer containing the size in
3523 bytes of a segment selector on the target system.
3526 This header is followed by a series of location list entries as
3527 described in Section \refersec{chap:locationlists}.
3528 The segment size is given by the
3529 \HFNsegmentselectorsize{} field of the header, and the address size is
3530 given by the \HFNaddresssize{} field of the header. If the
3531 \HFNsegmentselectorsize{} field in the header is zero, the segment
3532 selector is omitted from range list entries.
3534 The entries are referenced by a byte offset relative to the first
3535 location list following this header.
3538 \section{Dependencies and Constraints}
3539 \label{datarep:dependenciesandconstraints}
3540 The debugging information in this format is intended to
3541 exist in sections of an object file, or an equivalent
3542 separate file or database, having names beginning with
3543 the prefix ".debug\_" (see Appendix
3544 \refersec{app:dwarfsectionversionnumbersinformative}
3545 for a complete list of such names).
3546 Except as specifically specified, this information is not
3547 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3550 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3551 32-bit addresses, an assembler or compiler must provide a way
3552 to produce 2-byte and 4-byte quantities without alignment
3553 restrictions, and the linker must be able to relocate a
3555 \addtoindexx{section offset!alignment of}
3556 section offset that occurs at an arbitrary
3559 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3560 64-bit addresses, an assembler or compiler must provide a
3561 way to produce 2-byte, 4-byte and 8-byte quantities without
3562 alignment restrictions, and the linker must be able to relocate
3563 an 8-byte address or 4-byte
3564 \addtoindexx{section offset!alignment of}
3565 section offset that occurs at an
3566 arbitrary alignment.
3568 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3569 32-bit addresses, an assembler or compiler must provide a
3570 way to produce 2-byte, 4-byte and 8-byte quantities without
3571 alignment restrictions, and the linker must be able to relocate
3572 a 4-byte address or 8-byte
3573 \addtoindexx{section offset!alignment of}
3574 section offset that occurs at an
3575 arbitrary alignment.
3577 \textit{It is expected that this will be required only for very large
3578 32-bit programs or by those architectures which support
3579 a mix of 32-bit and 64-bit code and data within the same
3582 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3583 64-bit addresses, an assembler or compiler must provide a
3584 way to produce 2-byte, 4-byte and 8-byte quantities without
3585 alignment restrictions, and the linker must be able to
3586 relocate an 8-byte address or
3587 \addtoindexx{section offset!alignment of}
3588 section offset that occurs at
3589 an arbitrary alignment.
3593 \section{Integer Representation Names}
3594 \label{datarep:integerrepresentationnames}
3595 The sizes of the integers used in the lookup by name, lookup
3596 by address, line number, call frame information and other sections
3598 Table \ref{tab:integerrepresentationnames}.
3602 \setlength{\extrarowheight}{0.1cm}
3603 \begin{longtable}{c|l}
3604 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3605 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3607 \bfseries Representation name&\bfseries Representation\\ \hline
3609 \hline \emph{Continued on next page}
3614 \HFTsbyte& signed, 1-byte integer \\
3615 \HFTubyte&unsigned, 1-byte integer \\
3616 \HFTuhalf&unsigned, 2-byte integer \\
3617 \HFTuword&unsigned, 4-byte integer \\
3623 \section{Type Signature Computation}
3624 \label{datarep:typesignaturecomputation}
3626 A \addtoindex{type signature} is used by a DWARF consumer
3627 to resolve type references to the type definitions that
3628 are contained in \addtoindex{type unit}s (see Section
3629 \refersec{chap:typeunitentries}).
3631 \textit{A type signature is computed only by a DWARF producer;
3632 \addtoindexx{type signature!computation} a consumer need
3633 only compare two type signatures to check for equality.}
3636 The type signature for a type T0 is formed from the
3637 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3638 R.L. Rivest, RFC 1321, April 1992}
3639 digest of a flattened description of the type. The flattened
3640 description of the type is a byte sequence derived from the
3641 DWARF encoding of the type as follows:
3642 \begin{enumerate}[1. ]
3644 \item Start with an empty sequence S and a list V of visited
3645 types, where V is initialized to a list containing the type
3646 T0 as its single element. Elements in V are indexed from 1,
3649 \item If the debugging information entry represents a type that
3650 is nested inside another type or a namespace, append to S
3651 the type\textquoteright s context as follows: For each surrounding type
3652 or namespace, beginning with the outermost such construct,
3653 append the letter 'C', the DWARF tag of the construct, and
3654 the name (taken from
3655 \addtoindexx{name attribute}
3656 the \DWATname{} attribute) of the type
3657 \addtoindexx{name attribute}
3658 or namespace (including its trailing null byte).
3660 \item Append to S the letter 'D', followed by the DWARF tag of
3661 the debugging information entry.
3663 \item For each of the attributes in
3664 Table \refersec{tab:attributesusedintypesignaturecomputation}
3666 the debugging information entry, in the order listed,
3667 append to S a marker letter (see below), the DWARF attribute
3668 code, and the attribute value.
3671 \caption{Attributes used in type signature computation}
3672 \label{tab:attributesusedintypesignaturecomputation}
3673 \simplerule[\textwidth]
3675 \autocols[0pt]{c}{2}{l}{
3691 \DWATcontainingtype,
3695 \DWATdatamemberlocation,
3716 \DWATrvaluereference,
3720 \DWATstringlengthbitsize,
3721 \DWATstringlengthbytesize,
3726 \DWATvariableparameter,
3729 \DWATvtableelemlocation
3732 \simplerule[\textwidth]
3735 Note that except for the initial
3736 \DWATname{} attribute,
3737 \addtoindexx{name attribute}
3738 attributes are appended in order according to the alphabetical
3739 spelling of their identifier.
3741 If an implementation defines any vendor-specific attributes,
3742 any such attributes that are essential to the definition of
3743 the type are also included at the end of the above list,
3744 in their own alphabetical suborder.
3746 An attribute that refers to another type entry T is processed
3748 \begin{enumerate}[ a)]
3750 If T is in the list V at some V[x], use the
3751 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3752 encoding of x as the attribute value.
3755 Otherwise, append type T to the list V, then
3757 as the marker, process the type T recursively by performing
3758 Steps 2 through 7, and use the result as the attribute value.
3762 Other attribute values use the letter 'A' as the marker, and
3763 the value consists of the form code (encoded as an unsigned
3764 LEB128 value) followed by the encoding of the value according
3765 to the form code. To ensure reproducibility of the signature,
3766 the set of forms used in the signature computation is limited
3774 \item If the tag in Step 3 is one of \DWTAGpointertype,
3775 \DWTAGreferencetype,
3776 \DWTAGrvaluereferencetype,
3777 \DWTAGptrtomembertype,
3778 or \DWTAGfriend, and the referenced
3779 type (via the \DWATtype{} or
3780 \DWATfriend{} attribute) has a
3781 \DWATname{} attribute, append to S the letter 'N', the DWARF
3782 attribute code (\DWATtype{} or
3783 \DWATfriend), the context of
3784 the type (according to the method in Step 2), the letter 'E',
3785 and the name of the type. For \DWTAGfriend, if the referenced
3786 entry is a \DWTAGsubprogram, the context is omitted and the
3787 name to be used is the ABI-specific name of the subprogram
3788 (for example, the mangled linker name).
3791 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3792 \DWTAGreferencetype,
3793 \DWTAGrvaluereferencetype,
3794 \DWTAGptrtomembertype, or
3795 \DWTAGfriend, but has
3796 a \DWATtype{} attribute, or if the referenced type (via
3798 \DWATfriend{} attribute) does not have a
3799 \DWATname{} attribute, the attribute is processed according to
3800 the method in Step 4 for an attribute that refers to another
3804 \item Visit each child C of the debugging information
3805 entry as follows: If C is a nested type entry or a member
3806 function entry, and has
3807 a \DWATname{} attribute, append to
3808 \addtoindexx{name attribute}
3809 S the letter 'S', the tag of C, and its name; otherwise,
3810 process C recursively by performing Steps 3 through 7,
3811 appending the result to S. Following the last child (or if
3812 there are no children), append a zero byte.
3817 For the purposes of this algorithm, if a debugging information
3819 \DWATspecification{}
3820 attribute that refers to
3821 another entry D (which has a
3824 then S inherits the attributes and children of D, and S is
3825 processed as if those attributes and children were present in
3826 the entry S. Exception: if a particular attribute is found in
3827 both S and D, the attribute in S is used and the corresponding
3828 one in D is ignored.
3831 DWARF tag and attribute codes are appended to the sequence
3832 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3833 using the values defined earlier in this chapter.
3835 \textit{A grammar describing this computation may be found in
3836 Appendix \refersec{app:typesignaturecomputationgrammar}.
3839 \textit{An attribute that refers to another type entry is
3840 recursively processed or replaced with the name of the
3841 referent (in Step 4, 5 or 6). If neither treatment applies to
3842 an attribute that references another type entry, the entry
3843 that contains that attribute is not suitable for a
3844 separate \addtoindex{type unit}.}
3846 \textit{If a debugging information entry contains an attribute from
3847 the list above that would require an unsupported form, that
3848 entry is not suitable for a separate
3849 \addtoindex{type unit}.}
3851 \textit{A type is suitable for a separate
3852 \addtoindex{type unit} only
3853 if all of the type entries that it contains or refers to in
3854 Steps 6 and 7 are themselves suitable for a separate
3855 \addtoindex{type unit}.}
3858 Where the DWARF producer may reasonably choose two or more
3859 different forms for a given attribute, it should choose
3860 the simplest possible form in computing the signature. (For
3861 example, a constant value should be preferred to a location
3862 expression when possible.)
3864 Once the string S has been formed from the DWARF encoding,
3865 an 16-byte \MDfive{} digest is computed for the string and the
3866 last eight bytes are taken as the type signature.
3868 \textit{The string S is intended to be a flattened representation of
3869 the type that uniquely identifies that type (that is, a different
3870 type is highly unlikely to produce the same string).}
3873 \textit{A debugging information entry is not be placed in a
3874 separate \addtoindex{type unit}
3875 if any of the following apply:}
3879 \item \textit{The entry has an attribute whose value is a location
3880 description, and the location description
3881 contains a reference to
3882 another debugging information entry (for example, a \DWOPcallref{}
3883 operator), as it is unlikely that the entry will remain
3884 identical across compilation units.}
3886 \item \textit{The entry has an attribute whose value refers
3887 to a code location or a \addtoindex{location list}.}
3889 \item \textit{The entry has an attribute whose value refers
3890 to another debugging information entry that does not represent
3896 \textit{Certain attributes are not included in the type signature:}
3899 \item \textit{The \DWATdeclaration{} attribute is not included because it
3900 indicates that the debugging information entry represents an
3901 incomplete declaration, and incomplete declarations should
3903 \addtoindexx{type unit}
3904 separate type units.}
3906 \item \textit{The \DWATdescription{} attribute is not included because
3907 it does not provide any information unique to the defining
3908 declaration of the type.}
3910 \item \textit{The \DWATdeclfile,
3912 \DWATdeclcolumn{} attributes are not included because they
3913 may vary from one source file to the next, and would prevent
3914 two otherwise identical type declarations from producing the
3915 same \MDfive{} digest.}
3917 \item \textit{The \DWATobjectpointer{} attribute is not included
3918 because the information it provides is not necessary for the
3919 computation of a unique type signature.}
3923 \textit{Nested types and some types referred to by a debugging
3924 information entry are encoded by name rather than by recursively
3925 encoding the type to allow for cases where a complete definition
3926 of the type might not be available in all compilation units.}
3929 \textit{If a type definition contains the definition of a member function,
3930 it cannot be moved as is into a type unit, because the member function
3931 contains attributes that are unique to that compilation unit.
3932 Such a type definition can be moved to a type unit by rewriting the
3933 debugging information entry tree,
3934 moving the member function declaration into a separate declaration tree,
3935 and replacing the function definition in the type with a non-defining
3936 declaration of the function (as if the function had been defined out of
3939 An example that illustrates the computation of an \MDfive{} digest may be found in
3940 Appendix \refersec{app:usingtypeunits}.
3942 \section{Name Table Hash Function}
3943 \label{datarep:nametablehashfunction}
3944 The hash function used for hashing name strings in the accelerated
3945 access name index table (see Section \refersec{chap:acceleratedaccess})
3946 is defined in \addtoindex{C} as shown in
3947 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnoteRR{
3948 This hash function is sometimes known as the
3949 "\addtoindex{Bernstein hash function}" or the
3950 "\addtoindex{DJB hash function}"
3952 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
3953 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
3958 uint32_t /* must be a 32-bit integer type */
3959 hash(unsigned char *str)
3961 uint32_t hash = 5381;
3965 hash = hash * 33 + c;
3971 \caption{Name Table Hash Function Definition}
3972 \label{fig:nametablehashfunctiondefinition}