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.
9 \section{Vendor Extensibility}
10 \label{datarep:vendorextensibility}
11 \addtoindexx{vendor extensibility}
12 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
15 \addtoindexx{extensibility|see{vendor extensibility}}
16 reserve a portion of the DWARF name space and ranges of
17 enumeration values for use for vendor specific extensions,
18 special labels are reserved for tag names, attribute names,
19 base type encodings, location operations, language names,
20 calling conventions and call frame instructions.
22 The labels denoting the beginning and end of the reserved
23 \hypertarget{chap:DWXXXlohiuser}{}
24 value range for vendor specific extensions consist of the
26 (\DWATlouserMARK{}\DWAThiuserMARK{} DW\_AT,
27 \DWATElouserMARK{}\DWATEhiuserMARK{} DW\_ATE,
28 \DWCClouserMARK{}\DWCChiuserMARK{} DW\_CC,
29 \DWCFAlouserMARK{}\DWCFAhiuserMARK{} DW\_CFA
30 \DWENDlouserMARK{}\DWENDhiuserMARK{} DW\_END,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{} DW\_LANG,
32 \DWLNElouserMARK{}\DWLNEhiuserMARK{} DW\_LNE,
33 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
34 \DWOPlouserMARK{}\DWOPhiuserMARK{} DW\_OP or
35 \DWTAGlouserMARK{}\DWTAGhiuserMARK{} DW\_TAG,
36 respectively) followed by
37 \_lo\_user or \_hi\_user.
38 Values in the range between \textit{prefix}\_lo\_user
39 and \textit{prefix}\_hi\_user inclusive,
40 are reserved for vendor specific extensions. Vendors may
41 use values in this range without conflicting with current or
42 future system\dash defined values. All other values are reserved
43 for use by the system.
45 \textit{For example, for DIE tags, the special
46 labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
48 \textit{There may also be codes for vendor specific extensions
49 between the number of standard line number opcodes and
50 the first special line number opcode. However, since the
51 number of standard opcodes varies with the DWARF version,
52 the range for extensions is also version dependent. Thus,
53 \DWLNSlouserTARG{} and
54 \DWLNShiuserTARG{} symbols are not defined.
57 Vendor defined tags, attributes, base type encodings, location
58 atoms, language names, line number actions, calling conventions
59 and call frame instructions, conventionally use the form
60 \text{prefix\_vendor\_id\_name}, where
61 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
62 character sequence chosen so as to avoid conflicts with
65 To ensure that extensions added by one vendor may be safely
66 ignored by consumers that do not understand those extensions,
67 the following rules should be followed:
68 \begin{enumerate}[1. ]
70 \item New attributes should be added in such a way that a
71 debugger may recognize the format of a new attribute value
72 without knowing the content of that attribute value.
74 \item The semantics of any new attributes should not alter
75 the semantics of previously existing attributes.
77 \item The semantics of any new tags should not conflict with
78 the semantics of previously existing tags.
80 \item Do not add any new forms of attribute value.
85 \section{Reserved Values}
86 \label{datarep:reservedvalues}
87 \subsection{Error Values}
88 \label{datarep:errorvalues}
89 \addtoindexx{reserved values!error}
92 \addtoindexx{error value}
93 a convenience for consumers of DWARF information, the value
94 0 is reserved in the encodings for attribute names, attribute
95 forms, base type encodings, location operations, languages,
96 line number program opcodes, macro information entries and tag
97 names to represent an error condition or unknown value. DWARF
98 does not specify names for these reserved values, since they
99 do not represent valid encodings for the given type and should
100 not appear in DWARF debugging information.
103 \subsection{Initial Length Values}
104 \label{datarep:initiallengthvalues}
105 \addtoindexx{reserved values!initial length}
107 An \livetarg{datarep:initiallengthvalues}{initial length} field
108 \addtoindexx{initial length field|see{initial length}}
109 is one of the fields that occur at the beginning
110 of those DWARF sections that have a header
114 \dotdebugnames{}) or the length field
115 that occurs at the beginning of the CIE and FDE structures
116 in the \dotdebugframe{} section.
119 In an \addtoindex{initial length} field, the values \wfffffffzero through
120 \wffffffff are reserved by DWARF to indicate some form of
121 extension relative to \DWARFVersionII; such values must not
122 be interpreted as a length field. The use of one such value,
123 \xffffffff, is defined below
124 (see Section \refersec{datarep:32bitand64bitdwarfformats});
126 the other values is reserved for possible future extensions.
130 \section{Relocatable, Split, Executable, Shared and Package Object Files}
131 \label{datarep:executableobjectsandsharedobjects}
133 \subsection{Relocatable Objects}
134 \label{data:relocatableobjects}
135 A DWARF producer (for example, a compiler) typically generates its
136 debugging information as part of a relocatable object file.
137 Relocatable object files are then combined by a linker to form an
138 executable file. During the linking process, the linker resolves
139 (binds) symbolic references between the various object files, and
140 relocates the contents of each object file into a combined virtual
143 The DWARF debugging information is placed in several sections (see
144 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
145 requires an object file format capable of
146 representing these separate sections. There are symbolic references
147 between these sections, and also between the debugging information
148 sections and the other sections that contain the text and data of the
149 program itself. Many of these references require relocation, and the
150 producer must emit the relocation information appropriate to the
151 object file format and the target processor architecture. These
152 references include the following:
155 \item The compilation unit header (see Section
156 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
157 section contains a reference to the \dotdebugabbrev{} table. This
158 reference requires a relocation so that after linking, it refers to
159 that contribution to the combined \dotdebugabbrev{} section in the
162 \item Debugging information entries may have attributes with the form
163 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
164 These attributes represent locations
165 within the virtual address space of the program, and require
168 \item Debugging information entries may have attributes with the form
169 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
170 These attributes refer to
171 debugging information in other debugging information sections within
172 the object file, and must be relocated during the linking process.
173 Exception: attributes whose values are relative to a base offset given
174 by \DWATrangesbase{} do not need relocation.
176 \item Debugging information entries may have attributes with the form
177 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
178 \DWFORMrefudata{} (see Section \refersec{datarep:attributeencodings}).
179 These attributes refer to other
180 debugging information entries within the same compilation unit, and
181 are relative to the beginning of the current compilation unit. These
182 values do not need relocation.
184 \item Debugging information entries may have attributes with the form
185 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
186 These attributes refer to
187 debugging information entries that may be outside the current
188 compilation unit. These values require both symbolic binding and
191 \item Debugging information entries may have attributes with the form
192 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
193 These attributes refer to strings in
194 the \dotdebugstr{} section. These values require relocation.
196 \item Entries in the \dotdebugloc{}, \dotdebugranges{}, and \dotdebugaranges{}
197 sections contain references to locations within the virtual address
198 space of the program, and require relocation.
200 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
201 opcode is a reference to a location within the virtual address space
202 of the program, and requires relocation.
204 The \dotdebugstroffsets{} section contains a list of string offsets,
205 each of which is an offset of a string in the \dotdebugstr{} section. Each
206 of these offsets requires relocation. Depending on the implementation,
207 these relocations may be implicit (that is, the producer may not need to
208 emit any explicit relocation information for these offsets).
211 \subsection{Split DWARF Objects}
212 \label{datarep:splitdwarfobjects}
213 A DWARF producer may partition the debugging
214 information such that the majority of the debugging
215 information can remain in individual object files without
216 being processed by the linker. The first partition contains
217 debugging information that must still be processed by the linker,
218 and includes the following:
221 The line number tables, range tables, frame tables, and
222 accelerated access tables, in the usual sections:
223 \dotdebugline, \dotdebuglinestr, \dotdebugranges, \dotdebugframe,
224 \dotdebugnames{} and \dotdebugaranges,
228 An address table, in the \dotdebugaddr{} section. This table
229 contains all addresses and constants that require
230 link-time relocation, and items in the table can be
231 referenced indirectly from the debugging information via
232 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
233 \DWOPconstx{} operators.
235 A skeleton compilation unit, as described in Section
236 \refersec{chap:skeletoncompilationunitentries},
237 in the \dotdebuginfo{} section.
239 An abbreviations table for the skeleton compilation unit,
240 in the \dotdebugabbrev{} section.
242 A string table, in the \dotdebugstr{} section. The string
243 table is necessary only if the skeleton compilation unit
244 uses either indirect string form, \DWFORMstrp{} or
247 A string offsets table, in the \dotdebugstroffsets{}
248 section. The string offsets table is necessary only if
249 the skeleton compilation unit uses the \DWFORMstrx{} form.
251 The attributes contained in the skeleton compilation
252 unit can be used by a DWARF consumer to find the object file
253 or DWARF object file that contains the second partition.
255 The second partition contains the debugging information that
256 does not need to be processed by the linker. These sections
257 may be left in the object files and ignored by the linker
258 (that is, not combined and copied to the executable object), or
259 they may be placed by the producer in a separate DWARF object
260 file. This partition includes the following:
263 The full compilation unit, in the \dotdebuginfodwo{} section.
264 Attributes in debugging information entries may refer to
265 machine addresses indirectly using the \DWFORMaddrx{} form,
266 and location expressions may do so using the \DWOPaddrx{} and
267 \DWOPconstx{} forms. Attributes may refer to range table
268 entries with an offset relative to a base offset in the
269 range table for the compilation unit.
271 \item Separate type units, in the \dotdebuginfodwo{} section.
274 Abbreviations table(s) for the compilation unit and type
275 units, in the \dotdebugabbrevdwo{} section.
277 \item Location lists, in the \dotdebuglocdwo{} section.
280 A \addtoindex{specialized line number table} (for the type units),
281 in the \dotdebuglinedwo{} section. This table
282 contains only the directory and filename lists needed to
283 interpret \DWATdeclfile{} attributes in the debugging
286 \item Macro information, in the \dotdebugmacrodwo{} section.
288 \item A string table, in the \dotdebugstrdwo{} section.
290 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
294 Except where noted otherwise, all references in this document
295 to a debugging information section (for example, \dotdebuginfo),
296 applies also to the corresponding split DWARF section (for example,
299 \subsection{Executable Objects}
300 \label{chap:executableobjects}
301 The relocated addresses in the debugging information for an
302 executable object are virtual addresses.
304 \subsection{Shared Objects}
305 \label{datarep:sharedobjects}
307 addresses in the debugging information for a shared object
308 are offsets relative to the start of the lowest region of
309 memory loaded from that shared object.
312 \textit{This requirement makes the debugging information for
313 shared objects position independent. Virtual addresses in a
314 shared object may be calculated by adding the offset to the
315 base address at which the object was attached. This offset
316 is available in the run\dash time linker\textquoteright s data structures.}
318 \subsection{DWARF Package Files}
319 \label{datarep:dwarfpackagefiles}
320 \textit{Using split DWARF objects allows the developer to compile,
321 link, and debug an application quickly with less link-time overhead,
322 but a more convenient format is needed for saving the debug
323 information for later debugging of a deployed application. A
324 DWARF package file can be used to collect the debugging
325 information from the object (or separate DWARF object) files
326 produced during the compilation of an application.}
328 \textit{The package file is typically placed in the same directory as the
329 application, and is given the same name with a \doublequote{\texttt{.dwp}}
330 extension.\addtoindexx{\texttt{.dwp} file extension}}
332 A DWARF package file is itself an object file, using the
333 \addtoindexx{package files}
334 \addtoindexx{DWARF package files}
335 same object file format (including byte order) as the
336 corresponding application binary. It consists only of a file
337 header, section table, a number of DWARF debug information
338 sections, and two index sections.
341 Each DWARF package file contains no more than one of each of the
342 following sections, copied from a set of object or DWARF object
343 files, and combined, section by section:
349 \dotdebugstroffsetsdwo
354 The string table section in \dotdebugstrdwo{} contains all the
355 strings referenced from DWARF attributes using the form
356 \DWFORMstrx. Any attribute in a compilation unit or a type
357 unit using this form will refer to an entry in that unit's
358 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
359 will provide the offset of a string in the \dotdebugstrdwo{}
362 The DWARF package file also contains two index sections that
363 provide a fast way to locate debug information by compilation
364 unit signature (\DWATdwoid) for compilation units, or by type
365 signature for type units:
371 \subsubsection{The Compilation Unit (CU) Index Section}
372 The \dotdebugcuindex{} section is a hashed lookup table that maps a
373 compilation unit signature to a set of contributions in the
374 various debug information sections. Each contribution is stored
375 as an offset within its corresponding section and a size.
377 Each compilation unit set may contain contributions from the
380 \dotdebuginfodwo{} (required)
381 \dotdebugabbrevdwo{} (required)
384 \dotdebugstroffsetsdwo
388 \textit{Note that a set is not able to represent \dotdebugmacinfo{}
389 information from \DWARFVersionIV{} or earlier formats.}
391 \subsubsection{The Type Unit (TU) Index Section}
392 The \dotdebugtuindex{} section is a hashed lookup table that maps a
393 type signature to a set of offsets into the various debug
394 information sections. Each contribution is stored as an offset
395 within its corresponding section and a size.
397 Each type unit set may contain contributions from the following
400 \dotdebuginfodwo{} (required)
401 \dotdebugabbrevdwo{} (required)
403 \dotdebugstroffsetsdwo
406 \subsubsection{Format of the CU and TU Index Sections}
407 Both index sections have the same format, and serve to map a
408 64-bit signature to a set of contributions to the debug sections.
409 Each section begins with a header, followed by a hash table of
410 signatures, a parallel table of indexes, a table of offsets, and
411 a table of sizes. The index sections are aligned at 8-byte
412 boundaries in the file.
415 The index section header contains the following fields:
416 \begin{enumerate}[1. ]
417 \item \texttt{version} (\HFTuhalf) \\
419 \addtoindexx{version number!CU index information}
420 \addtoindexx{version number!TU index information}
421 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
422 This number is specific to the CU and TU index information
423 and is independent of the DWARF version number.
425 The version number is \versiondotdebugcuindex.
427 \item \textit{padding} (\HFTuhalf) \\
430 \item \texttt{column\_count} (\HFTuword) \\
431 The number of columns in the table of section counts that follows.
432 For brevity, the contents of this field is referred to as $C$ below.
434 \item \texttt{unit\_count} (\HFTuword) \\
435 The number of compilation units or type units in the index.
436 For brevity, the contents of this field is referred to as $U$ below.
438 \item \texttt{slot\_count} (\HFTuword) \\
439 The number of slots in the hash table.
440 For brevity, the contents of this field is referred to as $S$ below.
444 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
446 The size of the hash table, $S$, must be $2^k$ such that:
447 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
449 The hash table begins at offset 16 in the section, and consists
450 of an array of $M$ 64-bit slots. Each slot contains a 64-bit
452 % (using the byte order of the application binary).
454 The parallel table of indices begins immediately after the hash table
455 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
456 consists of an array of $M$ 32-bit slots,
457 % (using the byte order of the application binary),
458 corresponding 1-1 with slots in the hash
459 table. Each entry in the parallel table contains a row index into
460 the tables of offsets and sizes.
462 Unused slots in the hash table have 0 in both the hash table
463 entry and the parallel table entry. While 0 is a valid hash
464 value, the row index in a used slot will always be non-zero.
466 Given a 64-bit compilation unit signature or a type signature $X$,
467 an entry in the hash table is located as follows:
468 \begin{enumerate}[1. ]
469 \item Calculate a primary hash $H = X\ \&\ MASK(k)$, where $MASK(k)$ is a
470 mask with the low-order $k$ bits all set to 1.
472 \item Calculate a secondary hash $H' = (((X>>32)\ \&\ MASK(k))\ |\ 1)$.
474 \item If the hash table entry at index $H$ matches the signature, use
475 that entry. If the hash table entry at index $H$ is unused (all
476 zeroes), terminate the search: the signature is not present
479 \item Let $H = (H + H')\ modulo\ M$. Repeat at Step 3.
482 Because $M > U$, and $H'$ and $M$ are relatively prime, the search is
483 guaranteed to stop at an unused slot or find the match.
486 The table of offsets begins immediately following the parallel
487 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
488 The table is a two-dimensional array of 32-bit words,
489 %(using the byte order of the application binary),
490 with $C$ columns and $U + 1$
491 rows, in row-major order. Each row in the array is indexed
492 starting from 0. The first row provides a key to the columns:
493 each column in this row provides a section identifier for a debug
494 section, and the offsets in the same column of subsequent rows
495 refer to that section. The section identifiers are shown in
496 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
500 \setlength{\extrarowheight}{0.1cm}
501 \begin{longtable}{l|c|l}
502 \caption{DWARF package file section identifier \mbox{encodings}}
503 \label{tab:dwarfpackagefilesectionidentifierencodings}
504 \addtoindexx{DWARF package files!section identifier encodings} \\
505 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
507 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
509 \hline \emph{Continued on next page}
513 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
514 \textit{Reserved} & 2 & \\
515 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
516 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
517 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
518 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
519 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
520 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
524 The offsets provided by the CU and TU index sections are the base
525 offsets for the contributions made by each CU or TU to the
526 corresponding section in the package file. Each CU and TU header
527 contains an \texttt{abbrev\_offset} field, used to find the abbreviations
528 table for that CU or TU within the contribution to the
529 \dotdebugabbrevdwo{} section for that CU or TU, and should be
530 interpreted as relative to the base offset given in the index
531 section. Likewise, offsets into \dotdebuglinedwo{} from
532 \DWATstmtlist{} attributes should be interpreted as relative to
533 the base offset for \dotdebuglinedwo{}, and offsets into other debug
534 sections obtained from DWARF attributes should also be
535 interpreted as relative to the corresponding base offset.
537 The table of sizes begins immediately following the table of
538 offsets, and provides the sizes of the contributions made by each
539 CU or TU to the corresponding section in the package file. Like
540 the table of offsets, it is a two-dimensional array of 32-bit
541 words, with $C$ columns and $U$ rows, in row-major order. Each row in
542 the array is indexed starting from 1 (row 0 of the table of
543 offsets also serves as the key for the table of sizes).
545 \subsection{DWARF Supplementary Object Files}
546 \label{data:dwarfsupplemetaryobjectfiles}
547 In order to minimize the size of debugging information, it is possible
548 to move duplicate debug information entries, strings and macro entries from
549 several executables or shared objects into a separate
550 \addtoindexi{\textit{supplementary object file}}{supplementary object file} by some
551 post-linking utility; the moved entries and strings can be then referenced
552 from the debugging information of each of those executables or shared objects.
555 A DWARF \addtoindex{supplementary object file} is itself an object file,
556 using the same object
557 file format, byte order, and size as the corresponding application executables
558 or shared libraries. It consists only of a file header, section table, and
559 a number of DWARF debug information sections. Both the
560 \addtoindex{supplementary object file}
561 and all the executables or shared objects that reference entries or strings in that
562 file must contain a \dotdebugsup{} section that establishes the relationship.
564 The \dotdebugsup{} section contains:
565 \begin{enumerate}[1. ]
566 \item \texttt{version} (\HFTuhalf) \\
567 \addttindexx{version}
568 A 2-byte unsigned integer representing the version of the DWARF
569 information for the compilation unit (see Appendix G). The
570 value in this field is \versiondotdebugsup.
572 \item \texttt{is\_supplementary} (\HFTubyte) \\
573 \addttindexx{is\_supplementary}
574 A 1-byte unsigned integer, which contains the value 1 if it is
575 in the \addtoindex{supplementary object file} that other executables or
576 shared objects refer to, or 0 if it is an executable or shared object
577 referring to a \addtoindex{supplementary object file}.
580 \item \texttt{sup\_filename} (null terminated filename string) \\
581 \addttindexx{sup\_filename}
582 If \addttindex{is\_supplementary} is 0, this contains either an absolute
583 filename for the \addtoindex{supplementary object file}, or a filename
584 relative to the object file containing the \dotdebugsup{} section.
585 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
586 is not needed and must be an empty string (a single null byte).
589 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
590 \addttindexx{sup\_checksum\_len}
591 Length of the following \addttindex{sup\_checksum} field;
592 his value can be 0 if no checksum is provided.
595 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
596 \addttindexx{sup\_checksum}
597 Some checksum or cryptographic hash function of the \dotdebuginfo{},
598 \dotdebugstr{} and \dotdebugmacro{} sections of the
599 \addtoindex{supplementary object file}, or some unique identifier
600 which the implementation can choose to verify that the supplementary
601 section object file matches what the debug information in the executables
602 or shared objects expects.
605 Debug information entries that refer to an executable's or shared
606 object's addresses must \emph{not} be moved to supplementary files (the
607 addesses will likely not be the same). Similarly,
608 entries referenced from within location expressions or using loclistptr
609 form attributes must not be moved to a \addtoindex{supplementary object file}.
611 Executable or shared object compilation units can use
612 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
613 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
614 attributes to refer to them and \DWFORMstrpsup{} form attributes to
615 refer to strings that are used by debug information of multiple
616 executables or shared objects. Within the \addtoindex{supplementary object file}'s
617 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} should
618 not be used, and all reference forms referring to some other sections
619 refer to the local sections in the \addtoindex{supplementary object file}.
621 In macro information, \DWMACROdefineindirectsup{} or
622 \DWMACROundefindirectsup{} opcodes can refer to strings in the
623 \dotdebugstr{} section of the \addtoindex{supplementary object file},
624 or \DWMACROtransparentincludesup{}
625 can refer to \dotdebugmacro{} section entries. Within the
626 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
627 \DWMACROdefineindirect{} and \DWMACROundefindirect{}
628 opcodes refer to the local \dotdebugstr{} section, not the one in
629 the executable or shared object."
633 \section{32-Bit and 64-Bit DWARF Formats}
634 \label{datarep:32bitand64bitdwarfformats}
635 \hypertarget{datarep:xxbitdwffmt}{}
636 \addtoindexx{32-bit DWARF format}
637 \addtoindexx{64-bit DWARF format}
638 There are two closely related file formats. In the 32-bit DWARF
639 format, all values that represent lengths of DWARF sections
640 and offsets relative to the beginning of DWARF sections are
641 represented using 32-bits. In the 64-bit DWARF format, all
642 values that represent lengths of DWARF sections and offsets
643 relative to the beginning of DWARF sections are represented
644 using 64-bits. A special convention applies to the initial
645 length field of certain DWARF sections, as well as the CIE and
646 FDE structures, so that the 32-bit and 64-bit DWARF formats
647 can coexist and be distinguished within a single linked object.
649 The differences between the 32- and 64-bit DWARF formats are
650 detailed in the following:
651 \begin{enumerate}[1. ]
653 \item In the 32-bit DWARF format, an
654 \addtoindex{initial length} field (see
655 \addtoindexx{initial length!encoding}
656 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
657 is an unsigned 32-bit integer (which
658 must be less than \xfffffffzero); in the 64-bit DWARF format,
659 an \addtoindex{initial length} field is 96 bits in size,
662 \item The first 32-bits have the value \xffffffff.
664 \item The following 64-bits contain the actual length
665 represented as an unsigned 64-bit integer.
668 \textit{This representation allows a DWARF consumer to dynamically
669 detect that a DWARF section contribution is using the 64-bit
670 format and to adapt its processing accordingly.}
673 \item Section offset and section length
674 \hypertarget{datarep:sectionoffsetlength}{}
675 \addtoindexx{section length!use in headers}
677 \addtoindexx{section offset!use in headers}
678 in the headers of DWARF sections (other than initial length
679 \addtoindexx{initial length}
680 fields) are listed following. In the 32-bit DWARF format these
681 are 32-bit unsigned integer values; in the 64-bit DWARF format,
682 they are 64-bit unsigned integer values.
686 Section &Name & Role \\ \hline
687 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
688 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
689 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
690 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
691 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
692 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
698 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
699 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
700 union must be accessed to distinguish whether a CIE or FDE is
701 present, consequently, these two fields must exactly overlay
702 each other (both offset and size).
704 \item Within the body of the \dotdebuginfo{}
705 section, certain forms of attribute value depend on the choice
706 of DWARF format as follows. For the 32-bit DWARF format,
707 the value is a 32-bit unsigned integer; for the 64-bit DWARF
708 format, the value is a 64-bit unsigned integer.
710 \begin{tabular}{lp{6cm}}
711 Form & Role \\ \hline
712 \DWFORMlinestrp & offset in \dotdebuglinestr \\
713 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
714 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
715 \addtoindexx{supplementary object file}
716 \DWFORMsecoffset & offset in a section other than \\
717 & \dotdebuginfo{} or \dotdebugstr{} \\
718 \DWFORMstrp & offset in \dotdebugstr{} \\
719 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
720 \DWOPcallref & offset in \dotdebuginfo{} \\
725 \item Within the body of the \dotdebugline{} section, certain forms of content
726 description depend on the choice of DWARF format as follows: for the
727 32-bit DWARF format, the value is a 32-bit unsigned integer; for the
728 64-bit DWARF format, the value is a 64-bit unsigned integer.
730 \begin{tabular}{lp{6cm}}
731 Form & Role \\ \hline
732 \DWFORMlinestrp & offset in \dotdebuglinestr
736 \item Within the body of the \dotdebugnames{}
737 sections, the representation of each entry in the array of
738 compilation units (CUs) and the array of local type units
739 (TUs), which represents an offset in the
741 section, depends on the DWARF format as follows: in the
742 32-bit DWARF format, each entry is a 32-bit unsigned integer;
743 in the 64-bit DWARF format, it is a 64-bit unsigned integer.
746 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
747 sections, the size of entries in the body depend on the DWARF
748 format as follows: in the 32-bit DWARF format, entries are 32-bit
749 unsigned integer values; in the 64-bit DWARF format, they are
750 64-bit unsigned integers.
752 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
753 sections, the contents of the address size fields depends on the
754 DWARF format as follows: in the 32-bit DWARF format, these fields
755 contain 4; in the 64-bit DWARF format these fields contain 8.
759 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
760 intermixed within a single compilation unit.
762 \textit{Attribute values and section header fields that represent
763 addresses in the target program are not affected by these
766 A DWARF consumer that supports the 64-bit DWARF format must
767 support executables in which some compilation units use the
768 32-bit format and others use the 64-bit format provided that
769 the combination links correctly (that is, provided that there
770 are no link\dash time errors due to truncation or overflow). (An
771 implementation is not required to guarantee detection and
772 reporting of all such errors.)
774 \textit{It is expected that DWARF producing compilers will \emph{not} use
775 the 64-bit format \emph{by default}. In most cases, the division of
776 even very large applications into a number of executable and
777 shared objects will suffice to assure that the DWARF sections
778 within each individual linked object are less than 4 GBytes
779 in size. However, for those cases where needed, the 64-bit
780 format allows the unusual case to be handled as well. Even
781 in this case, it is expected that only application supplied
782 objects will need to be compiled using the 64-bit format;
783 separate 32-bit format versions of system supplied shared
784 executable libraries can still be used.}
788 \section{Format of Debugging Information}
789 \label{datarep:formatofdebugginginformation}
791 For each compilation unit compiled with a DWARF producer,
792 a contribution is made to the \dotdebuginfo{} section of
793 the object file. Each such contribution consists of a
794 compilation unit header
795 (see Section \refersec{datarep:compilationunitheader})
797 single \DWTAGcompileunit{} or
798 \DWTAGpartialunit{} debugging
799 information entry, together with its children.
801 For each type defined in a compilation unit, a separate
802 contribution may also be made to the
804 section of the object file. Each
805 such contribution consists of a
806 \addtoindex{type unit} header
807 (see Section \refersec{datarep:typeunitheader})
808 followed by a \DWTAGtypeunit{} entry, together with
811 Each debugging information entry begins with a code that
812 represents an entry in a separate
813 \addtoindex{abbreviations table}. This
814 code is followed directly by a series of attribute values.
816 The appropriate entry in the
817 \addtoindex{abbreviations table} guides the
818 interpretation of the information contained directly in the
819 \dotdebuginfo{} section.
822 Multiple debugging information entries may share the same
823 abbreviation table entry. Each compilation unit is associated
824 with a particular abbreviation table, but multiple compilation
825 units may share the same table.
827 \subsection{Unit Headers}
828 \label{datarep:unitheaders}
829 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
830 compilation unit that follows. The encodings for the unit type
831 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
835 \setlength{\extrarowheight}{0.1cm}
836 \begin{longtable}{l|c}
837 \caption{Unit header unit type encodings}
838 \label{tab:unitheaderunitkindencodings}
839 \addtoindexx{unit header unit type encodings} \\
840 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
842 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
844 \hline \emph{Continued on next page}
846 \hline \ddag\ \textit{New in DWARF Version 5}
848 \DWUTcompileTARG~\ddag &0x01 \\
849 \DWUTtypeTARG~\ddag &0x02 \\
850 \DWUTpartialTARG~\ddag &0x03 \\ \hline
855 \subsubsection{Compilation Unit Header}
856 \label{datarep:compilationunitheader}
857 \begin{enumerate}[1. ]
859 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
860 \addttindexx{unit\_length}
862 \addtoindexx{initial length}
863 unsigned integer representing the length
864 of the \dotdebuginfo{}
865 contribution for that compilation unit,
866 not including the length field itself. In the \thirtytwobitdwarfformat,
867 this is a 4-byte unsigned integer (which must be less
868 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
869 of the 4-byte value \wffffffff followed by an 8-byte unsigned
870 integer that gives the actual length
871 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
873 \item \texttt{version} (\HFTuhalf) \\
874 \addttindexx{version}
875 A 2-byte unsigned integer representing the version of the
876 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
877 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
878 The value in this field is \versiondotdebuginfo.
881 \item \texttt{unit\_type} (\HFTubyte) \\
882 \addttindexx{unit\_type}
883 A 1-byte unsigned integer identifying this unit as a compilation unit.
884 The value of this field is
885 \DWUTcompile{} for a {normal compilation} unit or
886 \DWUTpartial{} for a {partial compilation} unit
887 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
889 \textit{This field is new in \DWARFVersionV.}
892 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
893 \addttindexx{debug\_abbrev\_offset}
895 \addtoindexx{section offset!in .debug\_info header}
896 4-byte or 8-byte unsigned offset into the
898 section. This offset associates the compilation unit with a
899 particular set of debugging information entry abbreviations. In
900 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
901 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
902 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
904 \item \texttt{address\_size} (\HFTubyte) \\
905 \addttindexx{address\_size}
906 A 1-byte unsigned integer representing the size in bytes of
907 an address on the target architecture. If the system uses
908 \addtoindexx{address space!segmented}
909 segmented addressing, this value represents the size of the
910 offset portion of an address.
914 \subsubsection{Type Unit Header}
915 \label{datarep:typeunitheader}
917 The header for the series of debugging information entries
918 contributing to the description of a type that has been
919 placed in its own \addtoindex{type unit}, within the
920 \dotdebuginfo{} section,
921 consists of the following information:
922 \begin{enumerate}[1. ]
924 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
925 \addttindexx{unit\_length}
926 A 4-byte or 12-byte unsigned integer
927 \addtoindexx{initial length}
928 representing the length
929 of the \dotdebuginfo{} contribution for that type unit,
930 not including the length field itself. In the \thirtytwobitdwarfformat,
931 this is a 4-byte unsigned integer (which must be
932 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
933 consists of the 4-byte value \wffffffff followed by an
934 8-byte unsigned integer that gives the actual length
935 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
938 \item \texttt{version} (\HFTuhalf) \\
939 \addttindexx{version}
940 A 2-byte unsigned integer representing the version of the
941 DWARF information for the
942 type unit\addtoindexx{version number!type unit}
943 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
944 The value in this field is \versiondotdebuginfo.
946 \item \texttt{unit\_type} (\HFTubyte) \\
947 \addttindexx{unit\_type}
948 A 1-byte unsigned integer identifying this unit as a type unit.
949 The value of this field is \DWUTtype{} for a type unit
950 (see Section \refersec{chap:typeunitentries}).
952 \textit{This field is new in \DWARFVersionV.}
955 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
956 \addttindexx{debug\_abbrev\_offset}
958 \addtoindexx{section offset!in .debug\_info header}
959 4-byte or 8-byte unsigned offset into the
961 section. This offset associates the type unit with a
962 particular set of debugging information entry abbreviations. In
963 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
964 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
965 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
968 \item \texttt{address\_size} (\HFTubyte) \\
969 \addttindexx{address\_size}
970 A 1-byte unsigned integer representing the size
971 \addtoindexx{size of an address}
973 an address on the target architecture. If the system uses
974 \addtoindexx{address space!segmented}
975 segmented addressing, this value represents the size of the
976 offset portion of an address.
978 \item \texttt{type\_signature} (8-byte unsigned integer) \\
979 \addttindexx{type\_signature}
980 \addtoindexx{type signature}
981 A 64-bit unique signature (see Section
982 \refersec{datarep:typesignaturecomputation})
983 of the type described in this type
986 \textit{An attribute that refers (using
987 \DWFORMrefsigeight{}) to
988 the primary type contained in this
989 \addtoindex{type unit} uses this value.}
991 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
992 \addttindexx{type\_offset}
993 A 4-byte or 8-byte unsigned offset
994 \addtoindexx{section offset!in .debug\_info header}
995 relative to the beginning
996 of the \addtoindex{type unit} header.
997 This offset refers to the debugging
998 information entry that describes the type. Because the type
999 may be nested inside a namespace or other structures, and may
1000 contain references to other types that have not been placed in
1001 separate type units, it is not necessarily either the first or
1002 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1003 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1004 this is an 8-byte unsigned length
1005 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1009 \subsection{Debugging Information Entry}
1010 \label{datarep:debugginginformationentry}
1012 Each debugging information entry begins with an
1013 unsigned LEB128\addtoindexx{LEB128!unsigned}
1014 number containing the abbreviation code for the entry. This
1015 code represents an entry within the abbreviations table
1016 associated with the compilation unit containing this entry. The
1017 abbreviation code is followed by a series of attribute values.
1019 On some architectures, there are alignment constraints on
1020 section boundaries. To make it easier to pad debugging
1021 information sections to satisfy such constraints, the
1022 abbreviation code 0 is reserved. Debugging information entries
1023 consisting of only the abbreviation code 0 are considered
1026 \subsection{Abbreviations Tables}
1027 \label{datarep:abbreviationstables}
1029 The abbreviations tables for all compilation units
1030 are contained in a separate object file section called
1032 As mentioned before, multiple compilation
1033 units may share the same abbreviations table.
1035 The abbreviations table for a single compilation unit consists
1036 of a series of abbreviation declarations. Each declaration
1037 specifies the tag and attributes for a particular form of
1038 debugging information entry. Each declaration begins with
1039 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1040 number representing the abbreviation
1041 code itself. It is this code that appears at the beginning
1042 of a debugging information entry in the
1044 section. As described above, the abbreviation
1045 code 0 is reserved for null debugging information entries. The
1046 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1047 number that encodes the entry\textquoteright s tag. The encodings for the
1048 tag names are given in
1049 Table \refersec{tab:tagencodings}.
1052 \setlength{\extrarowheight}{0.1cm}
1053 \begin{longtable}{l|c}
1055 \caption{Tag encodings} \label{tab:tagencodings} \\
1056 \hline \bfseries Tag name&\bfseries Value\\ \hline
1058 \bfseries Tag name&\bfseries Value \\ \hline
1060 \hline \emph{Continued on next page}
1062 \hline \ddag\ \textit{New in DWARF Version 5}
1064 \DWTAGarraytype{} &0x01 \\
1065 \DWTAGclasstype&0x02 \\
1066 \DWTAGentrypoint&0x03 \\
1067 \DWTAGenumerationtype&0x04 \\
1068 \DWTAGformalparameter&0x05 \\
1069 \DWTAGimporteddeclaration&0x08 \\
1071 \DWTAGlexicalblock&0x0b \\
1072 \DWTAGmember&0x0d \\
1073 \DWTAGpointertype&0x0f \\
1074 \DWTAGreferencetype&0x10 \\
1075 \DWTAGcompileunit&0x11 \\
1076 \DWTAGstringtype&0x12 \\
1077 \DWTAGstructuretype&0x13 \\
1078 \DWTAGsubroutinetype&0x15 \\
1079 \DWTAGtypedef&0x16 \\
1080 \DWTAGuniontype&0x17 \\
1081 \DWTAGunspecifiedparameters&0x18 \\
1082 \DWTAGvariant&0x19 \\
1083 \DWTAGcommonblock&0x1a \\
1084 \DWTAGcommoninclusion&0x1b \\
1085 \DWTAGinheritance&0x1c \\
1086 \DWTAGinlinedsubroutine&0x1d \\
1087 \DWTAGmodule&0x1e \\
1088 \DWTAGptrtomembertype&0x1f \\
1089 \DWTAGsettype&0x20 \\
1090 \DWTAGsubrangetype&0x21 \\
1091 \DWTAGwithstmt&0x22 \\
1092 \DWTAGaccessdeclaration&0x23 \\
1093 \DWTAGbasetype&0x24 \\
1094 \DWTAGcatchblock&0x25 \\
1095 \DWTAGconsttype&0x26 \\
1096 \DWTAGconstant&0x27 \\
1097 \DWTAGenumerator&0x28 \\
1098 \DWTAGfiletype&0x29 \\
1099 \DWTAGfriend&0x2a \\
1100 \DWTAGnamelist&0x2b \\
1101 \DWTAGnamelistitem&0x2c \\
1102 \DWTAGpackedtype&0x2d \\
1103 \DWTAGsubprogram&0x2e \\
1104 \DWTAGtemplatetypeparameter&0x2f \\
1105 \DWTAGtemplatevalueparameter&0x30 \\
1106 \DWTAGthrowntype&0x31 \\
1107 \DWTAGtryblock&0x32 \\
1108 \DWTAGvariantpart&0x33 \\
1109 \DWTAGvariable&0x34 \\
1110 \DWTAGvolatiletype&0x35 \\
1111 \DWTAGdwarfprocedure&0x36 \\
1112 \DWTAGrestricttype&0x37 \\
1113 \DWTAGinterfacetype&0x38 \\
1114 \DWTAGnamespace&0x39 \\
1115 \DWTAGimportedmodule&0x3a \\
1116 \DWTAGunspecifiedtype&0x3b \\
1117 \DWTAGpartialunit&0x3c \\
1118 \DWTAGimportedunit&0x3d \\
1119 \DWTAGcondition&\xiiif \\
1120 \DWTAGsharedtype&0x40 \\
1121 \DWTAGtypeunit & 0x41 \\
1122 \DWTAGrvaluereferencetype & 0x42 \\
1123 \DWTAGtemplatealias & 0x43 \\
1124 \DWTAGcoarraytype~\ddag & 0x44 \\
1125 \DWTAGgenericsubrange~\ddag & 0x45 \\
1126 \DWTAGdynamictype~\ddag & 0x46 \\
1127 \DWTAGatomictype~\ddag & 0x47 \\
1128 \DWTAGcallsite~\ddag & 0x48 \\
1129 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1130 \DWTAGlouser&0x4080 \\
1131 \DWTAGhiuser&\xffff \\
1135 Following the tag encoding is a 1-byte value that determines
1136 whether a debugging information entry using this abbreviation
1137 has child entries or not. If the value is
1139 the next physically succeeding entry of any debugging
1140 information entry using this abbreviation is the first
1141 child of that entry. If the 1-byte value following the
1142 abbreviation\textquoteright s tag encoding is
1143 \DWCHILDRENnoTARG, the next
1144 physically succeeding entry of any debugging information entry
1145 using this abbreviation is a sibling of that entry. (Either
1146 the first child or sibling entries may be null entries). The
1147 encodings for the child determination byte are given in
1148 Table \refersec{tab:childdeterminationencodings}
1150 Section \refersec{chap:relationshipofdebugginginformationentries},
1151 each chain of sibling entries is terminated by a null entry.)
1155 \setlength{\extrarowheight}{0.1cm}
1156 \begin{longtable}{l|c}
1157 \caption{Child determination encodings}
1158 \label{tab:childdeterminationencodings}
1159 \addtoindexx{Child determination encodings} \\
1160 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1162 \bfseries Children determination name&\bfseries Value \\ \hline
1164 \hline \emph{Continued on next page}
1168 \DWCHILDRENno&0x00 \\
1169 \DWCHILDRENyes&0x01 \\ \hline
1174 Finally, the child encoding is followed by a series of
1175 attribute specifications. Each attribute specification
1176 consists of two parts. The first part is an
1177 unsigned LEB128\addtoindexx{LEB128!unsigned}
1178 number representing the attribute\textquoteright s name.
1179 The second part is an
1180 unsigned LEB128\addtoindexx{LEB128!unsigned}
1181 number representing the attribute\textquoteright s form.
1182 The series of attribute specifications ends with an
1183 entry containing 0 for the name and 0 for the form.
1186 \DWFORMindirectTARG{} is a special case. For
1187 attributes with this form, the attribute value itself in the
1189 section begins with an unsigned
1190 LEB128 number that represents its form. This allows producers
1191 to choose forms for particular attributes
1192 \addtoindexx{abbreviations table!dynamic forms in}
1194 without having to add a new entry to the abbreviations table.
1196 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1197 For attributes with this form, the attribute specification contains
1198 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1199 number. The value of this number is used as the value of the
1200 attribute, and no value is stored in the \dotdebuginfo{} section.
1202 The abbreviations for a given compilation unit end with an
1203 entry consisting of a 0 byte for the abbreviation code.
1206 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1207 for a depiction of the organization of the
1208 debugging information.}
1211 \subsection{Attribute Encodings}
1212 \label{datarep:attributeencodings}
1214 The encodings for the attribute names are given in
1215 Table \referfol{tab:attributeencodings}.
1218 \setlength{\extrarowheight}{0.1cm}
1219 \begin{longtable}{l|c|l}
1220 \caption{Attribute encodings}
1221 \label{tab:attributeencodings}
1222 \addtoindexx{attribute encodings} \\
1223 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1225 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1227 \hline \emph{Continued on next page}
1229 \hline \ddag\ \textit{New in DWARF Version 5}
1231 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1232 \addtoindexx{sibling attribute} \\
1233 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1234 \livelink{chap:classloclistptr}{loclistptr}
1235 \addtoindexx{location attribute} \\
1236 \DWATname&0x03&\livelink{chap:classstring}{string}
1237 \addtoindexx{name attribute} \\
1238 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1239 \addtoindexx{ordering attribute} \\
1240 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1241 \livelink{chap:classexprloc}{exprloc},
1242 \livelink{chap:classreference}{reference}
1243 \addtoindexx{byte size attribute} \\
1244 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1245 DW\_AT\_bit\_offset \mbox{attribute} which was
1246 defined in \DWARFVersionIII{} and earlier.}
1247 &\livelink{chap:classconstant}{constant},
1248 \livelink{chap:classexprloc}{exprloc},
1249 \livelink{chap:classreference}{reference}
1250 \addtoindexx{bit offset attribute (Version 3)}
1251 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1252 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1253 \livelink{chap:classexprloc}{exprloc},
1254 \livelink{chap:classreference}{reference}
1255 \addtoindexx{bit size attribute} \\
1256 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1257 \addtoindexx{statement list attribute} \\
1258 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1259 \addtoindexx{low PC attribute} \\
1260 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1261 \livelink{chap:classconstant}{constant}
1262 \addtoindexx{high PC attribute} \\
1263 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1264 \addtoindexx{language attribute} \\
1265 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1266 \addtoindexx{discriminant attribute} \\
1267 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1268 \addtoindexx{discriminant value attribute} \\
1269 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1270 \addtoindexx{visibility attribute} \\
1271 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1272 \addtoindexx{import attribute} \\
1273 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1274 \livelink{chap:classloclistptr}{loclistptr}
1275 \addtoindexx{string length attribute} \\
1276 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1277 \addtoindexx{common reference attribute} \\
1278 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1279 \addtoindexx{compilation directory attribute} \\
1280 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1281 \livelink{chap:classconstant}{constant},
1282 \livelink{chap:classstring}{string}
1283 \addtoindexx{constant value attribute} \\
1284 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1285 \addtoindexx{containing type attribute} \\
1286 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1287 \livelink{chap:classreference}{reference},
1288 \livelink{chap:classflag}{flag}
1289 \addtoindexx{default value attribute} \\
1290 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1291 \addtoindexx{inline attribute} \\
1292 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1293 \addtoindexx{is optional attribute} \\
1294 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1295 \livelink{chap:classexprloc}{exprloc},
1296 \livelink{chap:classreference}{reference}
1297 \addtoindexx{lower bound attribute} \\
1298 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1299 \addtoindexx{producer attribute} \\
1300 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1301 \addtoindexx{prototyped attribute} \\
1302 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1303 \livelink{chap:classloclistptr}{loclistptr}
1304 \addtoindexx{return address attribute} \\
1305 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1306 \livelink{chap:classrangelistptr}{rangelistptr}
1307 \addtoindexx{start scope attribute} \\
1308 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1309 \livelink{chap:classexprloc}{exprloc},
1310 \livelink{chap:classreference}{reference}
1311 \addtoindexx{bit stride attribute} \\
1312 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1313 \livelink{chap:classexprloc}{exprloc},
1314 \livelink{chap:classreference}{reference}
1315 \addtoindexx{upper bound attribute} \\
1316 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1317 \addtoindexx{abstract origin attribute} \\
1318 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1319 \addtoindexx{accessibility attribute} \\
1320 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1321 \addtoindexx{address class attribute} \\
1322 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1323 \addtoindexx{artificial attribute} \\
1324 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1325 \addtoindexx{base types attribute} \\
1326 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1327 \addtoindexx{calling convention attribute} \\
1328 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1329 \livelink{chap:classexprloc}{exprloc},
1330 \livelink{chap:classreference}{reference}
1331 \addtoindexx{count attribute} \\
1332 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1333 \livelink{chap:classexprloc}{exprloc},
1334 \livelink{chap:classloclistptr}{loclistptr}
1335 \addtoindexx{data member attribute} \\
1336 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1337 \addtoindexx{declaration column attribute} \\
1338 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1339 \addtoindexx{declaration file attribute} \\
1340 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1341 \addtoindexx{declaration line attribute} \\
1342 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1343 \addtoindexx{declaration attribute} \\
1344 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1345 \addtoindexx{discriminant list attribute} \\
1346 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1347 \addtoindexx{encoding attribute} \\
1348 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1349 \addtoindexx{external attribute} \\
1350 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1351 \livelink{chap:classloclistptr}{loclistptr}
1352 \addtoindexx{frame base attribute} \\
1353 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1354 \addtoindexx{friend attribute} \\
1355 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1356 \addtoindexx{identifier case attribute} \\
1357 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1358 Reserved for compatibility and coexistence
1359 with prior DWARF versions.}
1360 &0x43&\livelink{chap:classmacptr}{macptr}
1361 \addtoindexx{macro information attribute (legacy)!encoding} \\
1362 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1363 \addtoindexx{name list item attribute} \\
1364 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1365 \addtoindexx{priority attribute} \\
1366 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1367 \livelink{chap:classloclistptr}{loclistptr}
1368 \addtoindexx{segment attribute} \\
1369 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1370 \addtoindexx{specification attribute} \\
1371 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1372 \livelink{chap:classloclistptr}{loclistptr}
1373 \addtoindexx{static link attribute} \\
1374 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1375 \addtoindexx{type attribute} \\
1376 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1377 \livelink{chap:classloclistptr}{loclistptr}
1378 \addtoindexx{location list attribute} \\
1379 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1380 \addtoindexx{variable parameter attribute} \\
1381 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1382 \addtoindexx{virtuality attribute} \\
1383 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1384 \livelink{chap:classloclistptr}{loclistptr}
1385 \addtoindexx{vtable element location attribute} \\
1386 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1387 \livelink{chap:classexprloc}{exprloc},
1388 \livelink{chap:classreference}{reference}
1389 \addtoindexx{allocated attribute} \\
1390 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1391 \livelink{chap:classexprloc}{exprloc},
1392 \livelink{chap:classreference}{reference}
1393 \addtoindexx{associated attribute} \\
1394 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1395 \addtoindexx{data location attribute} \\
1396 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1397 \livelink{chap:classexprloc}{exprloc},
1398 \livelink{chap:classreference}{reference}
1399 \addtoindexx{byte stride attribute} \\
1400 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1401 \livelink{chap:classconstant}{constant}
1402 \addtoindexx{entry PC attribute} \\
1403 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1404 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1405 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1406 \addtoindexx{extension attribute} \\
1407 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1408 \addtoindexx{ranges attribute} \\
1409 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1410 \livelink{chap:classflag}{flag},
1411 \livelink{chap:classreference}{reference},
1412 \livelink{chap:classstring}{string}
1413 \addtoindexx{trampoline attribute} \\
1414 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1415 \addtoindexx{call column attribute} \\
1416 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1417 \addtoindexx{call file attribute} \\
1418 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1419 \addtoindexx{call line attribute} \\
1420 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1421 \addtoindexx{description attribute} \\
1422 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1423 \addtoindexx{binary scale attribute} \\
1424 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1425 \addtoindexx{decimal scale attribute} \\
1426 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1427 \addtoindexx{small attribute} \\
1428 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1429 \addtoindexx{decimal scale attribute} \\
1430 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1431 \addtoindexx{digit count attribute} \\
1432 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1433 \addtoindexx{picture string attribute} \\
1434 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1435 \addtoindexx{mutable attribute} \\
1436 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1437 \addtoindexx{thread scaled attribute} \\
1438 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1439 \addtoindexx{explicit attribute} \\
1440 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1441 \addtoindexx{object pointer attribute} \\
1442 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1443 \addtoindexx{endianity attribute} \\
1444 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1445 \addtoindexx{elemental attribute} \\
1446 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1447 \addtoindexx{pure attribute} \\
1448 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1449 \addtoindexx{recursive attribute} \\
1450 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1451 \addtoindexx{signature attribute} \\
1452 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1453 \addtoindexx{main subprogram attribute} \\
1454 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1455 \addtoindexx{data bit offset attribute} \\
1456 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1457 \addtoindexx{constant expression attribute} \\
1458 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1459 \addtoindexx{enumeration class attribute} \\
1460 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1461 \addtoindexx{linkage name attribute} \\
1462 \DWATstringlengthbitsize{}~\ddag&0x6f&
1463 \livelink{chap:classconstant}{constant}
1464 \addtoindexx{string length attribute!size of length} \\
1465 \DWATstringlengthbytesize{}~\ddag&0x70&
1466 \livelink{chap:classconstant}{constant}
1467 \addtoindexx{string length attribute!size of length} \\
1468 \DWATrank~\ddag&0x71&
1469 \livelink{chap:classconstant}{constant},
1470 \livelink{chap:classexprloc}{exprloc}
1471 \addtoindexx{rank attribute} \\
1472 \DWATstroffsetsbase~\ddag&0x72&
1473 \livelinki{chap:classstring}{stroffsetsptr}{stroffsetsptr class}
1474 \addtoindexx{string offsets base!encoding} \\
1475 \DWATaddrbase~\ddag &0x73&
1476 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1477 \addtoindexx{address table base!encoding} \\
1478 \DWATrangesbase~\ddag&0x74&
1479 \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class}
1480 \addtoindexx{ranges base!encoding} \\
1481 \DWATdwoid~\ddag &0x75&
1482 \livelink{chap:classconstant}{constant}
1483 \addtoindexx{split DWARF object id!encoding} \\
1484 \DWATdwoname~\ddag &0x76&
1485 \livelink{chap:classstring}{string}
1486 \addtoindexx{split DWARF object file name!encoding} \\
1487 \DWATreference~\ddag &0x77&
1488 \livelink{chap:classflag}{flag} \\
1489 \DWATrvaluereference~\ddag &0x78&
1490 \livelink{chap:classflag}{flag} \\
1491 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1492 \addtoindexx{macro information attribute} \\
1493 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1494 \addtoindexx{all calls summary attribute} \\
1495 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1496 \addtoindexx{all source calls summary attribute} \\
1497 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1498 \addtoindexx{all tail calls summary attribute} \\
1499 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1500 \addtoindexx{call return PC attribute} \\
1501 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1502 \addtoindexx{call value attribute} \\
1503 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1504 \addtoindexx{call origin attribute} \\
1505 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1506 \addtoindexx{call parameter attribute} \\
1507 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1508 \addtoindexx{call PC attribute} \\
1509 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1510 \addtoindexx{call tail call attribute} \\
1511 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1512 \addtoindexx{call target attribute} \\
1513 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1514 \addtoindexx{call target clobbered attribute} \\
1515 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1516 \addtoindexx{call data location attribute} \\
1517 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1518 \addtoindexx{call data value attribute} \\
1519 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1520 \addtoindexx{noreturn attribute} \\
1521 \DWATalignment~\ddag &0x88 &\CLASSconstant
1522 \addtoindexx{alignment attribute} \\
1523 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1524 \addtoindexx{export symbols attribute} \\
1525 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1526 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1527 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1528 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1533 The attribute form governs how the value of the attribute is
1534 encoded. There are nine classes of form, listed below. Each
1535 class is a set of forms which have related representations
1536 and which are given a common interpretation according to the
1537 attribute in which the form is used.
1539 Form \DWFORMsecoffsetTARG{}
1541 \addtoindexx{rangelistptr class}
1543 \addtoindexx{macptr class}
1545 \addtoindexx{loclistptr class}
1547 \addtoindexx{lineptr class}
1553 \CLASSrangelistptr{} or
1554 \CLASSstroffsetsptr;
1555 the list of classes allowed by the applicable attribute in
1556 Table \refersec{tab:attributeencodings}
1557 determines the class of the form.
1561 Each possible form belongs to one or more of the following classes:
1564 \item \livelinki{chap:classaddress}{address}{address class} \\
1565 \livetarg{datarep:classaddress}{}
1566 Represented as either:
1568 \item An object of appropriate size to hold an
1569 address on the target machine
1571 The size is encoded in the compilation unit header
1572 (see Section \refersec{datarep:compilationunitheader}).
1573 This address is relocatable in a relocatable object file and
1574 is relocated in an executable file or shared object.
1576 \item An indirect index into a table of addresses (as
1577 described in the previous bullet) in the
1578 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1579 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1580 \addtoindex{LEB128} value, which is interpreted as a zero-based
1581 index into an array of addresses in the \dotdebugaddr{} section.
1582 The index is relative to the value of the \DWATaddrbase{} attribute
1583 of the associated compilation unit.
1587 \item \livelink{chap:classaddrptr}{addrptr} \\
1588 \livetarg{datarep:classaddrptr}{}
1589 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1590 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1591 beginning of the list of machine addresses information for the
1592 referencing entity. It is relocatable in
1593 a relocatable object file, and relocated in an executable or
1594 shared object. In the \thirtytwobitdwarfformat, this offset
1595 is a 4-byte unsigned value; in the 64-bit DWARF
1596 format, it is an 8-byte unsigned value (see Section
1597 \refersec{datarep:32bitand64bitdwarfformats}).
1599 \textit{This class is new in \DWARFVersionV.}
1602 \item \livelink{chap:classblock}{block} \\
1603 \livetarg{datarep:classblock}{}
1604 Blocks come in four forms:
1606 \begin{myindentpara}{1cm}
1607 A 1-byte length followed by 0 to 255 contiguous information
1608 bytes (\DWFORMblockoneTARG).
1611 \begin{myindentpara}{1cm}
1612 A 2-byte length followed by 0 to 65,535 contiguous information
1613 bytes (\DWFORMblocktwoTARG).
1616 \begin{myindentpara}{1cm}
1617 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1618 information bytes (\DWFORMblockfourTARG).
1621 \begin{myindentpara}{1cm}
1622 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1623 length followed by the number of bytes
1624 specified by the length (\DWFORMblockTARG).
1627 In all forms, the length is the number of information bytes
1628 that follow. The information bytes may contain any mixture
1629 of relocated (or relocatable) addresses, references to other
1630 debugging information entries or data bytes.
1632 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1633 \livetarg{datarep:classconstant}{}
1634 There are eight forms of constants. There are fixed length
1635 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1639 \DWFORMdatafourTARG,
1640 \DWFORMdataeightTARG{} and
1641 \DWFORMdatasixteenTARG).
1642 There are also variable length constant
1643 data forms encoded using LEB128 numbers (see below).
1644 Both signed (\DWFORMsdataTARG) and unsigned
1645 (\DWFORMudataTARG) variable length constants are available.
1646 There is also an implicit constant (\DWFORMimplicitconst),
1647 whose value is provided as part of the abbreviation
1651 The data in \DWFORMdataone,
1654 \DWFORMdataeight{} and
1655 \DWFORMdatasixteen{}
1656 can be anything. Depending on context, it may
1657 be a signed integer, an unsigned integer, a floating\dash point
1658 constant, or anything else. A consumer must use context to
1659 know how to interpret the bits, which if they are target
1660 machine data (such as an integer or floating-point constant)
1661 will be in target machine byte\dash order.
1663 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1664 forms is used to represent a
1665 signed or unsigned integer, it can be hard for a consumer
1666 to discover the context necessary to determine which
1667 interpretation is intended. Producers are therefore strongly
1668 encouraged to use \DWFORMsdata{} or
1669 \DWFORMudata{} for signed and
1670 unsigned integers respectively, rather than
1671 \DWFORMdata\textless n\textgreater.}
1674 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1675 \livetarg{datarep:classexprloc}{}
1676 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1677 number of information bytes specified by the length
1678 (\DWFORMexprlocTARG).
1679 The information bytes contain a DWARF expression
1680 (see Section \refersec{chap:dwarfexpressions})
1681 or location description
1682 (see Section \refersec{chap:locationdescriptions}).
1684 \item \livelinki{chap:classflag}{flag}{flag class} \\
1685 \livetarg{datarep:classflag}{}
1686 A flag \addtoindexx{flag class}
1687 is represented explicitly as a single byte of data
1688 (\DWFORMflagTARG) or
1689 implicitly (\DWFORMflagpresentTARG).
1691 first case, if the \nolink{flag} has value zero, it indicates the
1692 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1693 it indicates the presence of the attribute. In the second
1694 case, the attribute is implicitly indicated as present, and
1695 no value is encoded in the debugging information entry itself.
1697 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1698 \livetarg{datarep:classlineptr}{}
1699 This is an offset into
1700 \addtoindexx{section offset!in class lineptr value}
1702 \dotdebugline{} or \dotdebuglinedwo{} section
1704 It consists of an offset from the beginning of the
1706 section to the first byte of
1707 the data making up the line number list for the compilation
1709 It is relocatable in a relocatable object file, and
1710 relocated in an executable or shared object. In the
1711 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1712 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1713 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1716 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1717 \livetarg{datarep:classloclistptr}{}
1718 This is an offset into the
1722 It consists of an offset from the
1723 \addtoindexx{section offset!in class loclistptr value}
1726 section to the first byte of
1727 the data making up the
1728 \addtoindex{location list} for the compilation unit.
1729 It is relocatable in a relocatable object file, and
1730 relocated in an executable or shared object. In the
1731 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1732 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1733 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1736 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1737 \livetarg{datarep:classmacptr}{}
1739 \addtoindexx{section offset!in class macptr value}
1741 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1743 It consists of an offset from the beginning of the
1744 \dotdebugmacro{} or \dotdebugmacrodwo{}
1745 section to the the header making up the
1746 macro information list for the compilation unit.
1747 It is relocatable in a relocatable object file, and
1748 relocated in an executable or shared object. In the
1749 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1750 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1751 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1754 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1755 \livetarg{datarep:classrangelistptr}{}
1757 \addtoindexx{section offset!in class rangelistptr value}
1758 offset into the \dotdebugranges{} section
1761 offset from the beginning of the
1762 \dotdebugranges{} section
1763 to the beginning of the non\dash contiguous address ranges
1764 information for the referencing entity.
1765 It is relocatable in
1766 a relocatable object file, and relocated in an executable or
1767 shared object. In the \thirtytwobitdwarfformat, this offset
1768 is a 4-byte unsigned value; in the 64-bit DWARF
1769 format, it is an 8-byte unsigned value (see Section
1770 \refersec{datarep:32bitand64bitdwarfformats}).
1773 \textit{Because classes
1778 \CLASSrangelistptr{} and
1779 \CLASSstroffsetsptr{}
1780 share a common representation, it is not possible for an
1781 attribute to allow more than one of these classes}
1785 \item \livelinki{chap:classreference}{reference}{reference class} \\
1786 \livetarg{datarep:classreference}{}
1787 There are four types of reference.
1790 \addtoindexx{reference class}
1791 first type of reference can identify any debugging
1792 information entry within the containing unit.
1795 \addtoindexx{section offset!in class reference value}
1796 offset from the first byte of the compilation
1797 header for the compilation unit containing the reference. There
1798 are five forms for this type of reference. There are fixed
1799 length forms for one, two, four and eight byte offsets
1805 and \DWFORMrefeightTARG).
1806 There is also an unsigned variable
1807 length offset encoded form that uses
1808 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1809 (\DWFORMrefudataTARG).
1810 Because this type of reference is within
1811 the containing compilation unit no relocation of the value
1814 The second type of reference can identify any debugging
1815 information entry within a
1816 \dotdebuginfo{} section; in particular,
1817 it may refer to an entry in a different compilation unit
1818 from the unit containing the reference, and may refer to an
1819 entry in a different shared object. This type of reference
1820 (\DWFORMrefaddrTARG)
1821 is an offset from the beginning of the
1823 section of the target executable or shared object, or, for
1824 references within a \addtoindex{supplementary object file},
1825 an offset from the beginning of the local \dotdebuginfo{} section;
1826 it is relocatable in a relocatable object file and frequently
1827 relocated in an executable file or shared object. For
1828 references from one shared object or static executable file
1829 to another, the relocation and identification of the target
1830 object must be performed by the consumer. In the
1831 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1832 in the \sixtyfourbitdwarfformat, it is an 8-byte
1834 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1836 \textit{A debugging information entry that may be referenced by
1837 another compilation unit using
1838 \DWFORMrefaddr{} must have a global symbolic name.}
1840 \textit{For a reference from one executable or shared object to
1841 another, the reference is resolved by the debugger to identify
1842 the shared object or executable and the offset into that
1843 object\textquoteright s \dotdebuginfo{}
1844 section in the same fashion as the run
1845 time loader, either when the debug information is first read,
1846 or when the reference is used.}
1848 The third type of reference can identify any debugging
1849 information type entry that has been placed in its own
1850 \addtoindex{type unit}. This type of
1851 reference (\DWFORMrefsigeightTARG) is the
1852 \addtoindexx{type signature}
1853 64-bit type signature
1854 (see Section \refersec{datarep:typesignaturecomputation})
1855 that was computed for the type.
1857 The fourth type of reference is a reference from within the
1858 \dotdebuginfo{} section of the executable or shared object to
1859 a debugging information entry in the \dotdebuginfo{} section of
1860 a \addtoindex{supplementary object file}.
1861 This type of reference (\DWFORMrefsupTARG) is an offset from the
1862 beginning of the \dotdebuginfo{} section in the
1863 \addtoindex{supplementary object file}.
1865 \textit{The use of compilation unit relative references will reduce the
1866 number of link\dash time relocations and so speed up linking. The
1867 use of the second, third and fourth type of reference allows for the
1868 sharing of information, such as types, across compilation
1869 units, while the fourth type further allows for sharing of information
1870 across compilation units from different executables or shared objects.}
1872 \textit{A reference to any kind of compilation unit identifies the
1873 debugging information entry for that unit, not the preceding
1877 \item \livelinki{chap:classstring}{string}{string class} \\
1878 \livetarg{datarep:classstring}{}
1879 A string is a sequence of contiguous non\dash null bytes followed by
1881 \addtoindexx{string class}
1882 A string may be represented:
1884 \setlength{\itemsep}{0em}
1885 \item immediately in the debugging information entry itself
1886 (\DWFORMstringTARG),
1889 \addtoindexx{section offset!in class string value}
1890 offset into a string table contained in
1891 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
1892 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
1893 or as an offset into a string table contained in the
1894 \dotdebugstr{} section of a \addtoindex{supplementary object file}
1895 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
1896 section of a \addtoindex{supplementary object file}
1897 refer to the local \dotdebugstr{} section of that same file.
1898 In the \thirtytwobitdwarfformat, the representation of a
1899 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
1900 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
1901 it is an 8-byte unsigned offset
1902 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1905 \item as an indirect offset into the string table using an
1906 index into a table of offsets contained in the
1907 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1908 The representation of a \DWFORMstrxNAME{} value is an unsigned
1909 \addtoindex{LEB128} value, which is interpreted as a zero-based
1910 index into an array of offsets in the \dotdebugstroffsets{} section.
1911 The offset entries in the \dotdebugstroffsets{} section have the
1912 same representation as \DWFORMstrp{} values.
1914 Any combination of these three forms may be used within a single compilation.
1916 If the \DWATuseUTFeight{}
1917 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1918 compilation, partial, skeleton or type unit entry, string values are encoded using the
1919 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1920 Character Set standard (ISO/IEC 10646\dash 1:1993).
1921 \addtoindexx{ISO 10646 character set standard}
1922 Otherwise, the string representation is unspecified.
1924 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1925 ISO/IEC 10646\dash 1:1993.
1926 \addtoindexx{ISO 10646 character set standard}
1927 It contains all the same characters
1928 and encoding points as ISO/IEC 10646, as well as additional
1929 information about the characters and their use.}
1931 \textit{Earlier versions of DWARF did not specify the representation
1932 of strings; for compatibility, this version also does
1933 not. However, the UTF\dash 8 representation is strongly recommended.}
1936 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1937 \livetarg{datarep:classstroffsetsptr}{}
1938 This is an offset into the \dotdebugstroffsets{} section
1939 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1940 \dotdebugstroffsets{} section to the
1941 beginning of the string offsets information for the
1942 referencing entity. It is relocatable in
1943 a relocatable object file, and relocated in an executable or
1944 shared object. In the \thirtytwobitdwarfformat, this offset
1945 is a 4-byte unsigned value; in the 64-bit DWARF
1946 format, it is an 8-byte unsigned value (see Section
1947 \refersec{datarep:32bitand64bitdwarfformats}).
1949 \textit{This class is new in \DWARFVersionV.}
1953 In no case does an attribute use one of the classes
1958 \CLASSrangelistptr{} or
1959 \CLASSstroffsetsptr{}
1960 to point into either the
1961 \dotdebuginfo{} or \dotdebugstr{} section.
1963 The form encodings are listed in
1964 Table \referfol{tab:attributeformencodings}.
1968 \setlength{\extrarowheight}{0.1cm}
1969 \begin{longtable}{l|c|l}
1970 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1971 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1973 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1975 \hline \emph{Continued on next page}
1977 \hline \ddag\ \textit{New in DWARF Version 5}
1980 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1981 \textit{Reserved} &0x02& \\
1982 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1983 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1984 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1985 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1986 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1987 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1988 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1989 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1990 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1991 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1992 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1993 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1994 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1995 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1996 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1997 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1998 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1999 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2000 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2001 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2002 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
2003 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
2004 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2005 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2006 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2007 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2008 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2009 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2010 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2011 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2012 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2013 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2019 \section{Variable Length Data}
2020 \label{datarep:variablelengthdata}
2021 \addtoindexx{variable length data|see {LEB128}}
2023 \addtoindexx{Little Endian Base 128|see{LEB128}}
2024 encoded using \doublequote{Little Endian Base 128}
2025 \addtoindexx{little-endian encoding|see{endian attribute}}
2027 \addtoindexx{LEB128}
2028 LEB128 is a scheme for encoding integers
2029 densely that exploits the assumption that most integers are
2032 \textit{This encoding is equally suitable whether the target machine
2033 architecture represents data in big\dash\ endian or little\dash endian
2034 order. It is \doublequote{little\dash endian} only in the sense that it
2035 avoids using space to represent the \doublequote{big} end of an
2036 unsigned integer, when the big end is all zeroes or sign
2039 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2040 numbers are encoded as follows:
2041 \addtoindexx{LEB128!unsigned, encoding as}
2042 start at the low order end of an unsigned integer and chop
2043 it into 7-bit chunks. Place each chunk into the low order 7
2044 bits of a byte. Typically, several of the high order bytes
2045 will be zero; discard them. Emit the remaining bytes in a
2046 stream, starting with the low order byte; set the high order
2047 bit on each byte except the last emitted byte. The high bit
2048 of zero on the last byte indicates to the decoder that it
2049 has encountered the last byte.
2051 The integer zero is a special case, consisting of a single
2054 Table \refersec{tab:examplesofunsignedleb128encodings}
2055 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2057 0x80 in each case is the high order bit of the byte, indicating
2058 that an additional byte follows.
2061 The encoding for signed, two\textquoteright s complement LEB128
2062 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2063 numbers is similar, except that the criterion for discarding
2064 high order bytes is not whether they are zero, but whether
2065 they consist entirely of sign extension bits. Consider the
2066 32-bit integer -2. The three high level bytes of the number
2067 are sign extension, thus LEB128 would represent it as a single
2068 byte containing the low order 7 bits, with the high order
2069 bit cleared to indicate the end of the byte stream. Note
2070 that there is nothing within the LEB128 representation that
2071 indicates whether an encoded number is signed or unsigned. The
2072 decoder must know what type of number to expect.
2073 Table \refersec{tab:examplesofunsignedleb128encodings}
2074 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2075 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2076 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2079 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2080 \addtoindexx{LEB128!examples}
2081 gives algorithms for encoding and decoding these forms.}
2085 \setlength{\extrarowheight}{0.1cm}
2086 \begin{longtable}{c|c|c}
2087 \caption{Examples of unsigned LEB128 encodings}
2088 \label{tab:examplesofunsignedleb128encodings}
2089 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2090 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2092 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2094 \hline \emph{Continued on next page}
2100 128& 0 + 0x80 & 1 \\
2101 129& 1 + 0x80 & 1 \\
2102 %130& 2 + 0x80 & 1 \\
2103 12857& 57 + 0x80 & 100 \\
2110 \setlength{\extrarowheight}{0.1cm}
2111 \begin{longtable}{c|c|c}
2112 \caption{Examples of signed LEB128 encodings}
2113 \label{tab:examplesofsignedleb128encodings}
2114 \addtoindexx{LEB128!signed} \\
2115 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2117 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2119 \hline \emph{Continued on next page}
2125 127& 127 + 0x80 & 0 \\
2126 -127& 1 + 0x80 & 0x7f \\
2127 128& 0 + 0x80 & 1 \\
2128 -128& 0 + 0x80 & 0x7f \\
2129 129& 1 + 0x80 & 1 \\
2130 -129& 0x7f + 0x80 & 0x7e \\
2137 \section{DWARF Expressions and Location Descriptions}
2138 \label{datarep:dwarfexpressionsandlocationdescriptions}
2139 \subsection{DWARF Expressions}
2140 \label{datarep:dwarfexpressions}
2143 \addtoindexx{DWARF expression!operator encoding}
2144 DWARF expression is stored in a \nolink{block} of contiguous
2145 bytes. The bytes form a sequence of operations. Each operation
2146 is a 1-byte code that identifies that operation, followed by
2147 zero or more bytes of additional data. The encodings for the
2148 operations are described in
2149 Table \refersec{tab:dwarfoperationencodings}.
2152 \setlength{\extrarowheight}{0.1cm}
2153 \begin{longtable}{l|c|c|l}
2154 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2155 \hline & &\bfseries No. of &\\
2156 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2158 & &\bfseries No. of &\\
2159 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2161 \hline \emph{Continued on next page}
2163 \hline \ddag\ \textit{New in DWARF Version 5}
2166 \DWOPaddr&0x03&1 & constant address \\
2167 & & &(size is target specific) \\
2169 \DWOPderef&0x06&0 & \\
2171 \DWOPconstoneu&0x08&1&1-byte constant \\
2172 \DWOPconstones&0x09&1&1-byte constant \\
2173 \DWOPconsttwou&0x0a&1&2-byte constant \\
2174 \DWOPconsttwos&0x0b&1&2-byte constant \\
2175 \DWOPconstfouru&0x0c&1&4-byte constant \\
2176 \DWOPconstfours&0x0d&1&4-byte constant \\
2177 \DWOPconsteightu&0x0e&1&8-byte constant \\
2178 \DWOPconsteights&0x0f&1&8-byte constant \\
2179 \DWOPconstu&0x10&1&ULEB128 constant \\
2180 \DWOPconsts&0x11&1&SLEB128 constant \\
2181 \DWOPdup&0x12&0 & \\
2182 \DWOPdrop&0x13&0 & \\
2183 \DWOPover&0x14&0 & \\
2184 \DWOPpick&0x15&1&1-byte stack index \\
2185 \DWOPswap&0x16&0 & \\
2186 \DWOProt&0x17&0 & \\
2187 \DWOPxderef&0x18&0 & \\
2188 \DWOPabs&0x19&0 & \\
2189 \DWOPand&0x1a&0 & \\
2190 \DWOPdiv&0x1b&0 & \\
2191 \DWOPminus&0x1c&0 & \\
2192 \DWOPmod&0x1d&0 & \\
2193 \DWOPmul&0x1e&0 & \\
2194 \DWOPneg&0x1f&0 & \\
2195 \DWOPnot&0x20&0 & \\
2197 \DWOPplus&0x22&0 & \\
2198 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2199 \DWOPshl&0x24&0 & \\
2200 \DWOPshr&0x25&0 & \\
2201 \DWOPshra&0x26&0 & \\
2202 \DWOPxor&0x27&0 & \\
2204 \DWOPbra&0x28&1 & signed 2-byte constant \\
2211 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2213 \DWOPlitzero & 0x30 & 0 & \\
2214 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2215 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2216 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2218 \DWOPregzero & 0x50 & 0 & \\*
2219 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2220 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2221 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2223 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2224 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2225 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2226 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2228 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2229 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2230 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2231 & & &SLEB128 offset \\
2232 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2233 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2234 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2235 \DWOPnop{} & 0x96 &0& \\
2237 \DWOPpushobjectaddress&0x97&0 & \\
2238 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2239 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2240 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2241 \DWOPformtlsaddress&0x9b &0& \\
2242 \DWOPcallframecfa{} &0x9c &0& \\
2243 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2245 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2246 &&&\nolink{block} of that size\\
2247 \DWOPstackvalue{} &0x9f &0& \\
2248 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2249 &&&SLEB128 constant offset \\
2250 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2251 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2252 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2253 &&&\nolink{block} of that size\\
2254 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2255 & & & 1-byte size, \\*
2256 & & & constant value \\
2257 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2258 &&& ULEB128 constant offset \\
2259 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2260 &&& ULEB128 type entry offset \\
2261 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2262 &&& ULEB128 type entry offset \\
2263 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2264 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2265 \DWOPlouser{} &0xe0 && \\
2266 \DWOPhiuser{} &\xff && \\
2272 \subsection{Location Descriptions}
2273 \label{datarep:locationdescriptions}
2275 A location description is used to compute the
2276 location of a variable or other entity.
2278 \subsection{Location Lists}
2279 \label{datarep:locationlists}
2281 Each entry in a \addtoindex{location list} is either a location list entry,
2282 a base address selection entry, or an
2283 \addtoindexx{end-of-list entry!in location list}
2287 \subsubsection{Location List Entries in Non-Split Objects}
2288 A \addtoindex{location list} entry consists of two address offsets followed
2289 by an unsigned 2-byte length, followed by a block of contiguous bytes
2290 that contains a DWARF location description. The length
2291 specifies the number of bytes in that block. The two offsets
2292 are the same size as an address on the target machine.
2295 A base address selection entry and an
2296 \addtoindexx{end-of-list entry!in location list}
2297 end-of-list entry each
2298 consist of two (constant or relocated) address offsets. The two
2299 offsets are the same size as an address on the target machine.
2301 For a \addtoindex{location list} to be specified, the base address of
2302 \addtoindexx{base address selection entry!in location list}
2303 the corresponding compilation unit must be defined
2304 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2306 \subsubsection{Location List Entries in Split Objects}
2307 \label{datarep:locationlistentriesinsplitobjects}
2308 An alternate form for location list entries is used in split objects.
2309 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2310 that follows. The encodings for these constants are given in
2311 Table \refersec{tab:locationlistentryencodingvalues}.
2315 \setlength{\extrarowheight}{0.1cm}
2316 \begin{longtable}{l|c}
2317 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2318 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2320 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2322 \hline \emph{Continued on next page}
2326 \DWLLEendoflistentry & 0x0 \\
2327 \DWLLEbaseaddressselectionentry & 0x01 \\
2328 \DWLLEstartendentry & 0x02 \\
2329 \DWLLEstartlengthentry & 0x03 \\
2330 \DWLLEoffsetpairentry & 0x04 \\
2334 \section{Base Type Attribute Encodings}
2335 \label{datarep:basetypeattributeencodings}
2337 The encodings of the
2338 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2340 \addtoindexx{encoding attribute}
2343 attribute are given in
2344 Table \refersec{tab:basetypeencodingvalues}
2347 \setlength{\extrarowheight}{0.1cm}
2348 \begin{longtable}{l|c}
2349 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2350 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2352 \bfseries Base type encoding name&\bfseries Value\\ \hline
2354 \hline \emph{Continued on next page}
2357 \ddag \ \textit{New in \DWARFVersionV}
2359 \DWATEaddress&0x01 \\
2360 \DWATEboolean&0x02 \\
2361 \DWATEcomplexfloat&0x03 \\
2363 \DWATEsigned&0x05 \\
2364 \DWATEsignedchar&0x06 \\
2365 \DWATEunsigned&0x07 \\
2366 \DWATEunsignedchar&0x08 \\
2367 \DWATEimaginaryfloat&0x09 \\
2368 \DWATEpackeddecimal&0x0a \\
2369 \DWATEnumericstring&0x0b \\
2370 \DWATEedited&0x0c \\
2371 \DWATEsignedfixed&0x0d \\
2372 \DWATEunsignedfixed&0x0e \\
2373 \DWATEdecimalfloat & 0x0f \\
2374 \DWATEUTF{} & 0x10 \\
2375 \DWATEUCS~\ddag & 0x11 \\
2376 \DWATEASCII~\ddag & 0x12 \\
2377 \DWATElouser{} & 0x80 \\
2378 \DWATEhiuser{} & \xff \\
2383 The encodings of the constants used in the
2384 \DWATdecimalsign{} attribute
2386 Table \refersec{tab:decimalsignencodings}.
2389 \setlength{\extrarowheight}{0.1cm}
2390 \begin{longtable}{l|c}
2391 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2392 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2394 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2396 \hline \emph{Continued on next page}
2401 \DWDSunsigned{} & 0x01 \\
2402 \DWDSleadingoverpunch{} & 0x02 \\
2403 \DWDStrailingoverpunch{} & 0x03 \\
2404 \DWDSleadingseparate{} & 0x04 \\
2405 \DWDStrailingseparate{} & 0x05 \\
2411 The encodings of the constants used in the
2412 \DWATendianity{} attribute are given in
2413 Table \refersec{tab:endianityencodings}.
2416 \setlength{\extrarowheight}{0.1cm}
2417 \begin{longtable}{l|c}
2418 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2419 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2421 \bfseries Endian code name&\bfseries Value\\ \hline
2423 \hline \emph{Continued on next page}
2428 \DWENDdefault{} & 0x00 \\
2429 \DWENDbig{} & 0x01 \\
2430 \DWENDlittle{} & 0x02 \\
2431 \DWENDlouser{} & 0x40 \\
2432 \DWENDhiuser{} & \xff \\
2438 \section{Accessibility Codes}
2439 \label{datarep:accessibilitycodes}
2440 The encodings of the constants used in the
2441 \DWATaccessibility{}
2443 \addtoindexx{accessibility attribute}
2445 Table \refersec{tab:accessibilityencodings}.
2448 \setlength{\extrarowheight}{0.1cm}
2449 \begin{longtable}{l|c}
2450 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2451 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2453 \bfseries Accessibility code name&\bfseries Value\\ \hline
2455 \hline \emph{Continued on next page}
2460 \DWACCESSpublic&0x01 \\
2461 \DWACCESSprotected&0x02 \\
2462 \DWACCESSprivate&0x03 \\
2468 \section{Visibility Codes}
2469 \label{datarep:visibilitycodes}
2470 The encodings of the constants used in the
2471 \DWATvisibility{} attribute are given in
2472 Table \refersec{tab:visibilityencodings}.
2475 \setlength{\extrarowheight}{0.1cm}
2476 \begin{longtable}{l|c}
2477 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2478 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2480 \bfseries Visibility code name&\bfseries Value\\ \hline
2482 \hline \emph{Continued on next page}
2488 \DWVISexported&0x02 \\
2489 \DWVISqualified&0x03 \\
2494 \section{Virtuality Codes}
2495 \label{datarep:vitualitycodes}
2497 The encodings of the constants used in the
2498 \DWATvirtuality{} attribute are given in
2499 Table \refersec{tab:virtualityencodings}.
2502 \setlength{\extrarowheight}{0.1cm}
2503 \begin{longtable}{l|c}
2504 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2505 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2507 \bfseries Virtuality code name&\bfseries Value\\ \hline
2509 \hline \emph{Continued on next page}
2514 \DWVIRTUALITYnone&0x00 \\
2515 \DWVIRTUALITYvirtual&0x01 \\
2516 \DWVIRTUALITYpurevirtual&0x02 \\
2523 \DWVIRTUALITYnone{} is equivalent to the absence of the
2527 \section{Source Languages}
2528 \label{datarep:sourcelanguages}
2530 The encodings of the constants used
2531 \addtoindexx{language attribute, encoding}
2533 \addtoindexx{language name encoding}
2536 attribute are given in
2537 Table \refersec{tab:languageencodings}.
2539 % If we don't force a following space it looks odd
2541 and their associated values are reserved, but the
2542 languages they represent are not well supported.
2543 Table \refersec{tab:languageencodings}
2545 \addtoindexx{lower bound attribute!default}
2546 default lower bound, if any, assumed for
2547 an omitted \DWATlowerbound{} attribute in the context of a
2548 \DWTAGsubrangetype{} debugging information entry for each
2552 \setlength{\extrarowheight}{0.1cm}
2553 \begin{longtable}{l|c|c}
2554 \caption{Language encodings} \label{tab:languageencodings}\\
2555 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2557 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2559 \hline \emph{Continued on next page}
2562 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2564 \addtoindexx{ISO-defined language names}
2566 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2567 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2568 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2569 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2570 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2571 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2572 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2573 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2574 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2575 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2576 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2577 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2578 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2579 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2580 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2581 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2582 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2583 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2584 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2585 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2586 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2587 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2588 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2589 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2590 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2591 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2592 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2593 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2594 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2595 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2596 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2597 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2598 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++:2014 (ISO)} \\
2599 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2600 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2601 \DWLANGlouser{} &0x8000 & \\
2602 \DWLANGhiuser{} &\xffff & \\
2607 \section{Address Class Encodings}
2608 \label{datarep:addressclassencodings}
2610 The value of the common
2611 \addtoindex{address class} encoding
2615 \section{Identifier Case}
2616 \label{datarep:identifiercase}
2618 The encodings of the constants used in the
2619 \DWATidentifiercase{} attribute are given in
2620 Table \refersec{tab:identifiercaseencodings}.
2624 \setlength{\extrarowheight}{0.1cm}
2625 \begin{longtable}{l|c}
2626 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2627 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2629 \bfseries Identifier case name&\bfseries Value\\ \hline
2631 \hline \emph{Continued on next page}
2635 \DWIDcasesensitive&0x00 \\
2637 \DWIDdowncase&0x02 \\
2638 \DWIDcaseinsensitive&0x03 \\
2642 \section{Calling Convention Encodings}
2643 \label{datarep:callingconventionencodings}
2644 The encodings of the constants used in the
2645 \DWATcallingconvention{} attribute are given in
2646 Table \refersec{tab:callingconventionencodings}.
2649 \setlength{\extrarowheight}{0.1cm}
2650 \begin{longtable}{l|c}
2651 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2652 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2654 \bfseries Calling convention name&\bfseries Value\\ \hline
2656 \hline \emph{Continued on next page}
2658 \hline \ddag\ \textit{New in DWARF Version 5}
2661 \DWCCnormal &0x01 \\
2662 \DWCCprogram&0x02 \\
2663 \DWCCnocall &0x03 \\
2664 \DWCCpassbyreference~\ddag &0x04 \\
2665 \DWCCpassbyvalue~\ddag &0x05 \\
2666 \DWCClouser &0x40 \\
2673 \section{Inline Codes}
2674 \label{datarep:inlinecodes}
2676 The encodings of the constants used in
2677 \addtoindexx{inline attribute}
2679 \DWATinline{} attribute are given in
2680 Table \refersec{tab:inlineencodings}.
2684 \setlength{\extrarowheight}{0.1cm}
2685 \begin{longtable}{l|c}
2686 \caption{Inline encodings} \label{tab:inlineencodings}\\
2687 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2689 \bfseries Inline Code name&\bfseries Value\\ \hline
2691 \hline \emph{Continued on next page}
2696 \DWINLnotinlined&0x00 \\
2697 \DWINLinlined&0x01 \\
2698 \DWINLdeclarednotinlined&0x02 \\
2699 \DWINLdeclaredinlined&0x03 \\
2704 % this clearpage is ugly, but the following table came
2705 % out oddly without it.
2707 \section{Array Ordering}
2708 \label{datarep:arrayordering}
2710 The encodings of the constants used in the
2711 \DWATordering{} attribute are given in
2712 Table \refersec{tab:orderingencodings}.
2716 \setlength{\extrarowheight}{0.1cm}
2717 \begin{longtable}{l|c}
2718 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2719 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2721 \bfseries Ordering name&\bfseries Value\\ \hline
2723 \hline \emph{Continued on next page}
2728 \DWORDrowmajor&0x00 \\
2729 \DWORDcolmajor&0x01 \\
2735 \section{Discriminant Lists}
2736 \label{datarep:discriminantlists}
2738 The descriptors used in
2739 \addtoindexx{discriminant list attribute}
2741 \DWATdiscrlist{} attribute are
2742 encoded as 1-byte constants. The
2743 defined values are given in
2744 Table \refersec{tab:discriminantdescriptorencodings}.
2746 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2748 \setlength{\extrarowheight}{0.1cm}
2749 \begin{longtable}{l|c}
2750 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2751 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2753 \bfseries Descriptor name&\bfseries Value\\ \hline
2755 \hline \emph{Continued on next page}
2767 \section{Name Index Table}
2768 \label{datarep:nameindextable}
2769 Each name index table in the \dotdebugnames{} section
2770 begins with a header consisting of:
2771 \begin{enumerate}[1. ]
2772 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2773 \addttindexx{unit\_length}
2774 A 4-byte or 12-byte initial length field that
2775 contains the size in bytes of this contribution to the \dotdebugnames{}
2776 section, not including the length field itself
2777 (see Section \refersec{datarep:initiallengthvalues}).
2779 \item \texttt{version} (\HFTuhalf) \\
2780 A 2-byte version number\addtoindexx{version number!name index table}
2781 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2782 This number is specific to the name index table and is
2783 independent of the DWARF version number.
2785 The value in this field is \versiondotdebugnames.
2787 \item padding (\HFTuhalf) \\
2789 \item \texttt{comp\_unit\_count} (\HFTuword) \\
2790 The number of CUs in the CU list.
2792 \item \texttt{local\_type\_unit\_count} (\HFTuword) \\
2793 The number of TUs in the first TU list.
2795 \item \texttt{foreign\_type\_unit\_count} (\HFTuword) \\
2796 The number of TUs in the second TU list.
2798 \item \texttt{bucket\_count} (\HFTuword) \\
2799 The number of hash buckets in the hash lookup table.
2800 If there is no hash lookup table, this field contains 0.
2802 \item \texttt{name\_count} (\HFTuword) \\
2803 The number of unique names in the index.
2805 \item \texttt{abbrev\_table\_size} (\HFTuword) \\
2806 The size in bytes of the abbreviations table.
2808 \item \texttt{augmentation\_string\_size} (\HFTuword) \\
2809 The size in bytes of the augmentation string. This value should be
2810 rounded up to a multiple of 4.
2812 \item \texttt{augmentation\_string} (\HFTaugstring) \\
2813 A vendor-specific augmentation string, which provides additional
2814 information about the contents of this index. If provided, the string
2815 should begin with a 4-character vendor ID. The remainder of the
2816 string is meant to be read by a cooperating consumer, and its
2817 contents and interpretation are not specified here. The
2818 string should be padded with null characters to a multiple of
2819 four bytes in length.
2823 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
2826 \setlength{\extrarowheight}{0.1cm}
2827 \begin{longtable}{l|c|l}
2828 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
2829 \hline \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2831 \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2833 \hline \emph{Continued on next page}
2836 \ddag \ \textit{New in \DWARFVersionV}
2838 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
2839 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
2840 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
2841 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
2842 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
2843 \DWIDXlouser~\ddag & 0x2000 & \\
2844 \DWIDXhiuser~\ddag & \xiiifff & \\
2848 The abbreviations table ends with an entry consisting of a single 0
2849 byte for the abbreviation code. The size of the table given by
2850 \texttt{abbrev\_table\_size} may include optional padding following the
2853 \section{Defaulted Member Encodings}
2854 \hypertarget{datarep:defaultedmemberencodings}{}
2856 The encodings of the constants used in the \DWATdefaulted{} attribute
2857 are given in Table \referfol{datarep:defaultedattributeencodings}.
2860 \setlength{\extrarowheight}{0.1cm}
2861 \begin{longtable}{l|c}
2862 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
2863 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
2865 \bfseries Defaulted name &\bfseries Value \\ \hline
2867 \hline \emph{Continued on next page}
2870 \ddag~\textit{New in \DWARFVersionV}
2872 \DWDEFAULTEDno~\ddag & 0x00 \\
2873 \DWDEFAULTEDinclass~\ddag & 0x01 \\
2874 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
2879 \section{Address Range Table}
2880 \label{datarep:addrssrangetable}
2882 Each set of entries in the table of address ranges contained
2883 in the \dotdebugaranges{}
2884 section begins with a header containing:
2885 \begin{enumerate}[1. ]
2886 % FIXME The unit length text is not fully consistent across
2889 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2890 \addttindexx{unit\_length}
2891 A 4-byte or 12-byte length containing the length of the
2892 \addtoindexx{initial length}
2893 set of entries for this compilation unit, not including the
2894 length field itself. In the \thirtytwobitdwarfformat, this is a
2895 4-byte unsigned integer (which must be less than \xfffffffzero);
2896 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2897 \wffffffff followed by an 8-byte unsigned integer that gives
2899 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2901 \item version (\HFTuhalf) \\
2902 A 2-byte version identifier representing the version of the
2903 DWARF information for the address range table
2904 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2906 This value in this field \addtoindexx{version number!address range table} is 2.
2908 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2910 \addtoindexx{section offset!in .debug\_aranges header}
2911 4-byte or 8-byte offset into the
2912 \dotdebuginfo{} section of
2913 the compilation unit header. In the \thirtytwobitdwarfformat,
2914 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2915 this is an 8-byte unsigned offset
2916 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2918 \item \texttt{address\_size} (\HFTubyte) \\
2919 A 1-byte unsigned integer containing the size in bytes of an
2920 \addttindexx{address\_size}
2922 \addtoindexx{size of an address}
2923 (or the offset portion of an address for segmented
2924 \addtoindexx{address space!segmented}
2925 addressing) on the target system.
2927 \item \texttt{segment\_size} (\HFTubyte) \\
2929 \addttindexx{segment\_size}
2930 1-byte unsigned integer containing the size in bytes of a
2931 segment selector on the target system.
2935 This header is followed by a series of tuples. Each tuple
2936 consists of a segment, an address and a length.
2938 size is given by the \addttindex{segment\_size} field of the header; the
2939 address and length size are each given by the \addttindex{address\_size}
2940 field of the header.
2941 The first tuple following the header in
2942 each set begins at an offset that is a multiple of the size
2943 of a single tuple (that is, the size of a segment selector
2944 plus twice the \addtoindex{size of an address}).
2945 The header is padded, if
2946 necessary, to that boundary. Each set of tuples is terminated
2947 by a 0 for the segment, a 0 for the address and 0 for the
2948 length. If the \addttindex{segment\_size} field in the header is zero,
2949 the segment selectors are omitted from all tuples, including
2950 the terminating tuple.
2953 \section{Line Number Information}
2954 \label{datarep:linenumberinformation}
2956 The \addtoindexi{version number}{version number!line number information}
2957 in the line number program header is \versiondotdebugline{}
2958 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2960 The boolean values \doublequote{true} and \doublequote{false}
2961 used by the line number information program are encoded
2962 as a single byte containing the value 0
2963 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2966 The encodings for the standard opcodes are given in
2967 \addtoindexx{line number opcodes!standard opcode encoding}
2968 Table \refersec{tab:linenumberstandardopcodeencodings}.
2971 \setlength{\extrarowheight}{0.1cm}
2972 \begin{longtable}{l|c}
2973 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2974 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2976 \bfseries Opcode name&\bfseries Value\\ \hline
2978 \hline \emph{Continued on next page}
2984 \DWLNSadvancepc&0x02 \\
2985 \DWLNSadvanceline&0x03 \\
2986 \DWLNSsetfile&0x04 \\
2987 \DWLNSsetcolumn&0x05 \\
2988 \DWLNSnegatestmt&0x06 \\
2989 \DWLNSsetbasicblock&0x07 \\
2990 \DWLNSconstaddpc&0x08 \\
2991 \DWLNSfixedadvancepc&0x09 \\
2992 \DWLNSsetprologueend&0x0a \\*
2993 \DWLNSsetepiloguebegin&0x0b \\*
2994 \DWLNSsetisa&0x0c \\*
3000 The encodings for the extended opcodes are given in
3001 \addtoindexx{line number opcodes!extended opcode encoding}
3002 Table \refersec{tab:linenumberextendedopcodeencodings}.
3005 \setlength{\extrarowheight}{0.1cm}
3006 \begin{longtable}{l|c}
3007 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3008 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3010 \bfseries Opcode name&\bfseries Value\\ \hline
3012 \hline \emph{Continued on next page}
3014 \hline %\ddag~\textit{New in DWARF Version 5}
3017 \DWLNEendsequence &0x01 \\
3018 \DWLNEsetaddress &0x02 \\
3019 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3020 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3022 \DWLNEsetdiscriminator &0x04 \\
3023 \DWLNElouser &0x80 \\
3024 \DWLNEhiuser &\xff \\
3030 The encodings for the line number header entry formats are given in
3031 \addtoindexx{line number opcodes!file entry format encoding}
3032 Table \refersec{tab:linenumberheaderentryformatencodings}.
3035 \setlength{\extrarowheight}{0.1cm}
3036 \begin{longtable}{l|c}
3037 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3038 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3040 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3042 \hline \emph{Continued on next page}
3044 \hline \ddag~\textit{New in DWARF Version 5}
3046 \DWLNCTpath~\ddag & 0x1 \\
3047 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3048 \DWLNCTtimestamp~\ddag & 0x3 \\
3049 \DWLNCTsize~\ddag & 0x4 \\
3050 \DWLNCTMDfive~\ddag & 0x5 \\
3051 \DWLNCTlouser~\ddag & 0x2000 \\
3052 \DWLNCThiuser~\ddag & \xiiifff \\
3057 \section{Macro Information}
3058 \label{datarep:macroinformation}
3059 The \addtoindexi{version number}{version number!macro information}
3060 in the macro information header is \versiondotdebugmacro{}
3061 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3063 The source line numbers and source file indices encoded in the
3064 macro information section are represented as
3065 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3068 The macro information entry type is encoded as a single unsigned byte.
3070 \addtoindexx{macro information entry types!encoding}
3072 Table \refersec{tab:macroinfoentrytypeencodings}.
3076 \setlength{\extrarowheight}{0.1cm}
3077 \begin{longtable}{l|c}
3078 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3079 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3081 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3083 \hline \emph{Continued on next page}
3085 \hline \ddag~\textit{New in DWARF Version 5}
3088 \DWMACROdefine~\ddag &0x01 \\
3089 \DWMACROundef~\ddag &0x02 \\
3090 \DWMACROstartfile~\ddag &0x03 \\
3091 \DWMACROendfile~\ddag &0x04 \\
3092 \DWMACROdefineindirect~\ddag &0x05 \\
3093 \DWMACROundefindirect~\ddag &0x06 \\
3094 \DWMACROtransparentinclude~\ddag &0x07 \\
3095 \DWMACROdefineindirectsup~\ddag &0x08 \\
3096 \DWMACROundefindirectsup~\ddag &0x09 \\
3097 \DWMACROtransparentincludesup~\ddag&0x0a \\
3098 \DWMACROdefineindirectx~\ddag &0x0b \\
3099 \DWMACROundefindirectx~\ddag &0x0c \\
3100 \DWMACROlouser~\ddag &0xe0 \\
3101 \DWMACROhiuser~\ddag &\xff \\
3107 \section{Call Frame Information}
3108 \label{datarep:callframeinformation}
3110 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3111 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3112 value is \xffffffffffffffff.
3114 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3115 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3117 Call frame instructions are encoded in one or more bytes. The
3118 primary opcode is encoded in the high order two bits of
3119 the first byte (that is, opcode = byte $\gg$ 6). An operand
3120 or extended opcode may be encoded in the low order 6
3121 bits. Additional operands are encoded in subsequent bytes.
3122 The instructions and their encodings are presented in
3123 Table \refersec{tab:callframeinstructionencodings}.
3126 \setlength{\extrarowheight}{0.1cm}
3127 \begin{longtable}{l|c|c|l|l}
3128 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3129 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3130 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3132 & \bfseries High 2 &\bfseries Low 6 & &\\
3133 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3135 \hline \emph{Continued on next page}
3140 \DWCFAadvanceloc&0x1&delta & \\
3141 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3142 \DWCFArestore&0x3®ister & & \\
3143 \DWCFAnop&0&0 & & \\
3144 \DWCFAsetloc&0&0x01&address & \\
3145 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3146 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3147 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3148 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3149 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3150 \DWCFAundefined&0&0x07&ULEB128 register & \\
3151 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3152 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3153 \DWCFArememberstate&0&0x0a & & \\
3154 \DWCFArestorestate&0&0x0b & & \\
3155 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3156 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3157 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3158 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3159 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3161 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3162 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3163 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3164 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3165 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3166 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3167 \DWCFAlouser&0&0x1c & & \\
3168 \DWCFAhiuser&0&\xiiif & & \\
3172 \section{Non-contiguous Address Ranges}
3173 \label{datarep:noncontiguousaddressranges}
3175 Each entry in a \addtoindex{range list}
3176 (see Section \refersec{chap:noncontiguousaddressranges})
3178 \addtoindexx{base address selection entry!in range list}
3180 \addtoindexx{range list}
3181 a base address selection entry, or an end-of-list entry.
3183 A \addtoindex{range list} entry consists of two relative addresses. The
3184 addresses are the same size as addresses on the target machine.
3187 A base address selection entry and an
3188 \addtoindexx{end-of-list entry!in range list}
3189 end-of-list entry each
3190 \addtoindexx{base address selection entry!in range list}
3191 consist of two (constant or relocated) addresses. The two
3192 addresses are the same size as addresses on the target machine.
3194 For a \addtoindex{range list} to be specified, the base address of the
3195 \addtoindexx{base address selection entry!in range list}
3196 corresponding compilation unit must be defined
3197 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
3200 \section{String Offsets Table}
3201 \label{chap:stringoffsetstable}
3202 Each set of entries in the string offsets table contained in the
3203 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3204 section begins with a header containing:
3205 \begin{enumerate}[1. ]
3206 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3207 \addttindexx{unit\_length}
3208 A 4-byte or 12-byte length containing the length of
3209 the set of entries for this compilation unit, not
3210 including the length field itself. In the 32-bit
3211 DWARF format, this is a 4-byte unsigned integer
3212 (which must be less than \xfffffffzero); in the 64-bit
3213 DWARF format, this consists of the 4-byte value
3214 \wffffffff followed by an 8-byte unsigned integer
3215 that gives the actual length (see
3216 Section \refersec{datarep:32bitand64bitdwarfformats}).
3219 \item \texttt{version} (\HFTuhalf) \\
3220 A 2-byte version identifier containing the value
3221 \versiondotdebugstroffsets{}
3222 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3224 \item \texttt{padding} (\HFTuhalf) \\
3227 This header is followed by a series of string table offsets
3228 that have the same representation as \DWFORMstrp.
3229 For the 32-bit DWARF format, each offset is 4 bytes long; for
3230 the 64-bit DWARF format, each offset is 8 bytes long.
3232 The \DWATstroffsetsbase{} attribute points to the first
3233 entry following the header. The entries are indexed
3234 sequentially from this base entry, starting from 0.
3236 \section{Address Table}
3237 \label{chap:addresstable}
3238 Each set of entries in the address table contained in the
3239 \dotdebugaddr{} section begins with a header containing:
3240 \begin{enumerate}[1. ]
3241 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3242 \addttindexx{unit\_length}
3243 A 4-byte or 12-byte length containing the length of
3244 the set of entries for this compilation unit, not
3245 including the length field itself. In the 32-bit
3246 DWARF format, this is a 4-byte unsigned integer
3247 (which must be less than \xfffffffzero); in the 64-bit
3248 DWARF format, this consists of the 4-byte value
3249 \wffffffff followed by an 8-byte unsigned integer
3250 that gives the actual length (see
3251 Section \refersec{datarep:32bitand64bitdwarfformats}).
3254 \item \texttt{version} (\HFTuhalf) \\
3255 A 2-byte version identifier containing the value
3256 \versiondotdebugaddr{}
3257 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3260 \item \texttt{address\_size} (\HFTubyte) \\
3261 A 1-byte unsigned integer containing the size in
3262 bytes of an address (or the offset portion of an
3263 address for segmented addressing) on the target
3267 \item \texttt{segment\_size} (\HFTubyte) \\
3268 A 1-byte unsigned integer containing the size in
3269 bytes of a segment selector on the target system.
3272 This header is followed by a series of segment/address pairs.
3273 The segment size is given by the \addttindex{segment\_size} field of the
3274 header, and the address size is given by the \addttindex{address\_size}
3275 field of the header. If the \addttindex{segment\_size} field in the header
3276 is zero, the entries consist only of an addresses.
3278 The \DWATaddrbase{} attribute points to the first entry
3279 following the header. The entries are indexed sequentially
3280 from this base entry, starting from 0.
3283 \section{Range List Table}
3284 \label{app:rangelisttable}
3285 Each set of entries in the range list table contained in the
3286 \dotdebugranges{} section begins with a header containing:
3287 \begin{enumerate}[1. ]
3288 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3289 \addttindexx{unit\_length}
3290 A 4-byte or 12-byte length containing the length of
3291 the set of entries for this compilation unit, not
3292 including the length field itself. In the 32-bit
3293 DWARF format, this is a 4-byte unsigned integer
3294 (which must be less than \xfffffffzero); in the 64-bit
3295 DWARF format, this consists of the 4-byte value
3296 \wffffffff followed by an 8-byte unsigned integer
3297 that gives the actual length (see
3298 Section \refersec{datarep:32bitand64bitdwarfformats}).
3301 \item \texttt{version} (\HFTuhalf) \\
3302 A 2-byte version identifier containing the value
3303 \versiondotdebugranges{}
3304 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3307 \item \texttt{address\_size} (\HFTubyte) \\
3308 A 1-byte unsigned integer containing the size in
3309 bytes of an address (or the offset portion of an
3310 address for segmented addressing) on the target
3314 \item \texttt{segment\_size} (\HFTubyte) \\
3315 A 1-byte unsigned integer containing the size in
3316 bytes of a segment selector on the target system.
3319 This header is followed by a series of range list entries as
3320 described in Section \refersec{chap:noncontiguousaddressranges}.
3321 The segment size is given by the
3322 \addttindex{segment\_size} field of the header, and the address size is
3323 given by the \addttindex{address\_size} field of the header. If the
3324 \addttindex{segment\_size} field in the header is zero, the segment
3325 selector is omitted from the range list entries.
3327 The \DWATrangesbase{} attribute points to the first entry
3328 following the header. The entries are referenced by a byte
3329 offset relative to this base address.
3332 \section{Location List Table}
3333 \label{datarep:locationlisttable}
3334 Each set of entries in the location list table contained in the
3335 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3336 \begin{enumerate}[1. ]
3337 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3338 \addttindexx{unit\_length}
3339 A 4-byte or 12-byte length containing the length of
3340 the set of entries for this compilation unit, not
3341 including the length field itself. In the 32-bit
3342 DWARF format, this is a 4-byte unsigned integer
3343 (which must be less than \xfffffffzero); in the 64-bit
3344 DWARF format, this consists of the 4-byte value
3345 \wffffffff followed by an 8-byte unsigned integer
3346 that gives the actual length (see
3347 Section \refersec{datarep:32bitand64bitdwarfformats}).
3350 \item \texttt{version} (\HFTuhalf) \\
3351 A 2-byte version identifier containing the value
3352 \versiondotdebugloc{}
3353 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3356 \item \texttt{address\_size} (\HFTubyte) \\
3357 A 1-byte unsigned integer containing the size in
3358 bytes of an address (or the offset portion of an
3359 address for segmented addressing) on the target
3363 \item \texttt{segment\_size} (\HFTubyte) \\
3364 A 1-byte unsigned integer containing the size in
3365 bytes of a segment selector on the target system.
3368 This header is followed by a series of location list entries as
3369 described in Section \refersec{chap:locationlists}.
3370 The segment size is given by the
3371 \addttindex{segment\_size} field of the header, and the address size is
3372 given by the \texttt{address\_size} field of the header. If the
3373 \addttindex{segment\_size} field in the header is zero, the segment
3374 selector is omitted from the range list entries.
3376 The entries are referenced by a byte offset relative to the first
3377 location list following this header.
3380 \section{Dependencies and Constraints}
3381 \label{datarep:dependenciesandconstraints}
3382 The debugging information in this format is intended to
3383 exist in sections of an object file, or an equivalent
3384 separate file or database, having names beginning with
3385 the prefix ".debug\_" (see Appendix
3386 \refersec{app:dwarfsectionversionnumbersinformative}
3387 for a complete list of such names).
3388 Except as specifically specified, this information is not
3389 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3392 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3393 32-bit addresses, an assembler or compiler must provide a way
3394 to produce 2-byte and 4-byte quantities without alignment
3395 restrictions, and the linker must be able to relocate a
3397 \addtoindexx{section offset!alignment of}
3398 section offset that occurs at an arbitrary
3401 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3402 64-bit addresses, an assembler or compiler must provide a
3403 way to produce 2-byte, 4-byte and 8-byte quantities without
3404 alignment restrictions, and the linker must be able to relocate
3405 an 8-byte address or 4-byte
3406 \addtoindexx{section offset!alignment of}
3407 section offset that occurs at an
3408 arbitrary alignment.
3410 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3411 32-bit addresses, an assembler or compiler must provide a
3412 way to produce 2-byte, 4-byte and 8-byte quantities without
3413 alignment restrictions, and the linker must be able to relocate
3414 a 4-byte address or 8-byte
3415 \addtoindexx{section offset!alignment of}
3416 section offset that occurs at an
3417 arbitrary alignment.
3419 \textit{It is expected that this will be required only for very large
3420 32-bit programs or by those architectures which support
3421 a mix of 32-bit and 64-bit code and data within the same
3424 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3425 64-bit addresses, an assembler or compiler must provide a
3426 way to produce 2-byte, 4-byte and 8-byte quantities without
3427 alignment restrictions, and the linker must be able to
3428 relocate an 8-byte address or
3429 \addtoindexx{section offset!alignment of}
3430 section offset that occurs at
3431 an arbitrary alignment.
3435 \section{Integer Representation Names}
3436 \label{datarep:integerrepresentationnames}
3437 The sizes of the integers used in the lookup by name, lookup
3438 by address, line number, call frame information and other sections
3440 Table \ref{tab:integerrepresentationnames}.
3444 \setlength{\extrarowheight}{0.1cm}
3445 \begin{longtable}{c|l}
3446 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3447 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3449 \bfseries Representation name&\bfseries Representation\\ \hline
3451 \hline \emph{Continued on next page}
3456 \HFTsbyte& signed, 1-byte integer \\
3457 \HFTubyte&unsigned, 1-byte integer \\
3458 \HFTuhalf&unsigned, 2-byte integer \\
3459 \HFTuword&unsigned, 4-byte integer \\
3465 \section{Type Signature Computation}
3466 \label{datarep:typesignaturecomputation}
3468 A type signature is computed only by the DWARF producer;
3469 \addtoindexx{type signature!computation}
3470 it is used by a DWARF consumer to resolve type references to
3471 the type definitions that are contained in
3472 \addtoindexx{type unit}
3476 The type signature for a type T0 is formed from the
3477 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3478 R.L. Rivest, RFC 1321, April 1992}
3479 hash of a flattened description of the type. The flattened
3480 description of the type is a byte sequence derived from the
3481 DWARF encoding of the type as follows:
3482 \begin{enumerate}[1. ]
3484 \item Start with an empty sequence S and a list V of visited
3485 types, where V is initialized to a list containing the type
3486 T0 as its single element. Elements in V are indexed from 1,
3489 \item If the debugging information entry represents a type that
3490 is nested inside another type or a namespace, append to S
3491 the type\textquoteright s context as follows: For each surrounding type
3492 or namespace, beginning with the outermost such construct,
3493 append the letter 'C', the DWARF tag of the construct, and
3494 the name (taken from
3495 \addtoindexx{name attribute}
3496 the \DWATname{} attribute) of the type
3497 \addtoindexx{name attribute}
3498 or namespace (including its trailing null byte).
3500 \item Append to S the letter 'D', followed by the DWARF tag of
3501 the debugging information entry.
3503 \item For each of the attributes in
3504 Table \refersec{tab:attributesusedintypesignaturecomputation}
3506 the debugging information entry, in the order listed,
3507 append to S a marker letter (see below), the DWARF attribute
3508 code, and the attribute value.
3511 \caption{Attributes used in type signature computation}
3512 \label{tab:attributesusedintypesignaturecomputation}
3513 \simplerule[\textwidth]
3515 \autocols[0pt]{c}{2}{l}{
3531 \DWATcontainingtype,
3535 \DWATdatamemberlocation,
3556 \DWATrvaluereference,
3560 \DWATstringlengthbitsize,
3561 \DWATstringlengthbytesize,
3566 \DWATvariableparameter,
3569 \DWATvtableelemlocation
3572 \simplerule[\textwidth]
3575 Note that except for the initial
3576 \DWATname{} attribute,
3577 \addtoindexx{name attribute}
3578 attributes are appended in order according to the alphabetical
3579 spelling of their identifier.
3581 If an implementation defines any vendor-specific attributes,
3582 any such attributes that are essential to the definition of
3583 the type should also be included at the end of the above list,
3584 in their own alphabetical suborder.
3586 An attribute that refers to another type entry T is processed
3587 as follows: (a) If T is in the list V at some V[x], use the
3588 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3589 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3590 as the marker, process the type T recursively by performing
3591 Steps 2 through 7, and use the result as the attribute value.
3593 Other attribute values use the letter 'A' as the marker, and
3594 the value consists of the form code (encoded as an unsigned
3595 LEB128 value) followed by the encoding of the value according
3596 to the form code. To ensure reproducibility of the signature,
3597 the set of forms used in the signature computation is limited
3606 \item If the tag in Step 3 is one of \DWTAGpointertype,
3607 \DWTAGreferencetype,
3608 \DWTAGrvaluereferencetype,
3609 \DWTAGptrtomembertype,
3610 or \DWTAGfriend, and the referenced
3611 type (via the \DWATtype{} or
3612 \DWATfriend{} attribute) has a
3613 \DWATname{} attribute, append to S the letter 'N', the DWARF
3614 attribute code (\DWATtype{} or
3615 \DWATfriend), the context of
3616 the type (according to the method in Step 2), the letter 'E',
3617 and the name of the type. For \DWTAGfriend, if the referenced
3618 entry is a \DWTAGsubprogram, the context is omitted and the
3619 name to be used is the ABI-specific name of the subprogram
3620 (for example, the mangled linker name).
3623 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3624 \DWTAGreferencetype,
3625 \DWTAGrvaluereferencetype,
3626 \DWTAGptrtomembertype, or
3627 \DWTAGfriend, but has
3628 a \DWATtype{} attribute, or if the referenced type (via
3630 \DWATfriend{} attribute) does not have a
3631 \DWATname{} attribute, the attribute is processed according to
3632 the method in Step 4 for an attribute that refers to another
3636 \item Visit each child C of the debugging information
3637 entry as follows: If C is a nested type entry or a member
3638 function entry, and has
3639 a \DWATname{} attribute, append to
3640 \addtoindexx{name attribute}
3641 S the letter 'S', the tag of C, and its name; otherwise,
3642 process C recursively by performing Steps 3 through 7,
3643 appending the result to S. Following the last child (or if
3644 there are no children), append a zero byte.
3649 For the purposes of this algorithm, if a debugging information
3651 \DWATspecification{}
3652 attribute that refers to
3653 another entry D (which has a
3656 then S inherits the attributes and children of D, and S is
3657 processed as if those attributes and children were present in
3658 the entry S. Exception: if a particular attribute is found in
3659 both S and D, the attribute in S is used and the corresponding
3660 one in D is ignored.
3663 DWARF tag and attribute codes are appended to the sequence
3664 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3665 using the values defined earlier in this chapter.
3667 \textit{A grammar describing this computation may be found in
3668 Appendix \refersec{app:typesignaturecomputationgrammar}.
3671 \textit{An attribute that refers to another type entry should
3672 be recursively processed or replaced with the name of the
3673 referent (in Step 4, 5 or 6). If neither treatment applies to
3674 an attribute that references another type entry, the entry
3675 that contains that attribute should not be considered for a
3676 separate \addtoindex{type unit}.}
3678 \textit{If a debugging information entry contains an attribute from
3679 the list above that would require an unsupported form, that
3680 entry should not be considered for a separate
3681 \addtoindex{type unit}.}
3683 \textit{A type should be considered for a separate
3684 \addtoindex{type unit} only
3685 if all of the type entries that it contains or refers to in
3686 Steps 6 and 7 can themselves each be considered for a separate
3687 \addtoindex{type unit}.}
3690 Where the DWARF producer may reasonably choose two or more
3691 different forms for a given attribute, it should choose
3692 the simplest possible form in computing the signature. (For
3693 example, a constant value should be preferred to a location
3694 expression when possible.)
3696 Once the string S has been formed from the DWARF encoding,
3697 an \MDfive{} hash is computed for the string and the
3698 least significant 64 bits are taken as the type signature.
3700 \textit{The string S is intended to be a flattened representation of
3701 the type that uniquely identifies that type (that is, a different
3702 type is highly unlikely to produce the same string).}
3705 \textit{A debugging information entry should not be placed in a
3706 separate \addtoindex{type unit}
3707 if any of the following apply:}
3711 \item \textit{The entry has an attribute whose value is a location
3712 expression, and the location expression contains a reference to
3713 another debugging information entry (for example, a \DWOPcallref{}
3714 operator), as it is unlikely that the entry will remain
3715 identical across compilation units.}
3717 \item \textit{The entry has an attribute whose value refers
3718 to a code location or a \addtoindex{location list}.}
3720 \item \textit{The entry has an attribute whose value refers
3721 to another debugging information entry that does not represent
3727 \textit{Certain attributes are not included in the type signature:}
3730 \item \textit{The \DWATdeclaration{} attribute is not included because it
3731 indicates that the debugging information entry represents an
3732 incomplete declaration, and incomplete declarations should
3734 \addtoindexx{type unit}
3735 separate type units.}
3737 \item \textit{The \DWATdescription{} attribute is not included because
3738 it does not provide any information unique to the defining
3739 declaration of the type.}
3741 \item \textit{The \DWATdeclfile,
3743 \DWATdeclcolumn{} attributes are not included because they
3744 may vary from one source file to the next, and would prevent
3745 two otherwise identical type declarations from producing the
3746 same \MDfive{} hash.}
3748 \item \textit{The \DWATobjectpointer{} attribute is not included
3749 because the information it provides is not necessary for the
3750 computation of a unique type signature.}
3754 \textit{Nested types and some types referred to by a debugging
3755 information entry are encoded by name rather than by recursively
3756 encoding the type to allow for cases where a complete definition
3757 of the type might not be available in all compilation units.}
3760 \textit{If a type definition contains the definition of a member function,
3761 it cannot be moved as is into a type unit, because the member function
3762 contains attributes that are unique to that compilation unit.
3763 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3764 moving the member function declaration into a separate declaration tree,
3765 and replacing the function definition in the type with a non-defining
3766 declaration of the function (as if the function had been defined out of
3769 An example that illustrates the computation of an \MDfive{} hash may be found in
3770 Appendix \refersec{app:usingtypeunits}.