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 reserved
22 \hypertarget{chap:DWXXXlohiuser}{}
23 value range 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 \DWLANGlouserMARK{}\DWLANGhiuserMARK{} DW\_LANG,
31 \DWLNElouserMARK{}\DWLNEhiuserMARK{} DW\_LNE,
32 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
33 \DWOPlouserMARK{}\DWOPhiuserMARK{} DW\_OP or
34 \DWTAGlouserMARK{}\DWTAGhiuserMARK{} DW\_TAG,
35 respectively) followed by
36 \_lo\_user or \_hi\_user.
37 Values in the range between \textit{prefix}\_lo\_user
38 and \textit{prefix}\_hi\_user inclusive,
39 are reserved for vendor specific extensions. Vendors may
40 use values in this range without conflicting with current or
41 future system\dash defined values. All other values are reserved
42 for use by the system.
44 \textit{For example, for DIE tags, the special
45 labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
47 \textit{There may also be codes for vendor specific extensions
48 between the number of standard line number opcodes and
49 the first special line number opcode. However, since the
50 number of standard opcodes varies with the DWARF version,
51 the range for extensions is also version dependent. Thus,
52 \DWLNSlouserTARG{} and
53 \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 below
123 (see Section \refersec{datarep:32bitand64bitdwarfformats});
125 the other values is reserved for possible future extensions.
129 \section{Relocatable, Split, Executable, Shared and Package Object Files}
130 \label{datarep:executableobjectsandsharedobjects}
132 \subsection{Relocatable Object Files}
133 \label{datarep:relocatableobjectfiles}
134 A DWARF producer (for example, a compiler) typically generates its
135 debugging information as part of a relocatable object file.
136 Relocatable object files are then combined by a linker to form an
137 executable file. During the linking process, the linker resolves
138 (binds) symbolic references between the various object files, and
139 relocates the contents of each object file into a combined virtual
142 The DWARF debugging information is placed in several sections (see
143 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
144 requires an object file format capable of
145 representing these separate sections. There are symbolic references
146 between these sections, and also between the debugging information
147 sections and the other sections that contain the text and data of the
148 program itself. Many of these references require relocation, and the
149 producer must emit the relocation information appropriate to the
150 object file format and the target processor architecture. These
151 references include the following:
154 \item The compilation unit header (see Section
155 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
156 section contains a reference to the \dotdebugabbrev{} table. This
157 reference requires a relocation so that after linking, it refers to
158 that contribution to the combined \dotdebugabbrev{} section in the
161 \item Debugging information entries may have attributes with the form
162 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
163 These attributes represent locations
164 within the virtual address space of the program, and require
167 \item A DWARF expression may contain a \DWOPaddr{} (see Section
168 \refersec{chap:literalencodings}) which contains a location within
169 the virtual address space of the program, and require relocation.
172 \item Debugging information entries may have attributes with the form
173 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
174 These attributes refer to
175 debugging information in other debugging information sections within
176 the object file, and must be relocated during the linking process.
178 However, if a \DWATrangesbase{} attribute is present, the offset in
179 a \DWATranges{} attribute (which uses form \DWFORMsecoffset) is
180 relative to the given base offset--no relocation is involved.
182 \item Debugging information entries may have attributes with the form
183 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
184 These attributes refer to
185 debugging information entries that may be outside the current
186 compilation unit. These values require both symbolic binding and
189 \item Debugging information entries may have attributes with the form
190 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
191 These attributes refer to strings in
192 the \dotdebugstr{} section. These values require relocation.
194 \item Entries in the \dotdebugaddr, \dotdebugloc{}, \dotdebugranges{}
195 and \dotdebugaranges{}
196 sections contain references to locations within the virtual address
197 space of the program, and require relocation.
199 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
200 opcode is a reference to a location within the virtual address space
201 of the program, and requires relocation.
203 \item The \dotdebugstroffsets{} section contains a list of string offsets,
204 each of which is an offset of a string in the \dotdebugstr{} section. Each
205 of these offsets requires relocation. Depending on the implementation,
206 these relocations may be implicit (that is, the producer may not need to
207 emit any explicit relocation information for these offsets).
209 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges header and
210 the list of compilation units following the \dotdebugnames{} header contain
211 references to the \dotdebuginfo{} section. These references require relocation
212 so that after linking they refer to the correct contribution in the combined
213 \dotdebuginfo{} section in the executable file.
215 \item Frame descriptor entries in the \dotdebugframe{} section
216 (see Section \refersec{chap:structureofcallframeinformation}) contain an
217 \HFNinitiallocation{} field value within the virtual address
218 space of the program and require relocation.
222 \textit{Note that operands of classes \CLASSblock, \CLASSconstant{} and
223 \CLASSflag{} do not require relocation. Attribute operands that use
224 form \DWFORMstring{} also do not require relocation. Further,
225 attribute operands that use form
226 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
227 \DWFORMrefudata{} 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.
238 \subsubsection{First Partition (with Skeleton Unit)}
239 The first partition contains
240 debugging information that must still be processed by the linker,
241 and includes the following:
244 The line number tables, range tables, frame tables, and
245 accelerated access tables, in the usual sections:
246 \dotdebugline, \dotdebuglinestr, \dotdebugranges, \dotdebugframe,
247 \dotdebugnames{} and \dotdebugaranges,
251 An address table, in the \dotdebugaddr{} section. This table
252 contains all addresses and constants that require
253 link-time relocation, and items in the table can be
254 referenced indirectly from the debugging information via
255 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
256 \DWOPconstx{} operators.
258 A skeleton compilation unit, as described in Section
259 \refersec{chap:skeletoncompilationunitentries},
260 in the \dotdebuginfo{} section.
262 An abbreviations table for the skeleton compilation unit,
263 in the \dotdebugabbrev{} section.
265 A string table, in the \dotdebugstr{} section. The string
266 table is necessary only if the skeleton compilation unit
267 uses either indirect string form, \DWFORMstrp{} or
270 A string offsets table, in the \dotdebugstroffsets{}
271 section. The string offsets table is necessary only if
272 the skeleton compilation unit uses the \DWFORMstrx{} form.
274 The attributes contained in the skeleton compilation
275 unit can be used by a DWARF consumer to find the object file
276 or DWARF object file that contains the second partition.
278 \subsubsection{Second Partition (Unlinked or In \texttt{.dwo} File)}
279 The second partition contains the debugging information that
280 does not need to be processed by the linker. These sections
281 may be left in the object files and ignored by the linker
282 (that is, not combined and copied to the executable object file), or
283 they may be placed by the producer in a separate DWARF object
284 file. This partition includes the following:
287 The full compilation unit, in the \dotdebuginfodwo{} section.
290 The full compilation unit entry includes a \DWATdwoid{}
291 attribute whose value is the same as that of the \DWATdwoid{}
292 attribute of the associated skeleton unit.
295 Attributes contained in the full compilation unit
296 may refer to machine addresses indirectly using the \DWFORMaddrx{}
297 form, which accesses the table of addresses specified by the
298 \DWATaddrbase{} attribute in the associated skeleton unit.
299 Location expressions may similarly do so using the \DWOPaddrx{} and
300 \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.
307 \item Separate type units, in the \dotdebuginfodwo{} section.
310 Abbreviations table(s) for the compilation unit and type
311 units, in the \dotdebugabbrevdwo{} section.
313 \item Location lists, in the \dotdebuglocdwo{} section.
316 A \addtoindex{specialized line number table} (for the type units),
317 in the \dotdebuglinedwo{} section. This table
318 contains only the directory and filename lists needed to
319 interpret \DWATdeclfile{} attributes in the debugging
322 \item Macro information, in the \dotdebugmacrodwo{} section.
324 \item A string table, in the \dotdebugstrdwo{} section.
326 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
330 Except where noted otherwise, all references in this document
331 to a debugging information section (for example, \dotdebuginfo),
332 applies also to the corresponding split DWARF section (for example,
335 Split DWARF object files do not get linked with any other files,
336 therefore references between sections must not make use of
337 normal object file relocation information. As a result, symbolic
338 references within or between sections are not possible.
340 \subsection{Executable Objects}
341 \label{chap:executableobjects}
342 The relocated addresses in the debugging information for an
343 executable object are virtual addresses.
346 \subsection{Shared Object Files}
347 \label{datarep:sharedobject Files}
349 addresses in the debugging information for a shared object file
350 are offsets relative to the start of the lowest region of
351 memory loaded from that shared object file.
354 \textit{This requirement makes the debugging information for
355 shared object files position independent. Virtual addresses in a
356 shared object file may be calculated by adding the offset to the
357 base address at which the object file was attached. This offset
358 is available in the run\dash time linker\textquoteright s data structures.}
360 \subsection{DWARF Package Files}
361 \label{datarep:dwarfpackagefiles}
362 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
363 link, and debug an application quickly with less link-time overhead,
364 but a more convenient format is needed for saving the debug
365 information for later debugging of a deployed application. A
366 DWARF package file can be used to collect the debugging
367 information from the object (or separate DWARF object) files
368 produced during the compilation of an application.}
370 \textit{The package file is typically placed in the same directory as the
371 application, and is given the same name with a \doublequote{\texttt{.dwp}}
372 extension.\addtoindexx{\texttt{.dwp} file extension}}
374 A DWARF package file is itself an object file, using the
375 \addtoindexx{package files}
376 \addtoindexx{DWARF package files}
377 same object file format (including \byteorder) as the
378 corresponding application binary. It consists only of a file
379 header, a section table, a number of DWARF debug information
380 sections, and two index sections.
383 Each DWARF package file contains no more than one of each of the
384 following sections, copied from a set of object or DWARF object
385 files, and combined, section by section:
391 \dotdebugstroffsetsdwo
396 The string table section in \dotdebugstrdwo{} contains all the
397 strings referenced from DWARF attributes using the form
398 \DWFORMstrx. Any attribute in a compilation unit or a type
399 unit using this form refers to an entry in that unit's
400 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
401 provides the offset of a string in the \dotdebugstrdwo{}
404 The DWARF package file also contains two index sections that
405 provide a fast way to locate debug information by compilation
406 unit signature (\DWATdwoid) for compilation units, or by type
407 signature for type units:
413 \subsubsection{The Compilation Unit (CU) Index Section}
414 The \dotdebugcuindex{} section is a hashed lookup table that maps a
415 compilation unit signature to a set of contributions in the
416 various debug information sections. Each contribution is stored
417 as an offset within its corresponding section and a size.
419 Each \compunitset{} may contain contributions from the
422 \dotdebuginfodwo{} (required)
423 \dotdebugabbrevdwo{} (required)
426 \dotdebugstroffsetsdwo
430 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
431 information from \DWARFVersionIV{} or earlier formats.}
433 \subsubsection{The Type Unit (TU) Index Section}
434 The \dotdebugtuindex{} section is a hashed lookup table that maps a
435 type signature to a set of offsets into the various debug
436 information sections. Each contribution is stored as an offset
437 within its corresponding section and a size.
439 Each \typeunitset{} may contain contributions from the following
442 \dotdebuginfodwo{} (required)
443 \dotdebugabbrevdwo{} (required)
445 \dotdebugstroffsetsdwo
448 \textit{Merging of type units with the same type signature
449 across \texttt{.dwo} files when creating a \texttt{.dwp} file
450 can be achieved using COMDAT-based techniques similar to those
451 described in Appendix
452 \refersec{app:dwarfcompressionandduplicateeliminationinformative}.
453 In fact, this is necessary in order to combine all \dotdebuginfodwo{}
454 section contributions into a single \dotdebuginfodwo{} section in a
457 \subsubsection{Format of the CU and TU Index Sections}
458 Both index sections have the same format, and serve to map a
459 64-bit signature to a set of contributions to the debug sections.
460 Each index section begins with a header, followed by a hash table of
461 signatures, a parallel table of indexes, a table of offsets, and
462 a table of sizes. The index sections are aligned at 8-byte
463 boundaries in the DWARF package file.
466 The index section header contains the following fields:
467 \begin{enumerate}[1. ]
468 \item \texttt{version} (\HFTuhalf) \\
470 \addtoindexx{version number!CU index information}
471 \addtoindexx{version number!TU index information}
472 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
473 This number is specific to the CU and TU index information
474 and is independent of the DWARF version number.
476 The version number is \versiondotdebugcuindex.
478 \item \textit{padding} (\HFTuhalf) \\
479 Reserved to DWARF (must be zero).
481 \item \texttt{column\_count} (\HFTuword) \\
482 The number of columns in the table of section counts that follows.
483 For brevity, the contents of this field is referred to as $C$ below.
485 \item \texttt{unit\_count} (\HFTuword) \\
486 The number of compilation units or type units in the index.
487 For brevity, the contents of this field is referred to as $U$ below.
489 \item \texttt{slot\_count} (\HFTuword) \\
490 The number of slots in the hash table.
491 For brevity, the contents of this field is referred to as $S$ below.
495 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
497 The size of the hash table, $S$, must be $2^k$ such that:
498 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
500 The hash table begins at offset 16 in the section, and consists
501 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
503 % (using the \byteorder{} of the application binary).
505 The parallel table of indices begins immediately after the hash table
506 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
507 consists of an array of $S$ 4-byte slots,
508 % (using the byte order of the application binary),
509 corresponding 1-1 with slots in the hash
510 table. Each entry in the parallel table contains a row index into
511 the tables of offsets and sizes.
513 Unused slots in the hash table have 0 in both the hash table
514 entry and the parallel table entry. While 0 is a valid hash
515 value, the row index in a used slot will always be non-zero.
517 Given a 64-bit compilation unit signature or a type signature $X$,
518 an entry in the hash table is located as follows:
519 \begin{enumerate}[1. ]
520 \item Calculate a primary hash $H = X\ \&\ MASK(k)$, where $MASK(k)$ is a
521 mask with the low-order $k$ bits all set to 1.
523 \item Calculate a secondary hash $H' = (((X>>32)\ \&\ MASK(k))\ |\ 1)$.
525 \item If the hash table entry at index $H$ matches the signature, use
526 that entry. If the hash table entry at index $H$ is unused (all
527 zeroes), terminate the search: the signature is not present
530 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 3.
533 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
534 guaranteed to stop at an unused slot or find the match.
537 The table of offsets begins immediately following the parallel
538 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
539 The table is a two-dimensional array of 4-byte words,
540 %(using the byte order of the application binary),
541 with $C$ columns and $U + 1$
542 rows, in row-major order. Each row in the array is indexed
543 starting from 0. The first row provides a key to the columns:
544 each column in this row provides a section identifier for a debug
545 section, and the offsets in the same column of subsequent rows
546 refer to that section. The section identifiers are shown in
547 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
551 \setlength{\extrarowheight}{0.1cm}
552 \begin{longtable}{l|c|l}
553 \caption{DWARF package file section identifier \mbox{encodings}}
554 \label{tab:dwarfpackagefilesectionidentifierencodings}
555 \addtoindexx{DWARF package files!section identifier encodings} \\
556 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
558 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
560 \hline \emph{Continued on next page}
564 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
565 \textit{Reserved} & 2 & \\
566 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
567 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
568 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
569 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
570 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
571 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
575 The offsets provided by the CU and TU index sections are the
576 base offsets for the contributions made by each CU or TU to the
577 corresponding section in the package file. Each CU and TU header
578 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
579 table for that CU or TU within the contribution to the
580 \dotdebugabbrevdwo{} section for that CU or TU, and are
581 interpreted as relative to the base offset given in the index
582 section. Likewise, offsets into \dotdebuglinedwo{} from
583 \DWATstmtlist{} attributes are interpreted as relative to
584 the base offset for \dotdebuglinedwo{}, and offsets into other debug
585 sections obtained from DWARF attributes are also
586 interpreted as relative to the corresponding base offset.
588 The table of sizes begins immediately following the table of
589 offsets, and provides the sizes of the contributions made by each
590 CU or TU to the corresponding section in the package file. Like
591 the table of offsets, it is a two-dimensional array of 4-byte
592 words, with $C$ columns and $U$ rows, in row-major order. Each row in
593 the array is indexed starting from 1 (row 0 of the table of
594 offsets also serves as the key for the table of sizes).
596 \subsection{DWARF Supplementary Object Files}
597 \label{datarep:dwarfsupplemetaryobjectfiles}
598 In order to minimize the size of debugging information, it is possible
599 to move duplicate debug information entries, strings and macro entries from
600 several executables or shared object files into a separate
601 \addtoindexi{\textit{supplementary object file}}{supplementary object file} by some
602 post-linking utility; the moved entries and strings can be then referenced
603 from the debugging information of each of those executable or shared object files.
606 A DWARF \addtoindex{supplementary object file} is itself an object file,
607 using the same object
608 file format, \byteorder{}, and size as the corresponding application executables
609 or shared libraries. It consists only of a file header, section table, and
610 a number of DWARF debug information sections. Both the
611 \addtoindex{supplementary object file}
612 and all the executable or shared object files that reference entries or strings in that
613 file must contain a \dotdebugsup{} section that establishes the relationship.
615 The \dotdebugsup{} section contains:
616 \begin{enumerate}[1. ]
617 \item \texttt{version} (\HFTuhalf) \\
618 \addttindexx{version}
619 A 2-byte unsigned integer representing the version of the DWARF
620 information for the compilation unit (see Appendix G). The
621 value in this field is \versiondotdebugsup.
623 \item \texttt{is\_supplementary} (\HFTubyte) \\
624 \addttindexx{is\_supplementary}
625 A 1-byte unsigned integer, which contains the value 1 if it is
626 in the \addtoindex{supplementary object file} that other executable or
627 shared object files refer to, or 0 if it is an executable or shared object
628 referring to a \addtoindex{supplementary object file}.
631 \item \texttt{sup\_filename} (null terminated filename string) \\
632 \addttindexx{sup\_filename}
633 If \addttindex{is\_supplementary} is 0, this contains either an absolute
634 filename for the \addtoindex{supplementary object file}, or a filename
635 relative to the object file containing the \dotdebugsup{} section.
636 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
637 is not needed and must be an empty string (a single null byte).
640 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
641 \addttindexx{sup\_checksum\_len}
642 Length of the following \addttindex{sup\_checksum} field;
643 his value can be 0 if no checksum is provided.
646 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
647 \addttindexx{sup\_checksum}
648 Some checksum or cryptographic hash function of the \dotdebuginfo{},
649 \dotdebugstr{} and \dotdebugmacro{} sections of the
650 \addtoindex{supplementary object file}, or some unique identifier
651 which the implementation can choose to verify that the supplementary
652 section object file matches what the debug information in the executable
653 or shared object file expects.
656 Debug information entries that refer to an executable's or shared
657 object's addresses must \emph{not} be moved to supplementary files (the
658 addesses will likely not be the same). Similarly,
659 entries referenced from within location expressions or using loclistptr
660 form attributes must not be moved to a \addtoindex{supplementary object file}.
662 Executable or shared object file compilation units can use
663 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
664 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
665 attributes to refer to them and \DWFORMstrpsup{} form attributes to
666 refer to strings that are used by debug information of multiple
667 executables or shared object files. Within the \addtoindex{supplementary object file}'s
668 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
669 not used, and all reference forms referring to some other sections
670 refer to the local sections in the \addtoindex{supplementary object file}.
672 In macro information, \DWMACROdefinesup{} or
673 \DWMACROundefsup{} opcodes can refer to strings in the
674 \dotdebugstr{} section of the \addtoindex{supplementary object file},
675 or \DWMACROimportsup{}
676 can refer to \dotdebugmacro{} section entries. Within the
677 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
678 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
679 opcodes refer to the local \dotdebugstr{} section in that
680 supplementary file, not the one in
681 the executable or shared object file.
685 \section{32-Bit and 64-Bit DWARF Formats}
686 \label{datarep:32bitand64bitdwarfformats}
687 \hypertarget{datarep:xxbitdwffmt}{}
688 \addtoindexx{32-bit DWARF format}
689 \addtoindexx{64-bit DWARF format}
690 There are two closely related file formats. In the 32-bit DWARF
691 format, all values that represent lengths of DWARF sections
692 and offsets relative to the beginning of DWARF sections are
693 represented using four bytes. In the 64-bit DWARF format, all
694 values that represent lengths of DWARF sections and offsets
695 relative to the beginning of DWARF sections are represented
696 using eight bytes. A special convention applies to the initial
697 length field of certain DWARF sections, as well as the CIE and
698 FDE structures, so that the 32-bit and 64-bit DWARF formats
699 can coexist and be distinguished within a single linked object.
701 The differences between the 32- and 64-bit DWARF formats are
702 detailed in the following:
703 \begin{enumerate}[1. ]
705 \item In the 32-bit DWARF format, an
706 \addtoindex{initial length} field (see
707 \addtoindexx{initial length!encoding}
708 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
709 is an unsigned 4-byte integer (which
710 must be less than \xfffffffzero); in the 64-bit DWARF format,
711 an \addtoindex{initial length} field is 12 bytes in size,
714 \item The first four bytes have the value \xffffffff.
716 \item The following eight bytes contain the actual length
717 represented as an unsigned 8-byte integer.
720 \textit{This representation allows a DWARF consumer to dynamically
721 detect that a DWARF section contribution is using the 64-bit
722 format and to adapt its processing accordingly.}
725 \item Section offset and section length
726 \hypertarget{datarep:sectionoffsetlength}{}
727 \addtoindexx{section length!use in headers}
729 \addtoindexx{section offset!use in headers}
730 in the headers of DWARF sections (other than initial length
731 \addtoindexx{initial length}
732 fields) are listed following. In the 32-bit DWARF format these
733 are 4-byte unsigned integer values; in the 64-bit DWARF format,
734 they are 8-byte unsigned integer values.
738 Section &Name & Role \\ \hline
739 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
740 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
741 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
742 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
743 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
744 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
750 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
751 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
752 union must be accessed to distinguish whether a CIE or FDE is
753 present, consequently, these two fields must exactly overlay
754 each other (both offset and size).
756 \item Within the body of the \dotdebuginfo{}
757 section, certain forms of attribute value depend on the choice
758 of DWARF format as follows. For the 32-bit DWARF format,
759 the value is a 4-byte unsigned integer; for the 64-bit DWARF
760 format, the value is an 8-byte unsigned integer.
762 \begin{tabular}{lp{6cm}}
763 Form & Role \\ \hline
764 \DWFORMlinestrp & offset in \dotdebuglinestr \\
765 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
766 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
767 \addtoindexx{supplementary object file}
768 \DWFORMsecoffset & offset in a section other than \\
769 & \dotdebuginfo{} or \dotdebugstr{} \\
770 \DWFORMstrp & offset in \dotdebugstr{} \\
771 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
772 \DWOPcallref & offset in \dotdebuginfo{} \\
777 \item Within the body of the \dotdebugline{} section, certain forms of content
778 description depend on the choice of DWARF format as follows: for the
779 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
780 64-bit DWARF format, the value is a 8-byte unsigned integer.
782 \begin{tabular}{lp{6cm}}
783 Form & Role \\ \hline
784 \DWFORMlinestrp & offset in \dotdebuglinestr
788 \item Within the body of the \dotdebugnames{}
789 sections, the representation of each entry in the array of
790 compilation units (CUs) and the array of local type units
791 (TUs), which represents an offset in the
793 section, depends on the DWARF format as follows: in the
794 32-bit DWARF format, each entry is a 4-byte unsigned integer;
795 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
798 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
799 sections, the size of entries in the body depend on the DWARF
800 format as follows: in the 32-bit DWARF format, entries are 4-byte
801 unsigned integer values; in the 64-bit DWARF format, they are
802 8-byte unsigned integers.
804 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
805 sections, the contents of the address size fields depends on the
806 DWARF format as follows: in the 32-bit DWARF format, these fields
807 contain 4; in the 64-bit DWARF format these fields contain 8.
811 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
812 intermixed within a single compilation unit.
814 \textit{Attribute values and section header fields that represent
815 addresses in the target program are not affected by these
818 A DWARF consumer that supports the 64-bit DWARF format must
819 support executables in which some compilation units use the
820 32-bit format and others use the 64-bit format provided that
821 the combination links correctly (that is, provided that there
822 are no link\dash time errors due to truncation or overflow). (An
823 implementation is not required to guarantee detection and
824 reporting of all such errors.)
826 \textit{It is expected that DWARF producing compilers will \emph{not} use
827 the 64-bit format \emph{by default}. In most cases, the division of
828 even very large applications into a number of executable and
829 shared object files will suffice to assure that the DWARF sections
830 within each individual linked object are less than 4 GBytes
831 in size. However, for those cases where needed, the 64-bit
832 format allows the unusual case to be handled as well. Even
833 in this case, it is expected that only application supplied
834 objects will need to be compiled using the 64-bit format;
835 separate 32-bit format versions of system supplied shared
836 executable libraries can still be used.}
840 \section{Format of Debugging Information}
841 \label{datarep:formatofdebugginginformation}
843 For each compilation unit compiled with a DWARF producer,
844 a contribution is made to the \dotdebuginfo{} section of
845 the object file. Each such contribution consists of a
846 compilation unit header
847 (see Section \refersec{datarep:compilationunitheader})
849 single \DWTAGcompileunit{} or
850 \DWTAGpartialunit{} debugging
851 information entry, together with its children.
853 For each type defined in a compilation unit, a separate
854 contribution may also be made to the
856 section of the object file. Each
857 such contribution consists of a
858 \addtoindex{type unit} header
859 (see Section \refersec{datarep:typeunitheader})
860 followed by a \DWTAGtypeunit{} entry, together with
863 Each debugging information entry begins with a code that
864 represents an entry in a separate
865 \addtoindex{abbreviations table}. This
866 code is followed directly by a series of attribute values.
868 The appropriate entry in the
869 \addtoindex{abbreviations table} guides the
870 interpretation of the information contained directly in the
871 \dotdebuginfo{} section.
874 Multiple debugging information entries may share the same
875 abbreviation table entry. Each compilation unit is associated
876 with a particular abbreviation table, but multiple compilation
877 units may share the same table.
879 \subsection{Unit Headers}
880 \label{datarep:unitheaders}
881 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
882 compilation unit that follows. The encodings for the unit type
883 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
887 \setlength{\extrarowheight}{0.1cm}
888 \begin{longtable}{l|c}
889 \caption{Unit header unit type encodings}
890 \label{tab:unitheaderunitkindencodings}
891 \addtoindexx{unit header unit type encodings} \\
892 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
894 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
896 \hline \emph{Continued on next page}
898 \hline \ddag\ \textit{New in DWARF Version 5}
900 \DWUTcompileTARG~\ddag &0x01 \\
901 \DWUTtypeTARG~\ddag &0x02 \\
902 \DWUTpartialTARG~\ddag &0x03 \\ \hline
907 \subsubsection{Compilation Unit Header}
908 \label{datarep:compilationunitheader}
909 \begin{enumerate}[1. ]
911 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
912 \addttindexx{unit\_length}
914 \addtoindexx{initial length}
915 unsigned integer representing the length
916 of the \dotdebuginfo{}
917 contribution for that compilation unit,
918 not including the length field itself. In the \thirtytwobitdwarfformat,
919 this is a 4-byte unsigned integer (which must be less
920 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
921 of the 4-byte value \wffffffff followed by an 8-byte unsigned
922 integer that gives the actual length
923 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
925 \item \texttt{version} (\HFTuhalf) \\
926 \addttindexx{version}
927 A 2-byte unsigned integer representing the version of the
928 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
929 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
930 The value in this field is \versiondotdebuginfo.
933 \item \texttt{unit\_type} (\HFTubyte) \\
934 \addttindexx{unit\_type}
935 A 1-byte unsigned integer identifying this unit as a compilation unit.
936 The value of this field is
937 \DWUTcompile{} for a {normal compilation} unit or
938 \DWUTpartial{} for a {partial compilation} unit
939 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
941 \textit{This field is new in \DWARFVersionV.}
944 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
946 \addtoindexx{section offset!in .debug\_info header}
947 4-byte or 8-byte unsigned offset into the
949 section. This offset associates the compilation unit with a
950 particular set of debugging information entry abbreviations. In
951 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
952 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
953 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
955 \item \texttt{address\_size} (\HFTubyte) \\
956 \addttindexx{address\_size}
957 A 1-byte unsigned integer representing the size in bytes of
958 an address on the target architecture. If the system uses
959 \addtoindexx{address space!segmented}
960 segmented addressing, this value represents the size of the
961 offset portion of an address.
965 \subsubsection{Type Unit Header}
966 \label{datarep:typeunitheader}
968 The header for the series of debugging information entries
969 contributing to the description of a type that has been
970 placed in its own \addtoindex{type unit}, within the
971 \dotdebuginfo{} section,
972 consists of the following information:
973 \begin{enumerate}[1. ]
975 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
976 \addttindexx{unit\_length}
977 A 4-byte or 12-byte unsigned integer
978 \addtoindexx{initial length}
979 representing the length
980 of the \dotdebuginfo{} contribution for that type unit,
981 not including the length field itself. In the \thirtytwobitdwarfformat,
982 this is a 4-byte unsigned integer (which must be
983 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
984 consists of the 4-byte value \wffffffff followed by an
985 8-byte unsigned integer that gives the actual length
986 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
989 \item \texttt{version} (\HFTuhalf) \\
990 \addttindexx{version}
991 A 2-byte unsigned integer representing the version of the
992 DWARF information for the
993 type unit\addtoindexx{version number!type unit}
994 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
995 The value in this field is \versiondotdebuginfo.
997 \item \texttt{unit\_type} (\HFTubyte) \\
998 \addttindexx{unit\_type}
999 A 1-byte unsigned integer identifying this unit as a type unit.
1000 The value of this field is \DWUTtype{} for a type unit
1001 (see Section \refersec{chap:typeunitentries}).
1003 \textit{This field is new in \DWARFVersionV.}
1006 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1008 \addtoindexx{section offset!in .debug\_info header}
1009 4-byte or 8-byte unsigned offset into the
1011 section. This offset associates the type unit with a
1012 particular set of debugging information entry abbreviations. In
1013 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1014 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1015 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1018 \item \texttt{address\_size} (\HFTubyte) \\
1019 \addttindexx{address\_size}
1020 A 1-byte unsigned integer representing the size
1021 \addtoindexx{size of an address}
1023 an address on the target architecture. If the system uses
1024 \addtoindexx{address space!segmented}
1025 segmented addressing, this value represents the size of the
1026 offset portion of an address.
1028 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1029 \addttindexx{type\_signature}
1030 \addtoindexx{type signature}
1031 A unique 64-bit signature (see Section
1032 \refersec{datarep:typesignaturecomputation})
1033 of the type described in this type
1036 \textit{An attribute that refers (using
1037 \DWFORMrefsigeight{}) to
1038 the primary type contained in this
1039 \addtoindex{type unit} uses this value.}
1041 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1042 \addttindexx{type\_offset}
1043 A 4-byte or 8-byte unsigned offset
1044 \addtoindexx{section offset!in .debug\_info header}
1045 relative to the beginning
1046 of the \addtoindex{type unit} header.
1047 This offset refers to the debugging
1048 information entry that describes the type. Because the type
1049 may be nested inside a namespace or other structures, and may
1050 contain references to other types that have not been placed in
1051 separate type units, it is not necessarily either the first or
1052 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1053 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1054 this is an 8-byte unsigned length
1055 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1059 \subsection{Debugging Information Entry}
1060 \label{datarep:debugginginformationentry}
1062 Each debugging information entry begins with an
1063 unsigned LEB128\addtoindexx{LEB128!unsigned}
1064 number containing the abbreviation code for the entry. This
1065 code represents an entry within the abbreviations table
1066 associated with the compilation unit containing this entry. The
1067 abbreviation code is followed by a series of attribute values.
1069 On some architectures, there are alignment constraints on
1070 section boundaries. To make it easier to pad debugging
1071 information sections to satisfy such constraints, the
1072 abbreviation code 0 is reserved. Debugging information entries
1073 consisting of only the abbreviation code 0 are considered
1076 \subsection{Abbreviations Tables}
1077 \label{datarep:abbreviationstables}
1079 The abbreviations tables for all compilation units
1080 are contained in a separate object file section called
1082 As mentioned before, multiple compilation
1083 units may share the same abbreviations table.
1085 The abbreviations table for a single compilation unit consists
1086 of a series of abbreviation declarations. Each declaration
1087 specifies the tag and attributes for a particular form of
1088 debugging information entry. Each declaration begins with
1089 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1090 number representing the abbreviation
1091 code itself. It is this code that appears at the beginning
1092 of a debugging information entry in the
1094 section. As described above, the abbreviation
1095 code 0 is reserved for null debugging information entries. The
1096 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1097 number that encodes the entry\textquoteright s tag. The encodings for the
1098 tag names are given in
1099 Table \referfol{tab:tagencodings}.
1102 \setlength{\extrarowheight}{0.1cm}
1103 \begin{longtable}{l|c}
1104 \caption{Tag encodings} \label{tab:tagencodings} \\
1105 \hline \bfseries Tag name&\bfseries Value\\ \hline
1107 \bfseries Tag name&\bfseries Value \\ \hline
1109 \hline \emph{Continued on next page}
1111 \hline \ddag\ \textit{New in DWARF Version 5}
1113 \DWTAGarraytype{} &0x01 \\
1114 \DWTAGclasstype&0x02 \\
1115 \DWTAGentrypoint&0x03 \\
1116 \DWTAGenumerationtype&0x04 \\
1117 \DWTAGformalparameter&0x05 \\
1118 \DWTAGimporteddeclaration&0x08 \\
1120 \DWTAGlexicalblock&0x0b \\
1121 \DWTAGmember&0x0d \\
1122 \DWTAGpointertype&0x0f \\
1123 \DWTAGreferencetype&0x10 \\
1124 \DWTAGcompileunit&0x11 \\
1125 \DWTAGstringtype&0x12 \\
1126 \DWTAGstructuretype&0x13 \\
1127 \DWTAGsubroutinetype&0x15 \\
1128 \DWTAGtypedef&0x16 \\
1129 \DWTAGuniontype&0x17 \\
1130 \DWTAGunspecifiedparameters&0x18 \\
1131 \DWTAGvariant&0x19 \\
1132 \DWTAGcommonblock&0x1a \\
1133 \DWTAGcommoninclusion&0x1b \\
1134 \DWTAGinheritance&0x1c \\
1135 \DWTAGinlinedsubroutine&0x1d \\
1136 \DWTAGmodule&0x1e \\
1137 \DWTAGptrtomembertype&0x1f \\
1138 \DWTAGsettype&0x20 \\
1139 \DWTAGsubrangetype&0x21 \\
1140 \DWTAGwithstmt&0x22 \\
1141 \DWTAGaccessdeclaration&0x23 \\
1142 \DWTAGbasetype&0x24 \\
1143 \DWTAGcatchblock&0x25 \\
1144 \DWTAGconsttype&0x26 \\
1145 \DWTAGconstant&0x27 \\
1146 \DWTAGenumerator&0x28 \\
1147 \DWTAGfiletype&0x29 \\
1148 \DWTAGfriend&0x2a \\
1149 \DWTAGnamelist&0x2b \\
1150 \DWTAGnamelistitem&0x2c \\
1151 \DWTAGpackedtype&0x2d \\
1152 \DWTAGsubprogram&0x2e \\
1153 \DWTAGtemplatetypeparameter&0x2f \\
1154 \DWTAGtemplatevalueparameter&0x30 \\
1155 \DWTAGthrowntype&0x31 \\
1156 \DWTAGtryblock&0x32 \\
1157 \DWTAGvariantpart&0x33 \\
1158 \DWTAGvariable&0x34 \\
1159 \DWTAGvolatiletype&0x35 \\
1160 \DWTAGdwarfprocedure&0x36 \\
1161 \DWTAGrestricttype&0x37 \\
1162 \DWTAGinterfacetype&0x38 \\
1163 \DWTAGnamespace&0x39 \\
1164 \DWTAGimportedmodule&0x3a \\
1165 \DWTAGunspecifiedtype&0x3b \\
1166 \DWTAGpartialunit&0x3c \\
1167 \DWTAGimportedunit&0x3d \\
1168 \DWTAGcondition&\xiiif \\
1169 \DWTAGsharedtype&0x40 \\
1170 \DWTAGtypeunit & 0x41 \\
1171 \DWTAGrvaluereferencetype & 0x42 \\
1172 \DWTAGtemplatealias & 0x43 \\
1173 \DWTAGcoarraytype~\ddag & 0x44 \\
1174 \DWTAGgenericsubrange~\ddag & 0x45 \\
1175 \DWTAGdynamictype~\ddag & 0x46 \\
1176 \DWTAGatomictype~\ddag & 0x47 \\
1177 \DWTAGcallsite~\ddag & 0x48 \\
1178 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1179 \DWTAGlouser&0x4080 \\
1180 \DWTAGhiuser&\xffff \\
1184 Following the tag encoding is a 1-byte value that determines
1185 whether a debugging information entry using this abbreviation
1186 has child entries or not. If the value is
1188 the next physically succeeding entry of any debugging
1189 information entry using this abbreviation is the first
1190 child of that entry. If the 1-byte value following the
1191 abbreviation\textquoteright s tag encoding is
1192 \DWCHILDRENnoTARG, the next
1193 physically succeeding entry of any debugging information entry
1194 using this abbreviation is a sibling of that entry. (Either
1195 the first child or sibling entries may be null entries). The
1196 encodings for the child determination byte are given in
1197 Table \refersec{tab:childdeterminationencodings}
1199 Section \refersec{chap:relationshipofdebugginginformationentries},
1200 each chain of sibling entries is terminated by a null entry.)
1204 \setlength{\extrarowheight}{0.1cm}
1205 \begin{longtable}{l|c}
1206 \caption{Child determination encodings}
1207 \label{tab:childdeterminationencodings}
1208 \addtoindexx{Child determination encodings} \\
1209 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1211 \bfseries Children determination name&\bfseries Value \\ \hline
1213 \hline \emph{Continued on next page}
1217 \DWCHILDRENno&0x00 \\
1218 \DWCHILDRENyes&0x01 \\ \hline
1223 Finally, the child encoding is followed by a series of
1224 attribute specifications. Each attribute specification
1225 consists of two parts. The first part is an
1226 unsigned LEB128\addtoindexx{LEB128!unsigned}
1227 number representing the attribute\textquoteright s name.
1228 The second part is an
1229 unsigned LEB128\addtoindexx{LEB128!unsigned}
1230 number representing the attribute\textquoteright s form.
1231 The series of attribute specifications ends with an
1232 entry containing 0 for the name and 0 for the form.
1235 \DWFORMindirectTARG{} is a special case. For
1236 attributes with this form, the attribute value itself in the
1238 section begins with an unsigned
1239 LEB128 number that represents its form. This allows producers
1240 to choose forms for particular attributes
1241 \addtoindexx{abbreviations table!dynamic forms in}
1243 without having to add a new entry to the abbreviations table.
1245 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1246 For attributes with this form, the attribute specification contains
1247 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1248 number. The value of this number is used as the value of the
1249 attribute, and no value is stored in the \dotdebuginfo{} section.
1251 The abbreviations for a given compilation unit end with an
1252 entry consisting of a 0 byte for the abbreviation code.
1255 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1256 for a depiction of the organization of the
1257 debugging information.}
1260 \subsection{Attribute Encodings}
1261 \label{datarep:attributeencodings}
1263 The encodings for the attribute names are given in
1264 Table \referfol{tab:attributeencodings}.
1267 \setlength{\extrarowheight}{0.1cm}
1268 \begin{longtable}{l|c|l}
1269 \caption{Attribute encodings}
1270 \label{tab:attributeencodings}
1271 \addtoindexx{attribute encodings} \\
1272 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1274 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1276 \hline \emph{Continued on next page}
1278 \hline \ddag\ \textit{New in DWARF Version 5}
1280 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1281 \addtoindexx{sibling attribute} \\
1282 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1283 \livelink{chap:classloclistptr}{loclistptr}
1284 \addtoindexx{location attribute} \\
1285 \DWATname&0x03&\livelink{chap:classstring}{string}
1286 \addtoindexx{name attribute} \\
1287 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1288 \addtoindexx{ordering attribute} \\
1289 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1290 \livelink{chap:classexprloc}{exprloc},
1291 \livelink{chap:classreference}{reference}
1292 \addtoindexx{byte size attribute} \\
1293 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1294 DW\_AT\_bit\_offset \mbox{attribute} which was
1295 defined in \DWARFVersionIII{} and earlier.}
1296 &\livelink{chap:classconstant}{constant},
1297 \livelink{chap:classexprloc}{exprloc},
1298 \livelink{chap:classreference}{reference}
1299 \addtoindexx{bit offset attribute (Version 3)}
1300 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1301 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1302 \livelink{chap:classexprloc}{exprloc},
1303 \livelink{chap:classreference}{reference}
1304 \addtoindexx{bit size attribute} \\
1305 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1306 \addtoindexx{statement list attribute} \\
1307 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1308 \addtoindexx{low PC attribute} \\
1309 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1310 \livelink{chap:classconstant}{constant}
1311 \addtoindexx{high PC attribute} \\
1312 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1313 \addtoindexx{language attribute} \\
1314 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1315 \addtoindexx{discriminant attribute} \\
1316 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1317 \addtoindexx{discriminant value attribute} \\
1318 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1319 \addtoindexx{visibility attribute} \\
1320 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1321 \addtoindexx{import attribute} \\
1322 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1323 \livelink{chap:classloclistptr}{loclistptr}
1324 \addtoindexx{string length attribute} \\
1325 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1326 \addtoindexx{common reference attribute} \\
1327 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1328 \addtoindexx{compilation directory attribute} \\
1329 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1330 \livelink{chap:classconstant}{constant},
1331 \livelink{chap:classstring}{string}
1332 \addtoindexx{constant value attribute} \\
1333 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1334 \addtoindexx{containing type attribute} \\
1335 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1336 \livelink{chap:classreference}{reference},
1337 \livelink{chap:classflag}{flag}
1338 \addtoindexx{default value attribute} \\
1339 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1340 \addtoindexx{inline attribute} \\
1341 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1342 \addtoindexx{is optional attribute} \\
1343 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1344 \livelink{chap:classexprloc}{exprloc},
1345 \livelink{chap:classreference}{reference}
1346 \addtoindexx{lower bound attribute} \\
1347 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1348 \addtoindexx{producer attribute} \\
1349 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1350 \addtoindexx{prototyped attribute} \\
1351 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1352 \livelink{chap:classloclistptr}{loclistptr}
1353 \addtoindexx{return address attribute} \\
1354 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1355 \livelink{chap:classrangelistptr}{rangelistptr}
1356 \addtoindexx{start scope attribute} \\
1357 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1358 \livelink{chap:classexprloc}{exprloc},
1359 \livelink{chap:classreference}{reference}
1360 \addtoindexx{bit stride attribute} \\
1361 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1362 \livelink{chap:classexprloc}{exprloc},
1363 \livelink{chap:classreference}{reference}
1364 \addtoindexx{upper bound attribute} \\
1365 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1366 \addtoindexx{abstract origin attribute} \\
1367 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1368 \addtoindexx{accessibility attribute} \\
1369 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1370 \addtoindexx{address class attribute} \\
1371 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1372 \addtoindexx{artificial attribute} \\
1373 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1374 \addtoindexx{base types attribute} \\
1375 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1376 \addtoindexx{calling convention attribute} \\
1377 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1378 \livelink{chap:classexprloc}{exprloc},
1379 \livelink{chap:classreference}{reference}
1380 \addtoindexx{count attribute} \\
1381 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1382 \livelink{chap:classexprloc}{exprloc},
1383 \livelink{chap:classloclistptr}{loclistptr}
1384 \addtoindexx{data member attribute} \\
1385 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1386 \addtoindexx{declaration column attribute} \\
1387 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1388 \addtoindexx{declaration file attribute} \\
1389 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1390 \addtoindexx{declaration line attribute} \\
1391 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1392 \addtoindexx{declaration attribute} \\
1393 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1394 \addtoindexx{discriminant list attribute} \\
1395 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1396 \addtoindexx{encoding attribute} \\
1397 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1398 \addtoindexx{external attribute} \\
1399 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1400 \livelink{chap:classloclistptr}{loclistptr}
1401 \addtoindexx{frame base attribute} \\
1402 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1403 \addtoindexx{friend attribute} \\
1404 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1405 \addtoindexx{identifier case attribute} \\
1406 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1407 Reserved for compatibility and coexistence
1408 with prior DWARF versions.}
1409 &0x43&\livelink{chap:classmacptr}{macptr}
1410 \addtoindexx{macro information attribute (legacy)!encoding} \\
1411 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1412 \addtoindexx{name list item attribute} \\
1413 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1414 \addtoindexx{priority attribute} \\
1415 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1416 \livelink{chap:classloclistptr}{loclistptr}
1417 \addtoindexx{segment attribute} \\
1418 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1419 \addtoindexx{specification attribute} \\
1420 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1421 \livelink{chap:classloclistptr}{loclistptr}
1422 \addtoindexx{static link attribute} \\
1423 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1424 \addtoindexx{type attribute} \\
1425 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1426 \livelink{chap:classloclistptr}{loclistptr}
1427 \addtoindexx{location list attribute} \\
1428 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1429 \addtoindexx{variable parameter attribute} \\
1430 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1431 \addtoindexx{virtuality attribute} \\
1432 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1433 \livelink{chap:classloclistptr}{loclistptr}
1434 \addtoindexx{vtable element location attribute} \\
1435 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1436 \livelink{chap:classexprloc}{exprloc},
1437 \livelink{chap:classreference}{reference}
1438 \addtoindexx{allocated attribute} \\
1439 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1440 \livelink{chap:classexprloc}{exprloc},
1441 \livelink{chap:classreference}{reference}
1442 \addtoindexx{associated attribute} \\
1443 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1444 \addtoindexx{data location attribute} \\
1445 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1446 \livelink{chap:classexprloc}{exprloc},
1447 \livelink{chap:classreference}{reference}
1448 \addtoindexx{byte stride attribute} \\
1449 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1450 \livelink{chap:classconstant}{constant}
1451 \addtoindexx{entry PC attribute} \\
1452 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1453 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1454 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1455 \addtoindexx{extension attribute} \\
1456 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1457 \addtoindexx{ranges attribute} \\
1458 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1459 \livelink{chap:classflag}{flag},
1460 \livelink{chap:classreference}{reference},
1461 \livelink{chap:classstring}{string}
1462 \addtoindexx{trampoline attribute} \\
1463 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1464 \addtoindexx{call column attribute} \\
1465 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1466 \addtoindexx{call file attribute} \\
1467 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1468 \addtoindexx{call line attribute} \\
1469 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1470 \addtoindexx{description attribute} \\
1471 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1472 \addtoindexx{binary scale attribute} \\
1473 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1474 \addtoindexx{decimal scale attribute} \\
1475 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1476 \addtoindexx{small attribute} \\
1477 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1478 \addtoindexx{decimal scale attribute} \\
1479 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1480 \addtoindexx{digit count attribute} \\
1481 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1482 \addtoindexx{picture string attribute} \\
1483 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1484 \addtoindexx{mutable attribute} \\
1485 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1486 \addtoindexx{thread scaled attribute} \\
1487 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1488 \addtoindexx{explicit attribute} \\
1489 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1490 \addtoindexx{object pointer attribute} \\
1491 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1492 \addtoindexx{endianity attribute} \\
1493 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1494 \addtoindexx{elemental attribute} \\
1495 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1496 \addtoindexx{pure attribute} \\
1497 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1498 \addtoindexx{recursive attribute} \\
1499 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1500 \addtoindexx{signature attribute} \\
1501 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1502 \addtoindexx{main subprogram attribute} \\
1503 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1504 \addtoindexx{data bit offset attribute} \\
1505 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1506 \addtoindexx{constant expression attribute} \\
1507 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1508 \addtoindexx{enumeration class attribute} \\
1509 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1510 \addtoindexx{linkage name attribute} \\
1511 \DWATstringlengthbitsize{}~\ddag&0x6f&
1512 \livelink{chap:classconstant}{constant}
1513 \addtoindexx{string length attribute!size of length} \\
1514 \DWATstringlengthbytesize{}~\ddag&0x70&
1515 \livelink{chap:classconstant}{constant}
1516 \addtoindexx{string length attribute!size of length} \\
1517 \DWATrank~\ddag&0x71&
1518 \livelink{chap:classconstant}{constant},
1519 \livelink{chap:classexprloc}{exprloc}
1520 \addtoindexx{rank attribute} \\
1521 \DWATstroffsetsbase~\ddag&0x72&
1522 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1523 \addtoindexx{string offsets base!encoding} \\
1524 \DWATaddrbase~\ddag &0x73&
1525 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1526 \addtoindexx{address table base!encoding} \\
1527 \DWATrangesbase~\ddag&0x74&
1528 \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class}
1529 \addtoindexx{ranges base!encoding} \\
1530 \DWATdwoid~\ddag &0x75&
1531 \livelink{chap:classconstant}{constant}
1532 \addtoindexx{split DWARF object file id!encoding} \\
1533 \DWATdwoname~\ddag &0x76&
1534 \livelink{chap:classstring}{string}
1535 \addtoindexx{split DWARF object file name!encoding} \\
1536 \DWATreference~\ddag &0x77&
1537 \livelink{chap:classflag}{flag} \\
1538 \DWATrvaluereference~\ddag &0x78&
1539 \livelink{chap:classflag}{flag} \\
1540 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1541 \addtoindexx{macro information attribute} \\
1542 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1543 \addtoindexx{all calls summary attribute} \\
1544 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1545 \addtoindexx{all source calls summary attribute} \\
1546 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1547 \addtoindexx{all tail calls summary attribute} \\
1548 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1549 \addtoindexx{call return PC attribute} \\
1550 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1551 \addtoindexx{call value attribute} \\
1552 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1553 \addtoindexx{call origin attribute} \\
1554 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1555 \addtoindexx{call parameter attribute} \\
1556 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1557 \addtoindexx{call PC attribute} \\
1558 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1559 \addtoindexx{call tail call attribute} \\
1560 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1561 \addtoindexx{call target attribute} \\
1562 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1563 \addtoindexx{call target clobbered attribute} \\
1564 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1565 \addtoindexx{call data location attribute} \\
1566 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1567 \addtoindexx{call data value attribute} \\
1568 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1569 \addtoindexx{noreturn attribute} \\
1570 \DWATalignment~\ddag &0x88 &\CLASSconstant
1571 \addtoindexx{alignment attribute} \\
1572 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1573 \addtoindexx{export symbols attribute} \\
1574 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1575 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1576 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1577 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1582 The attribute form governs how the value of the attribute is
1583 encoded. There are nine classes of form, listed below. Each
1584 class is a set of forms which have related representations
1585 and which are given a common interpretation according to the
1586 attribute in which the form is used.
1588 Form \DWFORMsecoffsetTARG{}
1590 \addtoindexx{rangelistptr class}
1592 \addtoindexx{macptr class}
1594 \addtoindexx{loclistptr class}
1596 \addtoindexx{lineptr class}
1602 \CLASSrangelistptr{} or
1603 \CLASSstroffsetsptr;
1604 the list of classes allowed by the applicable attribute in
1605 Table \refersec{tab:attributeencodings}
1606 determines the class of the form.
1609 In the form descriptions that follow, some forms are said
1610 to depend in part on the value of an attribute of the
1611 \definition{\associatedcompilationunit}:
1614 In the case of a \splitDWARFobjectfile{}, the associated
1615 compilation unit is the skeleton compilation unit corresponding
1616 to the containing unit.
1617 \item Otherwise, the associated compilation unit
1618 is the containing unit.
1622 Each possible form belongs to one or more of the following classes
1623 (see Table \refersec{tab:classesofattributevalue} for a summary of
1624 the purpose and general usage of each class):
1627 \item \livelinki{chap:classaddress}{address}{address class} \\
1628 \livetarg{datarep:classaddress}{}
1629 Represented as either:
1631 \item An object of appropriate size to hold an
1632 address on the target machine
1634 The size is encoded in the compilation unit header
1635 (see Section \refersec{datarep:compilationunitheader}).
1636 This address is relocatable in a relocatable object file and
1637 is relocated in an executable file or shared object file.
1639 \item An indirect index into a table of addresses (as
1640 described in the previous bullet) in the
1641 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1642 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1643 \addtoindex{LEB128} value, which is interpreted as a zero-based
1644 index into an array of addresses in the \dotdebugaddr{} section.
1645 The index is relative to the value of the \DWATaddrbase{} attribute
1646 of the associated compilation unit.
1651 \item \livelink{chap:classaddrptr}{addrptr} \\
1652 \livetarg{datarep:classaddrptr}{}
1653 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1654 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1655 beginning of the list of machine addresses information for the
1656 referencing entity. It is relocatable in
1657 a relocatable object file, and relocated in an executable or
1658 shared object file. In the \thirtytwobitdwarfformat, this offset
1659 is a 4-byte unsigned value; in the 64-bit DWARF
1660 format, it is an 8-byte unsigned value (see Section
1661 \refersec{datarep:32bitand64bitdwarfformats}).
1663 \textit{This class is new in \DWARFVersionV.}
1666 \item \livelink{chap:classblock}{block} \\
1667 \livetarg{datarep:classblock}{}
1668 Blocks come in four forms:
1671 A 1-byte length followed by 0 to 255 contiguous information
1672 bytes (\DWFORMblockoneTARG).
1675 A 2-byte length followed by 0 to 65,535 contiguous information
1676 bytes (\DWFORMblocktwoTARG).
1679 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1680 information bytes (\DWFORMblockfourTARG).
1683 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1684 length followed by the number of bytes
1685 specified by the length (\DWFORMblockTARG).
1688 In all forms, the length is the number of information bytes
1689 that follow. The information bytes may contain any mixture
1690 of relocated (or relocatable) addresses, references to other
1691 debugging information entries or data bytes.
1693 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1694 \livetarg{datarep:classconstant}{}
1695 There are eight forms of constants. There are fixed length
1696 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1700 \DWFORMdatafourTARG,
1701 \DWFORMdataeightTARG{} and
1702 \DWFORMdatasixteenTARG).
1703 There are also variable length constant
1704 data forms encoded using LEB128 numbers (see below).
1705 Both signed (\DWFORMsdataTARG) and unsigned
1706 (\DWFORMudataTARG) variable length constants are available.
1707 There is also an implicit constant (\DWFORMimplicitconst),
1708 whose value is provided as part of the abbreviation
1712 The data in \DWFORMdataone,
1715 \DWFORMdataeight{} and
1716 \DWFORMdatasixteen{}
1717 can be anything. Depending on context, it may
1718 be a signed integer, an unsigned integer, a floating\dash point
1719 constant, or anything else. A consumer must use context to
1720 know how to interpret the bits, which if they are target
1721 machine data (such as an integer or floating-point constant)
1722 will be in target machine \byteorder.
1724 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1725 forms is used to represent a
1726 signed or unsigned integer, it can be hard for a consumer
1727 to discover the context necessary to determine which
1728 interpretation is intended. Producers are therefore strongly
1729 encouraged to use \DWFORMsdata{} or
1730 \DWFORMudata{} for signed and
1731 unsigned integers respectively, rather than
1732 \DWFORMdata\textless n\textgreater.}
1735 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1736 \livetarg{datarep:classexprloc}{}
1737 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1738 number of information bytes specified by the length
1739 (\DWFORMexprlocTARG).
1740 The information bytes contain a DWARF expression
1741 (see Section \refersec{chap:dwarfexpressions})
1742 or location description
1743 (see Section \refersec{chap:locationdescriptions}).
1746 \item \livelinki{chap:classflag}{flag}{flag class} \\
1747 \livetarg{datarep:classflag}{}
1748 A flag \addtoindexx{flag class}
1749 is represented explicitly as a single byte of data
1750 (\DWFORMflagTARG) or
1751 implicitly (\DWFORMflagpresentTARG).
1753 first case, if the \nolink{flag} has value zero, it indicates the
1754 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1755 it indicates the presence of the attribute. In the second
1756 case, the attribute is implicitly indicated as present, and
1757 no value is encoded in the debugging information entry itself.
1759 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1760 \livetarg{datarep:classlineptr}{}
1761 This is an offset into
1762 \addtoindexx{section offset!in class lineptr value}
1764 \dotdebugline{} or \dotdebuglinedwo{} section
1766 It consists of an offset from the beginning of the
1768 section to the first byte of
1769 the data making up the line number list for the compilation
1771 It is relocatable in a relocatable object file, and
1772 relocated in an executable or shared object file. In the
1773 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1774 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1775 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1778 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1779 \livetarg{datarep:classloclistptr}{}
1780 This is an offset into the
1784 It consists of an offset from the
1785 \addtoindexx{section offset!in class loclistptr value}
1788 section to the first byte of
1789 the data making up the
1790 \addtoindex{location list} for the compilation unit.
1791 It is relocatable in a relocatable object file, and
1792 relocated in an executable or shared object file. In the
1793 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1794 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1795 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1798 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1799 \livetarg{datarep:classmacptr}{}
1801 \addtoindexx{section offset!in class macptr value}
1803 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1805 It consists of an offset from the beginning of the
1806 \dotdebugmacro{} or \dotdebugmacrodwo{}
1807 section to the the header making up the
1808 macro information list for the compilation unit.
1809 It is relocatable in a relocatable object file, and
1810 relocated in an executable or shared object file. In the
1811 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1812 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1813 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1816 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1817 \livetarg{datarep:classrangelistptr}{}
1819 \addtoindexx{section offset!in class rangelistptr value}
1820 offset into the \dotdebugranges{} section
1823 offset from the beginning of the
1824 \dotdebugranges{} section
1825 to the beginning of the non\dash contiguous address ranges
1826 information for the referencing entity.
1827 It is relocatable in
1828 a relocatable object file, and relocated in an executable or
1830 However, if a \DWATrangesbase{} attribute applies, the offset
1831 is relative to the base offset given by \DWATrangesbase.
1832 In the \thirtytwobitdwarfformat, this offset
1833 is a 4-byte unsigned value; in the 64-bit DWARF
1834 format, it is an 8-byte unsigned value (see Section
1835 \refersec{datarep:32bitand64bitdwarfformats}).
1838 \textit{Because classes
1843 \CLASSrangelistptr{} and
1844 \CLASSstroffsetsptr{}
1845 share a common representation, it is not possible for an
1846 attribute to allow more than one of these classes}
1850 \item \livelinki{chap:classreference}{reference}{reference class} \\
1851 \livetarg{datarep:classreference}{}
1852 There are four types of reference.
1855 \addtoindexx{reference class}
1856 first type of reference can identify any debugging
1857 information entry within the containing unit.
1860 \addtoindexx{section offset!in class reference value}
1861 offset from the first byte of the compilation
1862 header for the compilation unit containing the reference. There
1863 are five forms for this type of reference. There are fixed
1864 length forms for one, two, four and eight byte offsets
1870 and \DWFORMrefeightTARG).
1871 There is also an unsigned variable
1872 length offset encoded form that uses
1873 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1874 (\DWFORMrefudataTARG).
1875 Because this type of reference is within
1876 the containing compilation unit no relocation of the value
1879 The second type of reference can identify any debugging
1880 information entry within a
1881 \dotdebuginfo{} section; in particular,
1882 it may refer to an entry in a different compilation unit
1883 from the unit containing the reference, and may refer to an
1884 entry in a different shared object file. This type of reference
1885 (\DWFORMrefaddrTARG)
1886 is an offset from the beginning of the
1888 section of the target executable or shared object file, or, for
1889 references within a \addtoindex{supplementary object file},
1890 an offset from the beginning of the local \dotdebuginfo{} section;
1891 it is relocatable in a relocatable object file and frequently
1892 relocated in an executable or shared object file. For
1893 references from one shared object or static executable file
1894 to another, the relocation and identification of the target
1895 object must be performed by the consumer. In the
1896 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1897 in the \sixtyfourbitdwarfformat, it is an 8-byte
1899 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1901 \textit{A debugging information entry that may be referenced by
1902 another compilation unit using
1903 \DWFORMrefaddr{} must have a global symbolic name.}
1905 \textit{For a reference from one executable or shared object file to
1906 another, the reference is resolved by the debugger to identify
1907 the executable or shared object file and the offset into that
1908 file\textquoteright s \dotdebuginfo{}
1909 section in the same fashion as the run
1910 time loader, either when the debug information is first read,
1911 or when the reference is used.}
1913 The third type of reference can identify any debugging
1914 information type entry that has been placed in its own
1915 \addtoindex{type unit}. This type of
1916 reference (\DWFORMrefsigeightTARG) is the
1917 \addtoindexx{type signature}
1918 64-bit type signature
1919 (see Section \refersec{datarep:typesignaturecomputation})
1920 that was computed for the type.
1922 The fourth type of reference is a reference from within the
1923 \dotdebuginfo{} section of the executable or shared object file to
1924 a debugging information entry in the \dotdebuginfo{} section of
1925 a \addtoindex{supplementary object file}.
1926 This type of reference (\DWFORMrefsupTARG) is an offset from the
1927 beginning of the \dotdebuginfo{} section in the
1928 \addtoindex{supplementary object file}.
1930 \textit{The use of compilation unit relative references will reduce the
1931 number of link\dash time relocations and so speed up linking. The
1932 use of the second, third and fourth type of reference allows for the
1933 sharing of information, such as types, across compilation
1934 units, while the fourth type further allows for sharing of information
1935 across compilation units from different executables or shared object files.}
1937 \textit{A reference to any kind of compilation unit identifies the
1938 debugging information entry for that unit, not the preceding
1942 \item \livelinki{chap:classstring}{string}{string class} \\
1943 \livetarg{datarep:classstring}{}
1944 A string is a sequence of contiguous non\dash null bytes followed by
1946 \addtoindexx{string class}
1947 A string may be represented:
1949 \setlength{\itemsep}{0em}
1950 \item immediately in the debugging information entry itself
1951 (\DWFORMstringTARG),
1954 \addtoindexx{section offset!in class string value}
1955 offset into a string table contained in
1956 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
1957 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
1958 or as an offset into a string table contained in the
1959 \dotdebugstr{} section of a \addtoindex{supplementary object file}
1960 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
1961 section of a \addtoindex{supplementary object file}
1962 refer to the local \dotdebugstr{} section of that same file.
1963 In the \thirtytwobitdwarfformat, the representation of a
1964 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
1965 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
1966 it is an 8-byte unsigned offset
1967 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1970 \item as an indirect offset into the string table using an
1971 index into a table of offsets contained in the
1972 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1973 The representation of a \DWFORMstrxNAME{} value is an unsigned
1974 \addtoindex{LEB128} value, which is interpreted as a zero-based
1975 index into an array of offsets in the \dotdebugstroffsets{} section.
1976 The offset entries in the \dotdebugstroffsets{} section have the
1977 same representation as \DWFORMstrp{} values.
1979 Any combination of these three forms may be used within a single compilation.
1981 If the \DWATuseUTFeight{}
1982 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1983 compilation, partial, skeleton or type unit entry, string values are encoded using the
1984 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1985 Character Set standard (ISO/IEC 10646\dash 1:1993).
1986 \addtoindexx{ISO 10646 character set standard}
1987 Otherwise, the string representation is unspecified.
1989 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1990 ISO/IEC 10646\dash 1:1993.
1991 \addtoindexx{ISO 10646 character set standard}
1992 It contains all the same characters
1993 and encoding points as ISO/IEC 10646, as well as additional
1994 information about the characters and their use.}
1996 \textit{Earlier versions of DWARF did not specify the representation
1997 of strings; for compatibility, this version also does
1998 not. However, the UTF\dash 8 representation is strongly recommended.}
2001 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
2002 \livetarg{datarep:classstroffsetsptr}{}
2003 This is an offset into the \dotdebugstroffsets{} section
2004 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2005 \dotdebugstroffsets{} section to the
2006 beginning of the string offsets information for the
2007 referencing entity. It is relocatable in
2008 a relocatable object file, and relocated in an executable or
2009 shared object file. In the \thirtytwobitdwarfformat, this offset
2010 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2011 it is an 8-byte unsigned value (see Section
2012 \refersec{datarep:32bitand64bitdwarfformats}).
2014 \textit{This class is new in \DWARFVersionV.}
2018 In no case does an attribute use one of the classes
2023 \CLASSrangelistptr{} or
2024 \CLASSstroffsetsptr{}
2025 to point into either the
2026 \dotdebuginfo{} or \dotdebugstr{} section.
2028 The form encodings are listed in
2029 Table \referfol{tab:attributeformencodings}.
2033 \setlength{\extrarowheight}{0.1cm}
2034 \begin{longtable}{l|c|l}
2035 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2036 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2038 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2040 \hline \emph{Continued on next page}
2042 \hline \ddag\ \textit{New in DWARF Version 5}
2045 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2046 \textit{Reserved} &0x02& \\
2047 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2048 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2049 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2050 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2051 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2052 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2053 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2054 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2055 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2056 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2057 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2058 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2059 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2060 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2061 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2062 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2063 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2064 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2065 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2066 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2067 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
2068 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
2069 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2070 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2071 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2072 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2073 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2074 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2075 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2076 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2077 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2078 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2084 \section{Variable Length Data}
2085 \label{datarep:variablelengthdata}
2086 \addtoindexx{variable length data|see {LEB128}}
2088 \addtoindexx{Little Endian Base 128|see{LEB128}}
2089 encoded using \doublequote{Little Endian Base 128}
2090 \addtoindexx{little-endian encoding|see{endian attribute}}
2092 \addtoindexx{LEB128}
2093 LEB128 is a scheme for encoding integers
2094 densely that exploits the assumption that most integers are
2097 \textit{This encoding is equally suitable whether the target machine
2098 architecture represents data in big\dash\ endian or little\dash endian
2099 \byteorder. It is \doublequote{little\dash endian} only in the sense that it
2100 avoids using space to represent the \doublequote{big} end of an
2101 unsigned integer, when the big end is all zeroes or sign
2104 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2105 numbers are encoded as follows:
2106 \addtoindexx{LEB128!unsigned, encoding as}
2107 start at the low order end of an unsigned integer and chop
2108 it into 7-bit chunks. Place each chunk into the low order 7
2109 bits of a byte. Typically, several of the high order bytes
2110 will be zero; discard them. Emit the remaining bytes in a
2111 stream, starting with the low order byte; set the high order
2112 bit on each byte except the last emitted byte. The high bit
2113 of zero on the last byte indicates to the decoder that it
2114 has encountered the last byte.
2116 The integer zero is a special case, consisting of a single
2119 Table \refersec{tab:examplesofunsignedleb128encodings}
2120 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2122 0x80 in each case is the high order bit of the byte, indicating
2123 that an additional byte follows.
2126 The encoding for signed, two\textquoteright{s} complement LEB128
2127 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2128 numbers is similar, except that the criterion for discarding
2129 high order bytes is not whether they are zero, but whether
2130 they consist entirely of sign extension bits. Consider the
2131 4-byte integer -2. The three high level bytes of the number
2132 are sign extension, thus LEB128 would represent it as a single
2133 byte containing the low order 7 bits, with the high order
2134 bit cleared to indicate the end of the byte stream. Note
2135 that there is nothing within the LEB128 representation that
2136 indicates whether an encoded number is signed or unsigned. The
2137 decoder must know what type of number to expect.
2138 Table \refersec{tab:examplesofunsignedleb128encodings}
2139 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2140 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2141 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2144 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2145 \addtoindexx{LEB128!examples}
2146 gives algorithms for encoding and decoding these forms.}
2150 \setlength{\extrarowheight}{0.1cm}
2151 \begin{longtable}{c|c|c}
2152 \caption{Examples of unsigned LEB128 encodings}
2153 \label{tab:examplesofunsignedleb128encodings}
2154 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2155 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2157 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2159 \hline \emph{Continued on next page}
2165 128& 0 + 0x80 & 1 \\
2166 129& 1 + 0x80 & 1 \\
2167 %130& 2 + 0x80 & 1 \\
2168 12857& 57 + 0x80 & 100 \\
2175 \setlength{\extrarowheight}{0.1cm}
2176 \begin{longtable}{c|c|c}
2177 \caption{Examples of signed LEB128 encodings}
2178 \label{tab:examplesofsignedleb128encodings}
2179 \addtoindexx{LEB128!signed} \\
2180 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2182 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2184 \hline \emph{Continued on next page}
2190 127& 127 + 0x80 & 0 \\
2191 -127& 1 + 0x80 & 0x7f \\
2192 128& 0 + 0x80 & 1 \\
2193 -128& 0 + 0x80 & 0x7f \\
2194 129& 1 + 0x80 & 1 \\
2195 -129& 0x7f + 0x80 & 0x7e \\
2202 \section{DWARF Expressions and Location Descriptions}
2203 \label{datarep:dwarfexpressionsandlocationdescriptions}
2204 \subsection{DWARF Expressions}
2205 \label{datarep:dwarfexpressions}
2208 \addtoindexx{DWARF expression!operator encoding}
2209 DWARF expression is stored in a \nolink{block} of contiguous
2210 bytes. The bytes form a sequence of operations. Each operation
2211 is a 1-byte code that identifies that operation, followed by
2212 zero or more bytes of additional data. The encodings for the
2213 operations are described in
2214 Table \refersec{tab:dwarfoperationencodings}.
2217 \setlength{\extrarowheight}{0.1cm}
2218 \begin{longtable}{l|c|c|l}
2219 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2220 \hline & &\bfseries No. of &\\
2221 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2223 & &\bfseries No. of &\\
2224 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2226 \hline \emph{Continued on next page}
2228 \hline \ddag\ \textit{New in DWARF Version 5}
2231 \DWOPaddr&0x03&1 & constant address \\
2232 & & &(size is target specific) \\
2234 \DWOPderef&0x06&0 & \\
2236 \DWOPconstoneu&0x08&1&1-byte constant \\
2237 \DWOPconstones&0x09&1&1-byte constant \\
2238 \DWOPconsttwou&0x0a&1&2-byte constant \\
2239 \DWOPconsttwos&0x0b&1&2-byte constant \\
2240 \DWOPconstfouru&0x0c&1&4-byte constant \\
2241 \DWOPconstfours&0x0d&1&4-byte constant \\
2242 \DWOPconsteightu&0x0e&1&8-byte constant \\
2243 \DWOPconsteights&0x0f&1&8-byte constant \\
2244 \DWOPconstu&0x10&1&ULEB128 constant \\
2245 \DWOPconsts&0x11&1&SLEB128 constant \\
2246 \DWOPdup&0x12&0 & \\
2247 \DWOPdrop&0x13&0 & \\
2248 \DWOPover&0x14&0 & \\
2249 \DWOPpick&0x15&1&1-byte stack index \\
2250 \DWOPswap&0x16&0 & \\
2251 \DWOProt&0x17&0 & \\
2252 \DWOPxderef&0x18&0 & \\
2253 \DWOPabs&0x19&0 & \\
2254 \DWOPand&0x1a&0 & \\
2255 \DWOPdiv&0x1b&0 & \\
2256 \DWOPminus&0x1c&0 & \\
2257 \DWOPmod&0x1d&0 & \\
2258 \DWOPmul&0x1e&0 & \\
2259 \DWOPneg&0x1f&0 & \\
2260 \DWOPnot&0x20&0 & \\
2262 \DWOPplus&0x22&0 & \\
2263 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2264 \DWOPshl&0x24&0 & \\
2265 \DWOPshr&0x25&0 & \\
2266 \DWOPshra&0x26&0 & \\
2267 \DWOPxor&0x27&0 & \\
2269 \DWOPbra&0x28&1 & signed 2-byte constant \\
2276 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2278 \DWOPlitzero & 0x30 & 0 & \\
2279 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2280 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2281 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2283 \DWOPregzero & 0x50 & 0 & \\*
2284 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2285 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2286 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2288 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2289 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2290 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2291 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2293 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2294 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2295 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2296 & & &SLEB128 offset \\
2297 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2298 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2299 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2300 \DWOPnop{} & 0x96 &0& \\
2302 \DWOPpushobjectaddress&0x97&0 & \\
2303 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2304 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2305 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2306 \DWOPformtlsaddress&0x9b &0& \\
2307 \DWOPcallframecfa{} &0x9c &0& \\
2308 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2310 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2311 &&&\nolink{block} of that size\\
2312 \DWOPstackvalue{} &0x9f &0& \\
2313 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2314 &&&SLEB128 constant offset \\
2315 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2316 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2317 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2318 &&&\nolink{block} of that size\\
2319 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2320 & & & 1-byte size, \\*
2321 & & & constant value \\
2322 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2323 &&& ULEB128 constant offset \\
2324 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2325 &&& ULEB128 type entry offset \\
2326 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2327 &&& ULEB128 type entry offset \\
2328 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2329 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2330 \DWOPlouser{} &0xe0 && \\
2331 \DWOPhiuser{} &\xff && \\
2337 \subsection{Location Descriptions}
2338 \label{datarep:locationdescriptions}
2340 A location description is used to compute the
2341 location of a variable or other entity.
2343 \subsection{Location Lists}
2344 \label{datarep:locationlists}
2346 Each entry in a \addtoindex{location list} is either a location list entry,
2347 a base address selection entry, or an
2348 \addtoindexx{end-of-list entry!in location list}
2352 \subsubsection{Location List Entries in Non-Split Objects}
2353 A \addtoindex{location list} entry consists of two address offsets followed
2354 by an unsigned 2-byte length, followed by a block of contiguous bytes
2355 that contains a DWARF location description. The length
2356 specifies the number of bytes in that block. The two offsets
2357 are the same size as an address on the target machine.
2360 A base address selection entry and an
2361 \addtoindexx{end-of-list entry!in location list}
2362 end-of-list entry each
2363 consist of two (constant or relocated) address offsets. The two
2364 offsets are the same size as an address on the target machine.
2366 For a \addtoindex{location list} to be specified, the base address of
2367 \addtoindexx{base address selection entry!in location list}
2368 the corresponding compilation unit must be defined
2369 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2371 \subsubsection{Location List Entries in Split Objects}
2372 \label{datarep:locationlistentriesinsplitobjects}
2373 An alternate form for location list entries is used in split objects.
2374 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2375 that follows. The encodings for these constants are given in
2376 Table \refersec{tab:locationlistentryencodingvalues}.
2380 \setlength{\extrarowheight}{0.1cm}
2381 \begin{longtable}{l|c}
2382 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2383 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2385 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2387 \hline \emph{Continued on next page}
2391 \DWLLEendoflistentry & 0x0 \\
2392 \DWLLEbaseaddressselectionentry & 0x01 \\
2393 \DWLLEstartendentry & 0x02 \\
2394 \DWLLEstartlengthentry & 0x03 \\
2395 \DWLLEoffsetpairentry & 0x04 \\
2399 \section{Base Type Attribute Encodings}
2400 \label{datarep:basetypeattributeencodings}
2402 The encodings of the
2403 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2404 constants used in the
2405 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2407 Table \refersec{tab:basetypeencodingvalues}
2410 \setlength{\extrarowheight}{0.1cm}
2411 \begin{longtable}{l|c}
2412 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2413 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2415 \bfseries Base type encoding name&\bfseries Value\\ \hline
2417 \hline \emph{Continued on next page}
2420 \ddag \ \textit{New in \DWARFVersionV}
2422 \DWATEaddress&0x01 \\
2423 \DWATEboolean&0x02 \\
2424 \DWATEcomplexfloat&0x03 \\
2426 \DWATEsigned&0x05 \\
2427 \DWATEsignedchar&0x06 \\
2428 \DWATEunsigned&0x07 \\
2429 \DWATEunsignedchar&0x08 \\
2430 \DWATEimaginaryfloat&0x09 \\
2431 \DWATEpackeddecimal&0x0a \\
2432 \DWATEnumericstring&0x0b \\
2433 \DWATEedited&0x0c \\
2434 \DWATEsignedfixed&0x0d \\
2435 \DWATEunsignedfixed&0x0e \\
2436 \DWATEdecimalfloat & 0x0f \\
2437 \DWATEUTF{} & 0x10 \\
2438 \DWATEUCS~\ddag & 0x11 \\
2439 \DWATEASCII~\ddag & 0x12 \\
2440 \DWATElouser{} & 0x80 \\
2441 \DWATEhiuser{} & \xff \\
2446 The encodings of the constants used in the
2447 \DWATdecimalsign{} attribute
2449 Table \refersec{tab:decimalsignencodings}.
2452 \setlength{\extrarowheight}{0.1cm}
2453 \begin{longtable}{l|c}
2454 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2455 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2457 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2459 \hline \emph{Continued on next page}
2464 \DWDSunsigned{} & 0x01 \\
2465 \DWDSleadingoverpunch{} & 0x02 \\
2466 \DWDStrailingoverpunch{} & 0x03 \\
2467 \DWDSleadingseparate{} & 0x04 \\
2468 \DWDStrailingseparate{} & 0x05 \\
2474 The encodings of the constants used in the
2475 \DWATendianity{} attribute are given in
2476 Table \refersec{tab:endianityencodings}.
2479 \setlength{\extrarowheight}{0.1cm}
2480 \begin{longtable}{l|c}
2481 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2482 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2484 \bfseries Endian code name&\bfseries Value\\ \hline
2486 \hline \emph{Continued on next page}
2491 \DWENDdefault{} & 0x00 \\
2492 \DWENDbig{} & 0x01 \\
2493 \DWENDlittle{} & 0x02 \\
2494 \DWENDlouser{} & 0x40 \\
2495 \DWENDhiuser{} & \xff \\
2501 \section{Accessibility Codes}
2502 \label{datarep:accessibilitycodes}
2503 The encodings of the constants used in the
2504 \DWATaccessibility{}
2506 \addtoindexx{accessibility attribute}
2508 Table \refersec{tab:accessibilityencodings}.
2511 \setlength{\extrarowheight}{0.1cm}
2512 \begin{longtable}{l|c}
2513 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2514 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2516 \bfseries Accessibility code name&\bfseries Value\\ \hline
2518 \hline \emph{Continued on next page}
2523 \DWACCESSpublic&0x01 \\
2524 \DWACCESSprotected&0x02 \\
2525 \DWACCESSprivate&0x03 \\
2531 \section{Visibility Codes}
2532 \label{datarep:visibilitycodes}
2533 The encodings of the constants used in the
2534 \DWATvisibility{} attribute are given in
2535 Table \refersec{tab:visibilityencodings}.
2538 \setlength{\extrarowheight}{0.1cm}
2539 \begin{longtable}{l|c}
2540 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2541 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2543 \bfseries Visibility code name&\bfseries Value\\ \hline
2545 \hline \emph{Continued on next page}
2551 \DWVISexported&0x02 \\
2552 \DWVISqualified&0x03 \\
2557 \section{Virtuality Codes}
2558 \label{datarep:vitualitycodes}
2560 The encodings of the constants used in the
2561 \DWATvirtuality{} attribute are given in
2562 Table \refersec{tab:virtualityencodings}.
2565 \setlength{\extrarowheight}{0.1cm}
2566 \begin{longtable}{l|c}
2567 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2568 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2570 \bfseries Virtuality code name&\bfseries Value\\ \hline
2572 \hline \emph{Continued on next page}
2577 \DWVIRTUALITYnone&0x00 \\
2578 \DWVIRTUALITYvirtual&0x01 \\
2579 \DWVIRTUALITYpurevirtual&0x02 \\
2586 \DWVIRTUALITYnone{} is equivalent to the absence of the
2590 \section{Source Languages}
2591 \label{datarep:sourcelanguages}
2593 The encodings of the constants used
2594 \addtoindexx{language attribute, encoding}
2596 \addtoindexx{language name encoding}
2599 attribute are given in
2600 Table \refersec{tab:languageencodings}.
2602 % If we don't force a following space it looks odd
2604 and their associated values are reserved, but the
2605 languages they represent are not well supported.
2606 Table \refersec{tab:languageencodings}
2608 \addtoindexx{lower bound attribute!default}
2609 default lower bound, if any, assumed for
2610 an omitted \DWATlowerbound{} attribute in the context of a
2611 \DWTAGsubrangetype{} debugging information entry for each
2615 \setlength{\extrarowheight}{0.1cm}
2616 \begin{longtable}{l|c|c}
2617 \caption{Language encodings} \label{tab:languageencodings}\\
2618 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2620 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2622 \hline \emph{Continued on next page}
2625 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2627 \addtoindexx{ISO-defined language names}
2629 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2630 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2631 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2632 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2633 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2634 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2635 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2636 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2637 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2638 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2639 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2640 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2641 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2642 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2643 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2644 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2645 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2646 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2647 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2648 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2649 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2650 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2651 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2652 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2653 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2654 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2655 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2656 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2657 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2658 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2659 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2660 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2661 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++:2014 (ISO)} \\
2662 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2663 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2664 \DWLANGlouser{} &0x8000 & \\
2665 \DWLANGhiuser{} &\xffff & \\
2670 \section{Address Class Encodings}
2671 \label{datarep:addressclassencodings}
2673 The value of the common
2674 \addtoindex{address class} encoding
2678 \section{Identifier Case}
2679 \label{datarep:identifiercase}
2681 The encodings of the constants used in the
2682 \DWATidentifiercase{} attribute are given in
2683 Table \refersec{tab:identifiercaseencodings}.
2687 \setlength{\extrarowheight}{0.1cm}
2688 \begin{longtable}{l|c}
2689 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2690 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2692 \bfseries Identifier case name&\bfseries Value\\ \hline
2694 \hline \emph{Continued on next page}
2698 \DWIDcasesensitive&0x00 \\
2700 \DWIDdowncase&0x02 \\
2701 \DWIDcaseinsensitive&0x03 \\
2705 \section{Calling Convention Encodings}
2706 \label{datarep:callingconventionencodings}
2707 The encodings of the constants used in the
2708 \DWATcallingconvention{} attribute are given in
2709 Table \refersec{tab:callingconventionencodings}.
2712 \setlength{\extrarowheight}{0.1cm}
2713 \begin{longtable}{l|c}
2714 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2715 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2717 \bfseries Calling convention name&\bfseries Value\\ \hline
2719 \hline \emph{Continued on next page}
2721 \hline \ddag\ \textit{New in DWARF Version 5}
2724 \DWCCnormal &0x01 \\
2725 \DWCCprogram&0x02 \\
2726 \DWCCnocall &0x03 \\
2727 \DWCCpassbyreference~\ddag &0x04 \\
2728 \DWCCpassbyvalue~\ddag &0x05 \\
2729 \DWCClouser &0x40 \\
2736 \section{Inline Codes}
2737 \label{datarep:inlinecodes}
2739 The encodings of the constants used in
2740 \addtoindexx{inline attribute}
2742 \DWATinline{} attribute are given in
2743 Table \refersec{tab:inlineencodings}.
2747 \setlength{\extrarowheight}{0.1cm}
2748 \begin{longtable}{l|c}
2749 \caption{Inline encodings} \label{tab:inlineencodings}\\
2750 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2752 \bfseries Inline Code name&\bfseries Value\\ \hline
2754 \hline \emph{Continued on next page}
2759 \DWINLnotinlined&0x00 \\
2760 \DWINLinlined&0x01 \\
2761 \DWINLdeclarednotinlined&0x02 \\
2762 \DWINLdeclaredinlined&0x03 \\
2767 % this clearpage is ugly, but the following table came
2768 % out oddly without it.
2770 \section{Array Ordering}
2771 \label{datarep:arrayordering}
2773 The encodings of the constants used in the
2774 \DWATordering{} attribute are given in
2775 Table \refersec{tab:orderingencodings}.
2779 \setlength{\extrarowheight}{0.1cm}
2780 \begin{longtable}{l|c}
2781 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2782 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2784 \bfseries Ordering name&\bfseries Value\\ \hline
2786 \hline \emph{Continued on next page}
2791 \DWORDrowmajor&0x00 \\
2792 \DWORDcolmajor&0x01 \\
2798 \section{Discriminant Lists}
2799 \label{datarep:discriminantlists}
2801 The descriptors used in
2802 \addtoindexx{discriminant list attribute}
2804 \DWATdiscrlist{} attribute are
2805 encoded as 1-byte constants. The
2806 defined values are given in
2807 Table \refersec{tab:discriminantdescriptorencodings}.
2809 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2811 \setlength{\extrarowheight}{0.1cm}
2812 \begin{longtable}{l|c}
2813 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2814 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2816 \bfseries Descriptor name&\bfseries Value\\ \hline
2818 \hline \emph{Continued on next page}
2830 \section{Name Index Table}
2831 \label{datarep:nameindextable}
2832 Each name index table in the \dotdebugnames{} section
2833 begins with a header consisting of:
2834 \begin{enumerate}[1. ]
2835 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2836 \addttindexx{unit\_length}
2837 A 4-byte or 12-byte initial length field that
2838 contains the size in bytes of this contribution to the \dotdebugnames{}
2839 section, not including the length field itself
2840 (see Section \refersec{datarep:initiallengthvalues}).
2842 \item \texttt{version} (\HFTuhalf) \\
2843 A 2-byte version number\addtoindexx{version number!name index table}
2844 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2845 This number is specific to the name index table and is
2846 independent of the DWARF version number.
2848 The value in this field is \versiondotdebugnames.
2850 \item padding (\HFTuhalf) \\
2852 \item \texttt{comp\_unit\_count} (\HFTuword) \\
2853 The number of CUs in the CU list.
2855 \item \texttt{local\_type\_unit\_count} (\HFTuword) \\
2856 The number of TUs in the first TU list.
2858 \item \texttt{foreign\_type\_unit\_count} (\HFTuword) \\
2859 The number of TUs in the second TU list.
2861 \item \texttt{bucket\_count} (\HFTuword) \\
2862 The number of hash buckets in the hash lookup table.
2863 If there is no hash lookup table, this field contains 0.
2865 \item \texttt{name\_count} (\HFTuword) \\
2866 The number of unique names in the index.
2868 \item \texttt{abbrev\_table\_size} (\HFTuword) \\
2869 The size in bytes of the abbreviations table.
2871 \item \texttt{augmentation\_string\_size} (\HFTuword) \\
2872 The size in bytes of the augmentation string. This value is
2873 rounded up to a multiple of 4.
2875 \item \texttt{augmentation\_string} (\HFTaugstring) \\
2876 A vendor-specific augmentation string, which provides additional
2877 information about the contents of this index. If provided, the string
2878 begins with a 4-character vendor ID. The remainder of the
2879 string is meant to be read by a cooperating consumer, and its
2880 contents and interpretation are not specified here. The
2881 string is padded with null characters to a multiple of
2882 four bytes in length.
2886 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
2889 \setlength{\extrarowheight}{0.1cm}
2890 \begin{longtable}{l|c|l}
2891 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
2892 \hline \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2894 \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2896 \hline \emph{Continued on next page}
2899 \ddag \ \textit{New in \DWARFVersionV}
2901 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
2902 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
2903 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
2904 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
2905 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
2906 \DWIDXlouser~\ddag & 0x2000 & \\
2907 \DWIDXhiuser~\ddag & \xiiifff & \\
2911 The abbreviations table ends with an entry consisting of a single 0
2912 byte for the abbreviation code. The size of the table given by
2913 \texttt{abbrev\_table\_size} may include optional padding following the
2916 \section{Defaulted Member Encodings}
2917 \hypertarget{datarep:defaultedmemberencodings}{}
2919 The encodings of the constants used in the \DWATdefaulted{} attribute
2920 are given in Table \referfol{datarep:defaultedattributeencodings}.
2923 \setlength{\extrarowheight}{0.1cm}
2924 \begin{longtable}{l|c}
2925 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
2926 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
2928 \bfseries Defaulted name &\bfseries Value \\ \hline
2930 \hline \emph{Continued on next page}
2933 \ddag~\textit{New in \DWARFVersionV}
2935 \DWDEFAULTEDno~\ddag & 0x00 \\
2936 \DWDEFAULTEDinclass~\ddag & 0x01 \\
2937 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
2942 \section{Address Range Table}
2943 \label{datarep:addrssrangetable}
2945 Each set of entries in the table of address ranges contained
2946 in the \dotdebugaranges{}
2947 section begins with a header containing:
2948 \begin{enumerate}[1. ]
2949 % FIXME The unit length text is not fully consistent across
2952 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2953 \addttindexx{unit\_length}
2954 A 4-byte or 12-byte length containing the length of the
2955 \addtoindexx{initial length}
2956 set of entries for this compilation unit, not including the
2957 length field itself. In the \thirtytwobitdwarfformat, this is a
2958 4-byte unsigned integer (which must be less than \xfffffffzero);
2959 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2960 \wffffffff followed by an 8-byte unsigned integer that gives
2962 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2964 \item version (\HFTuhalf) \\
2965 A 2-byte version identifier representing the version of the
2966 DWARF information for the address range table
2967 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2969 This value in this field \addtoindexx{version number!address range table} is 2.
2971 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2973 \addtoindexx{section offset!in .debug\_aranges header}
2974 4-byte or 8-byte offset into the
2975 \dotdebuginfo{} section of
2976 the compilation unit header. In the \thirtytwobitdwarfformat,
2977 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2978 this is an 8-byte unsigned offset
2979 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2981 \item \texttt{address\_size} (\HFTubyte) \\
2982 A 1-byte unsigned integer containing the size in bytes of an
2983 \addttindexx{address\_size}
2985 \addtoindexx{size of an address}
2986 (or the offset portion of an address for segmented
2987 \addtoindexx{address space!segmented}
2988 addressing) on the target system.
2990 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
2991 A 1-byte unsigned integer containing the size in bytes of a
2992 segment selector on the target system.
2996 This header is followed by a series of tuples. Each tuple
2997 consists of a segment, an address and a length.
2998 The segment selector
2999 size is given by the \HFNsegmentselectorsize{} field of the header; the
3000 address and length size are each given by the \addttindex{address\_size}
3001 field of the header.
3002 The first tuple following the header in
3003 each set begins at an offset that is a multiple of the size
3004 of a single tuple (that is, the size of a segment selector
3005 plus twice the \addtoindex{size of an address}).
3006 The header is padded, if
3007 necessary, to that boundary. Each set of tuples is terminated
3008 by a 0 for the segment, a 0 for the address and 0 for the
3009 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3010 the segment selectors are omitted from all tuples, including
3011 the terminating tuple.
3014 \section{Line Number Information}
3015 \label{datarep:linenumberinformation}
3017 The \addtoindexi{version number}{version number!line number information}
3018 in the line number program header is \versiondotdebugline{}
3019 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3021 The boolean values \doublequote{true} and \doublequote{false}
3022 used by the line number information program are encoded
3023 as a single byte containing the value 0
3024 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3027 The encodings for the standard opcodes are given in
3028 \addtoindexx{line number opcodes!standard opcode encoding}
3029 Table \refersec{tab:linenumberstandardopcodeencodings}.
3032 \setlength{\extrarowheight}{0.1cm}
3033 \begin{longtable}{l|c}
3034 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3035 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3037 \bfseries Opcode name&\bfseries Value\\ \hline
3039 \hline \emph{Continued on next page}
3045 \DWLNSadvancepc&0x02 \\
3046 \DWLNSadvanceline&0x03 \\
3047 \DWLNSsetfile&0x04 \\
3048 \DWLNSsetcolumn&0x05 \\
3049 \DWLNSnegatestmt&0x06 \\
3050 \DWLNSsetbasicblock&0x07 \\
3051 \DWLNSconstaddpc&0x08 \\
3052 \DWLNSfixedadvancepc&0x09 \\
3053 \DWLNSsetprologueend&0x0a \\*
3054 \DWLNSsetepiloguebegin&0x0b \\*
3055 \DWLNSsetisa&0x0c \\*
3061 The encodings for the extended opcodes are given in
3062 \addtoindexx{line number opcodes!extended opcode encoding}
3063 Table \refersec{tab:linenumberextendedopcodeencodings}.
3066 \setlength{\extrarowheight}{0.1cm}
3067 \begin{longtable}{l|c}
3068 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3069 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3071 \bfseries Opcode name&\bfseries Value\\ \hline
3073 \hline \emph{Continued on next page}
3075 \hline %\ddag~\textit{New in DWARF Version 5}
3078 \DWLNEendsequence &0x01 \\
3079 \DWLNEsetaddress &0x02 \\
3080 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3081 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3083 \DWLNEsetdiscriminator &0x04 \\
3084 \DWLNElouser &0x80 \\
3085 \DWLNEhiuser &\xff \\
3091 The encodings for the line number header entry formats are given in
3092 \addtoindexx{line number opcodes!file entry format encoding}
3093 Table \refersec{tab:linenumberheaderentryformatencodings}.
3096 \setlength{\extrarowheight}{0.1cm}
3097 \begin{longtable}{l|c}
3098 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3099 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3101 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3103 \hline \emph{Continued on next page}
3105 \hline \ddag~\textit{New in DWARF Version 5}
3107 \DWLNCTpath~\ddag & 0x1 \\
3108 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3109 \DWLNCTtimestamp~\ddag & 0x3 \\
3110 \DWLNCTsize~\ddag & 0x4 \\
3111 \DWLNCTMDfive~\ddag & 0x5 \\
3112 \DWLNCTlouser~\ddag & 0x2000 \\
3113 \DWLNCThiuser~\ddag & \xiiifff \\
3118 \section{Macro Information}
3119 \label{datarep:macroinformation}
3120 The \addtoindexi{version number}{version number!macro information}
3121 in the macro information header is \versiondotdebugmacro{}
3122 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3124 The source line numbers and source file indices encoded in the
3125 macro information section are represented as
3126 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3129 The macro information entry type is encoded as a single unsigned byte.
3131 \addtoindexx{macro information entry types!encoding}
3133 Table \refersec{tab:macroinfoentrytypeencodings}.
3137 \setlength{\extrarowheight}{0.1cm}
3138 \begin{longtable}{l|c}
3139 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3140 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3142 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3144 \hline \emph{Continued on next page}
3146 \hline \ddag~\textit{New in DWARF Version 5}
3149 \DWMACROdefine~\ddag &0x01 \\
3150 \DWMACROundef~\ddag &0x02 \\
3151 \DWMACROstartfile~\ddag &0x03 \\
3152 \DWMACROendfile~\ddag &0x04 \\
3153 \DWMACROdefinestrp~\ddag &0x05 \\
3154 \DWMACROundefstrp~\ddag &0x06 \\
3155 \DWMACROimport~\ddag &0x07 \\
3156 \DWMACROdefinesup~\ddag &0x08 \\
3157 \DWMACROundefsup~\ddag &0x09 \\
3158 \DWMACROimportsup~\ddag &0x0a \\
3159 \DWMACROdefinestrx~\ddag &0x0b \\
3160 \DWMACROundefstrx~\ddag &0x0c \\
3161 \DWMACROlouser~\ddag &0xe0 \\
3162 \DWMACROhiuser~\ddag &\xff \\
3168 \section{Call Frame Information}
3169 \label{datarep:callframeinformation}
3171 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3172 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3173 value is \xffffffffffffffff.
3175 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3176 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3178 Call frame instructions are encoded in one or more bytes. The
3179 primary opcode is encoded in the high order two bits of
3180 the first byte (that is, opcode = byte $\gg$ 6). An operand
3181 or extended opcode may be encoded in the low order 6
3182 bits. Additional operands are encoded in subsequent bytes.
3183 The instructions and their encodings are presented in
3184 Table \refersec{tab:callframeinstructionencodings}.
3187 \setlength{\extrarowheight}{0.1cm}
3188 \begin{longtable}{l|c|c|l|l}
3189 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3190 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3191 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3193 & \bfseries High 2 &\bfseries Low 6 & &\\
3194 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3196 \hline \emph{Continued on next page}
3201 \DWCFAadvanceloc&0x1&delta & \\
3202 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3203 \DWCFArestore&0x3®ister & & \\
3204 \DWCFAnop&0&0 & & \\
3205 \DWCFAsetloc&0&0x01&address & \\
3206 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3207 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3208 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3209 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3210 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3211 \DWCFAundefined&0&0x07&ULEB128 register & \\
3212 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3213 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3214 \DWCFArememberstate&0&0x0a & & \\
3215 \DWCFArestorestate&0&0x0b & & \\
3216 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3217 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3218 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3219 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3220 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3222 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3223 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3224 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3225 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3226 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3227 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3228 \DWCFAlouser&0&0x1c & & \\
3229 \DWCFAhiuser&0&\xiiif & & \\
3233 \section{Non-contiguous Address Ranges}
3234 \label{datarep:noncontiguousaddressranges}
3236 Each entry in a \addtoindex{range list}
3237 (see Section \refersec{chap:noncontiguousaddressranges})
3239 \addtoindexx{base address selection entry!in range list}
3241 \addtoindexx{range list}
3242 a base address selection entry, or an end-of-list entry.
3244 A \addtoindex{range list} entry consists of two relative addresses. The
3245 addresses are the same size as addresses on the target machine.
3248 A base address selection entry and an
3249 \addtoindexx{end-of-list entry!in range list}
3250 end-of-list entry each
3251 \addtoindexx{base address selection entry!in range list}
3252 consist of two (constant or relocated) addresses. The two
3253 addresses are the same size as addresses on the target machine.
3255 For a \addtoindex{range list} to be specified, the base address of the
3256 \addtoindexx{base address selection entry!in range list}
3257 corresponding compilation unit must be defined
3258 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
3261 \section{String Offsets Table}
3262 \label{chap:stringoffsetstable}
3263 Each set of entries in the string offsets table contained in the
3264 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3265 section begins with a header containing:
3266 \begin{enumerate}[1. ]
3267 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3268 \addttindexx{unit\_length}
3269 A 4-byte or 12-byte length containing the length of
3270 the set of entries for this compilation unit, not
3271 including the length field itself. In the 32-bit
3272 DWARF format, this is a 4-byte unsigned integer
3273 (which must be less than \xfffffffzero); in the 64-bit
3274 DWARF format, this consists of the 4-byte value
3275 \wffffffff followed by an 8-byte unsigned integer
3276 that gives the actual length (see
3277 Section \refersec{datarep:32bitand64bitdwarfformats}).
3280 \item \texttt{version} (\HFTuhalf) \\
3281 A 2-byte version identifier containing the value
3282 \versiondotdebugstroffsets{}
3283 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3285 \item \texttt{padding} (\HFTuhalf) \\
3288 This header is followed by a series of string table offsets
3289 that have the same representation as \DWFORMstrp.
3290 For the 32-bit DWARF format, each offset is 4 bytes long; for
3291 the 64-bit DWARF format, each offset is 8 bytes long.
3293 The \DWATstroffsetsbase{} attribute points to the first
3294 entry following the header. The entries are indexed
3295 sequentially from this base entry, starting from 0.
3297 \section{Address Table}
3298 \label{chap:addresstable}
3299 Each set of entries in the address table contained in the
3300 \dotdebugaddr{} section begins with a header containing:
3301 \begin{enumerate}[1. ]
3302 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3303 \addttindexx{unit\_length}
3304 A 4-byte or 12-byte length containing the length of
3305 the set of entries for this compilation unit, not
3306 including the length field itself. In the 32-bit
3307 DWARF format, this is a 4-byte unsigned integer
3308 (which must be less than \xfffffffzero); in the 64-bit
3309 DWARF format, this consists of the 4-byte value
3310 \wffffffff followed by an 8-byte unsigned integer
3311 that gives the actual length (see
3312 Section \refersec{datarep:32bitand64bitdwarfformats}).
3315 \item \texttt{version} (\HFTuhalf) \\
3316 A 2-byte version identifier containing the value
3317 \versiondotdebugaddr{}
3318 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3321 \item \texttt{address\_size} (\HFTubyte) \\
3322 A 1-byte unsigned integer containing the size in
3323 bytes of an address (or the offset portion of an
3324 address for segmented addressing) on the target
3328 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3329 A 1-byte unsigned integer containing the size in
3330 bytes of a segment selector on the target system.
3333 This header is followed by a series of segment/address pairs.
3334 The segment size is given by the \HFNsegmentselectorsize{} field of the
3335 header, and the address size is given by the \addttindex{address\_size}
3336 field of the header. If the \HFNsegmentselectorsize{} field in the header
3337 is zero, the entries consist only of an addresses.
3339 The \DWATaddrbase{} attribute points to the first entry
3340 following the header. The entries are indexed sequentially
3341 from this base entry, starting from 0.
3344 \section{Range List Table}
3345 \label{app:rangelisttable}
3346 Each set of entries in the range list table contained in the
3347 \dotdebugranges{} section begins with a header containing:
3348 \begin{enumerate}[1. ]
3349 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3350 \addttindexx{unit\_length}
3351 A 4-byte or 12-byte length containing the length of
3352 the set of entries for this compilation unit, not
3353 including the length field itself. In the 32-bit
3354 DWARF format, this is a 4-byte unsigned integer
3355 (which must be less than \xfffffffzero); in the 64-bit
3356 DWARF format, this consists of the 4-byte value
3357 \wffffffff followed by an 8-byte unsigned integer
3358 that gives the actual length (see
3359 Section \refersec{datarep:32bitand64bitdwarfformats}).
3362 \item \texttt{version} (\HFTuhalf) \\
3363 A 2-byte version identifier containing the value
3364 \versiondotdebugranges{}
3365 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3368 \item \texttt{address\_size} (\HFTubyte) \\
3369 A 1-byte unsigned integer containing the size in
3370 bytes of an address (or the offset portion of an
3371 address for segmented addressing) on the target
3375 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3376 A 1-byte unsigned integer containing the size in
3377 bytes of a segment selector on the target system.
3380 This header is followed by a series of range list entries as
3381 described in Section \refersec{chap:noncontiguousaddressranges}.
3382 The segment size is given by the
3383 \HFNsegmentselectorsize{} field of the header, and the address size is
3384 given by the \addttindex{address\_size} field of the header. If the
3385 \HFNsegmentselectorsize{} field in the header is zero, the segment
3386 selector is omitted from the range list entries.
3388 The \DWATrangesbase{} attribute points to the first entry
3389 following the header. The entries are referenced by a byte
3390 offset relative to this base address.
3393 \section{Location List Table}
3394 \label{datarep:locationlisttable}
3395 Each set of entries in the location list table contained in the
3396 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3397 \begin{enumerate}[1. ]
3398 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3399 \addttindexx{unit\_length}
3400 A 4-byte or 12-byte length containing the length of
3401 the set of entries for this compilation unit, not
3402 including the length field itself. In the 32-bit
3403 DWARF format, this is a 4-byte unsigned integer
3404 (which must be less than \xfffffffzero); in the 64-bit
3405 DWARF format, this consists of the 4-byte value
3406 \wffffffff followed by an 8-byte unsigned integer
3407 that gives the actual length (see
3408 Section \refersec{datarep:32bitand64bitdwarfformats}).
3411 \item \texttt{version} (\HFTuhalf) \\
3412 A 2-byte version identifier containing the value
3413 \versiondotdebugloc{}
3414 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3417 \item \texttt{address\_size} (\HFTubyte) \\
3418 A 1-byte unsigned integer containing the size in
3419 bytes of an address (or the offset portion of an
3420 address for segmented addressing) on the target
3424 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3425 A 1-byte unsigned integer containing the size in
3426 bytes of a segment selector on the target system.
3429 This header is followed by a series of location list entries as
3430 described in Section \refersec{chap:locationlists}.
3431 The segment size is given by the
3432 \HFNsegmentselectorsize{} field of the header, and the address size is
3433 given by the \HFNaddresssize{} field of the header. If the
3434 \HFNsegmentselectorsize{} field in the header is zero, the segment
3435 selector is omitted from range list entries.
3437 The entries are referenced by a byte offset relative to the first
3438 location list following this header.
3441 \section{Dependencies and Constraints}
3442 \label{datarep:dependenciesandconstraints}
3443 The debugging information in this format is intended to
3444 exist in sections of an object file, or an equivalent
3445 separate file or database, having names beginning with
3446 the prefix ".debug\_" (see Appendix
3447 \refersec{app:dwarfsectionversionnumbersinformative}
3448 for a complete list of such names).
3449 Except as specifically specified, this information is not
3450 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3453 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3454 32-bit addresses, an assembler or compiler must provide a way
3455 to produce 2-byte and 4-byte quantities without alignment
3456 restrictions, and the linker must be able to relocate a
3458 \addtoindexx{section offset!alignment of}
3459 section offset that occurs at an arbitrary
3462 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3463 64-bit addresses, an assembler or compiler must provide a
3464 way to produce 2-byte, 4-byte and 8-byte quantities without
3465 alignment restrictions, and the linker must be able to relocate
3466 an 8-byte address or 4-byte
3467 \addtoindexx{section offset!alignment of}
3468 section offset that occurs at an
3469 arbitrary alignment.
3471 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3472 32-bit addresses, an assembler or compiler must provide a
3473 way to produce 2-byte, 4-byte and 8-byte quantities without
3474 alignment restrictions, and the linker must be able to relocate
3475 a 4-byte address or 8-byte
3476 \addtoindexx{section offset!alignment of}
3477 section offset that occurs at an
3478 arbitrary alignment.
3480 \textit{It is expected that this will be required only for very large
3481 32-bit programs or by those architectures which support
3482 a mix of 32-bit and 64-bit code and data within the same
3485 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3486 64-bit addresses, an assembler or compiler must provide a
3487 way to produce 2-byte, 4-byte and 8-byte quantities without
3488 alignment restrictions, and the linker must be able to
3489 relocate an 8-byte address or
3490 \addtoindexx{section offset!alignment of}
3491 section offset that occurs at
3492 an arbitrary alignment.
3496 \section{Integer Representation Names}
3497 \label{datarep:integerrepresentationnames}
3498 The sizes of the integers used in the lookup by name, lookup
3499 by address, line number, call frame information and other sections
3501 Table \ref{tab:integerrepresentationnames}.
3505 \setlength{\extrarowheight}{0.1cm}
3506 \begin{longtable}{c|l}
3507 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3508 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3510 \bfseries Representation name&\bfseries Representation\\ \hline
3512 \hline \emph{Continued on next page}
3517 \HFTsbyte& signed, 1-byte integer \\
3518 \HFTubyte&unsigned, 1-byte integer \\
3519 \HFTuhalf&unsigned, 2-byte integer \\
3520 \HFTuword&unsigned, 4-byte integer \\
3526 \section{Type Signature Computation}
3527 \label{datarep:typesignaturecomputation}
3529 A \addtoindex{type signature} is used by a DWARF consumer
3530 to resolve type references to the type definitions that
3531 are contained in \addtoindex{type unit}s (see Section
3532 \refersec{chap:typeunitentries}).
3534 \textit{A type signature is computed only by a DWARF producer;
3535 \addtoindexx{type signature!computation} a consumer need
3536 compare two type signatures to check for equality.}
3539 The type signature for a type T0 is formed from the
3540 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3541 R.L. Rivest, RFC 1321, April 1992}
3542 hash of a flattened description of the type. The flattened
3543 description of the type is a byte sequence derived from the
3544 DWARF encoding of the type as follows:
3545 \begin{enumerate}[1. ]
3547 \item Start with an empty sequence S and a list V of visited
3548 types, where V is initialized to a list containing the type
3549 T0 as its single element. Elements in V are indexed from 1,
3552 \item If the debugging information entry represents a type that
3553 is nested inside another type or a namespace, append to S
3554 the type\textquoteright s context as follows: For each surrounding type
3555 or namespace, beginning with the outermost such construct,
3556 append the letter 'C', the DWARF tag of the construct, and
3557 the name (taken from
3558 \addtoindexx{name attribute}
3559 the \DWATname{} attribute) of the type
3560 \addtoindexx{name attribute}
3561 or namespace (including its trailing null byte).
3563 \item Append to S the letter 'D', followed by the DWARF tag of
3564 the debugging information entry.
3566 \item For each of the attributes in
3567 Table \refersec{tab:attributesusedintypesignaturecomputation}
3569 the debugging information entry, in the order listed,
3570 append to S a marker letter (see below), the DWARF attribute
3571 code, and the attribute value.
3574 \caption{Attributes used in type signature computation}
3575 \label{tab:attributesusedintypesignaturecomputation}
3576 \simplerule[\textwidth]
3578 \autocols[0pt]{c}{2}{l}{
3594 \DWATcontainingtype,
3598 \DWATdatamemberlocation,
3619 \DWATrvaluereference,
3623 \DWATstringlengthbitsize,
3624 \DWATstringlengthbytesize,
3629 \DWATvariableparameter,
3632 \DWATvtableelemlocation
3635 \simplerule[\textwidth]
3638 Note that except for the initial
3639 \DWATname{} attribute,
3640 \addtoindexx{name attribute}
3641 attributes are appended in order according to the alphabetical
3642 spelling of their identifier.
3644 If an implementation defines any vendor-specific attributes,
3645 any such attributes that are essential to the definition of
3646 the type are also included at the end of the above list,
3647 in their own alphabetical suborder.
3649 An attribute that refers to another type entry T is processed
3650 as follows: (a) If T is in the list V at some V[x], use the
3651 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3652 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3653 as the marker, process the type T recursively by performing
3654 Steps 2 through 7, and use the result as the attribute value.
3657 Other attribute values use the letter 'A' as the marker, and
3658 the value consists of the form code (encoded as an unsigned
3659 LEB128 value) followed by the encoding of the value according
3660 to the form code. To ensure reproducibility of the signature,
3661 the set of forms used in the signature computation is limited
3670 \item If the tag in Step 3 is one of \DWTAGpointertype,
3671 \DWTAGreferencetype,
3672 \DWTAGrvaluereferencetype,
3673 \DWTAGptrtomembertype,
3674 or \DWTAGfriend, and the referenced
3675 type (via the \DWATtype{} or
3676 \DWATfriend{} attribute) has a
3677 \DWATname{} attribute, append to S the letter 'N', the DWARF
3678 attribute code (\DWATtype{} or
3679 \DWATfriend), the context of
3680 the type (according to the method in Step 2), the letter 'E',
3681 and the name of the type. For \DWTAGfriend, if the referenced
3682 entry is a \DWTAGsubprogram, the context is omitted and the
3683 name to be used is the ABI-specific name of the subprogram
3684 (for example, the mangled linker name).
3687 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3688 \DWTAGreferencetype,
3689 \DWTAGrvaluereferencetype,
3690 \DWTAGptrtomembertype, or
3691 \DWTAGfriend, but has
3692 a \DWATtype{} attribute, or if the referenced type (via
3694 \DWATfriend{} attribute) does not have a
3695 \DWATname{} attribute, the attribute is processed according to
3696 the method in Step 4 for an attribute that refers to another
3700 \item Visit each child C of the debugging information
3701 entry as follows: If C is a nested type entry or a member
3702 function entry, and has
3703 a \DWATname{} attribute, append to
3704 \addtoindexx{name attribute}
3705 S the letter 'S', the tag of C, and its name; otherwise,
3706 process C recursively by performing Steps 3 through 7,
3707 appending the result to S. Following the last child (or if
3708 there are no children), append a zero byte.
3713 For the purposes of this algorithm, if a debugging information
3715 \DWATspecification{}
3716 attribute that refers to
3717 another entry D (which has a
3720 then S inherits the attributes and children of D, and S is
3721 processed as if those attributes and children were present in
3722 the entry S. Exception: if a particular attribute is found in
3723 both S and D, the attribute in S is used and the corresponding
3724 one in D is ignored.
3727 DWARF tag and attribute codes are appended to the sequence
3728 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3729 using the values defined earlier in this chapter.
3731 \textit{A grammar describing this computation may be found in
3732 Appendix \refersec{app:typesignaturecomputationgrammar}.
3735 \textit{An attribute that refers to another type entry is
3736 recursively processed or replaced with the name of the
3737 referent (in Step 4, 5 or 6). If neither treatment applies to
3738 an attribute that references another type entry, the entry
3739 that contains that attribute is not suitable for a
3740 separate \addtoindex{type unit}.}
3742 \textit{If a debugging information entry contains an attribute from
3743 the list above that would require an unsupported form, that
3744 entry is not suitable for a separate
3745 \addtoindex{type unit}.}
3747 \textit{A type is suitable for a separate
3748 \addtoindex{type unit} only
3749 if all of the type entries that it contains or refers to in
3750 Steps 6 and 7 are themselves suitable for a separate
3751 \addtoindex{type unit}.}
3754 Where the DWARF producer may reasonably choose two or more
3755 different forms for a given attribute, it should choose
3756 the simplest possible form in computing the signature. (For
3757 example, a constant value should be preferred to a location
3758 expression when possible.)
3760 Once the string S has been formed from the DWARF encoding,
3761 an \MDfive{} hash is computed for the string and the
3762 least significant 64 bits are taken as the type signature.
3764 \textit{The string S is intended to be a flattened representation of
3765 the type that uniquely identifies that type (that is, a different
3766 type is highly unlikely to produce the same string).}
3769 \textit{A debugging information entry is not be placed in a
3770 separate \addtoindex{type unit}
3771 if any of the following apply:}
3775 \item \textit{The entry has an attribute whose value is a location
3776 expression, and the location expression contains a reference to
3777 another debugging information entry (for example, a \DWOPcallref{}
3778 operator), as it is unlikely that the entry will remain
3779 identical across compilation units.}
3781 \item \textit{The entry has an attribute whose value refers
3782 to a code location or a \addtoindex{location list}.}
3784 \item \textit{The entry has an attribute whose value refers
3785 to another debugging information entry that does not represent
3791 \textit{Certain attributes are not included in the type signature:}
3794 \item \textit{The \DWATdeclaration{} attribute is not included because it
3795 indicates that the debugging information entry represents an
3796 incomplete declaration, and incomplete declarations should
3798 \addtoindexx{type unit}
3799 separate type units.}
3801 \item \textit{The \DWATdescription{} attribute is not included because
3802 it does not provide any information unique to the defining
3803 declaration of the type.}
3805 \item \textit{The \DWATdeclfile,
3807 \DWATdeclcolumn{} attributes are not included because they
3808 may vary from one source file to the next, and would prevent
3809 two otherwise identical type declarations from producing the
3810 same \MDfive{} hash.}
3812 \item \textit{The \DWATobjectpointer{} attribute is not included
3813 because the information it provides is not necessary for the
3814 computation of a unique type signature.}
3818 \textit{Nested types and some types referred to by a debugging
3819 information entry are encoded by name rather than by recursively
3820 encoding the type to allow for cases where a complete definition
3821 of the type might not be available in all compilation units.}
3824 \textit{If a type definition contains the definition of a member function,
3825 it cannot be moved as is into a type unit, because the member function
3826 contains attributes that are unique to that compilation unit.
3827 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3828 moving the member function declaration into a separate declaration tree,
3829 and replacing the function definition in the type with a non-defining
3830 declaration of the function (as if the function had been defined out of
3833 An example that illustrates the computation of an \MDfive{} hash may be found in
3834 Appendix \refersec{app:usingtypeunits}.
3836 \section{Name Table Hash Function}
3837 \label{datarep:nametablehashfunction}
3838 The hash function used for hashing name strings in the accelerated
3839 access name index table (see Section \refersec{chap:acceleratedaccess})
3840 is defined in \addtoindex{C} as shown in
3841 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnote{
3842 This hash function is sometimes informally known as the
3843 "\addtoindex{DJB hash function}" or the "\addtoindex{Berstein hash function}"
3845 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
3846 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
3848 \begin{figure}[here]
3851 unsigned long \* must be a 32-bit integer type *\
3852 hash(unsigned char *str)
3854 unsigned long hash = 5381;
3858 hash = hash * 33 + c;
3864 \caption{Name Table Hash Function Definition}
3865 \label{fig:nametablehashfunctiondefinition}