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
117 that occurs at the beginning of the CIE and FDE structures
118 in the \dotdebugframe{} section.
121 In an \addtoindex{initial length} field, the values \wfffffffzero through
122 \wffffffff are reserved by DWARF to indicate some form of
123 extension relative to \DWARFVersionII; such values must not
124 be interpreted as a length field. The use of one such value,
125 \xffffffff, is defined in
126 Section \refersec{datarep:32bitand64bitdwarfformats});
128 the other values is reserved for possible future extensions.
131 \section{Relocatable, Split, Executable, Shared, Package and Supplementary Object Files}
132 \label{datarep:executableobjectsandsharedobjects}
134 \subsection{Relocatable Object Files}
135 \label{datarep:relocatableobjectfiles}
136 A DWARF producer (for example, a compiler) typically generates its
137 debugging information as part of a relocatable object file.
138 Relocatable object files are then combined by a linker to form an
139 executable file. During the linking process, the linker resolves
140 (binds) symbolic references between the various object files, and
141 relocates the contents of each object file into a combined virtual
144 The DWARF debugging information is placed in several sections (see
145 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
146 requires an object file format capable of
147 representing these separate sections. There are symbolic references
148 between these sections, and also between the debugging information
149 sections and the other sections that contain the text and data of the
150 program itself. Many of these references require relocation, and the
151 producer must emit the relocation information appropriate to the
152 object file format and the target processor architecture. These
153 references include the following:
156 \item The compilation unit header (see Section
157 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
158 section contains a reference to the \dotdebugabbrev{} table. This
159 reference requires a relocation so that after linking, it refers to
160 that contribution to the combined \dotdebugabbrev{} section in the
163 \item Debugging information entries may have attributes with the form
164 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
165 These attributes represent locations
166 within the virtual address space of the program, and require
169 \item A DWARF expression may contain a \DWOPaddr{} (see Section
170 \refersec{chap:literalencodings}) which contains a location within
171 the virtual address space of the program, and require relocation.
174 \item Debugging information entries may have attributes with the form
175 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
176 These attributes refer to
177 debugging information in other debugging information sections within
178 the object file, and must be relocated during the linking process.
180 \item Debugging information entries may have attributes with the form
181 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
182 These attributes refer to
183 debugging information entries that may be outside the current
184 compilation unit. These values require both symbolic binding and
187 \item Debugging information entries may have attributes with the form
188 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
189 These attributes refer to strings in
190 the \dotdebugstr{} section. These values require relocation.
192 \item Entries in the \dotdebugaddr{} and \dotdebugaranges{}
193 sections may contain references to locations within the virtual address
194 space of the program, and thus require relocation.
196 \item Entries in the \dotdebugloclists{} and \dotdebugrnglists{} sections may
197 contain references to locations within the virtual address space of the
198 program depending on whether certain kinds of location or range
199 list entries are used, and thus require relocation.
201 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
202 opcode is a reference to a location within the virtual address space
203 of the program, and requires relocation.
205 \item The \dotdebugstroffsets{} section contains a list of string offsets,
206 each of which is an offset of a string in the \dotdebugstr{} section. Each
207 of these offsets requires relocation. Depending on the implementation,
208 these relocations may be implicit (that is, the producer may not need to
209 emit any explicit relocation information for these offsets).
211 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges{} header and
212 the list of compilation units following the \dotdebugnames{} header contain
213 references to the \dotdebuginfo{} section. These references require relocation
214 so that after linking they refer to the correct contribution in the combined
215 \dotdebuginfo{} section in the executable file.
217 \item Frame descriptor entries in the \dotdebugframe{} section
218 (see Section \refersec{chap:structureofcallframeinformation}) contain an
219 \HFNinitiallocation{} field value within the virtual address
220 space of the program and require relocation.
225 \textit{Note that operands of classes
227 \CLASSflag{} do not require relocation. Attribute operands that use
228 forms \DWFORMstring{},
229 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
230 \DWFORMrefudata{} also do not need relocation.}
232 \subsection{Split DWARF Object Files}
233 \label{datarep:splitdwarfobjectfiles}
234 \addtoindexx{split DWARF object file}
235 A DWARF producer may partition the debugging
236 information such that the majority of the debugging
237 information can remain in individual object files without
238 being processed by the linker.
240 \textit{This reduces link time by reducing the amount of information
241 the linker must process.}
244 \subsubsection{First Partition (with Skeleton Unit)}
245 The first partition contains
246 debugging information that must still be processed by the linker,
247 and includes the following:
250 The line number tables, frame tables, and
251 accelerated access tables, in the usual sections:
252 \dotdebugline, \dotdebuglinestr,
253 \dotdebugframe, \dotdebugnames{} and \dotdebugaranges,
257 An address table, in the \dotdebugaddr{} section. This table
258 contains all addresses and constants that require
259 link-time relocation, and items in the table can be
260 referenced indirectly from the debugging information via
261 the \DWFORMaddrx{} form,
262 by the \DWOPaddrx{} and \DWOPconstx{} operators, and
263 by certain of the \texttt{DW\_LLE\_*} location list
264 and \texttt{DW\_RLE\_*} range list entries.
266 A skeleton compilation unit, as described in Section
267 \refersec{chap:skeletoncompilationunitentries},
268 in the \dotdebuginfo{} section.
270 An abbreviations table for the skeleton compilation unit,
271 in the \dotdebugabbrev{} section
272 used by the \dotdebuginfo{} section.
275 A string table, in the \dotdebugstr{} section. The string
276 table is necessary only if the skeleton compilation unit
277 uses either indirect string form, \DWFORMstrp{} or
280 A string offsets table, in the \dotdebugstroffsets{}
281 section 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.
300 Attributes contained in the full compilation unit
301 may refer to machine addresses indirectly using the \DWFORMaddrx{}
302 form, which accesses the table of addresses specified by the
303 \DWATaddrbase{} attribute in the associated skeleton unit.
304 Location descriptions may similarly do so using the \DWOPaddrx{} and
305 \DWOPconstx{} operations.
307 \item Separate type units, in the \dotdebuginfodwo{} section.
310 Abbreviations table(s) for the compilation unit and type
311 units, in the \dotdebugabbrevdwo{} section
312 used by the \dotdebuginfodwo{} section.
314 \item Location lists, in the
315 \dotdebugloclistsdwo{} section.
317 \item Range lists, in the \dotdebugrnglistsdwo{} section.
320 A \addtoindex{specialized line number table} (for the type units),
321 in the \dotdebuglinedwo{} section.
324 contains only the directory and filename lists needed to
325 interpret \DWATdeclfile{} attributes in the debugging
328 \item Macro information, in the \dotdebugmacrodwo{} section.
330 \item A string table, in the \dotdebugstrdwo{} section.
332 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
334 for the strings in the \dotdebugstrdwo{} section.
337 Except where noted otherwise, all references in this document
338 to a debugging information section (for example, \dotdebuginfo),
339 apply also to the corresponding split DWARF section (for example,
343 Split DWARF object files do not get linked with any other files,
344 therefore references between sections must not make use of
345 normal object file relocation information. As a result, symbolic
346 references within or between sections are not possible.
348 \subsection{Executable Objects}
349 \label{chap:executableobjects}
350 The relocated addresses in the debugging information for an
351 executable object are virtual addresses.
353 The sections containing the debugging information are typically
354 not loaded as part of the memory image of the program (in ELF
355 terminology, the sections are not "allocatable" and are not part
356 of a loadable segment). Therefore, the debugging information
357 sections described in this document are typically linked as if
358 they were each to be loaded at virtual address 0, and references
359 within the debugging information always implicitly indicate which
360 section a particular offset refers to. (For example, a reference
361 of form \DWFORMsecoffset{} may refer to one of several sections,
362 depending on the class allowed by a particular attribute of a
363 debugging information entry, as shown in
364 Table \refersec{tab:attributeencodings}.)
367 \subsection{Shared Object Files}
368 \label{datarep:sharedobjectfiles}
370 addresses in the debugging information for a shared object file
371 are offsets relative to the start of the lowest region of
372 memory loaded from that shared object file.
375 \textit{This requirement makes the debugging information for
376 shared object files position independent. Virtual addresses in a
377 shared object file may be calculated by adding the offset to the
378 base address at which the object file was attached. This offset
379 is available in the run\dash time linker\textquoteright s data structures.}
381 As with executable objects, the sections containing debugging
382 information are typically not loaded as part of the memory image
383 of the shared object, and are typically linked as if they were
384 each to be loaded at virtual address 0.
386 \subsection{DWARF Package Files}
387 \label{datarep:dwarfpackagefiles}
388 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
389 link, and debug an application quickly with less link-time overhead,
390 but a more convenient format is needed for saving the debug
391 information for later debugging of a deployed application. A
392 DWARF package file can be used to collect the debugging
393 information from the object (or separate DWARF object) files
394 produced during the compilation of an application.}
396 \textit{The package file is typically placed in the same directory as the
397 application, and is given the same name with a \doublequote{\texttt{.dwp}}
398 extension.\addtoindexx{\texttt{.dwp} file extension}}
401 A DWARF package file is itself an object file, using the
402 \addtoindexx{package files}
403 \addtoindexx{DWARF package files}
404 same object file format (including \byteorder) as the
405 corresponding application binary. It consists only of a file
406 header, a section table, a number of DWARF debug information
407 sections, and two index sections.
410 Each DWARF package file contains no more than one of each of the
411 following sections, copied from a set of object or DWARF object
412 files, and combined, section by section:
419 \dotdebugstroffsetsdwo
424 The string table section in \dotdebugstrdwo{} contains all the
425 strings referenced from DWARF attributes using the form
426 \DWFORMstrx. Any attribute in a compilation unit or a type
427 unit using this form refers to an entry in that unit's
428 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
429 provides the offset of a string in the \dotdebugstrdwo{}
432 The DWARF package file also contains two index sections that
433 provide a fast way to locate debug information by compilation
434 unit ID for compilation units, or by type
435 signature for type units:
441 \subsubsection{The Compilation Unit (CU) Index Section}
442 The \dotdebugcuindex{} section is a hashed lookup table that maps a
443 compilation unit ID to a set of contributions in the
444 various debug information sections. Each contribution is stored
445 as an offset within its corresponding section and a size.
448 Each \compunitset{} may contain contributions from the
451 \dotdebuginfodwo{} (required)
452 \dotdebugabbrevdwo{} (required)
456 \dotdebugstroffsetsdwo
460 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
461 information from \DWARFVersionIV{} or earlier formats.}
463 \subsubsection{The Type Unit (TU) Index Section}
464 The \dotdebugtuindex{} section is a hashed lookup table that maps a
465 type signature to a set of offsets in the various debug
466 information sections. Each contribution is stored as an offset
467 within its corresponding section and a size.
469 Each \typeunitset{} may contain contributions from the following
472 \dotdebuginfodwo{} (required)
473 \dotdebugabbrevdwo{} (required)
475 \dotdebugstroffsetsdwo
478 \subsubsection{Format of the CU and TU Index Sections}
479 Both index sections have the same format, and serve to map an
480 8-byte signature to a set of contributions to the debug sections.
481 Each index section begins with a header, followed by a hash table of
482 signatures, a parallel table of indexes, a table of offsets, and
483 a table of sizes. The index sections are aligned at 8-byte
484 boundaries in the DWARF package file.
487 The index section header contains the following fields:
488 \begin{enumerate}[1. ]
489 \item \texttt{version} (\HFTuhalf) \\
491 \addtoindexx{version number!CU index information}
492 \addtoindexx{version number!TU index information}
493 This number is specific to the CU and TU index information
494 and is independent of the DWARF version number.
496 The version number is \versiondotdebugcuindex.
498 \item \textit{padding} (\HFTuhalf) \\
499 Reserved to DWARF (must be zero).
502 \item \texttt{section\_count} (\HFTuword) \\
503 The number of entries in the table of section counts that follows.
504 For brevity, the contents of this field is referred to as $N$ below.
506 \item \texttt{unit\_count} (\HFTuword) \\
507 The number of compilation units or type units in the index.
508 For brevity, the contents of this field is referred to as $U$ below.
510 \item \texttt{slot\_count} (\HFTuword) \\
511 The number of slots in the hash table.
512 For brevity, the contents of this field is referred to as $S$ below.
516 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
518 The size of the hash table, $S$, must be $2^k$ such that:
519 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
521 The hash table begins at offset 16 in the section, and consists
522 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
524 % (using the \byteorder{} of the application binary).
526 The parallel table of indices begins immediately after the hash table
527 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
528 consists of an array of $S$ 4-byte slots,
529 % (using the byte order of the application binary),
530 corresponding 1-1 with slots in the hash
531 table. Each entry in the parallel table contains a row index into
532 the tables of offsets and sizes.
534 Unused slots in the hash table have 0 in both the hash table
535 entry and the parallel table entry. While 0 is a valid hash
536 value, the row index in a used slot will always be non-zero.
538 Given an 8-byte compilation unit ID or type signature $X$,
539 an entry in the hash table is located as follows:
540 \begin{enumerate}[1. ]
541 \item Define $REP(X)$ to be the value of $X$ interpreted as an
542 unsigned 64-bit integer in the target byte order.
543 \item Calculate a primary hash $H = REP(X)\ \&\ MASK(k)$, where
544 $MASK(k)$ is a mask with the low-order $k$ bits all set to 1.
545 \item Calculate a secondary hash $H' = (((REP(X)>>32)\ \&\ MASK(k))\ |\ 1)$.
546 \item If the hash table entry at index $H$ matches the signature, use
547 that entry. If the hash table entry at index $H$ is unused (all
548 zeroes), terminate the search: the signature is not present
550 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 4.
553 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
554 guaranteed to stop at an unused slot or find the match.
557 The table of offsets begins immediately following the parallel
558 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
559 This table consists of a single header row containing $N$ fields,
560 each a 4-byte unsigned integer, followed by $U$ data rows, each
561 also containing $N$ fields of 4-byte unsigned integers. The fields
562 in the header row provide a section identifier referring to a
563 debug section; the available section identifiers are shown in
564 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
565 Each data row corresponds to a specific CU
566 or TU in the package file. In the data rows, each field provides
567 an offset to the debug section whose identifier appears in the
568 corresponding field of the header row. The data rows are indexed
571 \textit{Not all sections listed in the table need be included.}
575 \setlength{\extrarowheight}{0.1cm}
576 \begin{longtable}{l|c|l}
577 \caption{DWARF package file section identifier \mbox{encodings}}
578 \label{tab:dwarfpackagefilesectionidentifierencodings}
579 \addtoindexx{DWARF package files!section identifier encodings} \\
580 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
582 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
584 \hline \emph{Continued on next page}
588 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
589 \textit{Reserved} & 2 & \\
590 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
591 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
592 \DWSECTLOCLISTSTARG & 5 & \dotdebugloclistsdwo \\
593 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
594 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
595 \DWSECTRNGLISTSTARG & 8 & \dotdebugrnglistsdwo \\
599 The offsets provided by the CU and TU index sections are the
600 base offsets for the contributions made by each CU or TU to the
601 corresponding section in the package file. Each CU and TU header
602 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
603 table for that CU or TU within the contribution to the
604 \dotdebugabbrevdwo{} section for that CU or TU, and are
605 interpreted as relative to the base offset given in the index
606 section. Likewise, offsets into \dotdebuglinedwo{} from
607 \DWATstmtlist{} attributes are interpreted as relative to
608 the base offset for \dotdebuglinedwo{}, and offsets into other debug
609 sections obtained from DWARF attributes are also
610 interpreted as relative to the corresponding base offset.
612 The table of sizes begins immediately following the table of
613 offsets, and provides the sizes of the contributions made by each
614 CU or TU to the corresponding section in the package file.
615 This table consists of U data rows, each with N fields of 4-byte
616 unsigned integers. Each data row corresponds to the same CU or TU
617 as the corresponding data row in the table of offsets described
618 above. Within each data row, the N fields also correspond
619 one-to-one with the fields in the corresponding data row of the
620 table of offsets. Each field provides the size of the
621 contribution made by a CU or TU to the corresponding section in
624 For an example, see Figure \refersec{fig:examplecuindexsection}.
626 \subsection{DWARF Supplementary Object Files}
627 \label{datarep:dwarfsupplemetaryobjectfiles}
628 \textit{A supplementary object file permits a post-link utility to analyze executable and
629 shared object files and collect duplicate debugging information into a single file that
630 can be referenced by each of the original files. This is in contrast to split DWARF
631 object files, which allow the compiler to split the debugging information between
632 multiple files in order to reduce link time and executable size.}
635 A DWARF \addtoindex{supplementary object file} is itself an object file,
636 using the same object
637 file format, \byteorder{}, and size as the corresponding application executables
638 or shared libraries. It consists only of a file header, section table, and
639 a number of DWARF debug information sections. Both the
640 \addtoindex{supplementary object file}
641 and all the executable or shared object files that reference entries or strings in that
642 file must contain a \dotdebugsup{} section that establishes the relationship.
644 The \dotdebugsup{} section contains:
645 \begin{enumerate}[1. ]
646 \item \texttt{version} (\HFTuhalf) \\
647 \addttindexx{version}
648 A 2-byte unsigned integer representing the version of the DWARF
649 information for the compilation unit.
651 The value in this field is \versiondotdebugsup.
653 \item \texttt{is\_supplementary} (\HFTubyte) \\
654 \addttindexx{is\_supplementary}
655 A 1-byte unsigned integer, which contains the value 1 if it is
656 in the \addtoindex{supplementary object file} that other executable or
657 shared object files refer to, or 0 if it is an executable or shared object
658 referring to a \addtoindex{supplementary object file}.
661 \item \texttt{sup\_filename} (null terminated filename string) \\
662 \addttindexx{sup\_filename}
663 If \addttindex{is\_supplementary} is 0, this contains either an absolute
664 filename for the \addtoindex{supplementary object file}, or a filename
665 relative to the object file containing the \dotdebugsup{} section.
666 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
667 is not needed and must be an empty string (a single null byte).
670 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
671 \addttindexx{sup\_checksum\_len}
672 Length of the following \addttindex{sup\_checksum} field;
673 this value can be 0 if no checksum is provided.
675 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
676 \addttindexx{sup\_checksum}
677 An implementation-defined integer constant value that
678 provides unique identification of the supplementary file.
682 Debug information entries that refer to an executable's or shared
683 object's addresses must \emph{not} be moved to supplementary files
684 (the addesses will likely not be the same). Similarly,
685 entries referenced from within location descriptions or using loclistsptr
686 form attributes must not be moved to a \addtoindex{supplementary object file}.
688 Executable or shared object file compilation units can use
689 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
690 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
691 attributes to refer to them and \DWFORMstrpsup{} form attributes to
692 refer to strings that are used by debug information of multiple
693 executables or shared object files. Within the \addtoindex{supplementary object file}'s
694 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
695 not used, and all reference forms referring to some other sections
696 refer to the local sections in the \addtoindex{supplementary object file}.
698 In macro information, \DWMACROdefinesup{} or
699 \DWMACROundefsup{} opcodes can refer to strings in the
700 \dotdebugstr{} section of the \addtoindex{supplementary object file},
701 or \DWMACROimportsup{}
702 can refer to \dotdebugmacro{} section entries. Within the
703 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
704 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
705 opcodes refer to the local \dotdebugstr{} section in that
706 supplementary file, not the one in
707 the executable or shared object file.
711 \section{32-Bit and 64-Bit DWARF Formats}
712 \label{datarep:32bitand64bitdwarfformats}
713 \hypertarget{datarep:xxbitdwffmt}{}
714 \addtoindexx{32-bit DWARF format}
715 \addtoindexx{64-bit DWARF format}
716 There are two closely-related DWARF
717 formats. In the 32-bit DWARF
718 format, all values that represent lengths of DWARF sections
719 and offsets relative to the beginning of DWARF sections are
720 represented using four bytes. In the 64-bit DWARF format, all
721 values that represent lengths of DWARF sections and offsets
722 relative to the beginning of DWARF sections are represented
723 using eight bytes. A special convention applies to the initial
724 length field of certain DWARF sections, as well as the CIE and
725 FDE structures, so that the 32-bit and 64-bit DWARF formats
726 can coexist and be distinguished within a single linked object.
728 Except where noted otherwise, all references in this document
729 to a debugging information section (for example, \dotdebuginfo),
730 apply also to the corresponding split DWARF section (for example,
733 The differences between the 32- and 64-bit DWARF formats are
734 detailed in the following:
735 \begin{enumerate}[1. ]
737 \item In the 32-bit DWARF format, an
738 \addtoindex{initial length} field (see
739 \addtoindexx{initial length!encoding}
740 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
741 is an unsigned 4-byte integer (which
742 must be less than \xfffffffzero); in the 64-bit DWARF format,
743 an \addtoindex{initial length} field is 12 bytes in size,
746 \item The first four bytes have the value \xffffffff.
748 \item The following eight bytes contain the actual length
749 represented as an unsigned 8-byte integer.
752 \textit{This representation allows a DWARF consumer to dynamically
753 detect that a DWARF section contribution is using the 64-bit
754 format and to adapt its processing accordingly.}
757 \item \hypertarget{datarep:sectionoffsetlength}{}
758 Section offset and section length
759 \addtoindexx{section length!use in headers}
761 \addtoindexx{section offset!use in headers}
762 in the headers of DWARF sections (other than initial length
763 \addtoindexx{initial length}
764 fields) are listed following. In the 32-bit DWARF format these
765 are 4-byte unsigned integer values; in the 64-bit DWARF format,
766 they are 8-byte unsigned integer values.
768 \begin{nolinenumbersenv}
771 Section &Name & Role \\ \hline
772 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
773 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
774 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
775 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
776 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
777 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
781 \end{nolinenumbersenv}
784 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
785 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
786 union must be accessed to distinguish whether a CIE or FDE is
787 present, consequently, these two fields must exactly overlay
788 each other (both offset and size).
790 \item Within the body of the \dotdebuginfo{}
791 section, certain forms of attribute value depend on the choice
792 of DWARF format as follows. For the 32-bit DWARF format,
793 the value is a 4-byte unsigned integer; for the 64-bit DWARF
794 format, the value is an 8-byte unsigned integer.
797 \begin{nolinenumbersenv}
798 \begin{tabular}{lp{6cm}}
799 Form & Role \\ \hline
800 \DWFORMlinestrp & offset in \dotdebuglinestr \\
801 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
802 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
803 \addtoindexx{supplementary object file}
804 \DWFORMsecoffset & offset in a section other than \\
805 & \dotdebuginfo{} or \dotdebugstr{} \\
806 \DWFORMstrp & offset in \dotdebugstr{} \\
807 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
808 \DWOPcallref & offset in \dotdebuginfo{} \\
810 \end{nolinenumbersenv}
814 \item Within the body of the \dotdebugline{} section, certain forms of content
815 description depend on the choice of DWARF format as follows: for the
816 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
817 64-bit DWARF format, the value is a 8-byte unsigned integer.
820 \begin{nolinenumbersenv}
821 \begin{tabular}{lp{6cm}}
822 Form & Role \\ \hline
823 \DWFORMlinestrp & offset in \dotdebuglinestr
825 \end{nolinenumbersenv}
828 \item Within the body of the \dotdebugnames{}
829 sections, the representation of each entry in the array of
830 compilation units (CUs) and the array of local type units
831 (TUs), which represents an offset in the
833 section, depends on the DWARF format as follows: in the
834 32-bit DWARF format, each entry is a 4-byte unsigned integer;
835 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
838 \item In the body of the \dotdebugstroffsets{}
839 sections, the size of entries in the body depend on the DWARF
840 format as follows: in the 32-bit DWARF format, entries are 4-byte
841 unsigned integer values; in the 64-bit DWARF format, they are
842 8-byte unsigned integers.
844 %\bbpareb-delete bullet 7
846 \item In the body of the \dotdebugloclists{} and \dotdebugrnglists{}
847 sections, the offsets the follow the header depend on the
848 DWARF format as follows: in the 32-bit DWARF format, offsets are 4-byte
849 unsigned integer values; in the 64-bit DWARF format, they are
850 8-byte unsigned integers.
855 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
856 intermixed within a single compilation unit.
858 \textit{Attribute values and section header fields that represent
859 addresses in the target program are not affected by these
863 A DWARF consumer that supports the 64-bit DWARF format must
864 support executables in which some compilation units use the
865 32-bit format and others use the 64-bit format provided that
866 the combination links correctly (that is, provided that there
867 are no link\dash time errors due to truncation or overflow). (An
868 implementation is not required to guarantee detection and
869 reporting of all such errors.)
871 \textit{It is expected that DWARF producing compilers will \emph{not} use
872 the 64-bit format \emph{by default}. In most cases, the division of
873 even very large applications into a number of executable and
874 shared object files will suffice to assure that the DWARF sections
875 within each individual linked object are less than 4 GBytes
876 in size. However, for those cases where needed, the 64-bit
877 format allows the unusual case to be handled as well. Even
878 in this case, it is expected that only application supplied
879 objects will need to be compiled using the 64-bit format;
880 separate 32-bit format versions of system supplied shared
881 executable libraries can still be used.}
884 \section{Format of Debugging Information}
885 \label{datarep:formatofdebugginginformation}
887 For each compilation unit compiled with a DWARF producer,
888 a contribution is made to the \dotdebuginfo{} section of
889 the object file. Each such contribution consists of a
890 compilation unit header
891 (see Section \refersec{datarep:compilationunitheader})
893 single \DWTAGcompileunit{} or
894 \DWTAGpartialunit{} debugging
895 information entry, together with its children.
897 For each type defined in a compilation unit, a separate
898 contribution may also be made to the
900 section of the object file. Each
901 such contribution consists of a
902 \addtoindex{type unit} header
903 (see Section \refersec{datarep:typeunitheaders})
904 followed by a \DWTAGtypeunit{} entry, together with
907 Each debugging information entry begins with a code that
908 represents an entry in a separate
909 \addtoindex{abbreviations table}. This
910 code is followed directly by a series of attribute values.
912 The appropriate entry in the
913 \addtoindex{abbreviations table} guides the
914 interpretation of the information contained directly in the
915 \dotdebuginfo{} section.
917 Multiple debugging information entries may share the same
918 abbreviation table entry. Each compilation unit is associated
919 with a particular abbreviation table, but multiple compilation
920 units may share the same table.
923 \subsection{Unit Headers}
924 \label{datarep:unitheaders}
925 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
926 compilation unit that follows. The encodings for the unit type
927 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
931 \setlength{\extrarowheight}{0.1cm}
932 \begin{longtable}{l|c}
933 \caption{Unit header unit type encodings}
934 \label{tab:unitheaderunitkindencodings}
935 \addtoindexx{unit header unit type encodings} \\
936 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
938 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
940 \hline \emph{Continued on next page}
942 \hline \ddag\ \textit{New in DWARF Version 5}
944 \DWUTcompileTARG~\ddag &0x01 \\
945 \DWUTtypeTARG~\ddag &0x02 \\
946 \DWUTpartialTARG~\ddag &0x03 \\
947 \DWUTskeletonTARG~\ddag &0x04 \\
948 \DWUTsplitcompileTARG~\ddag &0x05 \\
949 \DWUTsplittypeTARG~\ddag &0x06 \\
950 \DWUTlouserTARG~\ddag &0x80 \\
951 \DWUThiuserTARG~\ddag &\xff \\
956 \textit{All unit headers in a compilation have the same size.
957 Some header types include padding bytes to achieve this.}
960 \subsubsection{Compilation and Partial Unit Headers}
961 \label{datarep:compilationunitheader}
962 \begin{enumerate}[1. ]
964 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
965 \addttindexx{unit\_length}
967 \addtoindexx{initial length}
968 unsigned integer representing the length
969 of the \dotdebuginfo{} contribution for that compilation unit,
970 not including the length field itself. In the \thirtytwobitdwarfformat,
971 this is a 4-byte unsigned integer (which must be less
972 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
973 of the 4-byte value \wffffffff followed by an 8-byte unsigned
974 integer that gives the actual length
975 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
977 \item \texttt{version} (\HFTuhalf) \\
978 \addttindexx{version}
979 \addtoindexx{version number!compilation unit}
980 A 2-byte unsigned integer representing the version of the
981 DWARF information for the compilation unit.
983 The value in this field is \versiondotdebuginfo.
985 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
986 for a summary of all version numbers that apply to DWARF sections.}
989 \item \texttt{unit\_type} (\HFTubyte) \\
990 \addttindexx{unit\_type}
991 A 1-byte unsigned integer identifying this unit as a compilation unit.
992 The value of this field is
993 \DWUTcompile{} for a full compilation unit or
994 \DWUTpartial{} for a partial compilation unit
995 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
997 \textit{This field is new in \DWARFVersionV.}
1000 \item \texttt{address\_size} (\HFTubyte) \\
1001 \addttindexx{address\_size}
1002 A 1-byte unsigned integer representing the size in bytes of
1003 an address on the target architecture. If the system uses
1004 \addtoindexx{address space!segmented}
1005 segmented addressing, this value represents the size of the
1006 offset portion of an address.
1008 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1010 \addtoindexx{section offset!in .debug\_info header}
1011 4-byte or 8-byte unsigned offset into the
1013 section. This offset associates the compilation unit with a
1014 particular set of debugging information entry abbreviations. In
1015 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1016 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1017 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1019 \item \HFNunitpaddingONE{} (8 bytes) \\
1020 Reserved to DWARF (must be zero).
1023 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1024 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1025 this is 4 bytes in length; in the \sixtyfourbitdwarfformat, this
1026 is 8 bytes in length.
1030 \subsubsection{Skeleton and Split Compilation Unit Headers}
1031 \label{datarep:skeletonandfullcompilationunitheaders}
1032 \begin{enumerate}[1. ]
1034 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1035 \addttindexx{unit\_length}
1037 \addtoindexx{initial length}
1038 unsigned integer representing the length
1039 of the \dotdebuginfo{}
1040 contribution for that compilation unit,
1041 not including the length field itself. In the \thirtytwobitdwarfformat,
1042 this is a 4-byte unsigned integer (which must be less
1043 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1044 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1045 integer that gives the actual length
1046 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1048 \item \texttt{version} (\HFTuhalf) \\
1049 \addttindexx{version}
1050 \addtoindexx{version number!compilation unit}
1051 A 2-byte unsigned integer representing the version of the
1052 DWARF information for the compilation unit.
1054 The value in this field is \versiondotdebuginfo.
1056 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1057 for a summary of all version numbers that apply to DWARF sections.}
1060 \item \texttt{unit\_type} (\HFTubyte) \\
1061 \addttindexx{unit\_type}
1062 A 1-byte unsigned integer identifying this unit as a compilation unit.
1063 The value of this field is
1064 \DWUTskeleton{} for a skeleton compilation unit or
1065 \DWUTsplitcompile{} for a split compilation unit
1066 (see Section \refersec{chap:skeletoncompilationunitentries}).
1068 \textit{This field is new in \DWARFVersionV.}
1071 \item \texttt{address\_size} (\HFTubyte) \\
1072 \addttindexx{address\_size}
1073 A 1-byte unsigned integer representing the size in bytes of
1074 an address on the target architecture. If the system uses
1075 \addtoindexx{address space!segmented}
1076 segmented addressing, this value represents the size of the
1077 offset portion of an address.
1079 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1081 \addtoindexx{section offset!in .debug\_info header}
1082 4-byte or 8-byte unsigned offset into the
1084 section. This offset associates the compilation unit with a
1085 particular set of debugging information entry abbreviations. In
1086 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1087 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1088 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1091 \item \HFNdwoid{} (unit ID) \\
1092 An 8-byte implementation-defined integer constant value,
1093 known as the compilation unit ID, that provides
1094 unique identification of a skeleton compilation
1095 unit and its associated split compilation unit in
1096 the object file named in the \DWATdwoname{} attribute
1097 of the skeleton compilation.
1100 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1101 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1102 this is 4 bytes in length; in the \sixtyfourbitdwarfformat{}, this
1103 is 8 bytes in length.
1107 \subsubsection{Type Unit Headers}
1108 \label{datarep:typeunitheaders}
1109 The header for the series of debugging information entries
1110 contributing to the description of a type that has been
1111 placed in its own \addtoindex{type unit}, within the
1112 \dotdebuginfo{} section,
1113 consists of the following information:
1114 \begin{enumerate}[1. ]
1115 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1116 \addttindexx{unit\_length}
1117 A 4-byte or 12-byte unsigned integer
1118 \addtoindexx{initial length}
1119 representing the length
1120 of the \dotdebuginfo{} contribution for that type unit,
1121 not including the length field itself. In the \thirtytwobitdwarfformat,
1122 this is a 4-byte unsigned integer (which must be
1123 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
1124 consists of the 4-byte value \wffffffff followed by an
1125 8-byte unsigned integer that gives the actual length
1126 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1129 \item \texttt{version} (\HFTuhalf) \\
1130 \addttindexx{version}
1131 \addtoindexx{version number!type unit}
1132 A 2-byte unsigned integer representing the version of the
1133 DWARF information for the type unit.
1135 The value in this field is \versiondotdebuginfo.
1137 \item \texttt{unit\_type} (\HFTubyte) \\
1138 \addttindexx{unit\_type}
1139 A 1-byte unsigned integer identifying this unit as a type unit.
1140 The value of this field is \DWUTtype{} for a non-split type unit
1141 (see Section \refersec{chap:typeunitentries})
1142 or \DWUTsplittype{} for a split type unit.
1144 \textit{This field is new in \DWARFVersionV.}
1147 \item \texttt{address\_size} (\HFTubyte) \\
1148 \addttindexx{address\_size}
1149 A 1-byte unsigned integer representing the size
1150 \addtoindexx{size of an address}
1152 an address on the target architecture. If the system uses
1153 \addtoindexx{address space!segmented}
1154 segmented addressing, this value represents the size of the
1155 offset portion of an address.
1158 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1160 \addtoindexx{section offset!in .debug\_info header}
1161 4-byte or 8-byte unsigned offset into the
1163 section. This offset associates the type unit with a
1164 particular set of debugging information entry abbreviations. In
1165 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1166 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1167 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1169 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1170 \addttindexx{type\_signature}
1171 \addtoindexx{type signature}
1172 A unique 8-byte signature (see Section
1173 \refersec{datarep:typesignaturecomputation})
1174 of the type described in this type
1177 \textit{An attribute that refers (using
1178 \DWFORMrefsigeight{}) to
1179 the primary type contained in this
1180 \addtoindex{type unit} uses this value.}
1183 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1184 \addttindexx{type\_offset}
1185 A 4-byte or 8-byte unsigned offset
1186 \addtoindexx{section offset!in .debug\_info header}
1187 relative to the beginning
1188 of the \addtoindex{type unit} header.
1189 This offset refers to the debugging
1190 information entry that describes the type. Because the type
1191 may be nested inside a namespace or other structures, and may
1192 contain references to other types that have not been placed in
1193 separate type units, it is not necessarily either the first or
1194 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1195 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1196 this is an 8-byte unsigned length
1197 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1201 \subsection{Debugging Information Entry}
1202 \label{datarep:debugginginformationentry}
1204 Each debugging information entry begins with an
1205 unsigned LEB128\addtoindexx{LEB128!unsigned}
1206 number containing the abbreviation code for the entry. This
1207 code represents an entry within the abbreviations table
1208 associated with the compilation unit containing this entry. The
1209 abbreviation code is followed by a series of attribute values.
1211 On some architectures, there are alignment constraints on
1212 section boundaries. To make it easier to pad debugging
1213 information sections to satisfy such constraints, the
1214 abbreviation code 0 is reserved. Debugging information entries
1215 consisting of only the abbreviation code 0 are considered
1218 \subsection{Abbreviations Tables}
1219 \label{datarep:abbreviationstables}
1221 The abbreviations tables for all compilation units
1222 are contained in a separate object file section called
1224 As mentioned before, multiple compilation
1225 units may share the same abbreviations table.
1227 The abbreviations table for a single compilation unit consists
1228 of a series of abbreviation declarations. Each declaration
1229 specifies the tag and attributes for a particular form of
1230 debugging information entry. Each declaration begins with
1231 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1232 number representing the abbreviation
1233 code itself. It is this code that appears at the beginning
1234 of a debugging information entry in the
1236 section. As described above, the abbreviation
1237 code 0 is reserved for null debugging information entries. The
1238 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1239 number that encodes the entry\textquoteright s tag. The encodings for the
1240 tag names are given in
1241 Table \refersec{tab:tagencodings}.
1245 \setlength{\extrarowheight}{0.1cm}
1246 \begin{longtable}{l|c}
1247 \caption{Tag encodings} \label{tab:tagencodings} \\
1248 \hline \bfseries Tag name&\bfseries Value\\ \hline
1250 \bfseries Tag name&\bfseries Value \\ \hline
1252 \hline \emph{Continued on next page}
1254 \hline \ddag\ \textit{New in DWARF Version 5}
1256 \DWTAGarraytype{} &0x01 \\
1257 \DWTAGclasstype&0x02 \\
1258 \DWTAGentrypoint&0x03 \\
1259 \DWTAGenumerationtype&0x04 \\
1260 \DWTAGformalparameter&0x05 \\
1261 \DWTAGimporteddeclaration&0x08 \\
1263 \DWTAGlexicalblock&0x0b \\
1264 \DWTAGmember&0x0d \\
1265 \DWTAGpointertype&0x0f \\
1266 \DWTAGreferencetype&0x10 \\
1267 \DWTAGcompileunit&0x11 \\
1268 \DWTAGstringtype&0x12 \\
1269 \DWTAGstructuretype&0x13 \\
1270 \DWTAGsubroutinetype&0x15 \\
1271 \DWTAGtypedef&0x16 \\
1272 \DWTAGuniontype&0x17 \\
1273 \DWTAGunspecifiedparameters&0x18 \\
1274 \DWTAGvariant&0x19 \\
1275 \DWTAGcommonblock&0x1a \\
1276 \DWTAGcommoninclusion&0x1b \\
1277 \DWTAGinheritance&0x1c \\
1278 \DWTAGinlinedsubroutine&0x1d \\
1279 \DWTAGmodule&0x1e \\
1280 \DWTAGptrtomembertype&0x1f \\
1281 \DWTAGsettype&0x20 \\
1282 \DWTAGsubrangetype&0x21 \\
1283 \DWTAGwithstmt&0x22 \\
1284 \DWTAGaccessdeclaration&0x23 \\
1285 \DWTAGbasetype&0x24 \\
1286 \DWTAGcatchblock&0x25 \\
1287 \DWTAGconsttype&0x26 \\
1288 \DWTAGconstant&0x27 \\
1289 \DWTAGenumerator&0x28 \\
1290 \DWTAGfiletype&0x29 \\
1291 \DWTAGfriend&0x2a \\
1292 \DWTAGnamelist&0x2b \\
1293 \DWTAGnamelistitem&0x2c \\
1294 \DWTAGpackedtype&0x2d \\
1295 \DWTAGsubprogram&0x2e \\
1296 \DWTAGtemplatetypeparameter&0x2f \\
1297 \DWTAGtemplatevalueparameter&0x30 \\
1298 \DWTAGthrowntype&0x31 \\
1299 \DWTAGtryblock&0x32 \\
1300 \DWTAGvariantpart&0x33 \\
1301 \DWTAGvariable&0x34 \\
1302 \DWTAGvolatiletype&0x35 \\
1303 \DWTAGdwarfprocedure&0x36 \\
1304 \DWTAGrestricttype&0x37 \\
1305 \DWTAGinterfacetype&0x38 \\
1306 \DWTAGnamespace&0x39 \\
1307 \DWTAGimportedmodule&0x3a \\
1308 \DWTAGunspecifiedtype&0x3b \\
1309 \DWTAGpartialunit&0x3c \\
1310 \DWTAGimportedunit&0x3d \\
1311 \textit{Reserved}&0x3e\footnote{Code 0x3e is reserved to allow backward compatible support of the
1312 DW\_TAG\_mutable\_type DIE that was defined (only) in \DWARFVersionIII.}
1314 \DWTAGcondition&\xiiif \\
1315 \DWTAGsharedtype&0x40 \\
1316 \DWTAGtypeunit & 0x41 \\
1317 \DWTAGrvaluereferencetype & 0x42 \\
1318 \DWTAGtemplatealias & 0x43 \\
1319 \DWTAGcoarraytype~\ddag & 0x44 \\
1320 \DWTAGgenericsubrange~\ddag & 0x45 \\
1321 \DWTAGdynamictype~\ddag & 0x46 \\
1322 \DWTAGatomictype~\ddag & 0x47 \\
1323 \DWTAGcallsite~\ddag & 0x48 \\
1324 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1325 \DWTAGskeletonunit~\ddag & 0x4a \\
1326 \DWTAGimmutabletype~\ddag & 0x4b \\
1327 \DWTAGlouser&0x4080 \\
1328 \DWTAGhiuser&\xffff \\
1333 Following the tag encoding is a 1-byte value that determines
1334 whether a debugging information entry using this abbreviation
1335 has child entries or not. If the value is
1337 the next physically succeeding entry of any debugging
1338 information entry using this abbreviation is the first
1339 child of that entry. If the 1-byte value following the
1340 abbreviation\textquoteright s tag encoding is
1341 \DWCHILDRENnoTARG, the next
1342 physically succeeding entry of any debugging information entry
1343 using this abbreviation is a sibling of that entry. (Either
1344 the first child or sibling entries may be null entries). The
1345 encodings for the child determination byte are given in
1346 Table \refersec{tab:childdeterminationencodings}
1348 Section \refersec{chap:relationshipofdebugginginformationentries},
1349 each chain of sibling entries is terminated by a null entry.)
1353 \setlength{\extrarowheight}{0.1cm}
1354 \begin{longtable}{l|c}
1355 \caption{Child determination encodings}
1356 \label{tab:childdeterminationencodings}
1357 \addtoindexx{Child determination encodings} \\
1358 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1360 \bfseries Children determination name&\bfseries Value \\ \hline
1362 \hline \emph{Continued on next page}
1366 \DWCHILDRENno&0x00 \\
1367 \DWCHILDRENyes&0x01 \\ \hline
1372 Finally, the child encoding is followed by a series of
1373 attribute specifications. Each attribute specification
1374 consists of two parts. The first part is an
1375 unsigned LEB128\addtoindexx{LEB128!unsigned}
1376 number representing the attribute\textquoteright s name.
1377 The second part is an
1378 unsigned LEB128\addtoindexx{LEB128!unsigned}
1379 number representing the attribute\textquoteright s form.
1380 The series of attribute specifications ends with an
1381 entry containing 0 for the name and 0 for the form.
1385 \DWFORMindirectTARG{} is a special case. For
1386 attributes with this form, the attribute value itself in the
1388 section begins with an unsigned
1389 LEB128 number that represents its form. This allows producers
1390 to choose forms for particular attributes
1391 \addtoindexx{abbreviations table!dynamic forms in}
1393 without having to add a new entry to the abbreviations table.
1395 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1396 For attributes with this form, the attribute specification contains
1397 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1398 number. The value of this number is used as the value of the
1399 attribute, and no value is stored in the \dotdebuginfo{} section.
1401 The abbreviations for a given compilation unit end with an
1402 entry consisting of a 0 byte for the abbreviation code.
1405 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1406 for a depiction of the organization of the
1407 debugging information.}
1410 \subsection{Attribute Encodings}
1411 \label{datarep:attributeencodings}
1413 The encodings for the attribute names are given in
1414 Table \referfol{tab:attributeencodings}.
1417 \setlength{\extrarowheight}{0.1cm}
1418 \begin{longtable}{l|c|l}
1419 \caption{Attribute encodings}
1420 \label{tab:attributeencodings}
1421 \addtoindexx{attribute encodings} \\
1422 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1424 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1426 \hline \emph{Continued on next page}
1428 \hline \ddag\ \textit{New in DWARF Version 5}
1430 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1431 \addtoindexx{sibling attribute} \\
1432 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1434 \addtoindexx{location attribute} \\
1435 \DWATname&0x03&\livelink{chap:classstring}{string}
1436 \addtoindexx{name attribute} \\
1437 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1438 \addtoindexx{ordering attribute} \\
1439 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1440 \livelink{chap:classexprloc}{exprloc},
1441 \livelink{chap:classreference}{reference}
1442 \addtoindexx{byte size attribute} \\
1443 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1444 DW\_AT\_bit\_offset \mbox{attribute} which was
1445 defined in \DWARFVersionIII{} and earlier.}
1446 &\livelink{chap:classconstant}{constant},
1447 \livelink{chap:classexprloc}{exprloc},
1448 \livelink{chap:classreference}{reference}
1449 \addtoindexx{bit offset attribute (Version 3)}
1450 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1451 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1452 \livelink{chap:classexprloc}{exprloc},
1453 \livelink{chap:classreference}{reference}
1454 \addtoindexx{bit size attribute} \\
1455 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1456 \addtoindexx{statement list attribute} \\
1457 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1458 \addtoindexx{low PC attribute} \\
1459 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1460 \livelink{chap:classconstant}{constant}
1461 \addtoindexx{high PC attribute} \\
1462 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1463 \addtoindexx{language attribute} \\
1464 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1465 \addtoindexx{discriminant attribute} \\
1466 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1467 \addtoindexx{discriminant value attribute} \\
1468 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1469 \addtoindexx{visibility attribute} \\
1470 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1471 \addtoindexx{import attribute} \\
1472 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1474 \addtoindexx{string length attribute} \\
1475 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1476 \addtoindexx{common reference attribute} \\
1477 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1478 \addtoindexx{compilation directory attribute} \\
1479 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1480 \livelink{chap:classconstant}{constant},
1481 \livelink{chap:classstring}{string}
1482 \addtoindexx{constant value attribute} \\
1483 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1484 \addtoindexx{containing type attribute} \\
1485 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1486 \livelink{chap:classreference}{reference},
1487 \livelink{chap:classflag}{flag}
1488 \addtoindexx{default value attribute} \\
1489 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1490 \addtoindexx{inline attribute} \\
1491 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1492 \addtoindexx{is optional attribute} \\
1493 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1494 \livelink{chap:classexprloc}{exprloc},
1495 \livelink{chap:classreference}{reference}
1496 \addtoindexx{lower bound attribute} \\
1497 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1498 \addtoindexx{producer attribute} \\
1499 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1500 \addtoindexx{prototyped attribute} \\
1501 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1503 \addtoindexx{return address attribute} \\
1504 \DWATstartscope&0x2c&
1505 \livelink{chap:classconstant}{constant},
1507 \addtoindexx{start scope attribute} \\
1508 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1509 \livelink{chap:classexprloc}{exprloc},
1510 \livelink{chap:classreference}{reference}
1511 \addtoindexx{bit stride attribute} \\
1512 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1513 \livelink{chap:classexprloc}{exprloc},
1514 \livelink{chap:classreference}{reference}
1515 \addtoindexx{upper bound attribute} \\
1516 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1517 \addtoindexx{abstract origin attribute} \\
1518 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1519 \addtoindexx{accessibility attribute} \\
1520 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1521 \addtoindexx{address class attribute} \\
1522 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1523 \addtoindexx{artificial attribute} \\
1524 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1525 \addtoindexx{base types attribute} \\
1526 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1527 \addtoindexx{calling convention attribute} \\
1528 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1529 \livelink{chap:classexprloc}{exprloc},
1530 \livelink{chap:classreference}{reference}
1531 \addtoindexx{count attribute} \\
1532 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1533 \livelink{chap:classexprloc}{exprloc},
1535 \addtoindexx{data member attribute} \\
1536 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1537 \addtoindexx{declaration column attribute} \\
1538 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1539 \addtoindexx{declaration file attribute} \\
1540 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1541 \addtoindexx{declaration line attribute} \\
1542 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1543 \addtoindexx{declaration attribute} \\
1544 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1545 \addtoindexx{discriminant list attribute} \\
1546 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1547 \addtoindexx{encoding attribute} \\
1548 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1549 \addtoindexx{external attribute} \\
1550 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1552 \addtoindexx{frame base attribute} \\
1553 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1554 \addtoindexx{friend attribute} \\
1555 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1556 \addtoindexx{identifier case attribute} \\
1557 \textit{Reserved}&0x43\footnote{Code 0x43 is reserved to allow backward compatible support of the
1558 DW\_AT\_macro\_info \mbox{attribute} which was
1559 defined in \DWARFVersionIV{} and earlier.}
1560 &\livelink{chap:classmacptr}{macptr}
1561 \addtoindexx{macro information attribute (legacy)!encoding} \\
1562 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1563 \addtoindexx{name list item attribute} \\
1564 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1565 \addtoindexx{priority attribute} \\
1566 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1568 \addtoindexx{segment attribute} \\
1569 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1570 \addtoindexx{specification attribute} \\
1571 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1573 \addtoindexx{static link attribute} \\
1574 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1575 \addtoindexx{type attribute} \\
1576 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1578 \addtoindexx{location list attribute} \\
1579 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1580 \addtoindexx{variable parameter attribute} \\
1581 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1582 \addtoindexx{virtuality attribute} \\
1583 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1585 \addtoindexx{vtable element location attribute} \\
1586 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1587 \livelink{chap:classexprloc}{exprloc},
1588 \livelink{chap:classreference}{reference}
1589 \addtoindexx{allocated attribute} \\
1590 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1591 \livelink{chap:classexprloc}{exprloc},
1592 \livelink{chap:classreference}{reference}
1593 \addtoindexx{associated attribute} \\
1594 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1595 \addtoindexx{data location attribute} \\
1596 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1597 \livelink{chap:classexprloc}{exprloc},
1598 \livelink{chap:classreference}{reference}
1599 \addtoindexx{byte stride attribute} \\
1600 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1601 \livelink{chap:classconstant}{constant}
1602 \addtoindexx{entry PC attribute} \\
1603 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1604 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1605 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1606 \addtoindexx{extension attribute} \\
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 \DWATrnglistsbase~\ddag&0x74&
1681 \addtoindexx{range list 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 \DWATloclistsbase~\ddag &0x8c &\CLASSloclistsptr \addtoindexx{location list base attribute} \\
1727 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1728 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1733 \subsection{Classes and Forms}
1734 \label{datarep:classesandforms}
1735 Each class is a set of forms which have related representations
1736 and which are given a common interpretation according to the
1737 attribute in which the form is used.
1738 The attribute form governs how the value of an attribute is
1740 The classes and the forms they include are listed below.
1742 Form \DWFORMsecoffsetTARG{}
1743 is a member of more than one class, namely
1746 \CLASSloclist, \CLASSloclistsptr,
1748 \CLASSrnglist{}, \CLASSrnglistsptr,
1750 \CLASSstroffsetsptr;
1751 as a result, it is not possible for an
1752 attribute to allow more than one of these classes.
1753 The list of classes allowed by the applicable attribute in
1754 Table \refersec{tab:attributeencodings}
1755 determines the class of the form.
1758 In the form descriptions that follow, some forms are said
1759 to depend in part on the value of an attribute of the
1760 \definition{\associatedcompilationunit}:
1763 In the case of a \splitDWARFobjectfile{}, the associated
1764 compilation unit is the skeleton compilation unit corresponding
1765 to the containing unit.
1766 \item Otherwise, the associated compilation unit
1767 is the containing unit.
1771 Each possible form belongs to one or more of the following classes
1772 (see Table \refersec{tab:classesofattributevalue} for a summary of
1773 the purpose and general usage of each class):
1777 \item \CLASSaddress \\
1778 \livetarg{datarep:classaddress}{}
1779 Represented as either:
1781 \item An object of appropriate size to hold an
1782 address on the target machine (\DWFORMaddrTARG).
1783 The size is encoded in the compilation unit header
1784 (see Section \refersec{datarep:compilationunitheader}).
1785 This address is relocatable in a relocatable object file and
1786 is relocated in an executable file or shared object file.
1788 \item An indirect index into a table of addresses (as
1789 described in the previous bullet) in the
1790 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1791 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1792 \addtoindex{LEB128} value, which is interpreted as a zero-based
1793 index into an array of addresses in the \dotdebugaddr{} section.
1794 The index is relative to the value of the \DWATaddrbase{} attribute
1795 of the associated compilation unit.
1800 \item \CLASSaddrptr \\
1801 \livetarg{datarep:classaddrptr}{}
1802 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1803 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1804 beginning of the list of machine addresses information for the
1805 referencing entity. It is relocatable in
1806 a relocatable object file, and relocated in an executable or
1807 shared object file. In the \thirtytwobitdwarfformat, this offset
1808 is a 4-byte unsigned value; in the 64-bit DWARF
1809 format, it is an 8-byte unsigned value (see Section
1810 \refersec{datarep:32bitand64bitdwarfformats}).
1812 \textit{This class is new in \DWARFVersionV.}
1815 \item \CLASSblock \\
1816 \livetarg{datarep:classblock}{}
1817 Blocks come in four forms:
1820 A 1-byte length followed by 0 to 255 contiguous information
1821 bytes (\DWFORMblockoneTARG).
1824 A 2-byte length followed by 0 to 65,535 contiguous information
1825 bytes (\DWFORMblocktwoTARG).
1828 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1829 information bytes (\DWFORMblockfourTARG).
1832 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1833 length followed by the number of bytes
1834 specified by the length (\DWFORMblockTARG).
1837 In all forms, the length is the number of information bytes
1838 that follow. The information bytes may contain any mixture
1839 of relocated (or relocatable) addresses, references to other
1840 debugging information entries or data bytes.
1842 \item \CLASSconstant \\
1843 \livetarg{datarep:classconstant}{}
1844 There are eight forms of constants. There are fixed length
1845 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1849 \DWFORMdatafourTARG,
1850 \DWFORMdataeightTARG{} and
1851 \DWFORMdatasixteenTARG).
1852 There are variable length constant
1853 data forms encoded using
1854 signed LEB128 numbers (\DWFORMsdataTARG) and unsigned
1855 LEB128 numbers (\DWFORMudataTARG).
1856 There is also an implicit constant (\DWFORMimplicitconst),
1857 whose value is provided as part of the abbreviation
1861 The data in \DWFORMdataone,
1864 \DWFORMdataeight{} and
1865 \DWFORMdatasixteen{}
1866 can be anything. Depending on context, it may
1867 be a signed integer, an unsigned integer, a floating\dash point
1868 constant, or anything else. A consumer must use context to
1869 know how to interpret the bits, which if they are target
1870 machine data (such as an integer or floating-point constant)
1871 will be in target machine \byteorder.
1873 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1874 forms is used to represent a
1875 signed or unsigned integer, it can be hard for a consumer
1876 to discover the context necessary to determine which
1877 interpretation is intended. Producers are therefore strongly
1878 encouraged to use \DWFORMsdata{} or
1879 \DWFORMudata{} for signed and
1880 unsigned integers respectively, rather than
1881 \DWFORMdata\textless n\textgreater.}
1884 \item \CLASSexprloc \\
1885 \livetarg{datarep:classexprloc}{}
1886 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length
1887 followed by the number of information bytes specified by the
1888 length (\DWFORMexprlocTARG).
1889 The information bytes contain a DWARF expression
1890 (see Section \refersec{chap:dwarfexpressions})
1891 or location description
1892 (see Section \refersec{chap:locationdescriptions}).
1896 \livetarg{datarep:classflag}{}
1897 A flag \addtoindexx{flag class}
1898 is represented explicitly as a single byte of data
1899 (\DWFORMflagTARG) or implicitly (\DWFORMflagpresentTARG). In the
1900 first case, if the \nolink{flag} has value zero, it indicates the
1901 absence of the attribute; if the \nolink{flag} has a non-zero value,
1902 it indicates the presence of the attribute. In the second
1903 case, the attribute is implicitly indicated as present, and
1904 no value is encoded in the debugging information entry itself.
1907 \item \CLASSlineptr \\
1908 \livetarg{datarep:classlineptr}{}
1909 This is an offset into
1910 \addtoindexx{section offset!in class lineptr value}
1912 \dotdebugline{} or \dotdebuglinedwo{} section
1914 It consists of an offset from the beginning of the
1916 section to the first byte of
1917 the data making up the line number list for the compilation
1919 It is relocatable in a relocatable object file, and
1920 relocated in an executable or shared object file. In the
1921 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1922 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1923 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1926 \item \CLASSloclist \\
1927 \livetarg{datarep:classloclist}{}
1928 This is represented as either:
1931 An index into the \dotdebugloclists{} section (\DWFORMloclistxTARG).
1932 The unsigned ULEB operand identifies an offset location
1933 relative to the base of that section (the location of the first offset
1934 in the section, not the first byte of the section). The contents of
1935 that location is then added to the base to determine the location of
1936 the target list of entries.
1938 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
1939 The operand consists of a byte
1940 offset\addtoindexx{section offset!in class loclist value}
1941 from the beginning of the \dotdebugloclists{} section.
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 \textit{This class is new in \DWARFVersionV.}
1951 \item \CLASSloclistsptr \\
1952 \livetarg{datarep:classloclistsptr}{}
1953 This is an offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
1954 The operand consists of a byte
1955 offset\addtoindexx{section offset!in class loclistsptr}
1956 from the beginning of the \dotdebugloclists{} section.
1957 It is relocatable in a relocatable object file, and
1958 relocated in an executable or shared object file. In the
1959 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1960 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1961 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1963 \textit{This class is new in \DWARFVersionV.}
1965 \item \CLASSmacptr \\
1966 \livetarg{datarep:classmacptr}{}
1968 \addtoindexx{section offset!in class macptr value}
1970 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1972 It consists of an offset from the beginning of the
1973 \dotdebugmacro{} or \dotdebugmacrodwo{}
1974 section to the the header making up the
1975 macro information list for the compilation unit.
1976 It is relocatable in a relocatable object file, and
1977 relocated in an executable or shared object file. In the
1978 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1979 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1980 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1983 \item \CLASSrnglist \\
1984 \livetarg{datarep:classrnglist}{}
1985 This is represented as either:
1988 An index into the \dotdebugrnglists{} section (\DWFORMrnglistxTARG).
1989 The unsigned ULEB operand identifies an offset location
1990 relative to the base of that section (the location of the first offset
1991 in the section, not the first byte of the section). The contents of
1992 that location is then added to the base to determine the location of
1993 the target range list of entries.
1996 An offset into the \dotdebugrnglists{} section (\DWFORMsecoffset).
1997 The operand consists of a byte
1998 offset\addtoindexx{section offset!in class rnglist value}
2000 from the beginning of the \dotdebugrnglists{} section.
2001 It is relocatable in a relocatable object file, and
2002 relocated in an executable or shared object file. In the
2003 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2004 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2005 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2008 \textit{This class is new in \DWARFVersionV.}
2011 \item \CLASSrnglistsptr \\
2012 \livetarg{datarep:classrnglistsptr}{}
2013 This is an offset\addtoindexx{section offset!in class rnglistsptr}
2014 into the \dotdebugrnglists{} section (\DWFORMsecoffset).
2015 It consists of a byte offset from the beginning of the
2016 \dotdebugrnglists{} section.
2017 It is relocatable in a relocatable object file, and relocated
2018 in an executable or shared object file.
2019 In the \thirtytwobitdwarfformat, this offset
2020 is a 4-byte unsigned value; in the 64-bit DWARF
2021 format, it is an 8-byte unsigned value (see Section
2022 \refersec{datarep:32bitand64bitdwarfformats}).
2024 \textit{This class is new in \DWARFVersionV.}
2027 \item \CLASSreference \\
2028 \livetarg{datarep:classreference}{}
2029 There are four types of reference.\addtoindexx{reference class}
2032 The first type of reference can identify any debugging
2033 information entry within the containing unit.
2034 This type of reference is an
2035 offset\addtoindexx{section offset!in class reference value}
2036 from the first byte of the compilation
2037 header for the compilation unit containing the reference. There
2038 are five forms for this type of reference. There are fixed
2039 length forms for one, two, four and eight byte offsets
2045 and \DWFORMrefeightTARG).
2046 There is also an unsigned variable
2047 length offset encoded form that uses
2048 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
2049 (\DWFORMrefudataTARG).
2050 Because this type of reference is within
2051 the containing compilation unit no relocation of the value
2055 The second type of reference can identify any debugging
2056 information entry within a
2057 \dotdebuginfo{} section; in particular,
2058 it may refer to an entry in a different compilation unit
2059 from the unit containing the reference, and may refer to an
2060 entry in a different shared object file. This type of reference
2061 (\DWFORMrefaddrTARG)
2062 is an offset from the beginning of the
2064 section of the target executable or shared object file, or, for
2065 references within a \addtoindex{supplementary object file},
2066 an offset from the beginning of the local \dotdebuginfo{} section;
2067 it is relocatable in a relocatable object file and frequently
2068 relocated in an executable or shared object file. For
2069 references from one shared object or static executable file
2070 to another, the relocation and identification of the target
2071 object must be performed by the consumer. In the
2072 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2073 in the \sixtyfourbitdwarfformat, it is an 8-byte
2075 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2077 \textit{A debugging information entry that may be referenced by
2078 another compilation unit using
2079 \DWFORMrefaddr{} must have a global symbolic name.}
2081 \textit{For a reference from one executable or shared object file to
2082 another, the reference is resolved by the debugger to identify
2083 the executable or shared object file and the offset into that
2084 file\textquoteright s \dotdebuginfo{}
2085 section in the same fashion as the run
2086 time loader, either when the debug information is first read,
2087 or when the reference is used.}
2090 The third type of reference can identify any debugging
2091 information type entry that has been placed in its own
2092 \addtoindex{type unit}. This type of
2093 reference (\DWFORMrefsigeightTARG) is the
2094 \addtoindexx{type signature}
2095 8-byte type signature
2096 (see Section \refersec{datarep:typesignaturecomputation})
2097 that was computed for the type.
2100 The fourth type of reference is a reference from within the
2101 \dotdebuginfo{} section of the executable or shared object file to
2102 a debugging information entry in the \dotdebuginfo{} section of
2103 a \addtoindex{supplementary object file}.
2104 This type of reference (\DWFORMrefsupTARG) is an offset from the
2105 beginning of the \dotdebuginfo{} section in the
2106 \addtoindex{supplementary object file}.
2108 \textit{The use of compilation unit relative references will reduce the
2109 number of link\dash time relocations and so speed up linking. The
2110 use of the second, third and fourth type of reference allows for the
2111 sharing of information, such as types, across compilation
2112 units, while the fourth type further allows for sharing of information
2113 across compilation units from different executables or shared object files.}
2115 \textit{A reference to any kind of compilation unit identifies the
2116 debugging information entry for that unit, not the preceding
2121 \item \CLASSstring \\
2122 \livetarg{datarep:classstring}{}
2123 A string is a sequence of contiguous non\dash null bytes followed by
2125 \addtoindexx{string class}
2126 A string may be represented:
2128 \setlength{\itemsep}{0em}
2129 \item immediately in the debugging information entry itself
2130 (\DWFORMstringTARG),
2133 \addtoindexx{section offset!in class string value}
2134 offset into a string table contained in
2135 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
2136 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
2137 or as an offset into a string table contained in the
2138 \dotdebugstr{} section of a \addtoindex{supplementary object file}
2139 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
2140 section of a \addtoindex{supplementary object file}
2141 refer to the local \dotdebugstr{} section of that same file.
2142 In the \thirtytwobitdwarfformat, the representation of a
2145 \DWFORMlinestrpNAME{}
2147 or \DWFORMstrpsupNAME{}
2148 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2149 it is an 8-byte unsigned offset
2150 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2153 \item as an indirect offset into the string table using an
2154 index into a table of offsets contained in the
2155 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
2156 The representation of a \DWFORMstrxNAME{} value is an unsigned
2157 \addtoindex{LEB128} value, which is interpreted as a zero-based
2158 index into an array of offsets in the \dotdebugstroffsets{} section.
2159 The offset entries in the \dotdebugstroffsets{} section have the
2160 same representation as \DWFORMstrp{} values.
2162 Any combination of these three forms may be used within a single compilation.
2164 If the \DWATuseUTFeight{}
2165 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
2166 compilation, partial, skeleton or type unit entry, string values are encoded using the
2167 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
2168 Character Set standard (ISO/IEC 10646\dash 1:1993).
2169 \addtoindexx{ISO 10646 character set standard}
2170 Otherwise, the string representation is unspecified.
2172 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
2173 ISO/IEC 10646\dash 1:1993.
2174 \addtoindexx{ISO 10646 character set standard}
2175 It contains all the same characters
2176 and encoding points as ISO/IEC 10646, as well as additional
2177 information about the characters and their use.}
2180 \textit{Earlier versions of DWARF did not specify the representation
2181 of strings; for compatibility, this version also does
2182 not. However, the UTF\dash 8 representation is strongly recommended.}
2185 \item \CLASSstroffsetsptr \\
2186 \livetarg{datarep:classstroffsetsptr}{}
2187 This is an offset into the \dotdebugstroffsets{} section
2188 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2189 \dotdebugstroffsets{} section to the
2190 beginning of the string offsets information for the
2191 referencing entity. It is relocatable in
2192 a relocatable object file, and relocated in an executable or
2193 shared object file. In the \thirtytwobitdwarfformat, this offset
2194 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2195 it is an 8-byte unsigned value (see Section
2196 \refersec{datarep:32bitand64bitdwarfformats}).
2198 \textit{This class is new in \DWARFVersionV.}
2202 In no case does an attribute use one of the classes
2207 \CLASSrnglistsptr{} or
2208 \CLASSstroffsetsptr{}
2209 to point into either the
2210 \dotdebuginfo{} or \dotdebugstr{} section.
2212 \subsection{Form Encodings}
2213 \label{datarep:formencodings}
2214 The form encodings are listed in
2215 Table \referfol{tab:attributeformencodings}.
2219 \setlength{\extrarowheight}{0.1cm}
2220 \begin{longtable}{l|c|l}
2221 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2222 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2224 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2226 \hline \emph{Continued on next page}
2228 \hline \ddag\ \textit{New in DWARF Version 5}
2231 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2232 \textit{Reserved} &0x02& \\
2233 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2234 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2235 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2236 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2237 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2238 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2239 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2240 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2241 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2242 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2243 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2244 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2245 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2246 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2247 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2248 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2249 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2250 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2251 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2252 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2253 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclist, \CLASSloclistsptr, \\
2254 & & \CLASSmacptr, \CLASSrnglist, \CLASSrnglistsptr, \CLASSstroffsetsptr \\
2255 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2256 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2257 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2258 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2259 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2260 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2261 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2262 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2263 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2264 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2265 \DWFORMloclistx~\ddag &0x22 &\CLASSloclist \\
2266 \DWFORMrnglistx~\ddag &0x23 &\CLASSrnglist \\
2272 \section{Variable Length Data}
2273 \label{datarep:variablelengthdata}
2274 \addtoindexx{variable length data|see {LEB128}}
2276 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2277 encoded using \doublequote{Little-Endian Base 128}
2278 \addtoindexx{little-endian encoding|see{endian attribute}}
2280 \addtoindexx{LEB128}
2281 LEB128 is a scheme for encoding integers
2282 densely that exploits the assumption that most integers are
2285 \textit{This encoding is equally suitable whether the target machine
2286 architecture represents data in big-endian or little-endian
2287 \byteorder. It is \doublequote{little-endian} only in the sense that it
2288 avoids using space to represent the \doublequote{big} end of an
2289 unsigned integer, when the big end is all zeroes or sign
2292 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2293 numbers are encoded as follows:
2294 \addtoindexx{LEB128!unsigned, encoding as}
2295 start at the low order end of an unsigned integer and chop
2296 it into 7-bit chunks. Place each chunk into the low order 7
2297 bits of a byte. Typically, several of the high order bytes
2298 will be zero; discard them. Emit the remaining bytes in a
2299 stream, starting with the low order byte; set the high order
2300 bit on each byte except the last emitted byte. The high bit
2301 of zero on the last byte indicates to the decoder that it
2302 has encountered the last byte.
2304 The integer zero is a special case, consisting of a single
2307 Table \refersec{tab:examplesofunsignedleb128encodings}
2308 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2310 0x80 in each case is the high order bit of the byte, indicating
2311 that an additional byte follows.
2314 The encoding for signed, two\textquoteright{s} complement LEB128
2315 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2316 numbers is similar, except that the criterion for discarding
2317 high order bytes is not whether they are zero, but whether
2318 they consist entirely of sign extension bits. Consider the
2319 4-byte integer -2. The three high level bytes of the number
2320 are sign extension, thus LEB128 would represent it as a single
2321 byte containing the low order 7 bits, with the high order
2322 bit cleared to indicate the end of the byte stream. Note
2323 that there is nothing within the LEB128 representation that
2324 indicates whether an encoded number is signed or unsigned. The
2325 decoder must know what type of number to expect.
2326 Table \refersec{tab:examplesofunsignedleb128encodings}
2327 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2328 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2329 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2332 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2333 \addtoindexx{LEB128!examples}
2334 gives algorithms for encoding and decoding these forms.}
2338 \setlength{\extrarowheight}{0.1cm}
2339 \begin{longtable}{c|c|c}
2340 \caption{Examples of unsigned LEB128 encodings}
2341 \label{tab:examplesofunsignedleb128encodings}
2342 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2343 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2345 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2347 \hline \emph{Continued on next page}
2353 128& 0 + 0x80 & 1 \\
2354 129& 1 + 0x80 & 1 \\
2355 %130& 2 + 0x80 & 1 \\
2356 12857& 57 + 0x80 & 100 \\
2363 \setlength{\extrarowheight}{0.1cm}
2364 \begin{longtable}{c|c|c}
2365 \caption{Examples of signed LEB128 encodings}
2366 \label{tab:examplesofsignedleb128encodings}
2367 \addtoindexx{LEB128!signed} \\
2368 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2370 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2372 \hline \emph{Continued on next page}
2378 127& 127 + 0x80 & 0 \\
2379 -127& 1 + 0x80 & 0x7f \\
2380 128& 0 + 0x80 & 1 \\
2381 -128& 0 + 0x80 & 0x7f \\
2382 129& 1 + 0x80 & 1 \\
2383 -129& 0x7f + 0x80 & 0x7e \\
2390 \section{DWARF Expressions and Location Descriptions}
2391 \label{datarep:dwarfexpressionsandlocationdescriptions}
2392 \subsection{DWARF Expressions}
2393 \label{datarep:dwarfexpressions}
2396 \addtoindexx{DWARF expression!operator encoding}
2397 DWARF expression is stored in a \nolink{block} of contiguous
2398 bytes. The bytes form a sequence of operations. Each operation
2399 is a 1-byte code that identifies that operation, followed by
2400 zero or more bytes of additional data. The encodings for the
2401 operations are described in
2402 Table \refersec{tab:dwarfoperationencodings}.
2405 \setlength{\extrarowheight}{0.1cm}
2406 \begin{longtable}{l|c|c|l}
2407 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2408 \hline & &\bfseries No. of &\\
2409 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2411 & &\bfseries No. of &\\
2412 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2414 \hline \emph{Continued on next page}
2416 \hline \ddag\ \textit{New in DWARF Version 5}
2419 \DWOPaddr&0x03&1 & constant address \\
2420 & & &(size is target specific) \\
2422 \DWOPderef&0x06&0 & \\
2424 \DWOPconstoneu&0x08&1&1-byte constant \\
2425 \DWOPconstones&0x09&1&1-byte constant \\
2426 \DWOPconsttwou&0x0a&1&2-byte constant \\
2427 \DWOPconsttwos&0x0b&1&2-byte constant \\
2428 \DWOPconstfouru&0x0c&1&4-byte constant \\
2429 \DWOPconstfours&0x0d&1&4-byte constant \\
2430 \DWOPconsteightu&0x0e&1&8-byte constant \\
2431 \DWOPconsteights&0x0f&1&8-byte constant \\
2432 \DWOPconstu&0x10&1&ULEB128 constant \\
2433 \DWOPconsts&0x11&1&SLEB128 constant \\
2434 \DWOPdup&0x12&0 & \\
2435 \DWOPdrop&0x13&0 & \\
2436 \DWOPover&0x14&0 & \\
2437 \DWOPpick&0x15&1&1-byte stack index \\
2438 \DWOPswap&0x16&0 & \\
2439 \DWOProt&0x17&0 & \\
2440 \DWOPxderef&0x18&0 & \\
2441 \DWOPabs&0x19&0 & \\
2442 \DWOPand&0x1a&0 & \\
2443 \DWOPdiv&0x1b&0 & \\
2444 \DWOPminus&0x1c&0 & \\
2445 \DWOPmod&0x1d&0 & \\
2446 \DWOPmul&0x1e&0 & \\
2447 \DWOPneg&0x1f&0 & \\
2448 \DWOPnot&0x20&0 & \\
2450 \DWOPplus&0x22&0 & \\
2451 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2452 \DWOPshl&0x24&0 & \\
2453 \DWOPshr&0x25&0 & \\
2454 \DWOPshra&0x26&0 & \\
2455 \DWOPxor&0x27&0 & \\
2457 \DWOPbra&0x28&1 & signed 2-byte constant \\
2464 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2466 \DWOPlitzero & 0x30 & 0 & \\
2467 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2468 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2469 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2471 \DWOPregzero & 0x50 & 0 & \\*
2472 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2473 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2474 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2476 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2477 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2478 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2479 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2481 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2482 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2483 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2484 & & &SLEB128 offset \\
2485 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2486 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2487 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2488 \DWOPnop{} & 0x96 &0& \\
2490 \DWOPpushobjectaddress&0x97&0 & \\
2491 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2492 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2493 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2494 \DWOPformtlsaddress&0x9b &0& \\
2495 \DWOPcallframecfa{} &0x9c &0& \\
2496 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2498 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2499 &&&\nolink{block} of that size\\
2500 \DWOPstackvalue{} &0x9f &0& \\
2501 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2502 &&&SLEB128 constant offset \\
2503 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2504 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2505 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2506 &&&\nolink{block} of that size\\
2507 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2508 & & & 1-byte size, \\*
2509 & & & constant value \\
2510 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2511 &&& ULEB128 constant offset \\
2512 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2513 &&& ULEB128 type entry offset \\
2514 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2515 &&& ULEB128 type entry offset \\
2516 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2517 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2518 \DWOPlouser{} &0xe0 && \\
2519 \DWOPhiuser{} &\xff && \\
2525 \subsection{Location Descriptions}
2526 \label{datarep:locationdescriptions}
2528 A location description is used to compute the
2529 location of a variable or other entity.
2531 \subsection{Location Lists}
2532 \label{datarep:locationlists}
2533 Each entry in a \addtoindex{location list} is either a location list entry,
2534 a base address entry, a default location entry or an
2535 \addtoindexx{end-of-list entry!in location list}
2538 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2539 that follows. The encodings for these constants are given in
2540 Table \ref{tab:locationlistentryencodingvalues}.
2544 \setlength{\extrarowheight}{0.1cm}
2545 \begin{longtable}{l|c}
2546 \caption{Location list entry encoding values}
2547 \label{tab:locationlistentryencodingvalues} \\
2548 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2550 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2552 \hline \emph{Continued on next page}
2555 \ddag New in \DWARFVersionV
2557 \DWLLEendoflist~\ddag & 0x00 \\
2558 \DWLLEbaseaddressx~\ddag & 0x01 \\
2559 \DWLLEstartxendx~\ddag & 0x02 \\
2560 \DWLLEstartxlength~\ddag & 0x03 \\
2561 \DWLLEoffsetpair~\ddag & 0x04 \\
2562 \DWLLEdefaultlocation~\ddag & 0x05 \\
2563 \DWLLEbaseaddress~\ddag & 0x06 \\
2564 \DWLLEstartend~\ddag & 0x07 \\
2565 \DWLLEstartlength~\ddag & 0x08 \\
2569 \section{Base Type Attribute Encodings}
2570 \label{datarep:basetypeattributeencodings}
2572 The\hypertarget{chap:DWATencodingencodingofbasetype}{}
2573 encodings of the constants used in the
2574 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2576 Table \refersec{tab:basetypeencodingvalues}
2579 \setlength{\extrarowheight}{0.1cm}
2580 \begin{longtable}{l|c}
2581 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2582 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2584 \bfseries Base type encoding name&\bfseries Value\\ \hline
2586 \hline \emph{Continued on next page}
2589 \ddag \ \textit{New in \DWARFVersionV}
2591 \DWATEaddress&0x01 \\
2592 \DWATEboolean&0x02 \\
2593 \DWATEcomplexfloat&0x03 \\
2595 \DWATEsigned&0x05 \\
2596 \DWATEsignedchar&0x06 \\
2597 \DWATEunsigned&0x07 \\
2598 \DWATEunsignedchar&0x08 \\
2599 \DWATEimaginaryfloat&0x09 \\
2600 \DWATEpackeddecimal&0x0a \\
2601 \DWATEnumericstring&0x0b \\
2602 \DWATEedited&0x0c \\
2603 \DWATEsignedfixed&0x0d \\
2604 \DWATEunsignedfixed&0x0e \\
2605 \DWATEdecimalfloat & 0x0f \\
2606 \DWATEUTF{} & 0x10 \\
2607 \DWATEUCS~\ddag & 0x11 \\
2608 \DWATEASCII~\ddag & 0x12 \\
2609 \DWATElouser{} & 0x80 \\
2610 \DWATEhiuser{} & \xff \\
2615 The encodings of the constants used in the
2616 \DWATdecimalsign{} attribute
2618 Table \refersec{tab:decimalsignencodings}.
2621 \setlength{\extrarowheight}{0.1cm}
2622 \begin{longtable}{l|c}
2623 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2624 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2626 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2628 % \hline \emph{Continued on next page}
2632 \DWDSunsigned{} & 0x01 \\
2633 \DWDSleadingoverpunch{} & 0x02 \\
2634 \DWDStrailingoverpunch{} & 0x03 \\
2635 \DWDSleadingseparate{} & 0x04 \\
2636 \DWDStrailingseparate{} & 0x05 \\
2641 The encodings of the constants used in the
2642 \DWATendianity{} attribute are given in
2643 Table \refersec{tab:endianityencodings}.
2646 \setlength{\extrarowheight}{0.1cm}
2647 \begin{longtable}{l|c}
2648 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2649 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2651 \bfseries Endian code name&\bfseries Value\\ \hline
2653 \hline \emph{Continued on next page}
2658 \DWENDdefault{} & 0x00 \\
2659 \DWENDbig{} & 0x01 \\
2660 \DWENDlittle{} & 0x02 \\
2661 \DWENDlouser{} & 0x40 \\
2662 \DWENDhiuser{} & \xff \\
2668 \section{Accessibility Codes}
2669 \label{datarep:accessibilitycodes}
2670 The encodings of the constants used in the
2671 \DWATaccessibility{}
2673 \addtoindexx{accessibility attribute}
2675 Table \refersec{tab:accessibilityencodings}.
2678 \setlength{\extrarowheight}{0.1cm}
2679 \begin{longtable}{l|c}
2680 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2681 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2683 \bfseries Accessibility code name&\bfseries Value\\ \hline
2685 \hline \emph{Continued on next page}
2690 \DWACCESSpublic&0x01 \\
2691 \DWACCESSprotected&0x02 \\
2692 \DWACCESSprivate&0x03 \\
2698 \section{Visibility Codes}
2699 \label{datarep:visibilitycodes}
2700 The encodings of the constants used in the
2701 \DWATvisibility{} attribute are given in
2702 Table \refersec{tab:visibilityencodings}.
2705 \setlength{\extrarowheight}{0.1cm}
2706 \begin{longtable}{l|c}
2707 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2708 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2710 \bfseries Visibility code name&\bfseries Value\\ \hline
2712 \hline \emph{Continued on next page}
2718 \DWVISexported&0x02 \\
2719 \DWVISqualified&0x03 \\
2724 \section{Virtuality Codes}
2725 \label{datarep:vitualitycodes}
2727 The encodings of the constants used in the
2728 \DWATvirtuality{} attribute are given in
2729 Table \refersec{tab:virtualityencodings}.
2732 \setlength{\extrarowheight}{0.1cm}
2733 \begin{longtable}{l|c}
2734 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2735 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2737 \bfseries Virtuality code name&\bfseries Value\\ \hline
2739 \hline \emph{Continued on next page}
2744 \DWVIRTUALITYnone&0x00 \\
2745 \DWVIRTUALITYvirtual&0x01 \\
2746 \DWVIRTUALITYpurevirtual&0x02 \\
2753 \DWVIRTUALITYnone{} is equivalent to the absence of the
2757 \section{Source Languages}
2758 \label{datarep:sourcelanguages}
2760 The encodings of the constants used
2761 \addtoindexx{language attribute, encoding}
2763 \addtoindexx{language name encoding}
2766 attribute are given in
2767 Table \refersec{tab:languageencodings}.
2769 % If we don't force a following space it looks odd
2771 and their associated values are reserved, but the
2772 languages they represent are not well supported.
2773 Table \refersec{tab:languageencodings}
2775 \addtoindexx{lower bound attribute!default}
2776 default lower bound, if any, assumed for
2777 an omitted \DWATlowerbound{} attribute in the context of a
2778 \DWTAGsubrangetype{} debugging information entry for each
2782 \setlength{\extrarowheight}{0.1cm}
2783 \begin{longtable}{l|c|c}
2784 \caption{Language encodings} \label{tab:languageencodings}\\
2785 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2787 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2789 \hline \emph{Continued on next page}
2792 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2794 \addtoindexx{ISO-defined language names}
2796 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2797 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2798 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2799 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++98 (ISO)} \\
2800 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2801 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2802 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2803 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2804 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2805 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2806 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2807 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2808 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2809 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2810 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2811 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2812 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2813 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2814 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2815 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2816 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2817 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2818 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2819 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2820 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++03 (ISO)}\\
2821 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++11 (ISO)} \\
2822 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2823 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2824 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2825 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2826 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2827 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2828 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++14 (ISO)} \\
2829 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2830 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2831 \DWLANGRenderScript{}~\ddag &0x0024 &0 \addtoindexx{RenderScript Kernel Language}
2833 \DWLANGlouser{} &0x8000 & \\
2834 \DWLANGhiuser{} &\xffff & \\
2839 \section{Address Class Encodings}
2840 \label{datarep:addressclassencodings}
2842 The value of the common
2843 \addtoindex{address class} encoding
2847 \section{Identifier Case}
2848 \label{datarep:identifiercase}
2850 The encodings of the constants used in the
2851 \DWATidentifiercase{} attribute are given in
2852 Table \refersec{tab:identifiercaseencodings}.
2856 \setlength{\extrarowheight}{0.1cm}
2857 \begin{longtable}{l|c}
2858 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2859 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2861 \bfseries Identifier case name&\bfseries Value\\ \hline
2863 \hline \emph{Continued on next page}
2867 \DWIDcasesensitive&0x00 \\
2869 \DWIDdowncase&0x02 \\
2870 \DWIDcaseinsensitive&0x03 \\
2874 \section{Calling Convention Encodings}
2875 \label{datarep:callingconventionencodings}
2876 The encodings of the constants used in the
2877 \DWATcallingconvention{} attribute are given in
2878 Table \refersec{tab:callingconventionencodings}.
2881 \setlength{\extrarowheight}{0.1cm}
2882 \begin{longtable}{l|c}
2883 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2884 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2886 \bfseries Calling convention name&\bfseries Value\\ \hline
2888 \hline \emph{Continued on next page}
2890 \hline \ddag\ \textit{New in DWARF Version 5}
2893 \DWCCnormal &0x01 \\
2894 \DWCCprogram&0x02 \\
2895 \DWCCnocall &0x03 \\
2896 \DWCCpassbyreference~\ddag &0x04 \\
2897 \DWCCpassbyvalue~\ddag &0x05 \\
2898 \DWCClouser &0x40 \\
2905 \section{Inline Codes}
2906 \label{datarep:inlinecodes}
2908 The encodings of the constants used in
2909 \addtoindexx{inline attribute}
2911 \DWATinline{} attribute are given in
2912 Table \refersec{tab:inlineencodings}.
2916 \setlength{\extrarowheight}{0.1cm}
2917 \begin{longtable}{l|c}
2918 \caption{Inline encodings} \label{tab:inlineencodings}\\
2919 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2921 \bfseries Inline Code name&\bfseries Value\\ \hline
2923 \hline \emph{Continued on next page}
2928 \DWINLnotinlined&0x00 \\
2929 \DWINLinlined&0x01 \\
2930 \DWINLdeclarednotinlined&0x02 \\
2931 \DWINLdeclaredinlined&0x03 \\
2936 % this clearpage is ugly, but the following table came
2937 % out oddly without it.
2939 \section{Array Ordering}
2940 \label{datarep:arrayordering}
2942 The encodings of the constants used in the
2943 \DWATordering{} attribute are given in
2944 Table \refersec{tab:orderingencodings}.
2948 \setlength{\extrarowheight}{0.1cm}
2949 \begin{longtable}{l|c}
2950 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2951 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2953 \bfseries Ordering name&\bfseries Value\\ \hline
2955 \hline \emph{Continued on next page}
2960 \DWORDrowmajor&0x00 \\
2961 \DWORDcolmajor&0x01 \\
2967 \section{Discriminant Lists}
2968 \label{datarep:discriminantlists}
2970 The descriptors used in
2971 \addtoindexx{discriminant list attribute}
2973 \DWATdiscrlist{} attribute are
2974 encoded as 1-byte constants. The
2975 defined values are given in
2976 Table \refersec{tab:discriminantdescriptorencodings}.
2978 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2980 \setlength{\extrarowheight}{0.1cm}
2981 \begin{longtable}{l|c}
2982 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2983 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2985 \bfseries Descriptor name&\bfseries Value\\ \hline
2987 \hline \emph{Continued on next page}
2999 \section{Name Index Table}
3000 \label{datarep:nameindextable}
3001 The \addtoindexi{version number}{version number!name index table}
3002 in the name index table header is \versiondotdebugnames{}.
3004 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
3007 \setlength{\extrarowheight}{0.1cm}
3008 \begin{longtable}{l|c|l}
3009 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
3010 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3012 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3014 \hline \emph{Continued on next page}
3017 \ddag~\textit{New in \DWARFVersionV}
3019 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
3020 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
3021 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
3022 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
3023 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
3024 \DWIDXlouser~\ddag & 0x2000 & \\
3025 \DWIDXhiuser~\ddag & \xiiifff & \\
3029 The abbreviations table ends with an entry consisting of a single 0
3030 byte for the abbreviation code. The size of the table given by
3031 \texttt{abbrev\_table\_size} may include optional padding following the
3034 \section{Defaulted Member Encodings}
3035 \hypertarget{datarep:defaultedmemberencodings}{}
3037 The encodings of the constants used in the \DWATdefaulted{} attribute
3038 are given in Table \referfol{datarep:defaultedattributeencodings}.
3041 \setlength{\extrarowheight}{0.1cm}
3042 \begin{longtable}{l|c}
3043 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
3044 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
3046 \bfseries Defaulted name &\bfseries Value \\ \hline
3048 \hline \emph{Continued on next page}
3051 \ddag~\textit{New in \DWARFVersionV}
3053 \DWDEFAULTEDno~\ddag & 0x00 \\
3054 \DWDEFAULTEDinclass~\ddag & 0x01 \\
3055 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
3060 \section{Address Range Table}
3061 \label{datarep:addrssrangetable}
3063 Each set of entries in the table of address ranges contained
3064 in the \dotdebugaranges{}
3065 section begins with a header containing:
3066 \begin{enumerate}[1. ]
3067 % FIXME The unit length text is not fully consistent across
3070 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3071 \addttindexx{unit\_length}
3072 A 4-byte or 12-byte length containing the length of the
3073 \addtoindexx{initial length}
3074 set of entries for this compilation unit, not including the
3075 length field itself. In the \thirtytwobitdwarfformat, this is a
3076 4-byte unsigned integer (which must be less than \xfffffffzero);
3077 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
3078 \wffffffff followed by an 8-byte unsigned integer that gives
3080 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3082 \item version (\HFTuhalf) \\
3083 A 2-byte version identifier representing the version of the
3084 DWARF information for the address range table.
3086 This value in this field \addtoindexx{version number!address range table} is 2.
3088 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
3090 \addtoindexx{section offset!in .debug\_aranges header}
3091 4-byte or 8-byte offset into the
3092 \dotdebuginfo{} section of
3093 the compilation unit header. In the \thirtytwobitdwarfformat,
3094 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
3095 this is an 8-byte unsigned offset
3096 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3098 \item \texttt{address\_size} (\HFTubyte) \\
3099 A 1-byte unsigned integer containing the size in bytes of an
3100 \addttindexx{address\_size}
3102 \addtoindexx{size of an address}
3103 (or the offset portion of an address for segmented
3104 \addtoindexx{address space!segmented}
3105 addressing) on the target system.
3107 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3108 A 1-byte unsigned integer containing the size in bytes of a
3109 segment selector on the target system.
3113 This header is followed by a series of tuples. Each tuple
3114 consists of a segment, an address and a length.
3115 The segment selector
3116 size is given by the \HFNsegmentselectorsize{} field of the header; the
3117 address and length size are each given by the \addttindex{address\_size}
3118 field of the header.
3119 The first tuple following the header in
3120 each set begins at an offset that is a multiple of the size
3121 of a single tuple (that is, the size of a segment selector
3122 plus twice the \addtoindex{size of an address}).
3123 The header is padded, if
3124 necessary, to that boundary. Each set of tuples is terminated
3125 by a 0 for the segment, a 0 for the address and 0 for the
3126 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3127 the segment selectors are omitted from all tuples, including
3128 the terminating tuple.
3131 \section{Line Number Information}
3132 \label{datarep:linenumberinformation}
3134 The \addtoindexi{version number}{version number!line number information}
3135 in the line number program header is \versiondotdebugline{}.
3137 The boolean values \doublequote{true} and \doublequote{false}
3138 used by the line number information program are encoded
3139 as a single byte containing the value 0
3140 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3143 The encodings for the standard opcodes are given in
3144 \addtoindexx{line number opcodes!standard opcode encoding}
3145 Table \refersec{tab:linenumberstandardopcodeencodings}.
3148 \setlength{\extrarowheight}{0.1cm}
3149 \begin{longtable}{l|c}
3150 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3151 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3153 \bfseries Opcode name&\bfseries Value\\ \hline
3155 \hline \emph{Continued on next page}
3161 \DWLNSadvancepc&0x02 \\
3162 \DWLNSadvanceline&0x03 \\
3163 \DWLNSsetfile&0x04 \\
3164 \DWLNSsetcolumn&0x05 \\
3165 \DWLNSnegatestmt&0x06 \\
3166 \DWLNSsetbasicblock&0x07 \\
3167 \DWLNSconstaddpc&0x08 \\
3168 \DWLNSfixedadvancepc&0x09 \\
3169 \DWLNSsetprologueend&0x0a \\*
3170 \DWLNSsetepiloguebegin&0x0b \\*
3171 \DWLNSsetisa&0x0c \\*
3177 The encodings for the extended opcodes are given in
3178 \addtoindexx{line number opcodes!extended opcode encoding}
3179 Table \refersec{tab:linenumberextendedopcodeencodings}.
3182 \setlength{\extrarowheight}{0.1cm}
3183 \begin{longtable}{l|c}
3184 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3185 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3187 \bfseries Opcode name&\bfseries Value\\ \hline
3189 \hline \emph{Continued on next page}
3191 \hline %\ddag~\textit{New in DWARF Version 5}
3194 \DWLNEendsequence &0x01 \\
3195 \DWLNEsetaddress &0x02 \\
3196 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3197 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3199 \DWLNEsetdiscriminator &0x04 \\
3200 \DWLNElouser &0x80 \\
3201 \DWLNEhiuser &\xff \\
3207 The encodings for the line number header entry formats are given in
3208 \addtoindexx{line number opcodes!file entry format encoding}
3209 Table \refersec{tab:linenumberheaderentryformatencodings}.
3212 \setlength{\extrarowheight}{0.1cm}
3213 \begin{longtable}{l|c}
3214 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3215 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3217 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3219 \hline \emph{Continued on next page}
3221 \hline \ddag~\textit{New in DWARF Version 5}
3223 \DWLNCTpath~\ddag & 0x1 \\
3224 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3225 \DWLNCTtimestamp~\ddag & 0x3 \\
3226 \DWLNCTsize~\ddag & 0x4 \\
3227 \DWLNCTMDfive~\ddag & 0x5 \\
3228 \DWLNCTlouser~\ddag & 0x2000 \\
3229 \DWLNCThiuser~\ddag & \xiiifff \\
3234 \section{Macro Information}
3235 \label{datarep:macroinformation}
3236 The \addtoindexi{version number}{version number!macro information}
3237 in the macro information header is \versiondotdebugmacro{}.
3239 The source line numbers and source file indices encoded in the
3240 macro information section are represented as
3241 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3244 The macro information entry type is encoded as a single unsigned byte.
3246 \addtoindexx{macro information entry types!encoding}
3248 Table \refersec{tab:macroinfoentrytypeencodings}.
3252 \setlength{\extrarowheight}{0.1cm}
3253 \begin{longtable}{l|c}
3254 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3255 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3257 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3259 \hline \emph{Continued on next page}
3261 \hline \ddag~\textit{New in DWARF Version 5}
3264 \DWMACROdefine~\ddag &0x01 \\
3265 \DWMACROundef~\ddag &0x02 \\
3266 \DWMACROstartfile~\ddag &0x03 \\
3267 \DWMACROendfile~\ddag &0x04 \\
3268 \DWMACROdefinestrp~\ddag &0x05 \\
3269 \DWMACROundefstrp~\ddag &0x06 \\
3270 \DWMACROimport~\ddag &0x07 \\
3271 \DWMACROdefinesup~\ddag &0x08 \\
3272 \DWMACROundefsup~\ddag &0x09 \\
3273 \DWMACROimportsup~\ddag &0x0a \\
3274 \DWMACROdefinestrx~\ddag &0x0b \\
3275 \DWMACROundefstrx~\ddag &0x0c \\
3276 \DWMACROlouser~\ddag &0xe0 \\
3277 \DWMACROhiuser~\ddag &\xff \\
3283 \section{Call Frame Information}
3284 \label{datarep:callframeinformation}
3286 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3287 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3288 value is \xffffffffffffffff.
3290 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3291 is \versiondotdebugframe.
3293 Call frame instructions are encoded in one or more bytes. The
3294 primary opcode is encoded in the high order two bits of
3295 the first byte (that is, opcode = byte $\gg$ 6). An operand
3296 or extended opcode may be encoded in the low order 6
3297 bits. Additional operands are encoded in subsequent bytes.
3298 The instructions and their encodings are presented in
3299 Table \refersec{tab:callframeinstructionencodings}.
3302 \setlength{\extrarowheight}{0.1cm}
3303 \begin{longtable}{l|c|c|l|l}
3304 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3305 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3306 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3308 & \bfseries High 2 &\bfseries Low 6 & &\\
3309 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3311 \hline \emph{Continued on next page}
3316 \DWCFAadvanceloc&0x1&delta & \\
3317 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3318 \DWCFArestore&0x3®ister & & \\
3319 \DWCFAnop&0&0 & & \\
3320 \DWCFAsetloc&0&0x01&address & \\
3321 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3322 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3323 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3324 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3325 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3326 \DWCFAundefined&0&0x07&ULEB128 register & \\
3327 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3328 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3329 \DWCFArememberstate&0&0x0a & & \\
3330 \DWCFArestorestate&0&0x0b & & \\
3331 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3332 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3333 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3334 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3335 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3337 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3338 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3339 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3340 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3341 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3342 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3343 \DWCFAlouser&0&0x1c & & \\
3344 \DWCFAhiuser&0&\xiiif & & \\
3348 \section{Range List Entries for Non-contiguous Address Ranges}
3349 \label{datarep:noncontiguousaddressranges}
3350 Each entry in a \addtoindex{range list}
3351 (see Section \refersec{chap:noncontiguousaddressranges})
3353 \addtoindexx{base address selection entry!in range list}
3355 \addtoindexx{range list}
3356 a base address selection entry, or an end-of-list entry.
3358 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
3359 that follows. The encodings for these constants are given in
3360 Table \refersec{tab:rnglistsentryencodingvalues}.
3364 \setlength{\extrarowheight}{0.1cm}
3365 \begin{longtable}{l|c}
3366 \caption{Range list entry encoding values}
3367 \label{tab:rnglistsentryencodingvalues} \\
3368 \hline \bfseries Range list entry encoding name&\bfseries Value \\ \hline
3370 \bfseries Range list entry encoding name&\bfseries Value\\ \hline
3372 \hline \emph{Continued on next page}
3375 \ddag New in \DWARFVersionV
3377 \DWRLEendoflist~\ddag & 0x00 \\
3378 \DWRLEbaseaddressx~\ddag & 0x01 \\
3379 \DWRLEstartxendx~\ddag & 0x02 \\
3380 \DWRLEstartxlength~\ddag & 0x03 \\
3381 \DWRLEoffsetpair~\ddag & 0x04 \\
3382 \DWRLEbaseaddress~\ddag & 0x05 \\
3383 \DWRLEstartend~\ddag & 0x06 \\
3384 \DWRLEstartlength~\ddag & 0x07 \\
3388 For a \addtoindex{range list} to be specified, the base address of the
3389 \addtoindexx{base address selection entry!in range list}
3390 corresponding compilation unit must be defined
3391 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3394 \section{String Offsets Table}
3395 \label{chap:stringoffsetstable}
3396 Each set of entries in the string offsets table contained in the
3397 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3398 section begins with a header containing:
3399 \begin{enumerate}[1. ]
3400 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3401 \addttindexx{unit\_length}
3402 A 4-byte or 12-byte length containing the length of
3403 the set of entries for this compilation unit, not
3404 including the length field itself. In the 32-bit
3405 DWARF format, this is a 4-byte unsigned integer
3406 (which must be less than \xfffffffzero); in the 64-bit
3407 DWARF format, this consists of the 4-byte value
3408 \wffffffff followed by an 8-byte unsigned integer
3409 that gives the actual length (see
3410 Section \refersec{datarep:32bitand64bitdwarfformats}).
3413 \item \texttt{version} (\HFTuhalf) \\
3414 \addtoindexx{version number!string offsets table}
3415 A 2-byte version identifier containing the value
3416 \versiondotdebugstroffsets{}.
3418 \item \textit{padding} (\HFTuhalf) \\
3419 Reserved to DWARF (must be zero).
3422 This header is followed by a series of string table offsets
3423 that have the same representation as \DWFORMstrp.
3424 For the 32-bit DWARF format, each offset is 4 bytes long; for
3425 the 64-bit DWARF format, each offset is 8 bytes long.
3427 The \DWATstroffsetsbase{} attribute points to the first
3428 entry following the header. The entries are indexed
3429 sequentially from this base entry, starting from 0.
3431 \section{Address Table}
3432 \label{chap:addresstable}
3433 Each set of entries in the address table contained in the
3434 \dotdebugaddr{} section begins with a header containing:
3435 \begin{enumerate}[1. ]
3436 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3437 \addttindexx{unit\_length}
3438 A 4-byte or 12-byte length containing the length of
3439 the set of entries for this compilation unit, not
3440 including the length field itself. In the 32-bit
3441 DWARF format, this is a 4-byte unsigned integer
3442 (which must be less than \xfffffffzero); in the 64-bit
3443 DWARF format, this consists of the 4-byte value
3444 \wffffffff followed by an 8-byte unsigned integer
3445 that gives the actual length (see
3446 Section \refersec{datarep:32bitand64bitdwarfformats}).
3449 \item \texttt{version} (\HFTuhalf) \\
3450 \addtoindexx{version number!address table}
3451 A 2-byte version identifier containing the value
3452 \versiondotdebugaddr{}.
3455 \item \texttt{address\_size} (\HFTubyte) \\
3456 A 1-byte unsigned integer containing the size in
3457 bytes of an address (or the offset portion of an
3458 address for segmented addressing) on the target
3462 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3463 A 1-byte unsigned integer containing the size in
3464 bytes of a segment selector on the target system.
3467 This header is followed by a series of segment/address pairs.
3468 The segment size is given by the \HFNsegmentselectorsize{} field of the
3469 header, and the address size is given by the \addttindex{address\_size}
3470 field of the header. If the \HFNsegmentselectorsize{} field in the header
3471 is zero, the entries consist only of an addresses.
3473 The \DWATaddrbase{} attribute points to the first entry
3474 following the header. The entries are indexed sequentially
3475 from this base entry, starting from 0.
3478 \section{Range List Table}
3479 \label{app:ranglisttable}
3480 Each \dotdebugrnglists{} and \dotdebugrnglistsdwo{} section
3481 begins with a header containing:
3482 \begin{enumerate}[1. ]
3483 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3484 \addttindexx{unit\_length}
3485 A 4-byte or 12-byte length containing the length of
3486 the set of entries for this compilation unit, not
3487 including the length field itself. In the 32-bit
3488 DWARF format, this is a 4-byte unsigned integer
3489 (which must be less than \xfffffffzero); in the 64-bit
3490 DWARF format, this consists of the 4-byte value
3491 \wffffffff followed by an 8-byte unsigned integer
3492 that gives the actual length (see
3493 Section \refersec{datarep:32bitand64bitdwarfformats}).
3496 \item \texttt{version} (\HFTuhalf) \\
3497 \addtoindexx{version number!range list table}
3498 A 2-byte version identifier containing the value
3499 \versiondotdebugrnglists{}.
3502 \item \texttt{address\_size} (\HFTubyte) \\
3503 A 1-byte unsigned integer containing the size in
3504 bytes of an address (or the offset portion of an
3505 address for segmented addressing) on the target
3509 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3510 A 1-byte unsigned integer containing the size in
3511 bytes of a segment selector on the target system.
3513 \item \HFNoffsetentrycount{} (\HFTuword) \\
3514 A 4-byte count of the number of offsets
3515 that follow the header.
3518 Immediately following the header is an array of offsets.
3519 This array is followed by a series of range lists.
3521 There is one offset for each range list.
3523 of the $i$\textsuperscript{th} offset is the offset
3525 (an unsigned integer)
3528 beginning of the offset array to the location of the
3529 $i$\textsuperscript{th} range list.
3531 In the 32-bit DWARF format, each offset is 4-bytes in size;
3532 in the 64-bit DWARF format, each offset is 8-bytes in size
3533 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3537 described in Section \refersec{chap:noncontiguousaddressranges}.
3539 The segment size is given by the
3540 \HFNsegmentselectorsize{} field of the header, and the address size is
3541 given by the \addttindex{address\_size} field of the header. If the
3542 \HFNsegmentselectorsize{} field in the header is zero, the segment
3543 selector is omitted from the range list entries.
3545 The \DWATrnglistsbase{} attribute points to the first offset
3546 following the header. The range lists are referenced
3547 by the index of the position of their corresponding offset in the
3548 array of offsets, which indirectly specifies the offset to the
3552 \section{Location List Table}
3553 \label{datarep:locationlisttable}
3554 Each \dotdebugloclists{} or \dotdebugloclistsdwo{} section
3555 begins with a header containing:
3556 \begin{enumerate}[1. ]
3557 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3558 \addttindexx{unit\_length}
3559 A 4-byte or 12-byte length containing the length of
3560 the set of entries for this compilation unit, not
3561 including the length field itself. In the 32-bit
3562 DWARF format, this is a 4-byte unsigned integer
3563 (which must be less than \xfffffffzero); in the 64-bit
3564 DWARF format, this consists of the 4-byte value
3565 \wffffffff followed by an 8-byte unsigned integer
3566 that gives the actual length (see
3567 Section \refersec{datarep:32bitand64bitdwarfformats}).
3570 \item \texttt{version} (\HFTuhalf) \\
3571 \addtoindexx{version number!location list table}
3572 A 2-byte version identifier containing the value
3573 \versiondotdebugloclists{}.
3576 \item \texttt{address\_size} (\HFTubyte) \\
3577 A 1-byte unsigned integer containing the size in
3578 bytes of an address (or the offset portion of an
3579 address for segmented addressing) on the target
3583 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3584 A 1-byte unsigned integer containing the size in
3585 bytes of a segment selector on the target system.
3587 \item \HFNoffsetentrycount{} (\HFTuword) \\
3588 A 4-byte count of the number of offsets
3589 that follow the header.
3592 Immediately following the header is an array of offsets.
3593 This array is followed by a series of location lists.
3595 There is one offset for each location list. The contents
3596 of the $i$\textsuperscript{th} offset is the offset
3598 (an unsigned integer)
3601 beginning of the offset array to the location of the
3602 $i$\textsuperscript{th} location list.
3604 In the 32-bit DWARF format, each offset is 4-bytes in size;
3605 in the 64-bit DWARF format, each offset is 8-bytes in size
3606 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3611 described in Section \refersec{chap:locationlists}.
3613 The segment size is given by the
3614 \HFNsegmentselectorsize{} field of the header, and the address size is
3615 given by the \HFNaddresssize{} field of the header. If the
3616 \HFNsegmentselectorsize{} field in the header is zero, the segment
3617 selector is omitted from location list entries.
3619 The \DWATloclistsbase{} attribute points to the first offset
3620 following the header. The location lists are referenced
3621 by the index of the position of their corresponding offset in the
3622 array of offsets, which indirectly specifies the offset to the
3626 \section{Dependencies and Constraints}
3627 \label{datarep:dependenciesandconstraints}
3628 The debugging information in this format is intended to
3629 exist in sections of an object file, or an equivalent
3630 separate file or database, having names beginning with
3631 the prefix ".debug\_" (see Appendix
3632 \refersec{app:dwarfsectionversionnumbersinformative}
3633 for a complete list of such names).
3634 Except as specifically specified, this information is not
3635 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3638 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3639 32-bit addresses, an assembler or compiler must provide a way
3640 to produce 2-byte and 4-byte quantities without alignment
3641 restrictions, and the linker must be able to relocate a
3643 \addtoindexx{section offset!alignment of}
3644 section offset that occurs at an arbitrary
3647 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3648 64-bit addresses, an assembler or compiler must provide a
3649 way to produce 2-byte, 4-byte and 8-byte quantities without
3650 alignment restrictions, and the linker must be able to relocate
3651 an 8-byte address or 4-byte
3652 \addtoindexx{section offset!alignment of}
3653 section offset that occurs at an
3654 arbitrary alignment.
3656 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3657 32-bit addresses, an assembler or compiler must provide a
3658 way to produce 2-byte, 4-byte and 8-byte quantities without
3659 alignment restrictions, and the linker must be able to relocate
3660 a 4-byte address or 8-byte
3661 \addtoindexx{section offset!alignment of}
3662 section offset that occurs at an
3663 arbitrary alignment.
3665 \textit{It is expected that this will be required only for very large
3666 32-bit programs or by those architectures which support
3667 a mix of 32-bit and 64-bit code and data within the same
3670 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3671 64-bit addresses, an assembler or compiler must provide a
3672 way to produce 2-byte, 4-byte and 8-byte quantities without
3673 alignment restrictions, and the linker must be able to
3674 relocate an 8-byte address or
3675 \addtoindexx{section offset!alignment of}
3676 section offset that occurs at
3677 an arbitrary alignment.
3681 \section{Integer Representation Names}
3682 \label{datarep:integerrepresentationnames}
3683 The sizes of the integers used in the lookup by name, lookup
3684 by address, line number, call frame information and other sections
3686 Table \ref{tab:integerrepresentationnames}.
3690 \setlength{\extrarowheight}{0.1cm}
3691 \begin{longtable}{c|l}
3692 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3693 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3695 \bfseries Representation name&\bfseries Representation\\ \hline
3697 \hline \emph{Continued on next page}
3702 \HFTsbyte& signed, 1-byte integer \\
3703 \HFTubyte&unsigned, 1-byte integer \\
3704 \HFTuhalf&unsigned, 2-byte integer \\
3705 \HFTuword&unsigned, 4-byte integer \\
3711 \section{Type Signature Computation}
3712 \label{datarep:typesignaturecomputation}
3714 A \addtoindex{type signature} is used by a DWARF consumer
3715 to resolve type references to the type definitions that
3716 are contained in \addtoindex{type unit}s (see Section
3717 \refersec{chap:typeunitentries}).
3719 \textit{A type signature is computed only by a DWARF producer;
3720 \addtoindexx{type signature!computation} a consumer need
3721 only compare two type signatures to check for equality.}
3724 The type signature for a type T0 is formed from the
3725 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3726 R.L. Rivest, RFC 1321, April 1992}
3727 digest of a flattened description of the type. The flattened
3728 description of the type is a byte sequence derived from the
3729 DWARF encoding of the type as follows:
3730 \begin{enumerate}[1. ]
3732 \item Start with an empty sequence S and a list V of visited
3733 types, where V is initialized to a list containing the type
3734 T0 as its single element. Elements in V are indexed from 1,
3737 \item If the debugging information entry represents a type that
3738 is nested inside another type or a namespace, append to S
3739 the type\textquoteright s context as follows: For each surrounding type
3740 or namespace, beginning with the outermost such construct,
3741 append the letter 'C', the DWARF tag of the construct, and
3742 the name (taken from
3743 \addtoindexx{name attribute}
3744 the \DWATname{} attribute) of the type
3745 \addtoindexx{name attribute}
3746 or namespace (including its trailing null byte).
3748 \item Append to S the letter 'D', followed by the DWARF tag of
3749 the debugging information entry.
3751 \item For each of the attributes in
3752 Table \refersec{tab:attributesusedintypesignaturecomputation}
3754 the debugging information entry, in the order listed,
3755 append to S a marker letter (see below), the DWARF attribute
3756 code, and the attribute value.
3759 \caption{Attributes used in type signature computation}
3760 \label{tab:attributesusedintypesignaturecomputation}
3761 \simplerule[\textwidth]
3763 \autocols[0pt]{c}{2}{l}{
3779 \DWATcontainingtype,
3783 \DWATdatamemberlocation,
3804 \DWATrvaluereference,
3808 \DWATstringlengthbitsize,
3809 \DWATstringlengthbytesize,
3814 \DWATvariableparameter,
3817 \DWATvtableelemlocation
3820 \simplerule[\textwidth]
3823 Note that except for the initial
3824 \DWATname{} attribute,
3825 \addtoindexx{name attribute}
3826 attributes are appended in order according to the alphabetical
3827 spelling of their identifier.
3830 If an implementation defines any vendor-specific attributes,
3831 any such attributes that are essential to the definition of
3832 the type are also included at the end of the above list,
3833 in their own alphabetical suborder.
3835 An attribute that refers to another type entry T is processed
3837 \begin{enumerate}[ a)]
3839 If T is in the list V at some V[x], use the
3840 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3841 encoding of x as the attribute value.
3844 Otherwise, append type T to the list V, then
3846 as the marker, process the type T recursively by performing
3847 Steps 2 through 7, and use the result as the attribute value.
3851 Other attribute values use the letter 'A' as the marker, and
3852 the value consists of the form code (encoded as an unsigned
3853 LEB128 value) followed by the encoding of the value according
3854 to the form code. To ensure reproducibility of the signature,
3855 the set of forms used in the signature computation is limited
3863 \item If the tag in Step 3 is one of \DWTAGpointertype,
3864 \DWTAGreferencetype,
3865 \DWTAGrvaluereferencetype,
3866 \DWTAGptrtomembertype,
3867 or \DWTAGfriend, and the referenced
3868 type (via the \DWATtype{} or
3869 \DWATfriend{} attribute) has a
3870 \DWATname{} attribute, append to S the letter 'N', the DWARF
3871 attribute code (\DWATtype{} or
3872 \DWATfriend), the context of
3873 the type (according to the method in Step 2), the letter 'E',
3874 and the name of the type. For \DWTAGfriend, if the referenced
3875 entry is a \DWTAGsubprogram, the context is omitted and the
3876 name to be used is the ABI-specific name of the subprogram
3877 (for example, the mangled linker name).
3880 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3881 \DWTAGreferencetype,
3882 \DWTAGrvaluereferencetype,
3883 \DWTAGptrtomembertype, or
3884 \DWTAGfriend, but has
3885 a \DWATtype{} attribute, or if the referenced type (via
3887 \DWATfriend{} attribute) does not have a
3888 \DWATname{} attribute, the attribute is processed according to
3889 the method in Step 4 for an attribute that refers to another
3893 \item Visit each child C of the debugging information
3894 entry as follows: If C is a nested type entry or a member
3895 function entry, and has
3896 a \DWATname{} attribute, append to
3897 \addtoindexx{name attribute}
3898 S the letter 'S', the tag of C, and its name; otherwise,
3899 process C recursively by performing Steps 3 through 7,
3900 appending the result to S. Following the last child (or if
3901 there are no children), append a zero byte.
3906 For the purposes of this algorithm, if a debugging information
3908 \DWATspecification{}
3909 attribute that refers to
3910 another entry D (which has a
3913 then S inherits the attributes and children of D, and S is
3914 processed as if those attributes and children were present in
3915 the entry S. Exception: if a particular attribute is found in
3916 both S and D, the attribute in S is used and the corresponding
3917 one in D is ignored.
3920 DWARF tag and attribute codes are appended to the sequence
3921 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3922 using the values defined earlier in this chapter.
3924 \textit{A grammar describing this computation may be found in
3925 Appendix \refersec{app:typesignaturecomputationgrammar}.
3928 \textit{An attribute that refers to another type entry is
3929 recursively processed or replaced with the name of the
3930 referent (in Step 4, 5 or 6). If neither treatment applies to
3931 an attribute that references another type entry, the entry
3932 that contains that attribute is not suitable for a
3933 separate \addtoindex{type unit}.}
3935 \textit{If a debugging information entry contains an attribute from
3936 the list above that would require an unsupported form, that
3937 entry is not suitable for a separate
3938 \addtoindex{type unit}.}
3940 \textit{A type is suitable for a separate
3941 \addtoindex{type unit} only
3942 if all of the type entries that it contains or refers to in
3943 Steps 6 and 7 are themselves suitable for a separate
3944 \addtoindex{type unit}.}
3947 \textit{Where the DWARF producer may reasonably choose two or
3948 more different forms for a given attribute, it should choose
3949 the simplest possible form in computing the signature. (For
3950 example, a constant value should be preferred to a location
3951 expression when possible.)}
3953 Once the string S has been formed from the DWARF encoding,
3954 an 16-byte \MDfive{} digest is computed for the string and the
3955 last eight bytes are taken as the type signature.
3957 \textit{The string S is intended to be a flattened representation of
3958 the type that uniquely identifies that type (that is, a different
3959 type is highly unlikely to produce the same string).}
3962 \textit{A debugging information entry is not be placed in a
3963 separate \addtoindex{type unit}
3964 if any of the following apply:}
3968 \item \textit{The entry has an attribute whose value is a location
3969 description, and the location description
3970 contains a reference to
3971 another debugging information entry (for example, a \DWOPcallref{}
3972 operator), as it is unlikely that the entry will remain
3973 identical across compilation units.}
3975 \item \textit{The entry has an attribute whose value refers
3976 to a code location or a \addtoindex{location list}.}
3978 \item \textit{The entry has an attribute whose value refers
3979 to another debugging information entry that does not represent
3985 \textit{Certain attributes are not included in the type signature:}
3988 \item \textit{The \DWATdeclaration{} attribute is not included because it
3989 indicates that the debugging information entry represents an
3990 incomplete declaration, and incomplete declarations should
3992 \addtoindexx{type unit}
3993 separate type units.}
3995 \item \textit{The \DWATdescription{} attribute is not included because
3996 it does not provide any information unique to the defining
3997 declaration of the type.}
3999 \item \textit{The \DWATdeclfile,
4001 \DWATdeclcolumn{} attributes are not included because they
4002 may vary from one source file to the next, and would prevent
4003 two otherwise identical type declarations from producing the
4004 same \MDfive{} digest.}
4006 \item \textit{The \DWATobjectpointer{} attribute is not included
4007 because the information it provides is not necessary for the
4008 computation of a unique type signature.}
4012 \textit{Nested types and some types referred to by a debugging
4013 information entry are encoded by name rather than by recursively
4014 encoding the type to allow for cases where a complete definition
4015 of the type might not be available in all compilation units.}
4018 \textit{If a type definition contains the definition of a member function,
4019 it cannot be moved as is into a type unit, because the member function
4020 contains attributes that are unique to that compilation unit.
4021 Such a type definition can be moved to a type unit by rewriting the
4022 debugging information entry tree,
4023 moving the member function declaration into a separate declaration tree,
4024 and replacing the function definition in the type with a non-defining
4025 declaration of the function (as if the function had been defined out of
4028 An example that illustrates the computation of an \MDfive{} digest may be found in
4029 Appendix \refersec{app:usingtypeunits}.
4031 \section{Name Table Hash Function}
4032 \label{datarep:nametablehashfunction}
4033 The hash function used for hashing name strings in the accelerated
4034 access name index table (see Section \refersec{chap:acceleratedaccess})
4035 is defined in \addtoindex{C} as shown in
4036 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnoteRR{
4037 This hash function is sometimes known as the
4038 "\addtoindex{Bernstein hash function}" or the
4039 "\addtoindex{DJB hash function}"
4041 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
4042 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
4047 uint32_t /* must be a 32-bit integer type */
4048 hash(unsigned char *str)
4050 uint32_t hash = 5381;
4054 hash = hash * 33 + c;
4060 \caption{Name Table Hash Function Definition}
4061 \label{fig:nametablehashfunctiondefinition}