1 \chapter{Data Representation}
2 \label{datarep:datarepresentation}
4 This section describes the binary representation of the
5 debugging information entry itself, of the attribute types
6 and of other fundamental elements described above.
8 \section{Vendor Extensibility}
9 \label{datarep:vendorextensibility}
10 \addtoindexx{vendor extensibility}
11 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
14 \addtoindexx{extensibility|see{vendor extensibility}}
15 reserve a portion of the DWARF name space and ranges of
16 enumeration values for use for vendor specific extensions,
17 special labels are reserved for tag names, attribute names,
18 base type encodings, location operations, language names,
19 calling conventions and call frame instructions.
21 The labels denoting the beginning and end of the
22 \hypertarget{chap:DWXXXlohiuser}{reserved value range}
23 for vendor specific extensions consist of the
25 (\DWATlouserMARK{}\DWAThiuserMARK{}DW\_AT,
26 \DWATElouserMARK{}\DWATEhiuserMARK{}DW\_ATE,
27 \DWCClouserMARK{}\DWCChiuserMARK{}DW\_CC,
28 \DWCFAlouserMARK{}\DWCFAhiuserMARK{}DW\_CFA,
29 \DWENDlouserMARK{}\DWENDhiuserMARK{}DW\_END,
30 \DWIDXlouserMARK{}\DWIDXhiuserMARK{}DW\_IDX,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{}DW\_LANG,
32 \DWLNCTlouserMARK{}\DWLNCThiuserMARK{}DW\_LNCT,
33 \DWLNElouserMARK{}\DWLNEhiuserMARK{}DW\_LNE,
34 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
35 \DWOPlouserMARK{}\DWOPhiuserMARK{}DW\_OP or
36 \DWTAGlouserMARK{}\DWTAGhiuserMARK{}DW\_TAG)
37 followed by \_lo\_user or \_hi\_user.
38 Values in the range between \textit{prefix}\_lo\_user
39 and \textit{prefix}\_hi\_user inclusive,
40 are reserved for vendor specific extensions. Vendors may
41 use values in this range without conflicting with current or
42 future system\dash defined values. All other values are reserved
43 for use by the system.
45 \textit{For example, for debugging information entry
46 tags, the special labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
48 \textit{There may also be codes for vendor specific extensions
49 between the number of standard line number opcodes and
50 the first special line number opcode. However, since the
51 number of standard opcodes varies with the DWARF version,
52 the range for extensions is also version dependent. Thus,
53 \DWLNSlouserTARG{} and
54 \DWLNShiuserTARG{} symbols are not defined.}
56 Vendor defined tags, attributes, base type encodings, location
57 atoms, language names, line number actions, calling conventions
58 and call frame instructions, conventionally use the form
59 \text{prefix\_vendor\_id\_name}, where
60 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
61 character sequence chosen so as to avoid conflicts with
64 To ensure that extensions added by one vendor may be safely
65 ignored by consumers that do not understand those extensions,
66 the following rules must be followed:
67 \begin{enumerate}[1. ]
69 \item New attributes are added in such a way that a
70 debugger may recognize the format of a new attribute value
71 without knowing the content of that attribute value.
73 \item The semantics of any new attributes do not alter
74 the semantics of previously existing attributes.
76 \item The semantics of any new tags do not conflict with
77 the semantics of previously existing tags.
79 \item New forms of attribute value are not added.
84 \section{Reserved Values}
85 \label{datarep:reservedvalues}
86 \subsection{Error Values}
87 \label{datarep:errorvalues}
88 \addtoindexx{reserved values!error}
91 \addtoindexx{error value}
92 a convenience for consumers of DWARF information, the value
93 0 is reserved in the encodings for attribute names, attribute
94 forms, base type encodings, location operations, languages,
95 line number program opcodes, macro information entries and tag
96 names to represent an error condition or unknown value. DWARF
97 does not specify names for these reserved values, because they
98 do not represent valid encodings for the given type and do
99 not appear in DWARF debugging information.
102 \subsection{Initial Length Values}
103 \label{datarep:initiallengthvalues}
104 \addtoindexx{reserved values!initial length}
106 An \livetarg{datarep:initiallengthvalues}{initial length} field
107 \addtoindexx{initial length field|see{initial length}}
108 is one of the fields that occur at the beginning
109 of those DWARF sections that have a header
113 \dotdebugnames{}) or the length field
114 that occurs at the beginning of the CIE and FDE structures
115 in the \dotdebugframe{} section.
118 In an \addtoindex{initial length} field, the values \wfffffffzero through
119 \wffffffff are reserved by DWARF to indicate some form of
120 extension relative to \DWARFVersionII; such values must not
121 be interpreted as a length field. The use of one such value,
122 \xffffffff, is defined in
123 Section \refersec{datarep:32bitand64bitdwarfformats});
125 the other values is reserved for possible future extensions.
128 \section{Relocatable, Split, Executable, Shared and Package Object Files}
129 \label{datarep:executableobjectsandsharedobjects}
131 \subsection{Relocatable Object Files}
132 \label{datarep:relocatableobjectfiles}
133 A DWARF producer (for example, a compiler) typically generates its
134 debugging information as part of a relocatable object file.
135 Relocatable object files are then combined by a linker to form an
136 executable file. During the linking process, the linker resolves
137 (binds) symbolic references between the various object files, and
138 relocates the contents of each object file into a combined virtual
141 The DWARF debugging information is placed in several sections (see
142 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
143 requires an object file format capable of
144 representing these separate sections. There are symbolic references
145 between these sections, and also between the debugging information
146 sections and the other sections that contain the text and data of the
147 program itself. Many of these references require relocation, and the
148 producer must emit the relocation information appropriate to the
149 object file format and the target processor architecture. These
150 references include the following:
153 \item The compilation unit header (see Section
154 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
155 section contains a reference to the \dotdebugabbrev{} table. This
156 reference requires a relocation so that after linking, it refers to
157 that contribution to the combined \dotdebugabbrev{} section in the
160 \item Debugging information entries may have attributes with the form
161 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
162 These attributes represent locations
163 within the virtual address space of the program, and require
166 \item A DWARF expression may contain a \DWOPaddr{} (see Section
167 \refersec{chap:literalencodings}) which contains a location within
168 the virtual address space of the program, and require relocation.
171 \item Debugging information entries may have attributes with the form
172 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
173 These attributes refer to
174 debugging information in other debugging information sections within
175 the object file, and must be relocated during the linking process.
177 However, if a \DWATrangesbase{} attribute is present, the offset in
178 a \DWATranges{} attribute (which uses form \DWFORMsecoffset) is
179 relative to the given base offset--no relocation is involved.
181 \item Debugging information entries may have attributes with the form
182 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
183 These attributes refer to
184 debugging information entries that may be outside the current
185 compilation unit. These values require both symbolic binding and
188 \item Debugging information entries may have attributes with the form
189 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
190 These attributes refer to strings in
191 the \dotdebugstr{} section. These values require relocation.
193 \item Entries in the \dotdebugaddr, \dotdebugloc{}, \dotdebugranges{}
194 and \dotdebugaranges{}
195 sections contain references to locations within the virtual address
196 space of the program, and require relocation.
198 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
199 opcode is a reference to a location within the virtual address space
200 of the program, and requires relocation.
202 \item The \dotdebugstroffsets{} section contains a list of string offsets,
203 each of which is an offset of a string in the \dotdebugstr{} section. Each
204 of these offsets requires relocation. Depending on the implementation,
205 these relocations may be implicit (that is, the producer may not need to
206 emit any explicit relocation information for these offsets).
208 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges{} header and
209 the list of compilation units following the \dotdebugnames{} header contain
210 references to the \dotdebuginfo{} section. These references require relocation
211 so that after linking they refer to the correct contribution in the combined
212 \dotdebuginfo{} section in the executable file.
214 \item Frame descriptor entries in the \dotdebugframe{} section
215 (see Section \refersec{chap:structureofcallframeinformation}) contain an
216 \HFNinitiallocation{} field value within the virtual address
217 space of the program and require relocation.
222 \textit{Note that operands of classes
224 \CLASSflag{} do not require relocation. Attribute operands that use
225 forms \DWFORMstring{},
226 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
227 \DWFORMrefudata{} also do not need relocation.}
229 \subsection{Split DWARF Object Files}
230 \label{datarep:splitdwarfobjectfiles}
231 \addtoindexx{split DWARF object file}
232 A DWARF producer may partition the debugging
233 information such that the majority of the debugging
234 information can remain in individual object files without
235 being processed by the linker.
237 \textit{This reduces link time by reducing the amount of information
238 the linker must process.}
241 \subsubsection{First Partition (with Skeleton Unit)}
242 The first partition contains
243 debugging information that must still be processed by the linker,
244 and includes the following:
247 The line number tables, range tables, frame tables, and
248 accelerated access tables, in the usual sections:
249 \dotdebugline, \dotdebuglinestr, \dotdebugranges, \dotdebugframe,
250 \dotdebugnames{} and \dotdebugaranges,
254 An address table, in the \dotdebugaddr{} section. This table
255 contains all addresses and constants that require
256 link-time relocation, and items in the table can be
257 referenced indirectly from the debugging information via
258 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
259 \DWOPconstx{} operators.
261 A skeleton compilation unit, as described in Section
262 \refersec{chap:skeletoncompilationunitentries},
263 in the \dotdebuginfo{} section.
265 An abbreviations table for the skeleton compilation unit,
266 in the \dotdebugabbrev{} section.
268 A string table, in the \dotdebugstr{} section. The string
269 table is necessary only if the skeleton compilation unit
270 uses either indirect string form, \DWFORMstrp{} or
273 A string offsets table, in the \dotdebugstroffsets{}
274 section. The string offsets table is necessary only if
275 the skeleton compilation unit uses the \DWFORMstrx{} form.
277 The attributes contained in the skeleton compilation
278 unit can be used by a DWARF consumer to find the
279 DWARF object file that contains the second partition.
281 \subsubsection{Second Partition (Unlinked or in a \texttt{.dwo} File)}
282 The second partition contains the debugging information that
283 does not need to be processed by the linker. These sections
284 may be left in the object files and ignored by the linker
285 (that is, not combined and copied to the executable object file), or
286 they may be placed by the producer in a separate DWARF object
287 file. This partition includes the following:
290 The full compilation unit, in the \dotdebuginfodwo{} section.
294 Attributes contained in the full compilation unit
295 may refer to machine addresses indirectly using the \DWFORMaddrx{}
296 form, which accesses the table of addresses specified by the
297 \DWATaddrbase{} attribute in the associated skeleton unit.
298 Location descriptions may similarly do so using the \DWOPaddrx{} and
299 \DWOPconstx{} operations.
302 \DWATranges{} attributes contained in the full compilation unit
303 may refer to range table entries with a \DWFORMsecoffset{} offset
304 relative to the base offset specified by the \DWATrangesbase{}
305 attribute in the associated skeleton unit.
308 \item Separate type units, in the \dotdebuginfodwo{} section.
311 Abbreviations table(s) for the compilation unit and type
312 units, in the \dotdebugabbrevdwo{} section.
314 \item Location lists, in the \dotdebuglocdwo{} section.
317 A \addtoindex{specialized line number table} (for the type units),
318 in the \dotdebuglinedwo{} section. This table
319 contains only the directory and filename lists needed to
320 interpret \DWATdeclfile{} attributes in the debugging
323 \item Macro information, in the \dotdebugmacrodwo{} section.
325 \item A string table, in the \dotdebugstrdwo{} section.
327 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
331 Except where noted otherwise, all references in this document
332 to a debugging information section (for example, \dotdebuginfo),
333 apply also to the corresponding split DWARF section (for example,
337 Split DWARF object files do not get linked with any other files,
338 therefore references between sections must not make use of
339 normal object file relocation information. As a result, symbolic
340 references within or between sections are not possible.
342 \subsection{Executable Objects}
343 \label{chap:executableobjects}
344 The relocated addresses in the debugging information for an
345 executable object are virtual addresses.
347 The sections containing the debugging information are typically
348 not loaded as part of the memory image of the program (in ELF
349 terminology, the sections are not "allocatable" and are not part
350 of a loadable segment). Therefore, the debugging information
351 sections described in this document are typically linked as if
352 they were each to be loaded at virtual address 0, and references
353 within the debugging information always implicitly indicate which
354 section a particular offset refers to. (For example, a reference
355 of form \DWFORMsecoffset{} may refer to one of several sections,
356 depending on the class allowed by a particular attribute of a
357 debugging information entry, as shown in
358 Table \refersec{tab:attributeencodings}.)
361 \subsection{Shared Object Files}
362 \label{datarep:sharedobjectfiles}
364 addresses in the debugging information for a shared object file
365 are offsets relative to the start of the lowest region of
366 memory loaded from that shared object file.
369 \textit{This requirement makes the debugging information for
370 shared object files position independent. Virtual addresses in a
371 shared object file may be calculated by adding the offset to the
372 base address at which the object file was attached. This offset
373 is available in the run\dash time linker\textquoteright s data structures.}
375 As with executable objects, the sections containing debugging
376 information are typically not loaded as part of the memory image
377 of the shared object, and are typically linked as if they were
378 each to be loaded at virtual address 0.
380 \subsection{DWARF Package Files}
381 \label{datarep:dwarfpackagefiles}
382 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
383 link, and debug an application quickly with less link-time overhead,
384 but a more convenient format is needed for saving the debug
385 information for later debugging of a deployed application. A
386 DWARF package file can be used to collect the debugging
387 information from the object (or separate DWARF object) files
388 produced during the compilation of an application.}
390 \textit{The package file is typically placed in the same directory as the
391 application, and is given the same name with a \doublequote{\texttt{.dwp}}
392 extension.\addtoindexx{\texttt{.dwp} file extension}}
395 A DWARF package file is itself an object file, using the
396 \addtoindexx{package files}
397 \addtoindexx{DWARF package files}
398 same object file format (including \byteorder) as the
399 corresponding application binary. It consists only of a file
400 header, a section table, a number of DWARF debug information
401 sections, and two index sections.
404 Each DWARF package file contains no more than one of each of the
405 following sections, copied from a set of object or DWARF object
406 files, and combined, section by section:
412 \dotdebugstroffsetsdwo
417 The string table section in \dotdebugstrdwo{} contains all the
418 strings referenced from DWARF attributes using the form
419 \DWFORMstrx. Any attribute in a compilation unit or a type
420 unit using this form refers to an entry in that unit's
421 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
422 provides the offset of a string in the \dotdebugstrdwo{}
425 The DWARF package file also contains two index sections that
426 provide a fast way to locate debug information by compilation
429 for compilation units, or by type
430 signature for type units:
436 \subsubsection{The Compilation Unit (CU) Index Section}
437 The \dotdebugcuindex{} section is a hashed lookup table that maps a
438 compilation unit ID to a set of contributions in the
439 various debug information sections. Each contribution is stored
440 as an offset within its corresponding section and a size.
442 Each \compunitset{} may contain contributions from the
445 \dotdebuginfodwo{} (required)
446 \dotdebugabbrevdwo{} (required)
449 \dotdebugstroffsetsdwo
453 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
454 information from \DWARFVersionIV{} or earlier formats.}
456 \subsubsection{The Type Unit (TU) Index Section}
457 The \dotdebugtuindex{} section is a hashed lookup table that maps a
458 type signature to a set of offsets into the various debug
459 information sections. Each contribution is stored as an offset
460 within its corresponding section and a size.
462 Each \typeunitset{} may contain contributions from the following
465 \dotdebuginfodwo{} (required)
466 \dotdebugabbrevdwo{} (required)
468 \dotdebugstroffsetsdwo
471 \subsubsection{Format of the CU and TU Index Sections}
472 Both index sections have the same format, and serve to map an
473 8-byte signature to a set of contributions to the debug sections.
474 Each index section begins with a header, followed by a hash table of
475 signatures, a parallel table of indexes, a table of offsets, and
476 a table of sizes. The index sections are aligned at 8-byte
477 boundaries in the DWARF package file.
480 The index section header contains the following fields:
481 \begin{enumerate}[1. ]
482 \item \texttt{version} (\HFTuhalf) \\
484 \addtoindexx{version number!CU index information}
485 \addtoindexx{version number!TU index information}
486 This number is specific to the CU and TU index information
487 and is independent of the DWARF version number.
489 The version number is \versiondotdebugcuindex.
491 \item \textit{padding} (\HFTuhalf) \\
492 Reserved to DWARF (must be zero).
493 \item \texttt{section\_count} (\HFTuword) \\
494 The number of entries in the table of section counts that follows.
495 For brevity, the contents of this field is referred to as $N$ below.
497 \item \texttt{unit\_count} (\HFTuword) \\
498 The number of compilation units or type units in the index.
499 For brevity, the contents of this field is referred to as $U$ below.
501 \item \texttt{slot\_count} (\HFTuword) \\
502 The number of slots in the hash table.
503 For brevity, the contents of this field is referred to as $S$ below.
507 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
509 The size of the hash table, $S$, must be $2^k$ such that:
510 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
512 The hash table begins at offset 16 in the section, and consists
513 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
515 % (using the \byteorder{} of the application binary).
517 The parallel table of indices begins immediately after the hash table
518 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
519 consists of an array of $S$ 4-byte slots,
520 % (using the byte order of the application binary),
521 corresponding 1-1 with slots in the hash
522 table. Each entry in the parallel table contains a row index into
523 the tables of offsets and sizes.
525 Unused slots in the hash table have 0 in both the hash table
526 entry and the parallel table entry. While 0 is a valid hash
527 value, the row index in a used slot will always be non-zero.
529 Given an 8-byte compilation unit ID or type signature $X$,
530 an entry in the hash table is located as follows:
531 \begin{enumerate}[1. ]
532 \item Define $REP(X)$ to be the value of $X$ interpreted as an
533 unsigned 64-bit integer in the target byte order.
534 \item Calculate a primary hash $H = REP(X)\ \&\ MASK(k)$, where
535 $MASK(k)$ is a mask with the low-order $k$ bits all set to 1.
536 \item Calculate a secondary hash $H' = (((REP(X)>>32)\ \&\ MASK(k))\ |\ 1)$.
537 \item If the hash table entry at index $H$ matches the signature, use
538 that entry. If the hash table entry at index $H$ is unused (all
539 zeroes), terminate the search: the signature is not present
541 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 4.
544 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
545 guaranteed to stop at an unused slot or find the match.
548 The table of offsets begins immediately following the parallel
549 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
550 The table is a two-dimensional array of 4-byte words,
551 %(using the byte order of the application binary),
552 with $N$ sections and $U + 1$
553 rows, in row-major order. Each row in the array is indexed
554 starting from 0. The first row provides a key to the columns:
555 each column in this row provides a section identifier for a debug
556 section, and the offsets in the same column of subsequent rows
557 refer to that section. The section identifiers are shown in
558 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
560 \textit{Not all sections listed in the table need be included.}
564 \setlength{\extrarowheight}{0.1cm}
565 \begin{longtable}{l|c|l}
566 \caption{DWARF package file section identifier \mbox{encodings}}
567 \label{tab:dwarfpackagefilesectionidentifierencodings}
568 \addtoindexx{DWARF package files!section identifier encodings} \\
569 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
571 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
573 \hline \emph{Continued on next page}
577 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
578 \textit{Reserved} & 2 & \\
579 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
580 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
581 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
582 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
583 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
584 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
588 The offsets provided by the CU and TU index sections are the
589 base offsets for the contributions made by each CU or TU to the
590 corresponding section in the package file. Each CU and TU header
591 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
592 table for that CU or TU within the contribution to the
593 \dotdebugabbrevdwo{} section for that CU or TU, and are
594 interpreted as relative to the base offset given in the index
595 section. Likewise, offsets into \dotdebuglinedwo{} from
596 \DWATstmtlist{} attributes are interpreted as relative to
597 the base offset for \dotdebuglinedwo{}, and offsets into other debug
598 sections obtained from DWARF attributes are also
599 interpreted as relative to the corresponding base offset.
601 The table of sizes begins immediately following the table of
602 offsets, and provides the sizes of the contributions made by each
603 CU or TU to the corresponding section in the package file. Like
604 the table of offsets, it is a two-dimensional array of 4-byte
606 entries and $U$ rows, in row-major order. Each row in
607 the array is indexed starting from 1 (row 0 of the table of
608 offsets also serves as the key for the table of sizes).
610 For an example, see Figure \refersec{fig:examplecuindexsection}.
612 \subsection{DWARF Supplementary Object Files}
613 \label{datarep:dwarfsupplemetaryobjectfiles}
614 In order to minimize the size of debugging information,
615 it is possible to move duplicate debug information entries,
616 strings and macro entries from several executables or shared
617 object files into a separate
618 \addtoindexi{\textit{supplementary object file}}{supplementary object file}
619 by some post-linking utility; the moved entries and strings can
621 from the debugging information of each of those executable or
624 This facilitates distribution of separate consolidated debug files in
628 A DWARF \addtoindex{supplementary object file} is itself an object file,
629 using the same object
630 file format, \byteorder{}, and size as the corresponding application executables
631 or shared libraries. It consists only of a file header, section table, and
632 a number of DWARF debug information sections. Both the
633 \addtoindex{supplementary object file}
634 and all the executable or shared object files that reference entries or strings in that
635 file must contain a \dotdebugsup{} section that establishes the relationship.
637 The \dotdebugsup{} section contains:
638 \begin{enumerate}[1. ]
639 \item \texttt{version} (\HFTuhalf) \\
640 \addttindexx{version}
641 A 2-byte unsigned integer representing the version of the DWARF
642 information for the compilation unit.
644 The value in this field is \versiondotdebugsup.
646 \item \texttt{is\_supplementary} (\HFTubyte) \\
647 \addttindexx{is\_supplementary}
648 A 1-byte unsigned integer, which contains the value 1 if it is
649 in the \addtoindex{supplementary object file} that other executable or
650 shared object files refer to, or 0 if it is an executable or shared object
651 referring to a \addtoindex{supplementary object file}.
654 \item \texttt{sup\_filename} (null terminated filename string) \\
655 \addttindexx{sup\_filename}
656 If \addttindex{is\_supplementary} is 0, this contains either an absolute
657 filename for the \addtoindex{supplementary object file}, or a filename
658 relative to the object file containing the \dotdebugsup{} section.
659 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
660 is not needed and must be an empty string (a single null byte).
663 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
664 \addttindexx{sup\_checksum\_len}
665 Length of the following \addttindex{sup\_checksum} field;
666 this value can be 0 if no checksum is provided.
668 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
669 \addttindexx{sup\_checksum}
670 An implementation-defined integer constant value that
671 provides unique identification of the supplementary file.
675 Debug information entries that refer to an executable's or shared
676 object's addresses must \emph{not} be moved to supplementary files
677 (the addesses will likely not be the same). Similarly,
678 entries referenced from within location descriptions or using loclistptr
679 form attributes must not be moved to a \addtoindex{supplementary object file}.
681 Executable or shared object file compilation units can use
682 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
683 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
684 attributes to refer to them and \DWFORMstrpsup{} form attributes to
685 refer to strings that are used by debug information of multiple
686 executables or shared object files. Within the \addtoindex{supplementary object file}'s
687 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
688 not used, and all reference forms referring to some other sections
689 refer to the local sections in the \addtoindex{supplementary object file}.
691 In macro information, \DWMACROdefinesup{} or
692 \DWMACROundefsup{} opcodes can refer to strings in the
693 \dotdebugstr{} section of the \addtoindex{supplementary object file},
694 or \DWMACROimportsup{}
695 can refer to \dotdebugmacro{} section entries. Within the
696 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
697 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
698 opcodes refer to the local \dotdebugstr{} section in that
699 supplementary file, not the one in
700 the executable or shared object file.
704 \section{32-Bit and 64-Bit DWARF Formats}
705 \label{datarep:32bitand64bitdwarfformats}
706 \hypertarget{datarep:xxbitdwffmt}{}
707 \addtoindexx{32-bit DWARF format}
708 \addtoindexx{64-bit DWARF format}
709 There are two closely-related DWARF
710 formats. In the 32-bit DWARF
711 format, all values that represent lengths of DWARF sections
712 and offsets relative to the beginning of DWARF sections are
713 represented using four bytes. In the 64-bit DWARF format, all
714 values that represent lengths of DWARF sections and offsets
715 relative to the beginning of DWARF sections are represented
716 using eight bytes. A special convention applies to the initial
717 length field of certain DWARF sections, as well as the CIE and
718 FDE structures, so that the 32-bit and 64-bit DWARF formats
719 can coexist and be distinguished within a single linked object.
721 Except where noted otherwise, all references in this document
722 to a debugging information section (for example, \dotdebuginfo),
723 apply also to the corresponding split DWARF section (for example,
726 The differences between the 32- and 64-bit DWARF formats are
727 detailed in the following:
728 \begin{enumerate}[1. ]
730 \item In the 32-bit DWARF format, an
731 \addtoindex{initial length} field (see
732 \addtoindexx{initial length!encoding}
733 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
734 is an unsigned 4-byte integer (which
735 must be less than \xfffffffzero); in the 64-bit DWARF format,
736 an \addtoindex{initial length} field is 12 bytes in size,
739 \item The first four bytes have the value \xffffffff.
741 \item The following eight bytes contain the actual length
742 represented as an unsigned 8-byte integer.
745 \textit{This representation allows a DWARF consumer to dynamically
746 detect that a DWARF section contribution is using the 64-bit
747 format and to adapt its processing accordingly.}
750 \item \hypertarget{datarep:sectionoffsetlength}{}
751 Section offset and section length
752 \addtoindexx{section length!use in headers}
754 \addtoindexx{section offset!use in headers}
755 in the headers of DWARF sections (other than initial length
756 \addtoindexx{initial length}
757 fields) are listed following. In the 32-bit DWARF format these
758 are 4-byte unsigned integer values; in the 64-bit DWARF format,
759 they are 8-byte unsigned integer values.
763 Section &Name & Role \\ \hline
764 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
765 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
766 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
767 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
768 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
769 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
775 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
776 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
777 union must be accessed to distinguish whether a CIE or FDE is
778 present, consequently, these two fields must exactly overlay
779 each other (both offset and size).
781 \item Within the body of the \dotdebuginfo{}
782 section, certain forms of attribute value depend on the choice
783 of DWARF format as follows. For the 32-bit DWARF format,
784 the value is a 4-byte unsigned integer; for the 64-bit DWARF
785 format, the value is an 8-byte unsigned integer.
787 \begin{tabular}{lp{6cm}}
788 Form & Role \\ \hline
789 \DWFORMlinestrp & offset in \dotdebuglinestr \\
790 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
791 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
792 \addtoindexx{supplementary object file}
793 \DWFORMsecoffset & offset in a section other than \\
794 & \dotdebuginfo{} or \dotdebugstr{} \\
795 \DWFORMstrp & offset in \dotdebugstr{} \\
796 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
797 \DWOPcallref & offset in \dotdebuginfo{} \\
802 \item Within the body of the \dotdebugline{} section, certain forms of content
803 description depend on the choice of DWARF format as follows: for the
804 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
805 64-bit DWARF format, the value is a 8-byte unsigned integer.
807 \begin{tabular}{lp{6cm}}
808 Form & Role \\ \hline
809 \DWFORMlinestrp & offset in \dotdebuglinestr
813 \item Within the body of the \dotdebugnames{}
814 sections, the representation of each entry in the array of
815 compilation units (CUs) and the array of local type units
816 (TUs), which represents an offset in the
818 section, depends on the DWARF format as follows: in the
819 32-bit DWARF format, each entry is a 4-byte unsigned integer;
820 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
823 \item In the body of the \dotdebugstroffsets{}
824 sections, the size of entries in the body depend on the DWARF
825 format as follows: in the 32-bit DWARF format, entries are 4-byte
826 unsigned integer values; in the 64-bit DWARF format, they are
827 8-byte unsigned integers.
829 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
830 sections, the contents of the address size fields depends on the
831 DWARF format as follows: in the 32-bit DWARF format, these fields
832 contain 4; in the 64-bit DWARF format these fields contain 8.
836 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
837 intermixed within a single compilation unit.
839 \textit{Attribute values and section header fields that represent
840 addresses in the target program are not affected by these
843 A DWARF consumer that supports the 64-bit DWARF format must
844 support executables in which some compilation units use the
845 32-bit format and others use the 64-bit format provided that
846 the combination links correctly (that is, provided that there
847 are no link\dash time errors due to truncation or overflow). (An
848 implementation is not required to guarantee detection and
849 reporting of all such errors.)
851 \textit{It is expected that DWARF producing compilers will \emph{not} use
852 the 64-bit format \emph{by default}. In most cases, the division of
853 even very large applications into a number of executable and
854 shared object files will suffice to assure that the DWARF sections
855 within each individual linked object are less than 4 GBytes
856 in size. However, for those cases where needed, the 64-bit
857 format allows the unusual case to be handled as well. Even
858 in this case, it is expected that only application supplied
859 objects will need to be compiled using the 64-bit format;
860 separate 32-bit format versions of system supplied shared
861 executable libraries can still be used.}
864 \section{Format of Debugging Information}
865 \label{datarep:formatofdebugginginformation}
867 For each compilation unit compiled with a DWARF producer,
868 a contribution is made to the \dotdebuginfo{} section of
869 the object file. Each such contribution consists of a
870 compilation unit header
871 (see Section \refersec{datarep:compilationunitheader})
873 single \DWTAGcompileunit{} or
874 \DWTAGpartialunit{} debugging
875 information entry, together with its children.
877 For each type defined in a compilation unit, a separate
878 contribution may also be made to the
880 section of the object file. Each
881 such contribution consists of a
882 \addtoindex{type unit} header
883 (see Section \refersec{datarep:typeunitheaders})
884 followed by a \DWTAGtypeunit{} entry, together with
887 Each debugging information entry begins with a code that
888 represents an entry in a separate
889 \addtoindex{abbreviations table}. This
890 code is followed directly by a series of attribute values.
892 The appropriate entry in the
893 \addtoindex{abbreviations table} guides the
894 interpretation of the information contained directly in the
895 \dotdebuginfo{} section.
898 Multiple debugging information entries may share the same
899 abbreviation table entry. Each compilation unit is associated
900 with a particular abbreviation table, but multiple compilation
901 units may share the same table.
903 \subsection{Unit Headers}
904 \label{datarep:unitheaders}
905 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
906 compilation unit that follows. The encodings for the unit type
907 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
911 \setlength{\extrarowheight}{0.1cm}
912 \begin{longtable}{l|c}
913 \caption{Unit header unit type encodings}
914 \label{tab:unitheaderunitkindencodings}
915 \addtoindexx{unit header unit type encodings} \\
916 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
918 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
920 \hline \emph{Continued on next page}
922 \hline \ddag\ \textit{New in DWARF Version 5}
924 \DWUTcompileTARG~\ddag &0x01 \\
925 \DWUTtypeTARG~\ddag &0x02 \\
926 \DWUTpartialTARG~\ddag &0x03 \\
928 \DWUTskeletonTARG~\ddag &0x04 \\
929 \DWUTsplitcompileTARG~\ddag &0x05 \\
930 \DWUTsplittypeTARG~\ddag &0x06 \\
931 \DWUTlouserTARG~\ddag &0x80 \\
932 \DWUThiuserTARG~\ddag &\xff
940 \textit{All unit headers in a compilation have the same size.
941 Some header types include padding bytes to achieve this.}
946 \subsubsection{Compilation and Partial Unit Headers}
947 \label{datarep:compilationunitheader}
948 \begin{enumerate}[1. ]
950 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
951 \addttindexx{unit\_length}
953 \addtoindexx{initial length}
954 unsigned integer representing the length
955 of the \dotdebuginfo{}
956 contribution for that compilation unit,
957 not including the length field itself. In the \thirtytwobitdwarfformat,
958 this is a 4-byte unsigned integer (which must be less
959 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
960 of the 4-byte value \wffffffff followed by an 8-byte unsigned
961 integer that gives the actual length
962 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
964 \item \texttt{version} (\HFTuhalf) \\
965 \addttindexx{version}
966 \addtoindexx{version number!compilation unit}
967 A 2-byte unsigned integer representing the version of the
968 DWARF information for the compilation unit.
970 The value in this field is \versiondotdebuginfo.
972 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
973 for a summary of all version numbers that apply to DWARF sections.}
976 \item \texttt{unit\_type} (\HFTubyte) \\
977 \addttindexx{unit\_type}
978 A 1-byte unsigned integer identifying this unit as a compilation unit.
979 The value of this field is
980 \DWUTcompile{} for a full compilation unit or
981 \DWUTpartial{} for a partial compilation unit
982 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
984 \textit{This field is new in \DWARFVersionV.}
987 \item \texttt{address\_size} (\HFTubyte) \\
988 \addttindexx{address\_size}
989 A 1-byte unsigned integer representing the size in bytes of
990 an address on the target architecture. If the system uses
991 \addtoindexx{address space!segmented}
992 segmented addressing, this value represents the size of the
993 offset portion of an address.
995 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
997 \addtoindexx{section offset!in .debug\_info header}
998 4-byte or 8-byte unsigned offset into the
1000 section. This offset associates the compilation unit with a
1001 particular set of debugging information entry abbreviations. In
1002 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1003 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1004 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1007 \item \HFNunitpaddingONE{} (8 bytes) \\
1008 Reserved to DWARF (must be zero).
1011 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1012 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1013 this is 4 bytes in length; in the \sixtyfourbitdwarfformat this
1014 is 8 bytes in length.
1020 \subsubsection{Skeleton and Split Compilation Unit Headers}
1021 \label{datarep:skeletonandfullcompilationunitheaders}
1022 \begin{enumerate}[1. ]
1024 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1025 \addttindexx{unit\_length}
1027 \addtoindexx{initial length}
1028 unsigned integer representing the length
1029 of the \dotdebuginfo{}
1030 contribution for that compilation unit,
1031 not including the length field itself. In the \thirtytwobitdwarfformat,
1032 this is a 4-byte unsigned integer (which must be less
1033 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1034 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1035 integer that gives the actual length
1036 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1038 \item \texttt{version} (\HFTuhalf) \\
1039 \addttindexx{version}
1040 \addtoindexx{version number!compilation unit}
1041 A 2-byte unsigned integer representing the version of the
1042 DWARF information for the compilation unit.
1044 The value in this field is \versiondotdebuginfo.
1046 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1047 for a summary of all version numbers that apply to DWARF sections.}
1050 \item \texttt{unit\_type} (\HFTubyte) \\
1051 \addttindexx{unit\_type}
1052 A 1-byte unsigned integer identifying this unit as a compilation unit.
1053 The value of this field is
1054 \DWUTskeleton{} for a skeleton compilation unit or
1055 \DWUTsplitcompile{} for a split compilation unit
1056 (see Section \refersec{chap:skeletoncompilationunitentries}).
1058 \textit{This field is new in \DWARFVersionV.}
1061 \item \texttt{address\_size} (\HFTubyte) \\
1062 \addttindexx{address\_size}
1063 A 1-byte unsigned integer representing the size in bytes of
1064 an address on the target architecture. If the system uses
1065 \addtoindexx{address space!segmented}
1066 segmented addressing, this value represents the size of the
1067 offset portion of an address.
1069 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1071 \addtoindexx{section offset!in .debug\_info header}
1072 4-byte or 8-byte unsigned offset into the
1074 section. This offset associates the compilation unit with a
1075 particular set of debugging information entry abbreviations. In
1076 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1077 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1078 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1081 \item \HFNdwoid{} (unit ID) \\
1082 An 8-byte implementation-defined integer constant value,
1083 known as the compilation unit ID, that provides
1084 unique identification of a skeleton compilation
1085 unit and its associated split compilation unit in
1086 the object file named in the \DWATdwoname{} attribute
1087 of the skeleton compilation.
1090 \item \HFNunitpaddingTWO{} (4 or 8 bytes) \\
1091 Reserved to DWARF (must be zero). In the \thirtytwobitdwarfformat,
1092 this is 4 bytes in length; in the \sixtyfourbitdwarfformat this
1093 is 8 bytes in length.
1098 \subsubsection{Type Unit Headers}
1099 \label{datarep:typeunitheaders}
1100 The header for the series of debugging information entries
1101 contributing to the description of a type that has been
1102 placed in its own \addtoindex{type unit}, within the
1103 \dotdebuginfo{} section,
1104 consists of the following information:
1105 \begin{enumerate}[1. ]
1106 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1107 \addttindexx{unit\_length}
1108 A 4-byte or 12-byte unsigned integer
1109 \addtoindexx{initial length}
1110 representing the length
1111 of the \dotdebuginfo{} contribution for that type unit,
1112 not including the length field itself. In the \thirtytwobitdwarfformat,
1113 this is a 4-byte unsigned integer (which must be
1114 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
1115 consists of the 4-byte value \wffffffff followed by an
1116 8-byte unsigned integer that gives the actual length
1117 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1120 \item \texttt{version} (\HFTuhalf) \\
1121 \addttindexx{version}
1122 \addtoindexx{version number!type unit}
1123 A 2-byte unsigned integer representing the version of the
1124 DWARF information for the type unit.
1126 The value in this field is \versiondotdebuginfo.
1128 \item \texttt{unit\_type} (\HFTubyte) \\
1129 \addttindexx{unit\_type}
1130 A 1-byte unsigned integer identifying this unit as a type unit.
1131 The value of this field is \DWUTtype{} for a
1136 (see Section \refersec{chap:typeunitentries})
1138 or \DWUTsplittype{} for a split type unit.
1141 \textit{This field is new in \DWARFVersionV.}
1144 \item \texttt{address\_size} (\HFTubyte) \\
1145 \addttindexx{address\_size}
1146 A 1-byte unsigned integer representing the size
1147 \addtoindexx{size of an address}
1149 an address on the target architecture. If the system uses
1150 \addtoindexx{address space!segmented}
1151 segmented addressing, this value represents the size of the
1152 offset portion of an address.
1155 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1157 \addtoindexx{section offset!in .debug\_info header}
1158 4-byte or 8-byte unsigned offset into the
1160 section. This offset associates the type unit with a
1161 particular set of debugging information entry abbreviations. In
1162 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1163 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1164 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1166 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1167 \addttindexx{type\_signature}
1168 \addtoindexx{type signature}
1169 A unique 8-byte signature (see Section
1170 \refersec{datarep:typesignaturecomputation})
1171 of the type described in this type
1174 \textit{An attribute that refers (using
1175 \DWFORMrefsigeight{}) to
1176 the primary type contained in this
1177 \addtoindex{type unit} uses this value.}
1180 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1181 \addttindexx{type\_offset}
1182 A 4-byte or 8-byte unsigned offset
1183 \addtoindexx{section offset!in .debug\_info header}
1184 relative to the beginning
1185 of the \addtoindex{type unit} header.
1186 This offset refers to the debugging
1187 information entry that describes the type. Because the type
1188 may be nested inside a namespace or other structures, and may
1189 contain references to other types that have not been placed in
1190 separate type units, it is not necessarily either the first or
1191 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1192 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1193 this is an 8-byte unsigned length
1194 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1198 \subsection{Debugging Information Entry}
1199 \label{datarep:debugginginformationentry}
1201 Each debugging information entry begins with an
1202 unsigned LEB128\addtoindexx{LEB128!unsigned}
1203 number containing the abbreviation code for the entry. This
1204 code represents an entry within the abbreviations table
1205 associated with the compilation unit containing this entry. The
1206 abbreviation code is followed by a series of attribute values.
1208 On some architectures, there are alignment constraints on
1209 section boundaries. To make it easier to pad debugging
1210 information sections to satisfy such constraints, the
1211 abbreviation code 0 is reserved. Debugging information entries
1212 consisting of only the abbreviation code 0 are considered
1215 \subsection{Abbreviations Tables}
1216 \label{datarep:abbreviationstables}
1218 The abbreviations tables for all compilation units
1219 are contained in a separate object file section called
1221 As mentioned before, multiple compilation
1222 units may share the same abbreviations table.
1224 The abbreviations table for a single compilation unit consists
1225 of a series of abbreviation declarations. Each declaration
1226 specifies the tag and attributes for a particular form of
1227 debugging information entry. Each declaration begins with
1228 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1229 number representing the abbreviation
1230 code itself. It is this code that appears at the beginning
1231 of a debugging information entry in the
1233 section. As described above, the abbreviation
1234 code 0 is reserved for null debugging information entries. The
1235 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1236 number that encodes the entry\textquoteright s tag. The encodings for the
1237 tag names are given in
1238 Table \refersec{tab:tagencodings}.
1242 \setlength{\extrarowheight}{0.1cm}
1243 \begin{longtable}{l|c}
1244 \caption{Tag encodings} \label{tab:tagencodings} \\
1245 \hline \bfseries Tag name&\bfseries Value\\ \hline
1247 \bfseries Tag name&\bfseries Value \\ \hline
1249 \hline \emph{Continued on next page}
1251 \hline \ddag\ \textit{New in DWARF Version 5}
1253 \DWTAGarraytype{} &0x01 \\
1254 \DWTAGclasstype&0x02 \\
1255 \DWTAGentrypoint&0x03 \\
1256 \DWTAGenumerationtype&0x04 \\
1257 \DWTAGformalparameter&0x05 \\
1258 \DWTAGimporteddeclaration&0x08 \\
1260 \DWTAGlexicalblock&0x0b \\
1261 \DWTAGmember&0x0d \\
1262 \DWTAGpointertype&0x0f \\
1263 \DWTAGreferencetype&0x10 \\
1264 \DWTAGcompileunit&0x11 \\
1265 \DWTAGstringtype&0x12 \\
1266 \DWTAGstructuretype&0x13 \\
1267 \DWTAGsubroutinetype&0x15 \\
1268 \DWTAGtypedef&0x16 \\
1269 \DWTAGuniontype&0x17 \\
1270 \DWTAGunspecifiedparameters&0x18 \\
1271 \DWTAGvariant&0x19 \\
1272 \DWTAGcommonblock&0x1a \\
1273 \DWTAGcommoninclusion&0x1b \\
1274 \DWTAGinheritance&0x1c \\
1275 \DWTAGinlinedsubroutine&0x1d \\
1276 \DWTAGmodule&0x1e \\
1277 \DWTAGptrtomembertype&0x1f \\
1278 \DWTAGsettype&0x20 \\
1279 \DWTAGsubrangetype&0x21 \\
1280 \DWTAGwithstmt&0x22 \\
1281 \DWTAGaccessdeclaration&0x23 \\
1282 \DWTAGbasetype&0x24 \\
1283 \DWTAGcatchblock&0x25 \\
1284 \DWTAGconsttype&0x26 \\
1285 \DWTAGconstant&0x27 \\
1286 \DWTAGenumerator&0x28 \\
1287 \DWTAGfiletype&0x29 \\
1288 \DWTAGfriend&0x2a \\
1289 \DWTAGnamelist&0x2b \\
1290 \DWTAGnamelistitem&0x2c \\
1291 \DWTAGpackedtype&0x2d \\
1292 \DWTAGsubprogram&0x2e \\
1293 \DWTAGtemplatetypeparameter&0x2f \\
1294 \DWTAGtemplatevalueparameter&0x30 \\
1295 \DWTAGthrowntype&0x31 \\
1296 \DWTAGtryblock&0x32 \\
1297 \DWTAGvariantpart&0x33 \\
1298 \DWTAGvariable&0x34 \\
1299 \DWTAGvolatiletype&0x35 \\
1300 \DWTAGdwarfprocedure&0x36 \\
1301 \DWTAGrestricttype&0x37 \\
1302 \DWTAGinterfacetype&0x38 \\
1303 \DWTAGnamespace&0x39 \\
1304 \DWTAGimportedmodule&0x3a \\
1305 \DWTAGunspecifiedtype&0x3b \\
1306 \DWTAGpartialunit&0x3c \\
1307 \DWTAGimportedunit&0x3d \\
1309 \textit{Reserved}&0x3e\footnote{Code 0x3e is reserved to allow backward compatible support of the
1310 DW\_TAG\_mutable\_type DIE that was defined (only) in \DWARFVersionIII.}
1313 \DWTAGcondition&\xiiif \\
1314 \DWTAGsharedtype&0x40 \\
1315 \DWTAGtypeunit & 0x41 \\
1316 \DWTAGrvaluereferencetype & 0x42 \\
1317 \DWTAGtemplatealias & 0x43 \\
1318 \DWTAGcoarraytype~\ddag & 0x44 \\
1319 \DWTAGgenericsubrange~\ddag & 0x45 \\
1320 \DWTAGdynamictype~\ddag & 0x46 \\
1321 \DWTAGatomictype~\ddag & 0x47 \\
1322 \DWTAGcallsite~\ddag & 0x48 \\
1323 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1325 \DWTAGskeletonunit~\ddag & 0x4a
1328 \DWTAGlouser&0x4080 \\
1329 \DWTAGhiuser&\xffff \\
1334 Following the tag encoding is a 1-byte value that determines
1335 whether a debugging information entry using this abbreviation
1336 has child entries or not. If the value is
1338 the next physically succeeding entry of any debugging
1339 information entry using this abbreviation is the first
1340 child of that entry. If the 1-byte value following the
1341 abbreviation\textquoteright s tag encoding is
1342 \DWCHILDRENnoTARG, the next
1343 physically succeeding entry of any debugging information entry
1344 using this abbreviation is a sibling of that entry. (Either
1345 the first child or sibling entries may be null entries). The
1346 encodings for the child determination byte are given in
1347 Table \refersec{tab:childdeterminationencodings}
1349 Section \refersec{chap:relationshipofdebugginginformationentries},
1350 each chain of sibling entries is terminated by a null entry.)
1354 \setlength{\extrarowheight}{0.1cm}
1355 \begin{longtable}{l|c}
1356 \caption{Child determination encodings}
1357 \label{tab:childdeterminationencodings}
1358 \addtoindexx{Child determination encodings} \\
1359 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1361 \bfseries Children determination name&\bfseries Value \\ \hline
1363 \hline \emph{Continued on next page}
1367 \DWCHILDRENno&0x00 \\
1368 \DWCHILDRENyes&0x01 \\ \hline
1373 Finally, the child encoding is followed by a series of
1374 attribute specifications. Each attribute specification
1375 consists of two parts. The first part is an
1376 unsigned LEB128\addtoindexx{LEB128!unsigned}
1377 number representing the attribute\textquoteright s name.
1378 The second part is an
1379 unsigned LEB128\addtoindexx{LEB128!unsigned}
1380 number representing the attribute\textquoteright s form.
1381 The series of attribute specifications ends with an
1382 entry containing 0 for the name and 0 for the form.
1386 \DWFORMindirectTARG{} is a special case. For
1387 attributes with this form, the attribute value itself in the
1389 section begins with an unsigned
1390 LEB128 number that represents its form. This allows producers
1391 to choose forms for particular attributes
1392 \addtoindexx{abbreviations table!dynamic forms in}
1394 without having to add a new entry to the abbreviations table.
1396 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1397 For attributes with this form, the attribute specification contains
1398 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1399 number. The value of this number is used as the value of the
1400 attribute, and no value is stored in the \dotdebuginfo{} section.
1402 The abbreviations for a given compilation unit end with an
1403 entry consisting of a 0 byte for the abbreviation code.
1406 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1407 for a depiction of the organization of the
1408 debugging information.}
1411 \subsection{Attribute Encodings}
1412 \label{datarep:attributeencodings}
1414 The encodings for the attribute names are given in
1415 Table \referfol{tab:attributeencodings}.
1418 \setlength{\extrarowheight}{0.1cm}
1419 \begin{longtable}{l|c|l}
1420 \caption{Attribute encodings}
1421 \label{tab:attributeencodings}
1422 \addtoindexx{attribute encodings} \\
1423 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1425 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1427 \hline \emph{Continued on next page}
1429 \hline \ddag\ \textit{New in DWARF Version 5}
1431 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1432 \addtoindexx{sibling attribute} \\
1433 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1434 \livelink{chap:classloclistptr}{loclistptr}
1435 \addtoindexx{location attribute} \\
1436 \DWATname&0x03&\livelink{chap:classstring}{string}
1437 \addtoindexx{name attribute} \\
1438 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1439 \addtoindexx{ordering attribute} \\
1440 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1441 \livelink{chap:classexprloc}{exprloc},
1442 \livelink{chap:classreference}{reference}
1443 \addtoindexx{byte size attribute} \\
1444 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1445 DW\_AT\_bit\_offset \mbox{attribute} which was
1446 defined in \DWARFVersionIII{} and earlier.}
1447 &\livelink{chap:classconstant}{constant},
1448 \livelink{chap:classexprloc}{exprloc},
1449 \livelink{chap:classreference}{reference}
1450 \addtoindexx{bit offset attribute (Version 3)}
1451 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1452 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1453 \livelink{chap:classexprloc}{exprloc},
1454 \livelink{chap:classreference}{reference}
1455 \addtoindexx{bit size attribute} \\
1456 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1457 \addtoindexx{statement list attribute} \\
1458 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1459 \addtoindexx{low PC attribute} \\
1460 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1461 \livelink{chap:classconstant}{constant}
1462 \addtoindexx{high PC attribute} \\
1463 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1464 \addtoindexx{language attribute} \\
1465 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1466 \addtoindexx{discriminant attribute} \\
1467 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1468 \addtoindexx{discriminant value attribute} \\
1469 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1470 \addtoindexx{visibility attribute} \\
1471 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1472 \addtoindexx{import attribute} \\
1473 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1474 \livelink{chap:classloclistptr}{loclistptr}
1475 \addtoindexx{string length attribute} \\
1476 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1477 \addtoindexx{common reference attribute} \\
1478 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1479 \addtoindexx{compilation directory attribute} \\
1480 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1481 \livelink{chap:classconstant}{constant},
1482 \livelink{chap:classstring}{string}
1483 \addtoindexx{constant value attribute} \\
1484 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1485 \addtoindexx{containing type attribute} \\
1486 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1487 \livelink{chap:classreference}{reference},
1488 \livelink{chap:classflag}{flag}
1489 \addtoindexx{default value attribute} \\
1490 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1491 \addtoindexx{inline attribute} \\
1492 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1493 \addtoindexx{is optional attribute} \\
1494 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1495 \livelink{chap:classexprloc}{exprloc},
1496 \livelink{chap:classreference}{reference}
1497 \addtoindexx{lower bound attribute} \\
1498 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1499 \addtoindexx{producer attribute} \\
1500 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1501 \addtoindexx{prototyped attribute} \\
1502 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1503 \livelink{chap:classloclistptr}{loclistptr}
1504 \addtoindexx{return address attribute} \\
1505 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1506 \livelink{chap:classrangelistptr}{rangelistptr}
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},
1534 \livelink{chap:classloclistptr}{loclistptr}
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},
1551 \livelink{chap:classloclistptr}{loclistptr}
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},
1567 \livelink{chap:classloclistptr}{loclistptr}
1568 \addtoindexx{segment attribute} \\
1569 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1570 \addtoindexx{specification attribute} \\
1571 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1572 \livelink{chap:classloclistptr}{loclistptr}
1573 \addtoindexx{static link attribute} \\
1574 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1575 \addtoindexx{type attribute} \\
1576 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1577 \livelink{chap:classloclistptr}{loclistptr}
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},
1584 \livelink{chap:classloclistptr}{loclistptr}
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} \\
1607 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1608 \addtoindexx{ranges attribute} \\
1609 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1610 \livelink{chap:classflag}{flag},
1611 \livelink{chap:classreference}{reference},
1612 \livelink{chap:classstring}{string}
1613 \addtoindexx{trampoline attribute} \\
1614 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1615 \addtoindexx{call column attribute} \\
1616 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1617 \addtoindexx{call file attribute} \\
1618 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1619 \addtoindexx{call line attribute} \\
1620 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1621 \addtoindexx{description attribute} \\
1622 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1623 \addtoindexx{binary scale attribute} \\
1624 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1625 \addtoindexx{decimal scale attribute} \\
1626 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1627 \addtoindexx{small attribute} \\
1628 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1629 \addtoindexx{decimal scale attribute} \\
1630 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1631 \addtoindexx{digit count attribute} \\
1632 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1633 \addtoindexx{picture string attribute} \\
1634 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1635 \addtoindexx{mutable attribute} \\
1636 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1637 \addtoindexx{thread scaled attribute} \\
1638 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1639 \addtoindexx{explicit attribute} \\
1640 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1641 \addtoindexx{object pointer attribute} \\
1642 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1643 \addtoindexx{endianity attribute} \\
1644 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1645 \addtoindexx{elemental attribute} \\
1646 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1647 \addtoindexx{pure attribute} \\
1648 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1649 \addtoindexx{recursive attribute} \\
1650 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1651 \addtoindexx{signature attribute} \\
1652 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1653 \addtoindexx{main subprogram attribute} \\
1654 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1655 \addtoindexx{data bit offset attribute} \\
1656 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1657 \addtoindexx{constant expression attribute} \\
1658 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1659 \addtoindexx{enumeration class attribute} \\
1660 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1661 \addtoindexx{linkage name attribute} \\
1662 \DWATstringlengthbitsize{}~\ddag&0x6f&
1663 \livelink{chap:classconstant}{constant}
1664 \addtoindexx{string length attribute!size of length} \\
1665 \DWATstringlengthbytesize{}~\ddag&0x70&
1666 \livelink{chap:classconstant}{constant}
1667 \addtoindexx{string length attribute!size of length} \\
1668 \DWATrank~\ddag&0x71&
1669 \livelink{chap:classconstant}{constant},
1670 \livelink{chap:classexprloc}{exprloc}
1671 \addtoindexx{rank attribute} \\
1672 \DWATstroffsetsbase~\ddag&0x72&
1673 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1674 \addtoindexx{string offsets base!encoding} \\
1675 \DWATaddrbase~\ddag &0x73&
1676 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1677 \addtoindexx{address table base!encoding} \\
1678 \DWATrangesbase~\ddag&0x74&
1679 \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class}
1680 \addtoindexx{ranges base!encoding} \\
1682 \textit{Reserved} &0x75& \textit{Unused}
1685 \DWATdwoname~\ddag &0x76&
1686 \livelink{chap:classstring}{string}
1687 \addtoindexx{split DWARF object file name!encoding} \\
1688 \DWATreference~\ddag &0x77&
1689 \livelink{chap:classflag}{flag} \\
1690 \DWATrvaluereference~\ddag &0x78&
1691 \livelink{chap:classflag}{flag} \\
1692 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1693 \addtoindexx{macro information attribute} \\
1694 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1695 \addtoindexx{all calls summary attribute} \\
1696 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1697 \addtoindexx{all source calls summary attribute} \\
1698 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1699 \addtoindexx{all tail calls summary attribute} \\
1700 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1701 \addtoindexx{call return PC attribute} \\
1702 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1703 \addtoindexx{call value attribute} \\
1704 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1705 \addtoindexx{call origin attribute} \\
1706 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1707 \addtoindexx{call parameter attribute} \\
1708 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1709 \addtoindexx{call PC attribute} \\
1710 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1711 \addtoindexx{call tail call attribute} \\
1712 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1713 \addtoindexx{call target attribute} \\
1714 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1715 \addtoindexx{call target clobbered attribute} \\
1716 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1717 \addtoindexx{call data location attribute} \\
1718 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1719 \addtoindexx{call data value attribute} \\
1720 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1721 \addtoindexx{noreturn attribute} \\
1722 \DWATalignment~\ddag &0x88 &\CLASSconstant
1723 \addtoindexx{alignment attribute} \\
1724 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1725 \addtoindexx{export symbols attribute} \\
1726 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1727 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1728 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1729 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1734 The attribute form governs how the value of the attribute is
1735 encoded. There are nine classes of form, listed below. Each
1736 class is a set of forms which have related representations
1737 and which are given a common interpretation according to the
1738 attribute in which the form is used.
1740 Form \DWFORMsecoffsetTARG{}
1742 \addtoindexx{rangelistptr class}
1744 \addtoindexx{macptr class}
1746 \addtoindexx{loclistptr class}
1748 \addtoindexx{lineptr class}
1754 \CLASSrangelistptr{} or
1755 \CLASSstroffsetsptr;
1756 the list of classes allowed by the applicable attribute in
1757 Table \refersec{tab:attributeencodings}
1758 determines the class of the form.
1761 In the form descriptions that follow, some forms are said
1762 to depend in part on the value of an attribute of the
1763 \definition{\associatedcompilationunit}:
1766 In the case of a \splitDWARFobjectfile{}, the associated
1767 compilation unit is the skeleton compilation unit corresponding
1768 to the containing unit.
1769 \item Otherwise, the associated compilation unit
1770 is the containing unit.
1774 Each possible form belongs to one or more of the following classes
1775 (see Table \refersec{tab:classesofattributevalue} for a summary of
1776 the purpose and general usage of each class):
1779 \item \livelinki{chap:classaddress}{address}{address class} \\
1780 \livetarg{datarep:classaddress}{}
1781 Represented as either:
1783 \item An object of appropriate size to hold an
1784 address on the target machine
1786 The size is encoded in the compilation unit header
1787 (see Section \refersec{datarep:compilationunitheader}).
1788 This address is relocatable in a relocatable object file and
1789 is relocated in an executable file or shared object file.
1791 \item An indirect index into a table of addresses (as
1792 described in the previous bullet) in the
1793 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1794 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1795 \addtoindex{LEB128} value, which is interpreted as a zero-based
1796 index into an array of addresses in the \dotdebugaddr{} section.
1797 The index is relative to the value of the \DWATaddrbase{} attribute
1798 of the associated compilation unit.
1803 \item \livelink{chap:classaddrptr}{addrptr} \\
1804 \livetarg{datarep:classaddrptr}{}
1805 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1806 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1807 beginning of the list of machine addresses information for the
1808 referencing entity. It is relocatable in
1809 a relocatable object file, and relocated in an executable or
1810 shared object file. In the \thirtytwobitdwarfformat, this offset
1811 is a 4-byte unsigned value; in the 64-bit DWARF
1812 format, it is an 8-byte unsigned value (see Section
1813 \refersec{datarep:32bitand64bitdwarfformats}).
1815 \textit{This class is new in \DWARFVersionV.}
1818 \item \livelink{chap:classblock}{block} \\
1819 \livetarg{datarep:classblock}{}
1820 Blocks come in four forms:
1823 A 1-byte length followed by 0 to 255 contiguous information
1824 bytes (\DWFORMblockoneTARG).
1827 A 2-byte length followed by 0 to 65,535 contiguous information
1828 bytes (\DWFORMblocktwoTARG).
1831 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1832 information bytes (\DWFORMblockfourTARG).
1835 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1836 length followed by the number of bytes
1837 specified by the length (\DWFORMblockTARG).
1840 In all forms, the length is the number of information bytes
1841 that follow. The information bytes may contain any mixture
1842 of relocated (or relocatable) addresses, references to other
1843 debugging information entries or data bytes.
1845 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1846 \livetarg{datarep:classconstant}{}
1847 There are eight forms of constants. There are fixed length
1848 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1852 \DWFORMdatafourTARG,
1853 \DWFORMdataeightTARG{} and
1854 \DWFORMdatasixteenTARG).
1855 There are variable length constant
1856 data forms encoded using
1857 signed LEB128 numbers (\DWFORMsdataTARG) and unsigned
1858 LEB128 numbers (\DWFORMudataTARG).
1859 There is also an implicit constant (\DWFORMimplicitconst),
1860 whose value is provided as part of the abbreviation
1864 The data in \DWFORMdataone,
1867 \DWFORMdataeight{} and
1868 \DWFORMdatasixteen{}
1869 can be anything. Depending on context, it may
1870 be a signed integer, an unsigned integer, a floating\dash point
1871 constant, or anything else. A consumer must use context to
1872 know how to interpret the bits, which if they are target
1873 machine data (such as an integer or floating-point constant)
1874 will be in target machine \byteorder.
1876 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1877 forms is used to represent a
1878 signed or unsigned integer, it can be hard for a consumer
1879 to discover the context necessary to determine which
1880 interpretation is intended. Producers are therefore strongly
1881 encouraged to use \DWFORMsdata{} or
1882 \DWFORMudata{} for signed and
1883 unsigned integers respectively, rather than
1884 \DWFORMdata\textless n\textgreater.}
1887 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1888 \livetarg{datarep:classexprloc}{}
1889 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1890 number of information bytes specified by the length
1891 (\DWFORMexprlocTARG).
1892 The information bytes contain a DWARF expression
1893 (see Section \refersec{chap:dwarfexpressions})
1894 or location description
1895 (see Section \refersec{chap:locationdescriptions}).
1898 \item \livelinki{chap:classflag}{flag}{flag class} \\
1899 \livetarg{datarep:classflag}{}
1900 A flag \addtoindexx{flag class}
1901 is represented explicitly as a single byte of data
1902 (\DWFORMflagTARG) or
1903 implicitly (\DWFORMflagpresentTARG).
1905 first case, if the \nolink{flag} has value zero, it indicates the
1906 absence of the attribute; if the \nolink{flag} has a non-zero value,
1907 it indicates the presence of the attribute. In the second
1908 case, the attribute is implicitly indicated as present, and
1909 no value is encoded in the debugging information entry itself.
1912 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1913 \livetarg{datarep:classlineptr}{}
1914 This is an offset into
1915 \addtoindexx{section offset!in class lineptr value}
1917 \dotdebugline{} or \dotdebuglinedwo{} section
1919 It consists of an offset from the beginning of the
1921 section to the first byte of
1922 the data making up the line number list for the compilation
1924 It is relocatable in a relocatable object file, and
1925 relocated in an executable or shared object file. In the
1926 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1927 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1928 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1931 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1932 \livetarg{datarep:classloclistptr}{}
1933 This is an offset into the
1937 It consists of an offset from the
1938 \addtoindexx{section offset!in class loclistptr value}
1941 section to the first byte of
1942 the data making up the
1943 \addtoindex{location list} for the compilation unit.
1944 It is relocatable in a relocatable object file, and
1945 relocated in an executable or shared object file. In the
1946 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1947 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1948 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1951 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1952 \livetarg{datarep:classmacptr}{}
1954 \addtoindexx{section offset!in class macptr value}
1956 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1958 It consists of an offset from the beginning of the
1959 \dotdebugmacro{} or \dotdebugmacrodwo{}
1960 section to the the header making up the
1961 macro information list for the compilation unit.
1962 It is relocatable in a relocatable object file, and
1963 relocated in an executable or shared object file. In the
1964 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1965 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1966 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1969 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1970 \livetarg{datarep:classrangelistptr}{}
1972 \addtoindexx{section offset!in class rangelistptr value}
1973 offset into the \dotdebugranges{} section
1976 offset from the beginning of the
1977 \dotdebugranges{} section
1978 to the beginning of the non-contiguous address ranges
1979 information for the referencing entity.
1980 It is relocatable in
1981 a relocatable object file, and relocated in an executable or
1983 However, if a \DWATrangesbase{} attribute applies, the offset
1984 is relative to the base offset given by \DWATrangesbase.
1985 In the \thirtytwobitdwarfformat, this offset
1986 is a 4-byte unsigned value; in the 64-bit DWARF
1987 format, it is an 8-byte unsigned value (see Section
1988 \refersec{datarep:32bitand64bitdwarfformats}).
1991 \textit{Because classes
1996 \CLASSrangelistptr{} and
1997 \CLASSstroffsetsptr{}
1998 share a common representation, it is not possible for an
1999 attribute to allow more than one of these classes}
2003 \item \livelinki{chap:classreference}{reference}{reference class} \\
2004 \livetarg{datarep:classreference}{}
2005 There are four types of reference.
2008 \addtoindexx{reference class}
2009 first type of reference can identify any debugging
2010 information entry within the containing unit.
2013 \addtoindexx{section offset!in class reference value}
2014 offset from the first byte of the compilation
2015 header for the compilation unit containing the reference. There
2016 are five forms for this type of reference. There are fixed
2017 length forms for one, two, four and eight byte offsets
2023 and \DWFORMrefeightTARG).
2024 There is also an unsigned variable
2025 length offset encoded form that uses
2026 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
2027 (\DWFORMrefudataTARG).
2028 Because this type of reference is within
2029 the containing compilation unit no relocation of the value
2032 The second type of reference can identify any debugging
2033 information entry within a
2034 \dotdebuginfo{} section; in particular,
2035 it may refer to an entry in a different compilation unit
2036 from the unit containing the reference, and may refer to an
2037 entry in a different shared object file. This type of reference
2038 (\DWFORMrefaddrTARG)
2039 is an offset from the beginning of the
2041 section of the target executable or shared object file, or, for
2042 references within a \addtoindex{supplementary object file},
2043 an offset from the beginning of the local \dotdebuginfo{} section;
2044 it is relocatable in a relocatable object file and frequently
2045 relocated in an executable or shared object file. For
2046 references from one shared object or static executable file
2047 to another, the relocation and identification of the target
2048 object must be performed by the consumer. In the
2049 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2050 in the \sixtyfourbitdwarfformat, it is an 8-byte
2052 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2054 \textit{A debugging information entry that may be referenced by
2055 another compilation unit using
2056 \DWFORMrefaddr{} must have a global symbolic name.}
2058 \textit{For a reference from one executable or shared object file to
2059 another, the reference is resolved by the debugger to identify
2060 the executable or shared object file and the offset into that
2061 file\textquoteright s \dotdebuginfo{}
2062 section in the same fashion as the run
2063 time loader, either when the debug information is first read,
2064 or when the reference is used.}
2066 The third type of reference can identify any debugging
2067 information type entry that has been placed in its own
2068 \addtoindex{type unit}. This type of
2069 reference (\DWFORMrefsigeightTARG) is the
2070 \addtoindexx{type signature}
2071 8-byte type signature
2072 (see Section \refersec{datarep:typesignaturecomputation})
2073 that was computed for the type.
2075 The fourth type of reference is a reference from within the
2076 \dotdebuginfo{} section of the executable or shared object file to
2077 a debugging information entry in the \dotdebuginfo{} section of
2078 a \addtoindex{supplementary object file}.
2079 This type of reference (\DWFORMrefsupTARG) is an offset from the
2080 beginning of the \dotdebuginfo{} section in the
2081 \addtoindex{supplementary object file}.
2083 \textit{The use of compilation unit relative references will reduce the
2084 number of link\dash time relocations and so speed up linking. The
2085 use of the second, third and fourth type of reference allows for the
2086 sharing of information, such as types, across compilation
2087 units, while the fourth type further allows for sharing of information
2088 across compilation units from different executables or shared object files.}
2090 \textit{A reference to any kind of compilation unit identifies the
2091 debugging information entry for that unit, not the preceding
2095 \item \livelinki{chap:classstring}{string}{string class} \\
2096 \livetarg{datarep:classstring}{}
2097 A string is a sequence of contiguous non\dash null bytes followed by
2099 \addtoindexx{string class}
2100 A string may be represented:
2102 \setlength{\itemsep}{0em}
2103 \item immediately in the debugging information entry itself
2104 (\DWFORMstringTARG),
2107 \addtoindexx{section offset!in class string value}
2108 offset into a string table contained in
2109 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
2110 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
2111 or as an offset into a string table contained in the
2112 \dotdebugstr{} section of a \addtoindex{supplementary object file}
2113 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
2114 section of a \addtoindex{supplementary object file}
2115 refer to the local \dotdebugstr{} section of that same file.
2116 In the \thirtytwobitdwarfformat, the representation of a
2117 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
2118 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2119 it is an 8-byte unsigned offset
2120 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2123 \item as an indirect offset into the string table using an
2124 index into a table of offsets contained in the
2125 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
2126 The representation of a \DWFORMstrxNAME{} value is an unsigned
2127 \addtoindex{LEB128} value, which is interpreted as a zero-based
2128 index into an array of offsets in the \dotdebugstroffsets{} section.
2129 The offset entries in the \dotdebugstroffsets{} section have the
2130 same representation as \DWFORMstrp{} values.
2132 Any combination of these three forms may be used within a single compilation.
2134 If the \DWATuseUTFeight{}
2135 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
2136 compilation, partial, skeleton or type unit entry, string values are encoded using the
2137 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
2138 Character Set standard (ISO/IEC 10646\dash 1:1993).
2139 \addtoindexx{ISO 10646 character set standard}
2140 Otherwise, the string representation is unspecified.
2142 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
2143 ISO/IEC 10646\dash 1:1993.
2144 \addtoindexx{ISO 10646 character set standard}
2145 It contains all the same characters
2146 and encoding points as ISO/IEC 10646, as well as additional
2147 information about the characters and their use.}
2149 \textit{Earlier versions of DWARF did not specify the representation
2150 of strings; for compatibility, this version also does
2151 not. However, the UTF\dash 8 representation is strongly recommended.}
2154 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
2155 \livetarg{datarep:classstroffsetsptr}{}
2156 This is an offset into the \dotdebugstroffsets{} section
2157 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2158 \dotdebugstroffsets{} section to the
2159 beginning of the string offsets information for the
2160 referencing entity. It is relocatable in
2161 a relocatable object file, and relocated in an executable or
2162 shared object file. In the \thirtytwobitdwarfformat, this offset
2163 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2164 it is an 8-byte unsigned value (see Section
2165 \refersec{datarep:32bitand64bitdwarfformats}).
2167 \textit{This class is new in \DWARFVersionV.}
2171 In no case does an attribute use one of the classes
2176 \CLASSrangelistptr{} or
2177 \CLASSstroffsetsptr{}
2178 to point into either the
2179 \dotdebuginfo{} or \dotdebugstr{} section.
2181 The form encodings are listed in
2182 Table \referfol{tab:attributeformencodings}.
2186 \setlength{\extrarowheight}{0.1cm}
2187 \begin{longtable}{l|c|l}
2188 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2189 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2191 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2193 \hline \emph{Continued on next page}
2195 \hline \ddag\ \textit{New in DWARF Version 5}
2198 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2199 \textit{Reserved} &0x02& \\
2200 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2201 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2202 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2203 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2204 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2205 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2206 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2207 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2208 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2209 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2210 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2211 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2212 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2213 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2214 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2215 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2216 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2217 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2218 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2219 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2220 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
2221 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
2222 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2223 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2224 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2225 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2226 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2227 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2228 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2229 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2230 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2231 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2237 \section{Variable Length Data}
2238 \label{datarep:variablelengthdata}
2239 \addtoindexx{variable length data|see {LEB128}}
2241 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2242 encoded using \doublequote{Little-Endian Base 128}
2243 \addtoindexx{little-endian encoding|see{endian attribute}}
2245 \addtoindexx{LEB128}
2246 LEB128 is a scheme for encoding integers
2247 densely that exploits the assumption that most integers are
2250 \textit{This encoding is equally suitable whether the target machine
2251 architecture represents data in big-endian or little-endian
2252 \byteorder. It is \doublequote{little-endian} only in the sense that it
2253 avoids using space to represent the \doublequote{big} end of an
2254 unsigned integer, when the big end is all zeroes or sign
2257 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2258 numbers are encoded as follows:
2259 \addtoindexx{LEB128!unsigned, encoding as}
2260 start at the low order end of an unsigned integer and chop
2261 it into 7-bit chunks. Place each chunk into the low order 7
2262 bits of a byte. Typically, several of the high order bytes
2263 will be zero; discard them. Emit the remaining bytes in a
2264 stream, starting with the low order byte; set the high order
2265 bit on each byte except the last emitted byte. The high bit
2266 of zero on the last byte indicates to the decoder that it
2267 has encountered the last byte.
2269 The integer zero is a special case, consisting of a single
2272 Table \refersec{tab:examplesofunsignedleb128encodings}
2273 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2275 0x80 in each case is the high order bit of the byte, indicating
2276 that an additional byte follows.
2279 The encoding for signed, two\textquoteright{s} complement LEB128
2280 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2281 numbers is similar, except that the criterion for discarding
2282 high order bytes is not whether they are zero, but whether
2283 they consist entirely of sign extension bits. Consider the
2284 4-byte integer -2. The three high level bytes of the number
2285 are sign extension, thus LEB128 would represent it as a single
2286 byte containing the low order 7 bits, with the high order
2287 bit cleared to indicate the end of the byte stream. Note
2288 that there is nothing within the LEB128 representation that
2289 indicates whether an encoded number is signed or unsigned. The
2290 decoder must know what type of number to expect.
2291 Table \refersec{tab:examplesofunsignedleb128encodings}
2292 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2293 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2294 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2297 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2298 \addtoindexx{LEB128!examples}
2299 gives algorithms for encoding and decoding these forms.}
2303 \setlength{\extrarowheight}{0.1cm}
2304 \begin{longtable}{c|c|c}
2305 \caption{Examples of unsigned LEB128 encodings}
2306 \label{tab:examplesofunsignedleb128encodings}
2307 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2308 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2310 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2312 \hline \emph{Continued on next page}
2318 128& 0 + 0x80 & 1 \\
2319 129& 1 + 0x80 & 1 \\
2320 %130& 2 + 0x80 & 1 \\
2321 12857& 57 + 0x80 & 100 \\
2328 \setlength{\extrarowheight}{0.1cm}
2329 \begin{longtable}{c|c|c}
2330 \caption{Examples of signed LEB128 encodings}
2331 \label{tab:examplesofsignedleb128encodings}
2332 \addtoindexx{LEB128!signed} \\
2333 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2335 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2337 \hline \emph{Continued on next page}
2343 127& 127 + 0x80 & 0 \\
2344 -127& 1 + 0x80 & 0x7f \\
2345 128& 0 + 0x80 & 1 \\
2346 -128& 0 + 0x80 & 0x7f \\
2347 129& 1 + 0x80 & 1 \\
2348 -129& 0x7f + 0x80 & 0x7e \\
2355 \section{DWARF Expressions and Location Descriptions}
2356 \label{datarep:dwarfexpressionsandlocationdescriptions}
2357 \subsection{DWARF Expressions}
2358 \label{datarep:dwarfexpressions}
2361 \addtoindexx{DWARF expression!operator encoding}
2362 DWARF expression is stored in a \nolink{block} of contiguous
2363 bytes. The bytes form a sequence of operations. Each operation
2364 is a 1-byte code that identifies that operation, followed by
2365 zero or more bytes of additional data. The encodings for the
2366 operations are described in
2367 Table \refersec{tab:dwarfoperationencodings}.
2370 \setlength{\extrarowheight}{0.1cm}
2371 \begin{longtable}{l|c|c|l}
2372 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2373 \hline & &\bfseries No. of &\\
2374 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2376 & &\bfseries No. of &\\
2377 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2379 \hline \emph{Continued on next page}
2381 \hline \ddag\ \textit{New in DWARF Version 5}
2384 \DWOPaddr&0x03&1 & constant address \\
2385 & & &(size is target specific) \\
2387 \DWOPderef&0x06&0 & \\
2389 \DWOPconstoneu&0x08&1&1-byte constant \\
2390 \DWOPconstones&0x09&1&1-byte constant \\
2391 \DWOPconsttwou&0x0a&1&2-byte constant \\
2392 \DWOPconsttwos&0x0b&1&2-byte constant \\
2393 \DWOPconstfouru&0x0c&1&4-byte constant \\
2394 \DWOPconstfours&0x0d&1&4-byte constant \\
2395 \DWOPconsteightu&0x0e&1&8-byte constant \\
2396 \DWOPconsteights&0x0f&1&8-byte constant \\
2397 \DWOPconstu&0x10&1&ULEB128 constant \\
2398 \DWOPconsts&0x11&1&SLEB128 constant \\
2399 \DWOPdup&0x12&0 & \\
2400 \DWOPdrop&0x13&0 & \\
2401 \DWOPover&0x14&0 & \\
2402 \DWOPpick&0x15&1&1-byte stack index \\
2403 \DWOPswap&0x16&0 & \\
2404 \DWOProt&0x17&0 & \\
2405 \DWOPxderef&0x18&0 & \\
2406 \DWOPabs&0x19&0 & \\
2407 \DWOPand&0x1a&0 & \\
2408 \DWOPdiv&0x1b&0 & \\
2409 \DWOPminus&0x1c&0 & \\
2410 \DWOPmod&0x1d&0 & \\
2411 \DWOPmul&0x1e&0 & \\
2412 \DWOPneg&0x1f&0 & \\
2413 \DWOPnot&0x20&0 & \\
2415 \DWOPplus&0x22&0 & \\
2416 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2417 \DWOPshl&0x24&0 & \\
2418 \DWOPshr&0x25&0 & \\
2419 \DWOPshra&0x26&0 & \\
2420 \DWOPxor&0x27&0 & \\
2422 \DWOPbra&0x28&1 & signed 2-byte constant \\
2429 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2431 \DWOPlitzero & 0x30 & 0 & \\
2432 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2433 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2434 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2436 \DWOPregzero & 0x50 & 0 & \\*
2437 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2438 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2439 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2441 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2442 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2443 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2444 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2446 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2447 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2448 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2449 & & &SLEB128 offset \\
2450 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2451 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2452 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2453 \DWOPnop{} & 0x96 &0& \\
2455 \DWOPpushobjectaddress&0x97&0 & \\
2456 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2457 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2458 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2459 \DWOPformtlsaddress&0x9b &0& \\
2460 \DWOPcallframecfa{} &0x9c &0& \\
2461 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2463 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2464 &&&\nolink{block} of that size\\
2465 \DWOPstackvalue{} &0x9f &0& \\
2466 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2467 &&&SLEB128 constant offset \\
2468 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2469 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2470 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2471 &&&\nolink{block} of that size\\
2472 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2473 & & & 1-byte size, \\*
2474 & & & constant value \\
2475 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2476 &&& ULEB128 constant offset \\
2477 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2478 &&& ULEB128 type entry offset \\
2479 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2480 &&& ULEB128 type entry offset \\
2481 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2482 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2483 \DWOPlouser{} &0xe0 && \\
2484 \DWOPhiuser{} &\xff && \\
2490 \subsection{Location Descriptions}
2491 \label{datarep:locationdescriptions}
2493 A location description is used to compute the
2494 location of a variable or other entity.
2496 \subsection{Location Lists}
2497 \label{datarep:locationlists}
2499 Each entry in a \addtoindex{location list} is either a location list entry,
2500 a base address selection entry, or an
2501 \addtoindexx{end-of-list entry!in location list}
2505 \subsubsection{Location List Entries in Non-Split Objects}
2506 A \addtoindex{location list} entry consists of two address offsets followed
2507 by an unsigned 2-byte length, followed by a block of contiguous bytes
2508 that contains a DWARF location description. The length
2509 specifies the number of bytes in that block. The two offsets
2510 are the same size as an address on the target machine.
2513 A base address selection entry and an
2514 \addtoindexx{end-of-list entry!in location list}
2515 end-of-list entry each
2516 consist of two (constant or relocated) address offsets. The two
2517 offsets are the same size as an address on the target machine.
2519 For a \addtoindex{location list} to be specified, the base address of
2520 \addtoindexx{base address selection entry!in location list}
2521 the corresponding compilation unit must be defined
2522 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
2524 \subsubsection{Location List Entries in Split Objects}
2525 \label{datarep:locationlistentriesinsplitobjects}
2526 An alternate form for location list entries is used in split objects.
2527 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2528 that follows. The encodings for these constants are given in
2529 Table \refersec{tab:locationlistentryencodingvalues}.
2533 \setlength{\extrarowheight}{0.1cm}
2534 \begin{longtable}{l|c}
2535 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2536 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2538 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2540 \hline \emph{Continued on next page}
2544 \DWLLEendoflistentry & 0x0 \\
2545 \DWLLEbaseaddressselectionentry & 0x01 \\
2546 \DWLLEstartendentry & 0x02 \\
2547 \DWLLEstartlengthentry & 0x03 \\
2548 \DWLLEoffsetpairentry & 0x04 \\
2552 \section{Base Type Attribute Encodings}
2553 \label{datarep:basetypeattributeencodings}
2555 The\hypertarget{chap:DWATencodingencodingofbasetype}{}
2556 encodings of the constants used in the
2557 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2559 Table \refersec{tab:basetypeencodingvalues}
2562 \setlength{\extrarowheight}{0.1cm}
2563 \begin{longtable}{l|c}
2564 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2565 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2567 \bfseries Base type encoding name&\bfseries Value\\ \hline
2569 \hline \emph{Continued on next page}
2572 \ddag \ \textit{New in \DWARFVersionV}
2574 \DWATEaddress&0x01 \\
2575 \DWATEboolean&0x02 \\
2576 \DWATEcomplexfloat&0x03 \\
2578 \DWATEsigned&0x05 \\
2579 \DWATEsignedchar&0x06 \\
2580 \DWATEunsigned&0x07 \\
2581 \DWATEunsignedchar&0x08 \\
2582 \DWATEimaginaryfloat&0x09 \\
2583 \DWATEpackeddecimal&0x0a \\
2584 \DWATEnumericstring&0x0b \\
2585 \DWATEedited&0x0c \\
2586 \DWATEsignedfixed&0x0d \\
2587 \DWATEunsignedfixed&0x0e \\
2588 \DWATEdecimalfloat & 0x0f \\
2589 \DWATEUTF{} & 0x10 \\
2590 \DWATEUCS~\ddag & 0x11 \\
2591 \DWATEASCII~\ddag & 0x12 \\
2592 \DWATElouser{} & 0x80 \\
2593 \DWATEhiuser{} & \xff \\
2598 The encodings of the constants used in the
2599 \DWATdecimalsign{} attribute
2601 Table \refersec{tab:decimalsignencodings}.
2604 \setlength{\extrarowheight}{0.1cm}
2605 \begin{longtable}{l|c}
2606 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2607 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2609 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2611 % \hline \emph{Continued on next page}
2615 \DWDSunsigned{} & 0x01 \\
2616 \DWDSleadingoverpunch{} & 0x02 \\
2617 \DWDStrailingoverpunch{} & 0x03 \\
2618 \DWDSleadingseparate{} & 0x04 \\
2619 \DWDStrailingseparate{} & 0x05 \\
2624 The encodings of the constants used in the
2625 \DWATendianity{} attribute are given in
2626 Table \refersec{tab:endianityencodings}.
2629 \setlength{\extrarowheight}{0.1cm}
2630 \begin{longtable}{l|c}
2631 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2632 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2634 \bfseries Endian code name&\bfseries Value\\ \hline
2636 \hline \emph{Continued on next page}
2641 \DWENDdefault{} & 0x00 \\
2642 \DWENDbig{} & 0x01 \\
2643 \DWENDlittle{} & 0x02 \\
2644 \DWENDlouser{} & 0x40 \\
2645 \DWENDhiuser{} & \xff \\
2651 \section{Accessibility Codes}
2652 \label{datarep:accessibilitycodes}
2653 The encodings of the constants used in the
2654 \DWATaccessibility{}
2656 \addtoindexx{accessibility attribute}
2658 Table \refersec{tab:accessibilityencodings}.
2661 \setlength{\extrarowheight}{0.1cm}
2662 \begin{longtable}{l|c}
2663 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2664 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2666 \bfseries Accessibility code name&\bfseries Value\\ \hline
2668 \hline \emph{Continued on next page}
2673 \DWACCESSpublic&0x01 \\
2674 \DWACCESSprotected&0x02 \\
2675 \DWACCESSprivate&0x03 \\
2681 \section{Visibility Codes}
2682 \label{datarep:visibilitycodes}
2683 The encodings of the constants used in the
2684 \DWATvisibility{} attribute are given in
2685 Table \refersec{tab:visibilityencodings}.
2688 \setlength{\extrarowheight}{0.1cm}
2689 \begin{longtable}{l|c}
2690 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2691 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2693 \bfseries Visibility code name&\bfseries Value\\ \hline
2695 \hline \emph{Continued on next page}
2701 \DWVISexported&0x02 \\
2702 \DWVISqualified&0x03 \\
2707 \section{Virtuality Codes}
2708 \label{datarep:vitualitycodes}
2710 The encodings of the constants used in the
2711 \DWATvirtuality{} attribute are given in
2712 Table \refersec{tab:virtualityencodings}.
2715 \setlength{\extrarowheight}{0.1cm}
2716 \begin{longtable}{l|c}
2717 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2718 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2720 \bfseries Virtuality code name&\bfseries Value\\ \hline
2722 \hline \emph{Continued on next page}
2727 \DWVIRTUALITYnone&0x00 \\
2728 \DWVIRTUALITYvirtual&0x01 \\
2729 \DWVIRTUALITYpurevirtual&0x02 \\
2736 \DWVIRTUALITYnone{} is equivalent to the absence of the
2740 \section{Source Languages}
2741 \label{datarep:sourcelanguages}
2743 The encodings of the constants used
2744 \addtoindexx{language attribute, encoding}
2746 \addtoindexx{language name encoding}
2749 attribute are given in
2750 Table \refersec{tab:languageencodings}.
2752 % If we don't force a following space it looks odd
2754 and their associated values are reserved, but the
2755 languages they represent are not well supported.
2756 Table \refersec{tab:languageencodings}
2758 \addtoindexx{lower bound attribute!default}
2759 default lower bound, if any, assumed for
2760 an omitted \DWATlowerbound{} attribute in the context of a
2761 \DWTAGsubrangetype{} debugging information entry for each
2765 \setlength{\extrarowheight}{0.1cm}
2766 \begin{longtable}{l|c|c}
2767 \caption{Language encodings} \label{tab:languageencodings}\\
2768 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2770 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2772 \hline \emph{Continued on next page}
2775 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2777 \addtoindexx{ISO-defined language names}
2779 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2780 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2781 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2782 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++98 (ISO)} \\
2783 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2784 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2785 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2786 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2787 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2788 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2789 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2790 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2791 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2792 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2793 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2794 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2795 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2796 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2797 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2798 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2799 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2800 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2801 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2802 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2803 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++03 (ISO)}\\
2804 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++11 (ISO)} \\
2805 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2806 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2807 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2808 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2809 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2810 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2811 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++14 (ISO)} \\
2812 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2813 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2815 \DWLANGRenderScript{}~\ddag &0x0024 &0 \addtoindexx{RenderScript Kernel Language}
2818 \DWLANGlouser{} &0x8000 & \\
2819 \DWLANGhiuser{} &\xffff & \\
2824 \section{Address Class Encodings}
2825 \label{datarep:addressclassencodings}
2827 The value of the common
2828 \addtoindex{address class} encoding
2832 \section{Identifier Case}
2833 \label{datarep:identifiercase}
2835 The encodings of the constants used in the
2836 \DWATidentifiercase{} attribute are given in
2837 Table \refersec{tab:identifiercaseencodings}.
2841 \setlength{\extrarowheight}{0.1cm}
2842 \begin{longtable}{l|c}
2843 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2844 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2846 \bfseries Identifier case name&\bfseries Value\\ \hline
2848 \hline \emph{Continued on next page}
2852 \DWIDcasesensitive&0x00 \\
2854 \DWIDdowncase&0x02 \\
2855 \DWIDcaseinsensitive&0x03 \\
2859 \section{Calling Convention Encodings}
2860 \label{datarep:callingconventionencodings}
2861 The encodings of the constants used in the
2862 \DWATcallingconvention{} attribute are given in
2863 Table \refersec{tab:callingconventionencodings}.
2866 \setlength{\extrarowheight}{0.1cm}
2867 \begin{longtable}{l|c}
2868 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2869 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2871 \bfseries Calling convention name&\bfseries Value\\ \hline
2873 \hline \emph{Continued on next page}
2875 \hline \ddag\ \textit{New in DWARF Version 5}
2878 \DWCCnormal &0x01 \\
2879 \DWCCprogram&0x02 \\
2880 \DWCCnocall &0x03 \\
2881 \DWCCpassbyreference~\ddag &0x04 \\
2882 \DWCCpassbyvalue~\ddag &0x05 \\
2883 \DWCClouser &0x40 \\
2890 \section{Inline Codes}
2891 \label{datarep:inlinecodes}
2893 The encodings of the constants used in
2894 \addtoindexx{inline attribute}
2896 \DWATinline{} attribute are given in
2897 Table \refersec{tab:inlineencodings}.
2901 \setlength{\extrarowheight}{0.1cm}
2902 \begin{longtable}{l|c}
2903 \caption{Inline encodings} \label{tab:inlineencodings}\\
2904 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2906 \bfseries Inline Code name&\bfseries Value\\ \hline
2908 \hline \emph{Continued on next page}
2913 \DWINLnotinlined&0x00 \\
2914 \DWINLinlined&0x01 \\
2915 \DWINLdeclarednotinlined&0x02 \\
2916 \DWINLdeclaredinlined&0x03 \\
2921 % this clearpage is ugly, but the following table came
2922 % out oddly without it.
2924 \section{Array Ordering}
2925 \label{datarep:arrayordering}
2927 The encodings of the constants used in the
2928 \DWATordering{} attribute are given in
2929 Table \refersec{tab:orderingencodings}.
2933 \setlength{\extrarowheight}{0.1cm}
2934 \begin{longtable}{l|c}
2935 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2936 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2938 \bfseries Ordering name&\bfseries Value\\ \hline
2940 \hline \emph{Continued on next page}
2945 \DWORDrowmajor&0x00 \\
2946 \DWORDcolmajor&0x01 \\
2952 \section{Discriminant Lists}
2953 \label{datarep:discriminantlists}
2955 The descriptors used in
2956 \addtoindexx{discriminant list attribute}
2958 \DWATdiscrlist{} attribute are
2959 encoded as 1-byte constants. The
2960 defined values are given in
2961 Table \refersec{tab:discriminantdescriptorencodings}.
2963 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2965 \setlength{\extrarowheight}{0.1cm}
2966 \begin{longtable}{l|c}
2967 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2968 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2970 \bfseries Descriptor name&\bfseries Value\\ \hline
2972 \hline \emph{Continued on next page}
2984 \section{Name Index Table}
2985 \label{datarep:nameindextable}
2986 The \addtoindexi{version number}{version number!name index table}
2987 in the name index table header is \versiondotdebugnames{}.
2989 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
2992 \setlength{\extrarowheight}{0.1cm}
2993 \begin{longtable}{l|c|l}
2994 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
2995 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
2997 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
2999 \hline \emph{Continued on next page}
3002 \ddag~\textit{New in \DWARFVersionV}
3004 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
3005 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
3006 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
3007 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
3008 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
3009 \DWIDXlouser~\ddag & 0x2000 & \\
3010 \DWIDXhiuser~\ddag & \xiiifff & \\
3014 The abbreviations table ends with an entry consisting of a single 0
3015 byte for the abbreviation code. The size of the table given by
3016 \texttt{abbrev\_table\_size} may include optional padding following the
3019 \section{Defaulted Member Encodings}
3020 \hypertarget{datarep:defaultedmemberencodings}{}
3022 The encodings of the constants used in the \DWATdefaulted{} attribute
3023 are given in Table \referfol{datarep:defaultedattributeencodings}.
3026 \setlength{\extrarowheight}{0.1cm}
3027 \begin{longtable}{l|c}
3028 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
3029 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
3031 \bfseries Defaulted name &\bfseries Value \\ \hline
3033 \hline \emph{Continued on next page}
3036 \ddag~\textit{New in \DWARFVersionV}
3038 \DWDEFAULTEDno~\ddag & 0x00 \\
3039 \DWDEFAULTEDinclass~\ddag & 0x01 \\
3040 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
3045 \section{Address Range Table}
3046 \label{datarep:addrssrangetable}
3048 Each set of entries in the table of address ranges contained
3049 in the \dotdebugaranges{}
3050 section begins with a header containing:
3051 \begin{enumerate}[1. ]
3052 % FIXME The unit length text is not fully consistent across
3055 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3056 \addttindexx{unit\_length}
3057 A 4-byte or 12-byte length containing the length of the
3058 \addtoindexx{initial length}
3059 set of entries for this compilation unit, not including the
3060 length field itself. In the \thirtytwobitdwarfformat, this is a
3061 4-byte unsigned integer (which must be less than \xfffffffzero);
3062 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
3063 \wffffffff followed by an 8-byte unsigned integer that gives
3065 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3067 \item version (\HFTuhalf) \\
3068 A 2-byte version identifier representing the version of the
3069 DWARF information for the address range table.
3071 This value in this field \addtoindexx{version number!address range table} is 2.
3073 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
3075 \addtoindexx{section offset!in .debug\_aranges header}
3076 4-byte or 8-byte offset into the
3077 \dotdebuginfo{} section of
3078 the compilation unit header. In the \thirtytwobitdwarfformat,
3079 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
3080 this is an 8-byte unsigned offset
3081 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3083 \item \texttt{address\_size} (\HFTubyte) \\
3084 A 1-byte unsigned integer containing the size in bytes of an
3085 \addttindexx{address\_size}
3087 \addtoindexx{size of an address}
3088 (or the offset portion of an address for segmented
3089 \addtoindexx{address space!segmented}
3090 addressing) on the target system.
3092 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3093 A 1-byte unsigned integer containing the size in bytes of a
3094 segment selector on the target system.
3098 This header is followed by a series of tuples. Each tuple
3099 consists of a segment, an address and a length.
3100 The segment selector
3101 size is given by the \HFNsegmentselectorsize{} field of the header; the
3102 address and length size are each given by the \addttindex{address\_size}
3103 field of the header.
3104 The first tuple following the header in
3105 each set begins at an offset that is a multiple of the size
3106 of a single tuple (that is, the size of a segment selector
3107 plus twice the \addtoindex{size of an address}).
3108 The header is padded, if
3109 necessary, to that boundary. Each set of tuples is terminated
3110 by a 0 for the segment, a 0 for the address and 0 for the
3111 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3112 the segment selectors are omitted from all tuples, including
3113 the terminating tuple.
3116 \section{Line Number Information}
3117 \label{datarep:linenumberinformation}
3119 The \addtoindexi{version number}{version number!line number information}
3120 in the line number program header is \versiondotdebugline{}.
3122 The boolean values \doublequote{true} and \doublequote{false}
3123 used by the line number information program are encoded
3124 as a single byte containing the value 0
3125 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3128 The encodings for the standard opcodes are given in
3129 \addtoindexx{line number opcodes!standard opcode encoding}
3130 Table \refersec{tab:linenumberstandardopcodeencodings}.
3133 \setlength{\extrarowheight}{0.1cm}
3134 \begin{longtable}{l|c}
3135 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3136 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3138 \bfseries Opcode name&\bfseries Value\\ \hline
3140 \hline \emph{Continued on next page}
3146 \DWLNSadvancepc&0x02 \\
3147 \DWLNSadvanceline&0x03 \\
3148 \DWLNSsetfile&0x04 \\
3149 \DWLNSsetcolumn&0x05 \\
3150 \DWLNSnegatestmt&0x06 \\
3151 \DWLNSsetbasicblock&0x07 \\
3152 \DWLNSconstaddpc&0x08 \\
3153 \DWLNSfixedadvancepc&0x09 \\
3154 \DWLNSsetprologueend&0x0a \\*
3155 \DWLNSsetepiloguebegin&0x0b \\*
3156 \DWLNSsetisa&0x0c \\*
3162 The encodings for the extended opcodes are given in
3163 \addtoindexx{line number opcodes!extended opcode encoding}
3164 Table \refersec{tab:linenumberextendedopcodeencodings}.
3167 \setlength{\extrarowheight}{0.1cm}
3168 \begin{longtable}{l|c}
3169 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3170 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3172 \bfseries Opcode name&\bfseries Value\\ \hline
3174 \hline \emph{Continued on next page}
3176 \hline %\ddag~\textit{New in DWARF Version 5}
3179 \DWLNEendsequence &0x01 \\
3180 \DWLNEsetaddress &0x02 \\
3181 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3182 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3184 \DWLNEsetdiscriminator &0x04 \\
3185 \DWLNElouser &0x80 \\
3186 \DWLNEhiuser &\xff \\
3192 The encodings for the line number header entry formats are given in
3193 \addtoindexx{line number opcodes!file entry format encoding}
3194 Table \refersec{tab:linenumberheaderentryformatencodings}.
3197 \setlength{\extrarowheight}{0.1cm}
3198 \begin{longtable}{l|c}
3199 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3200 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3202 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3204 \hline \emph{Continued on next page}
3206 \hline \ddag~\textit{New in DWARF Version 5}
3208 \DWLNCTpath~\ddag & 0x1 \\
3209 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3210 \DWLNCTtimestamp~\ddag & 0x3 \\
3211 \DWLNCTsize~\ddag & 0x4 \\
3212 \DWLNCTMDfive~\ddag & 0x5 \\
3213 \DWLNCTlouser~\ddag & 0x2000 \\
3214 \DWLNCThiuser~\ddag & \xiiifff \\
3219 \section{Macro Information}
3220 \label{datarep:macroinformation}
3221 The \addtoindexi{version number}{version number!macro information}
3222 in the macro information header is \versiondotdebugmacro{}.
3224 The source line numbers and source file indices encoded in the
3225 macro information section are represented as
3226 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3229 The macro information entry type is encoded as a single unsigned byte.
3231 \addtoindexx{macro information entry types!encoding}
3233 Table \refersec{tab:macroinfoentrytypeencodings}.
3237 \setlength{\extrarowheight}{0.1cm}
3238 \begin{longtable}{l|c}
3239 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3240 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3242 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3244 \hline \emph{Continued on next page}
3246 \hline \ddag~\textit{New in DWARF Version 5}
3249 \DWMACROdefine~\ddag &0x01 \\
3250 \DWMACROundef~\ddag &0x02 \\
3251 \DWMACROstartfile~\ddag &0x03 \\
3252 \DWMACROendfile~\ddag &0x04 \\
3253 \DWMACROdefinestrp~\ddag &0x05 \\
3254 \DWMACROundefstrp~\ddag &0x06 \\
3255 \DWMACROimport~\ddag &0x07 \\
3256 \DWMACROdefinesup~\ddag &0x08 \\
3257 \DWMACROundefsup~\ddag &0x09 \\
3258 \DWMACROimportsup~\ddag &0x0a \\
3259 \DWMACROdefinestrx~\ddag &0x0b \\
3260 \DWMACROundefstrx~\ddag &0x0c \\
3261 \DWMACROlouser~\ddag &0xe0 \\
3262 \DWMACROhiuser~\ddag &\xff \\
3268 \section{Call Frame Information}
3269 \label{datarep:callframeinformation}
3271 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3272 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3273 value is \xffffffffffffffff.
3275 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3276 is \versiondotdebugframe.
3278 Call frame instructions are encoded in one or more bytes. The
3279 primary opcode is encoded in the high order two bits of
3280 the first byte (that is, opcode = byte $\gg$ 6). An operand
3281 or extended opcode may be encoded in the low order 6
3282 bits. Additional operands are encoded in subsequent bytes.
3283 The instructions and their encodings are presented in
3284 Table \refersec{tab:callframeinstructionencodings}.
3287 \setlength{\extrarowheight}{0.1cm}
3288 \begin{longtable}{l|c|c|l|l}
3289 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3290 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3291 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3293 & \bfseries High 2 &\bfseries Low 6 & &\\
3294 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3296 \hline \emph{Continued on next page}
3301 \DWCFAadvanceloc&0x1&delta & \\
3302 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3303 \DWCFArestore&0x3®ister & & \\
3304 \DWCFAnop&0&0 & & \\
3305 \DWCFAsetloc&0&0x01&address & \\
3306 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3307 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3308 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3309 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3310 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3311 \DWCFAundefined&0&0x07&ULEB128 register & \\
3312 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3313 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3314 \DWCFArememberstate&0&0x0a & & \\
3315 \DWCFArestorestate&0&0x0b & & \\
3316 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3317 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3318 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3319 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3320 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3322 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3323 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3324 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3325 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3326 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3327 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3328 \DWCFAlouser&0&0x1c & & \\
3329 \DWCFAhiuser&0&\xiiif & & \\
3333 \section{Non-contiguous Address Ranges}
3334 \label{datarep:noncontiguousaddressranges}
3336 Each entry in a \addtoindex{range list}
3337 (see Section \refersec{chap:noncontiguousaddressranges})
3339 \addtoindexx{base address selection entry!in range list}
3341 \addtoindexx{range list}
3342 a base address selection entry, or an end-of-list entry.
3344 A \addtoindex{range list} entry consists of two relative addresses. The
3345 addresses are the same size as addresses on the target machine.
3348 A base address selection entry and an
3349 \addtoindexx{end-of-list entry!in range list}
3350 end-of-list entry each
3351 \addtoindexx{base address selection entry!in range list}
3352 consist of two (constant or relocated) addresses. The two
3353 addresses are the same size as addresses on the target machine.
3355 For a \addtoindex{range list} to be specified, the base address of the
3356 \addtoindexx{base address selection entry!in range list}
3357 corresponding compilation unit must be defined
3358 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3361 \section{String Offsets Table}
3362 \label{chap:stringoffsetstable}
3363 Each set of entries in the string offsets table contained in the
3364 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3365 section begins with a header containing:
3366 \begin{enumerate}[1. ]
3367 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3368 \addttindexx{unit\_length}
3369 A 4-byte or 12-byte length containing the length of
3370 the set of entries for this compilation unit, not
3371 including the length field itself. In the 32-bit
3372 DWARF format, this is a 4-byte unsigned integer
3373 (which must be less than \xfffffffzero); in the 64-bit
3374 DWARF format, this consists of the 4-byte value
3375 \wffffffff followed by an 8-byte unsigned integer
3376 that gives the actual length (see
3377 Section \refersec{datarep:32bitand64bitdwarfformats}).
3380 \item \texttt{version} (\HFTuhalf) \\
3381 \addtoindexx{version number!string offsets table}
3382 A 2-byte version identifier containing the value
3383 \versiondotdebugstroffsets{}.
3385 \item \textit{padding} (\HFTuhalf) \\
3386 Reserved to DWARF (must be zero).
3389 This header is followed by a series of string table offsets
3390 that have the same representation as \DWFORMstrp.
3391 For the 32-bit DWARF format, each offset is 4 bytes long; for
3392 the 64-bit DWARF format, each offset is 8 bytes long.
3394 The \DWATstroffsetsbase{} attribute points to the first
3395 entry following the header. The entries are indexed
3396 sequentially from this base entry, starting from 0.
3398 \section{Address Table}
3399 \label{chap:addresstable}
3400 Each set of entries in the address table contained in the
3401 \dotdebugaddr{} section begins with a header containing:
3402 \begin{enumerate}[1. ]
3403 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3404 \addttindexx{unit\_length}
3405 A 4-byte or 12-byte length containing the length of
3406 the set of entries for this compilation unit, not
3407 including the length field itself. In the 32-bit
3408 DWARF format, this is a 4-byte unsigned integer
3409 (which must be less than \xfffffffzero); in the 64-bit
3410 DWARF format, this consists of the 4-byte value
3411 \wffffffff followed by an 8-byte unsigned integer
3412 that gives the actual length (see
3413 Section \refersec{datarep:32bitand64bitdwarfformats}).
3416 \item \texttt{version} (\HFTuhalf) \\
3417 \addtoindexx{version number!address table}
3418 A 2-byte version identifier containing the value
3419 \versiondotdebugaddr{}.
3422 \item \texttt{address\_size} (\HFTubyte) \\
3423 A 1-byte unsigned integer containing the size in
3424 bytes of an address (or the offset portion of an
3425 address for segmented addressing) on the target
3429 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3430 A 1-byte unsigned integer containing the size in
3431 bytes of a segment selector on the target system.
3434 This header is followed by a series of segment/address pairs.
3435 The segment size is given by the \HFNsegmentselectorsize{} field of the
3436 header, and the address size is given by the \addttindex{address\_size}
3437 field of the header. If the \HFNsegmentselectorsize{} field in the header
3438 is zero, the entries consist only of an addresses.
3440 The \DWATaddrbase{} attribute points to the first entry
3441 following the header. The entries are indexed sequentially
3442 from this base entry, starting from 0.
3445 \section{Range List Table}
3446 \label{app:rangelisttable}
3447 Each set of entries in the range list table contained in the
3448 \dotdebugranges{} section begins with a header containing:
3449 \begin{enumerate}[1. ]
3450 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3451 \addttindexx{unit\_length}
3452 A 4-byte or 12-byte length containing the length of
3453 the set of entries for this compilation unit, not
3454 including the length field itself. In the 32-bit
3455 DWARF format, this is a 4-byte unsigned integer
3456 (which must be less than \xfffffffzero); in the 64-bit
3457 DWARF format, this consists of the 4-byte value
3458 \wffffffff followed by an 8-byte unsigned integer
3459 that gives the actual length (see
3460 Section \refersec{datarep:32bitand64bitdwarfformats}).
3463 \item \texttt{version} (\HFTuhalf) \\
3464 \addtoindexx{version number!range list table}
3465 A 2-byte version identifier containing the value
3466 \versiondotdebugranges{}.
3469 \item \texttt{address\_size} (\HFTubyte) \\
3470 A 1-byte unsigned integer containing the size in
3471 bytes of an address (or the offset portion of an
3472 address for segmented addressing) on the target
3476 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3477 A 1-byte unsigned integer containing the size in
3478 bytes of a segment selector on the target system.
3481 This header is followed by a series of range list entries as
3482 described in Section \refersec{chap:noncontiguousaddressranges}.
3483 The segment size is given by the
3484 \HFNsegmentselectorsize{} field of the header, and the address size is
3485 given by the \addttindex{address\_size} field of the header. If the
3486 \HFNsegmentselectorsize{} field in the header is zero, the segment
3487 selector is omitted from the range list entries.
3489 The \DWATrangesbase{} attribute points to the first entry
3490 following the header. The entries are referenced by a byte
3491 offset relative to this base address.
3494 \section{Location List Table}
3495 \label{datarep:locationlisttable}
3496 Each set of entries in the location list table contained in the
3497 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3498 \begin{enumerate}[1. ]
3499 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3500 \addttindexx{unit\_length}
3501 A 4-byte or 12-byte length containing the length of
3502 the set of entries for this compilation unit, not
3503 including the length field itself. In the 32-bit
3504 DWARF format, this is a 4-byte unsigned integer
3505 (which must be less than \xfffffffzero); in the 64-bit
3506 DWARF format, this consists of the 4-byte value
3507 \wffffffff followed by an 8-byte unsigned integer
3508 that gives the actual length (see
3509 Section \refersec{datarep:32bitand64bitdwarfformats}).
3512 \item \texttt{version} (\HFTuhalf) \\
3513 \addtoindexx{version number!location list table}
3514 A 2-byte version identifier containing the value
3515 \versiondotdebugloc{}.
3518 \item \texttt{address\_size} (\HFTubyte) \\
3519 A 1-byte unsigned integer containing the size in
3520 bytes of an address (or the offset portion of an
3521 address for segmented addressing) on the target
3525 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3526 A 1-byte unsigned integer containing the size in
3527 bytes of a segment selector on the target system.
3530 This header is followed by a series of location list entries as
3531 described in Section \refersec{chap:locationlists}.
3532 The segment size is given by the
3533 \HFNsegmentselectorsize{} field of the header, and the address size is
3534 given by the \HFNaddresssize{} field of the header. If the
3535 \HFNsegmentselectorsize{} field in the header is zero, the segment
3536 selector is omitted from range list entries.
3538 The entries are referenced by a byte offset relative to the first
3539 location list following this header.
3542 \section{Dependencies and Constraints}
3543 \label{datarep:dependenciesandconstraints}
3544 The debugging information in this format is intended to
3545 exist in sections of an object file, or an equivalent
3546 separate file or database, having names beginning with
3547 the prefix ".debug\_" (see Appendix
3548 \refersec{app:dwarfsectionversionnumbersinformative}
3549 for a complete list of such names).
3550 Except as specifically specified, this information is not
3551 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3554 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3555 32-bit addresses, an assembler or compiler must provide a way
3556 to produce 2-byte and 4-byte quantities without alignment
3557 restrictions, and the linker must be able to relocate a
3559 \addtoindexx{section offset!alignment of}
3560 section offset that occurs at an arbitrary
3563 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3564 64-bit addresses, an assembler or compiler must provide a
3565 way to produce 2-byte, 4-byte and 8-byte quantities without
3566 alignment restrictions, and the linker must be able to relocate
3567 an 8-byte address or 4-byte
3568 \addtoindexx{section offset!alignment of}
3569 section offset that occurs at an
3570 arbitrary alignment.
3572 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3573 32-bit addresses, an assembler or compiler must provide a
3574 way to produce 2-byte, 4-byte and 8-byte quantities without
3575 alignment restrictions, and the linker must be able to relocate
3576 a 4-byte address or 8-byte
3577 \addtoindexx{section offset!alignment of}
3578 section offset that occurs at an
3579 arbitrary alignment.
3581 \textit{It is expected that this will be required only for very large
3582 32-bit programs or by those architectures which support
3583 a mix of 32-bit and 64-bit code and data within the same
3586 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3587 64-bit addresses, an assembler or compiler must provide a
3588 way to produce 2-byte, 4-byte and 8-byte quantities without
3589 alignment restrictions, and the linker must be able to
3590 relocate an 8-byte address or
3591 \addtoindexx{section offset!alignment of}
3592 section offset that occurs at
3593 an arbitrary alignment.
3597 \section{Integer Representation Names}
3598 \label{datarep:integerrepresentationnames}
3599 The sizes of the integers used in the lookup by name, lookup
3600 by address, line number, call frame information and other sections
3602 Table \ref{tab:integerrepresentationnames}.
3606 \setlength{\extrarowheight}{0.1cm}
3607 \begin{longtable}{c|l}
3608 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3609 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3611 \bfseries Representation name&\bfseries Representation\\ \hline
3613 \hline \emph{Continued on next page}
3618 \HFTsbyte& signed, 1-byte integer \\
3619 \HFTubyte&unsigned, 1-byte integer \\
3620 \HFTuhalf&unsigned, 2-byte integer \\
3621 \HFTuword&unsigned, 4-byte integer \\
3627 \section{Type Signature Computation}
3628 \label{datarep:typesignaturecomputation}
3630 A \addtoindex{type signature} is used by a DWARF consumer
3631 to resolve type references to the type definitions that
3632 are contained in \addtoindex{type unit}s (see Section
3633 \refersec{chap:typeunitentries}).
3635 \textit{A type signature is computed only by a DWARF producer;
3636 \addtoindexx{type signature!computation} a consumer need
3640 compare two type signatures to check for equality.}
3643 The type signature for a type T0 is formed from the
3644 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3645 R.L. Rivest, RFC 1321, April 1992}
3646 digest of a flattened description of the type. The flattened
3647 description of the type is a byte sequence derived from the
3648 DWARF encoding of the type as follows:
3649 \begin{enumerate}[1. ]
3651 \item Start with an empty sequence S and a list V of visited
3652 types, where V is initialized to a list containing the type
3653 T0 as its single element. Elements in V are indexed from 1,
3656 \item If the debugging information entry represents a type that
3657 is nested inside another type or a namespace, append to S
3658 the type\textquoteright s context as follows: For each surrounding type
3659 or namespace, beginning with the outermost such construct,
3660 append the letter 'C', the DWARF tag of the construct, and
3661 the name (taken from
3662 \addtoindexx{name attribute}
3663 the \DWATname{} attribute) of the type
3664 \addtoindexx{name attribute}
3665 or namespace (including its trailing null byte).
3667 \item Append to S the letter 'D', followed by the DWARF tag of
3668 the debugging information entry.
3670 \item For each of the attributes in
3671 Table \refersec{tab:attributesusedintypesignaturecomputation}
3673 the debugging information entry, in the order listed,
3674 append to S a marker letter (see below), the DWARF attribute
3675 code, and the attribute value.
3678 \caption{Attributes used in type signature computation}
3679 \label{tab:attributesusedintypesignaturecomputation}
3680 \simplerule[\textwidth]
3682 \autocols[0pt]{c}{2}{l}{
3698 \DWATcontainingtype,
3702 \DWATdatamemberlocation,
3723 \DWATrvaluereference,
3727 \DWATstringlengthbitsize,
3728 \DWATstringlengthbytesize,
3733 \DWATvariableparameter,
3736 \DWATvtableelemlocation
3739 \simplerule[\textwidth]
3742 Note that except for the initial
3743 \DWATname{} attribute,
3744 \addtoindexx{name attribute}
3745 attributes are appended in order according to the alphabetical
3746 spelling of their identifier.
3748 If an implementation defines any vendor-specific attributes,
3749 any such attributes that are essential to the definition of
3750 the type are also included at the end of the above list,
3751 in their own alphabetical suborder.
3753 An attribute that refers to another type entry T is processed
3755 \begin{enumerate}[ a)]
3760 T is in the list V at some V[x], use the
3761 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3762 encoding of x as the attribute value.
3766 Otherwise, append type T to the list V, then
3769 as the marker, process the type T recursively by performing
3770 Steps 2 through 7, and use the result as the attribute value.
3774 Other attribute values use the letter 'A' as the marker, and
3775 the value consists of the form code (encoded as an unsigned
3776 LEB128 value) followed by the encoding of the value according
3777 to the form code. To ensure reproducibility of the signature,
3778 the set of forms used in the signature computation is limited
3786 \item If the tag in Step 3 is one of \DWTAGpointertype,
3787 \DWTAGreferencetype,
3788 \DWTAGrvaluereferencetype,
3789 \DWTAGptrtomembertype,
3790 or \DWTAGfriend, and the referenced
3791 type (via the \DWATtype{} or
3792 \DWATfriend{} attribute) has a
3793 \DWATname{} attribute, append to S the letter 'N', the DWARF
3794 attribute code (\DWATtype{} or
3795 \DWATfriend), the context of
3796 the type (according to the method in Step 2), the letter 'E',
3797 and the name of the type. For \DWTAGfriend, if the referenced
3798 entry is a \DWTAGsubprogram, the context is omitted and the
3799 name to be used is the ABI-specific name of the subprogram
3800 (for example, the mangled linker name).
3803 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3804 \DWTAGreferencetype,
3805 \DWTAGrvaluereferencetype,
3806 \DWTAGptrtomembertype, or
3807 \DWTAGfriend, but has
3808 a \DWATtype{} attribute, or if the referenced type (via
3810 \DWATfriend{} attribute) does not have a
3811 \DWATname{} attribute, the attribute is processed according to
3812 the method in Step 4 for an attribute that refers to another
3816 \item Visit each child C of the debugging information
3817 entry as follows: If C is a nested type entry or a member
3818 function entry, and has
3819 a \DWATname{} attribute, append to
3820 \addtoindexx{name attribute}
3821 S the letter 'S', the tag of C, and its name; otherwise,
3822 process C recursively by performing Steps 3 through 7,
3823 appending the result to S. Following the last child (or if
3824 there are no children), append a zero byte.
3829 For the purposes of this algorithm, if a debugging information
3831 \DWATspecification{}
3832 attribute that refers to
3833 another entry D (which has a
3836 then S inherits the attributes and children of D, and S is
3837 processed as if those attributes and children were present in
3838 the entry S. Exception: if a particular attribute is found in
3839 both S and D, the attribute in S is used and the corresponding
3840 one in D is ignored.
3843 DWARF tag and attribute codes are appended to the sequence
3844 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3845 using the values defined earlier in this chapter.
3847 \textit{A grammar describing this computation may be found in
3848 Appendix \refersec{app:typesignaturecomputationgrammar}.
3851 \textit{An attribute that refers to another type entry is
3852 recursively processed or replaced with the name of the
3853 referent (in Step 4, 5 or 6). If neither treatment applies to
3854 an attribute that references another type entry, the entry
3855 that contains that attribute is not suitable for a
3856 separate \addtoindex{type unit}.}
3858 \textit{If a debugging information entry contains an attribute from
3859 the list above that would require an unsupported form, that
3860 entry is not suitable for a separate
3861 \addtoindex{type unit}.}
3863 \textit{A type is suitable for a separate
3864 \addtoindex{type unit} only
3865 if all of the type entries that it contains or refers to in
3866 Steps 6 and 7 are themselves suitable for a separate
3867 \addtoindex{type unit}.}
3870 Where the DWARF producer may reasonably choose two or more
3871 different forms for a given attribute, it should choose
3872 the simplest possible form in computing the signature. (For
3873 example, a constant value should be preferred to a location
3874 expression when possible.)
3876 Once the string S has been formed from the DWARF encoding,
3877 an 16-byte \MDfive{} digest is computed for the string and the
3878 last eight bytes are taken as the type signature.
3880 \textit{The string S is intended to be a flattened representation of
3881 the type that uniquely identifies that type (that is, a different
3882 type is highly unlikely to produce the same string).}
3885 \textit{A debugging information entry is not be placed in a
3886 separate \addtoindex{type unit}
3887 if any of the following apply:}
3891 \item \textit{The entry has an attribute whose value is a location
3892 description, and the location description
3893 contains a reference to
3894 another debugging information entry (for example, a \DWOPcallref{}
3895 operator), as it is unlikely that the entry will remain
3896 identical across compilation units.}
3898 \item \textit{The entry has an attribute whose value refers
3899 to a code location or a \addtoindex{location list}.}
3901 \item \textit{The entry has an attribute whose value refers
3902 to another debugging information entry that does not represent
3908 \textit{Certain attributes are not included in the type signature:}
3911 \item \textit{The \DWATdeclaration{} attribute is not included because it
3912 indicates that the debugging information entry represents an
3913 incomplete declaration, and incomplete declarations should
3915 \addtoindexx{type unit}
3916 separate type units.}
3918 \item \textit{The \DWATdescription{} attribute is not included because
3919 it does not provide any information unique to the defining
3920 declaration of the type.}
3922 \item \textit{The \DWATdeclfile,
3924 \DWATdeclcolumn{} attributes are not included because they
3925 may vary from one source file to the next, and would prevent
3926 two otherwise identical type declarations from producing the
3927 same \MDfive{} digest.}
3929 \item \textit{The \DWATobjectpointer{} attribute is not included
3930 because the information it provides is not necessary for the
3931 computation of a unique type signature.}
3935 \textit{Nested types and some types referred to by a debugging
3936 information entry are encoded by name rather than by recursively
3937 encoding the type to allow for cases where a complete definition
3938 of the type might not be available in all compilation units.}
3941 \textit{If a type definition contains the definition of a member function,
3942 it cannot be moved as is into a type unit, because the member function
3943 contains attributes that are unique to that compilation unit.
3944 Such a type definition can be moved to a type unit by rewriting the
3945 debugging information entry tree,
3946 moving the member function declaration into a separate declaration tree,
3947 and replacing the function definition in the type with a non-defining
3948 declaration of the function (as if the function had been defined out of
3951 An example that illustrates the computation of an \MDfive{} digest may be found in
3952 Appendix \refersec{app:usingtypeunits}.
3954 \section{Name Table Hash Function}
3955 \label{datarep:nametablehashfunction}
3956 The hash function used for hashing name strings in the accelerated
3957 access name index table (see Section \refersec{chap:acceleratedaccess})
3958 is defined in \addtoindex{C} as shown in
3959 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnoteRR{
3960 This hash function is sometimes known as the
3961 "\addtoindex{Bernstein hash function}" or the
3962 "\addtoindex{DJB hash function}"
3964 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
3965 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
3970 uint32_t /* must be a 32-bit integer type */
3971 hash(unsigned char *str)
3973 uint32_t hash = 5381;
3977 hash = hash * 33 + c;
3983 \caption{Name Table Hash Function Definition}
3984 \label{fig:nametablehashfunctiondefinition}