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 skeleton line number table (for the type units), in the
281 \dotdebuglinedwo{} section (see
282 Section \refersec{chap:skeletoncompilationunitentries}).
284 \item Macro information, in the \dotdebugmacrodwo{} section.
286 \item A string table, in the \dotdebugstrdwo{} section.
288 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
292 Except where noted otherwise, all references in this document
293 to a debugging information section (for example, \dotdebuginfo),
294 applies also to the corresponding split DWARF section (for example,
297 \subsection{Executable Objects}
298 \label{chap:executableobjects}
299 The relocated addresses in the debugging information for an
300 executable object are virtual addresses.
302 \subsection{Shared Objects}
303 \label{datarep:sharedobjects}
305 addresses in the debugging information for a shared object
306 are offsets relative to the start of the lowest region of
307 memory loaded from that shared object.
310 \textit{This requirement makes the debugging information for
311 shared objects position independent. Virtual addresses in a
312 shared object may be calculated by adding the offset to the
313 base address at which the object was attached. This offset
314 is available in the run\dash time linker\textquoteright s data structures.}
316 \subsection{DWARF Package Files}
317 \label{datarep:dwarfpackagefiles}
318 \textit{Using split DWARF objects allows the developer to compile,
319 link, and debug an application quickly with less link-time overhead,
320 but a more convenient format is needed for saving the debug
321 information for later debugging of a deployed application. A
322 DWARF package file can be used to collect the debugging
323 information from the object (or separate DWARF object) files
324 produced during the compilation of an application.}
326 \textit{The package file is typically placed in the same directory as the
327 application, and is given the same name with a \doublequote{\texttt{.dwp}}
328 extension.\addtoindexx{\texttt{.dwp} file extension}}
330 A DWARF package file is itself an object file, using the
331 \addtoindexx{package files}
332 \addtoindexx{DWARF package files}
333 same object file format (including byte order) as the
334 corresponding application binary. It consists only of a file
335 header, section table, a number of DWARF debug information
336 sections, and two index sections.
339 Each DWARF package file contains no more than one of each of the
340 following sections, copied from a set of object or DWARF object
341 files, and combined, section by section:
347 \dotdebugstroffsetsdwo
352 The string table section in \dotdebugstrdwo{} contains all the
353 strings referenced from DWARF attributes using the form
354 \DWFORMstrx. Any attribute in a compilation unit or a type
355 unit using this form will refer to an entry in that unit's
356 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
357 will provide the offset of a string in the \dotdebugstrdwo{}
360 The DWARF package file also contains two index sections that
361 provide a fast way to locate debug information by compilation
362 unit signature (\DWATdwoid) for compilation units, or by type
363 signature for type units:
369 \subsubsection{The Compilation Unit (CU) Index Section}
370 The \dotdebugcuindex{} section is a hashed lookup table that maps a
371 compilation unit signature to a set of contributions in the
372 various debug information sections. Each contribution is stored
373 as an offset within its corresponding section and a size.
375 Each compilation unit set may contain contributions from the
378 \dotdebuginfodwo{} (required)
379 \dotdebugabbrevdwo{} (required)
382 \dotdebugstroffsetsdwo
386 \textit{Note that a set is not able to represent \dotdebugmacinfo{}
387 information from \DWARFVersionIV{} or earlier formats.}
389 \subsubsection{The Type Unit (TU) Index Section}
390 The \dotdebugtuindex{} section is a hashed lookup table that maps a
391 type signature to a set of offsets into the various debug
392 information sections. Each contribution is stored as an offset
393 within its corresponding section and a size.
395 Each type unit set may contain contributions from the following
398 \dotdebuginfodwo{} (required)
399 \dotdebugabbrevdwo{} (required)
401 \dotdebugstroffsetsdwo
404 \subsubsection{Format of the CU and TU Index Sections}
405 Both index sections have the same format, and serve to map a
406 64-bit signature to a set of contributions to the debug sections.
407 Each section begins with a header, followed by a hash table of
408 signatures, a parallel table of indexes, a table of offsets, and
409 a table of sizes. The index sections are aligned at 8-byte
410 boundaries in the file.
413 The index section header contains four unsigned 32-bit values
414 (using the byte order of the application binary):
416 \item The \addtoindexi{version number}{version number!package index tables}
417 of the format of this index (currently 5)
418 \item L, the number of columns in the table of section offsets
419 \item N, the number of compilation units or type units in the index
420 \item M, the number of slots in the hash table
423 \textit{We assume that N and M will not exceed $2^{32}$.}
425 The size of the hash table, M, must be $2^k$ such that:
426 \hspace{0.3cm}$2^k\ \ >\ \ 3*N/2$
428 The hash table begins at offset 16 in the section, and consists
429 of an array of M 64-bit slots. Each slot contains a 64-bit
430 signature (using the byte order of the application binary).
432 The parallel table begins immediately after the hash table (at
433 offset \mbox{16 + 8 * M} from the beginning of the section), and
434 consists of an array of M 32-bit slots (using the byte order of
435 the application binary), corresponding 1-1 with slots in the hash
436 table. Each entry in the parallel table contains a row index into
437 the tables of offsets and sizes.
439 Unused slots in the hash table have 0 in both the hash table
440 entry and the parallel table entry. While 0 is a valid hash
441 value, the row index in a used slot will always be non-zero.
443 Given a 64-bit compilation unit signature or a type signature S,
444 an entry in the hash table is located as follows:
445 \begin{enumerate}[1. ]
446 \item Calculate a primary hash $H = S\ \&\ MASK(k)$, where $MASK(k)$ is a
447 mask with the low-order k bits all set to 1.
449 \item Calculate a secondary hash $H' = (((S>>32)\ \&\ MASK(k))\ |\ 1)$.
451 \item If the hash table entry at index H matches the signature, use
452 that entry. If the hash table entry at index H is unused (all
453 zeroes), terminate the search: the signature is not present
456 \item Let $H = (H + H')\ modulo\ M$. Repeat at Step 3.
459 Because $M > N$, and H' and M are relatively prime, the search is
460 guaranteed to stop at an unused slot or find the match.
463 The table of offsets begins immediately following the parallel
464 table (at offset \mbox{16 + 12 * M} from the beginning of the section).
465 The table is a two-dimensional array of 32-bit words (using the
466 byte order of the application binary), with L columns and N+1
467 rows, in row-major order. Each row in the array is indexed
468 starting from 0. The first row provides a key to the columns:
469 each column in this row provides an identifier for a debug
470 section, and the offsets in the same column of subsequent rows
471 refer to that section. The section identifiers are shown in
472 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
475 \setlength{\extrarowheight}{0.1cm}
476 \begin{longtable}{l|c|l}
477 \caption{DWARF package file section identifier \mbox{encodings}}
478 \label{tab:dwarfpackagefilesectionidentifierencodings}
479 \addtoindexx{DWARF package files!section identifier encodings} \\
480 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
482 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
484 \hline \emph{Continued on next page}
488 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
489 \textit(reserved) & 2 & \\
490 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
491 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
492 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
493 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
494 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
495 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
499 The offsets provided by the CU and TU index sections are the base
500 offsets for the contributions made by each CU or TU to the
501 corresponding section in the package file. Each CU and TU header
502 contains an \texttt{abbrev\_offset} field, used to find the abbreviations
503 table for that CU or TU within the contribution to the
504 \dotdebugabbrevdwo{} section for that CU or TU, and should be
505 interpreted as relative to the base offset given in the index
506 section. Likewise, offsets into \dotdebuglinedwo{} from
507 \DWATstmtlist{} attributes should be interpreted as relative to
508 the base offset for \dotdebuglinedwo{}, and offsets into other debug
509 sections obtained from DWARF attributes should also be
510 interpreted as relative to the corresponding base offset.
512 The table of sizes begins immediately following the table of
513 offsets, and provides the sizes of the contributions made by each
514 CU or TU to the corresponding section in the package file. Like
515 the table of offsets, it is a two-dimensional array of 32-bit
516 words, with L columns and N rows, in row-major order. Each row in
517 the array is indexed starting from 1 (row 0 of the table of
518 offsets also serves as the key for the table of sizes).
520 \subsection{DWARF Supplementary Object Files}
521 \label{data:dwarfsupplemetaryobjectfiles}
522 In order to minimize the size of debugging information, it is possible
523 to move duplicate debug information entries, strings and macro entries from
524 several executables or shared objects into a separate
525 \addtoindexi{\textit{supplementary object file}}{supplementary object file} by some
526 post-linking utility; the moved entries and strings can be then referenced
527 from the debugging information of each of those executables or shared objects.
529 A DWARF supplementary object file is itself an object file, using the same object
530 file format, byte order, and size as the corresponding application executables
531 or shared libraries. It consists only of a file header, section table, and
532 a number of DWARF debug information sections. Both the supplementary object file
533 and all the executables or shared objects that reference entries or strings in that
534 file must contain a \dotdebugsup{} section that establishes the relationship.
536 The \dotdebugsup section contains:
537 \begin{enumerate}[1. ]
538 \item \texttt{version} (uhalf) \\
539 \addttindexx{version}
540 A 2-byte unsigned integer representing the version of the DWARF
541 information for the compilation unit (see Appendix G). The
542 value in this field is \versiondotdebugsup.
544 \item \texttt{is\_supplementary} (ubyte) \\
545 \addttindexx{is\_supplementary}
546 A 1-byte unsigned integer, which contains the value 1 if it is
547 in the \addtoindex{supplementary object file} that other executables or
548 shared objects refer to, or 0 if it is an executable or shared object
549 referring to a supplemental object file file.
552 \item \texttt{sup\_filename} (null terminated filename string) \\
553 \addttindexx{sup\_filename}
554 If \addttindex{is\_supplementary} is 0, this contains either an absolute
555 filename for the supplementary object file, or a filename relative to
556 the object file containing the \dotdebugsup{} section.
557 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
558 is not needed and must be an empty string (a single nul byte).
561 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
562 \addttindexx{sup\_checksum\_len}
563 Length of the following \addttindex{sup\_checksum} field;
564 his value can be 0 if no checksum is provided.
567 \item \texttt{sup\_checksum} (array of ubyte) \\
568 \addttindexx{sup\_checksum}
569 Some checksum or cryptographic hash function of the \dotdebuginfo{},
570 \dotdebugstr{} and \dotdebugmacro{} sections of the
571 \addtoindex{supplementary object file}, or some unique identifier
572 which the implementation can choose to verify that the supplementary
573 section object file matches what the debug information in the executables
574 or shared objects expects.
577 Debug information entries that refer to an executable's or shared
578 object's addresses must \emph{not} be moved to supplementary files (the
579 addesses will likely not be the same). Similarly,
580 entries referenced from within locationexpressions or using loclistptr
581 form attributes must not be moved.
583 Executable or shared object compilation units can use
584 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
585 to import entries from the supplementary object file, other \DWFORMrefsup{}
586 attributes to refer to them and \DWFORMstrpsup{} form attributes to
587 refer to strings that are used by debug information of multiple
588 executables or shared objects. Within the \addtoindex{supplementary object file}'s
589 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} should
590 not be used, and all reference forms referring to some other sections
591 refer to the local sections in the supplementary object file.
593 In macro information, \DWMACROdefineindirectsup{} or
594 \DWMACROundefindirectsup{} opcodes can refer to strings in the
595 \dotdebugstr section of the supplementary file, or \DWMACROtransparentincludesup{}
596 can refer to \dotdebugmacro section entries. Within the
597 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
598 \DWMACROdefineindirect{} and \DWMACROundefindirect{}
599 opcodes refer to the local \dotdebugstr{} section, not the one in
600 the executable or shared object."
604 \section{32-Bit and 64-Bit DWARF Formats}
605 \label{datarep:32bitand64bitdwarfformats}
606 \hypertarget{datarep:xxbitdwffmt}{}
607 \addtoindexx{32-bit DWARF format}
608 \addtoindexx{64-bit DWARF format}
609 There are two closely related file formats. In the 32\dash bit DWARF
610 format, all values that represent lengths of DWARF sections
611 and offsets relative to the beginning of DWARF sections are
612 represented using 32\dash bits. In the 64\dash bit DWARF format, all
613 values that represent lengths of DWARF sections and offsets
614 relative to the beginning of DWARF sections are represented
615 using 64\dash bits. A special convention applies to the initial
616 length field of certain DWARF sections, as well as the CIE and
617 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
618 can coexist and be distinguished within a single linked object.
620 The differences between the 32\dash\ and 64\dash bit
622 detailed in the following:
623 \begin{enumerate}[1. ]
625 \item In the 32\dash bit DWARF format, an
626 \addtoindex{initial length} field (see
627 \addtoindexx{initial length!encoding}
628 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
629 is an unsigned 32\dash bit integer (which
630 must be less than \xfffffffzero); in the 64\dash bit DWARF format,
631 an \addtoindex{initial length} field is 96 bits in size,
634 \item The first 32\dash bits have the value \xffffffff.
636 \item The following 64\dash bits contain the actual length
637 represented as an unsigned 64\dash bit integer.
640 \textit{This representation allows a DWARF consumer to dynamically
641 detect that a DWARF section contribution is using the 64\dash bit
642 format and to adapt its processing accordingly.}
644 \item Section offset and section length
645 \hypertarget{datarep:sectionoffsetlength}{}
646 \addtoindexx{section length!use in headers}
648 \addtoindexx{section offset!use in headers}
649 in the headers of DWARF sections (other than initial length
650 \addtoindexx{initial length}
651 fields) are listed following. In the 32\dash bit DWARF format these
652 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
653 they are 64\dash bit unsigned integer values.
657 Section &Name & Role \\ \hline
658 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
659 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
660 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
661 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
662 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
663 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
669 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
670 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
671 union must be accessed to distinguish whether a CIE or FDE is
672 present, consequently, these two fields must exactly overlay
673 each other (both offset and size).
675 \item Within the body of the \dotdebuginfo{}
676 section, certain forms of attribute value depend on the choice
677 of DWARF format as follows. For the 32\dash bit DWARF format,
678 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
679 format, the value is a 64\dash bit unsigned integer.
681 \begin{tabular}{lp{6cm}}
682 Form & Role \\ \hline
683 \DWFORMlinestrp & offset in \dotdebuglinestr \\
684 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
685 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
686 \addtoindexx{supplementary object file}
687 \DWFORMsecoffset & offset in a section other than \\
688 & \dotdebuginfo{} or \dotdebugstr{} \\
689 \DWFORMstrp & offset in \dotdebugstr{} \\
690 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
691 \DWOPcallref & offset in \dotdebuginfo{} \\
696 \item Within the body of the \dotdebugline{} section, certain forms of content
697 description depend on the choice of DWARF format as follows: for the
698 32-bit DWARF format, the value is a 32-bit unsigned integer; for the
699 64-bit DWARF format, the value is a 64-bit unsigned integer.
701 \begin{tabular}{lp{6cm}}
702 Form & Role \\ \hline
703 \DWFORMlinestrp & offset in \dotdebuglinestr
707 \item Within the body of the \dotdebugnames{}
708 sections, the representation of each entry in the array of
709 compilation units (CUs) and the array of local type units
710 (TUs), which represents an offset in the
712 section, depends on the DWARF format as follows: in the
713 32\dash bit DWARF format, each entry is a 32\dash bit unsigned integer;
714 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
717 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
718 sections, the size of entries in the body depend on the DWARF
719 format as follows: in the 32-bit DWARF format, entries are 32-bit
720 unsigned integer values; in the 64-bit DWARF format, they are
721 64-bit unsigned integers.
723 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
724 sections, the contents of the address size fields depends on the
725 DWARF format as follows: in the 32-bit DWARF format, these fields
726 contain 4; in the 64-bit DWARF format these fields contain 8.
730 The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
731 intermixed within a single compilation unit.
733 \textit{Attribute values and section header fields that represent
734 addresses in the target program are not affected by these
737 A DWARF consumer that supports the 64\dash bit DWARF format must
738 support executables in which some compilation units use the
739 32\dash bit format and others use the 64\dash bit format provided that
740 the combination links correctly (that is, provided that there
741 are no link\dash time errors due to truncation or overflow). (An
742 implementation is not required to guarantee detection and
743 reporting of all such errors.)
745 \textit{It is expected that DWARF producing compilers will \emph{not} use
746 the 64\dash bit format \emph{by default}. In most cases, the division of
747 even very large applications into a number of executable and
748 shared objects will suffice to assure that the DWARF sections
749 within each individual linked object are less than 4 GBytes
750 in size. However, for those cases where needed, the 64\dash bit
751 format allows the unusual case to be handled as well. Even
752 in this case, it is expected that only application supplied
753 objects will need to be compiled using the 64\dash bit format;
754 separate 32\dash bit format versions of system supplied shared
755 executable libraries can still be used.}
759 \section{Format of Debugging Information}
760 \label{datarep:formatofdebugginginformation}
762 For each compilation unit compiled with a DWARF producer,
763 a contribution is made to the \dotdebuginfo{} section of
764 the object file. Each such contribution consists of a
765 compilation unit header
766 (see Section \refersec{datarep:compilationunitheader})
768 single \DWTAGcompileunit{} or
769 \DWTAGpartialunit{} debugging
770 information entry, together with its children.
772 For each type defined in a compilation unit, a separate
773 contribution may also be made to the
775 section of the object file. Each
776 such contribution consists of a
777 \addtoindex{type unit} header
778 (see Section \refersec{datarep:typeunitheader})
779 followed by a \DWTAGtypeunit{} entry, together with
782 Each debugging information entry begins with a code that
783 represents an entry in a separate
784 \addtoindex{abbreviations table}. This
785 code is followed directly by a series of attribute values.
787 The appropriate entry in the
788 \addtoindex{abbreviations table} guides the
789 interpretation of the information contained directly in the
790 \dotdebuginfo{} section.
793 Multiple debugging information entries may share the same
794 abbreviation table entry. Each compilation unit is associated
795 with a particular abbreviation table, but multiple compilation
796 units may share the same table.
798 \subsection{Unit Headers}
799 \label{datarep:unitheaders}
800 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
801 compilation unit that follows. The encodings for the unit type
802 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
806 \setlength{\extrarowheight}{0.1cm}
807 \begin{longtable}{l|c}
808 \caption{Unit header unit type encodings}
809 \label{tab:unitheaderunitkindencodings}
810 \addtoindexx{unit header unit type encodings} \\
811 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
813 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
815 \hline \emph{Continued on next page}
817 \hline \ddag\ \textit{New in DWARF Version 5}
819 \DWUTcompileTARG~\ddag &0x01 \\
820 \DWUTtypeTARG~\ddag &0x02 \\
821 \DWUTpartialTARG~\ddag &0x03 \\ \hline
826 \subsubsection{Compilation Unit Header}
827 \label{datarep:compilationunitheader}
828 \begin{enumerate}[1. ]
830 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
831 \addttindexx{unit\_length}
832 A 4\dash byte or 12\dash byte
833 \addtoindexx{initial length}
834 unsigned integer representing the length
835 of the \dotdebuginfo{}
836 contribution for that compilation unit,
837 not including the length field itself. In the \thirtytwobitdwarfformat,
838 this is a 4\dash byte unsigned integer (which must be less
839 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
840 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
841 integer that gives the actual length
842 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
844 \item \texttt{version} (\addtoindex{uhalf}) \\
845 \addttindexx{version}
846 A 2\dash byte unsigned integer representing the version of the
847 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
848 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
849 The value in this field is \versiondotdebuginfo.
852 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
853 \addttindexx{unit\_type}
854 A 1-byte unsigned integer identifying this unit as a compilation unit.
855 The value of this field is
856 \DWUTcompile{} for a {normal compilation} unit or
857 \DWUTpartial{} for a {partial compilation} unit
858 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
860 \textit{This field is new in \DWARFVersionV.}
863 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
864 \addttindexx{debug\_abbrev\_offset}
866 \addtoindexx{section offset!in .debug\_info header}
867 4\dash byte or 8\dash byte unsigned offset into the
869 section. This offset associates the compilation unit with a
870 particular set of debugging information entry abbreviations. In
871 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
872 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
873 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
875 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
876 \addttindexx{address\_size}
877 A 1\dash byte unsigned integer representing the size in bytes of
878 an address on the target architecture. If the system uses
879 \addtoindexx{address space!segmented}
880 segmented addressing, this value represents the size of the
881 offset portion of an address.
885 \subsubsection{Type Unit Header}
886 \label{datarep:typeunitheader}
888 The header for the series of debugging information entries
889 contributing to the description of a type that has been
890 placed in its own \addtoindex{type unit}, within the
891 \dotdebuginfo{} section,
892 consists of the following information:
893 \begin{enumerate}[1. ]
895 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
896 \addttindexx{unit\_length}
897 A 4\dash byte or 12\dash byte unsigned integer
898 \addtoindexx{initial length}
899 representing the length
900 of the \dotdebuginfo{} contribution for that type unit,
901 not including the length field itself. In the \thirtytwobitdwarfformat,
902 this is a 4\dash byte unsigned integer (which must be
903 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
904 consists of the 4\dash byte value \wffffffff followed by an
905 8\dash byte unsigned integer that gives the actual length
906 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
909 \item \texttt{version} (\addtoindex{uhalf}) \\
910 \addttindexx{version}
911 A 2\dash byte unsigned integer representing the version of the
912 DWARF information for the
913 type unit\addtoindexx{version number!type unit}
914 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
915 The value in this field is \versiondotdebuginfo.
917 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
918 \addttindexx{unit\_type}
919 A 1-byte unsigned integer identifying this unit as a type unit.
920 The value of this field is \DWUTtype{} for a type unit
921 (see Section \refersec{chap:separatetypeunitentries}).
923 \textit{This field is new in \DWARFVersionV.}
926 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
927 \addttindexx{debug\_abbrev\_offset}
929 \addtoindexx{section offset!in .debug\_info header}
930 4\dash byte or 8\dash byte unsigned offset into the
932 section. This offset associates the type unit with a
933 particular set of debugging information entry abbreviations. In
934 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
935 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
936 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
939 \item \texttt{address\_size} (addtoindex{ubyte}) \\
940 \addttindexx{address\_size}
941 A 1\dash byte unsigned integer representing the size
942 \addtoindexx{size of an address}
944 an address on the target architecture. If the system uses
945 \addtoindexx{address space!segmented}
946 segmented addressing, this value represents the size of the
947 offset portion of an address.
949 \item \texttt{type\_signature} (8\dash byte unsigned integer) \\
950 \addttindexx{type\_signature}
951 \addtoindexx{type signature}
952 A 64\dash bit unique signature (see Section
953 \refersec{datarep:typesignaturecomputation})
954 of the type described in this type
957 \textit{An attribute that refers (using
958 \DWFORMrefsigeight{}) to
959 the primary type contained in this
960 \addtoindex{type unit} uses this value.}
962 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
963 \addttindexx{type\_offset}
964 A 4\dash byte or 8\dash byte unsigned offset
965 \addtoindexx{section offset!in .debug\_info header}
966 relative to the beginning
967 of the \addtoindex{type unit} header.
968 This offset refers to the debugging
969 information entry that describes the type. Because the type
970 may be nested inside a namespace or other structures, and may
971 contain references to other types that have not been placed in
972 separate type units, it is not necessarily either the first or
973 the only entry in the type unit. In the \thirtytwobitdwarfformat,
974 this is a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat,
975 this is an 8\dash byte unsigned length
976 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
980 \subsection{Debugging Information Entry}
981 \label{datarep:debugginginformationentry}
983 Each debugging information entry begins with an
984 unsigned LEB128\addtoindexx{LEB128!unsigned}
985 number containing the abbreviation code for the entry. This
986 code represents an entry within the abbreviations table
987 associated with the compilation unit containing this entry. The
988 abbreviation code is followed by a series of attribute values.
990 On some architectures, there are alignment constraints on
991 section boundaries. To make it easier to pad debugging
992 information sections to satisfy such constraints, the
993 abbreviation code 0 is reserved. Debugging information entries
994 consisting of only the abbreviation code 0 are considered
997 \subsection{Abbreviations Tables}
998 \label{datarep:abbreviationstables}
1000 The abbreviations tables for all compilation units
1001 are contained in a separate object file section called
1003 As mentioned before, multiple compilation
1004 units may share the same abbreviations table.
1006 The abbreviations table for a single compilation unit consists
1007 of a series of abbreviation declarations. Each declaration
1008 specifies the tag and attributes for a particular form of
1009 debugging information entry. Each declaration begins with
1010 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1011 number representing the abbreviation
1012 code itself. It is this code that appears at the beginning
1013 of a debugging information entry in the
1015 section. As described above, the abbreviation
1016 code 0 is reserved for null debugging information entries. The
1017 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1018 number that encodes the entry\textquoteright s tag. The encodings for the
1019 tag names are given in
1020 Table \refersec{tab:tagencodings}.
1023 \setlength{\extrarowheight}{0.1cm}
1024 \begin{longtable}{l|c}
1026 \caption{Tag encodings} \label{tab:tagencodings} \\
1027 \hline \bfseries Tag name&\bfseries Value\\ \hline
1029 \bfseries Tag name&\bfseries Value \\ \hline
1031 \hline \emph{Continued on next page}
1033 \hline \ddag\ \textit{New in DWARF Version 5}
1035 \DWTAGarraytype{} &0x01 \\
1036 \DWTAGclasstype&0x02 \\
1037 \DWTAGentrypoint&0x03 \\
1038 \DWTAGenumerationtype&0x04 \\
1039 \DWTAGformalparameter&0x05 \\
1040 \DWTAGimporteddeclaration&0x08 \\
1042 \DWTAGlexicalblock&0x0b \\
1043 \DWTAGmember&0x0d \\
1044 \DWTAGpointertype&0x0f \\
1045 \DWTAGreferencetype&0x10 \\
1046 \DWTAGcompileunit&0x11 \\
1047 \DWTAGstringtype&0x12 \\
1048 \DWTAGstructuretype&0x13 \\
1049 \DWTAGsubroutinetype&0x15 \\
1050 \DWTAGtypedef&0x16 \\
1051 \DWTAGuniontype&0x17 \\
1052 \DWTAGunspecifiedparameters&0x18 \\
1053 \DWTAGvariant&0x19 \\
1054 \DWTAGcommonblock&0x1a \\
1055 \DWTAGcommoninclusion&0x1b \\
1056 \DWTAGinheritance&0x1c \\
1057 \DWTAGinlinedsubroutine&0x1d \\
1058 \DWTAGmodule&0x1e \\
1059 \DWTAGptrtomembertype&0x1f \\
1060 \DWTAGsettype&0x20 \\
1061 \DWTAGsubrangetype&0x21 \\
1062 \DWTAGwithstmt&0x22 \\
1063 \DWTAGaccessdeclaration&0x23 \\
1064 \DWTAGbasetype&0x24 \\
1065 \DWTAGcatchblock&0x25 \\
1066 \DWTAGconsttype&0x26 \\
1067 \DWTAGconstant&0x27 \\
1068 \DWTAGenumerator&0x28 \\
1069 \DWTAGfiletype&0x29 \\
1070 \DWTAGfriend&0x2a \\
1071 \DWTAGnamelist&0x2b \\
1072 \DWTAGnamelistitem&0x2c \\
1073 \DWTAGpackedtype&0x2d \\
1074 \DWTAGsubprogram&0x2e \\
1075 \DWTAGtemplatetypeparameter&0x2f \\
1076 \DWTAGtemplatevalueparameter&0x30 \\
1077 \DWTAGthrowntype&0x31 \\
1078 \DWTAGtryblock&0x32 \\
1079 \DWTAGvariantpart&0x33 \\
1080 \DWTAGvariable&0x34 \\
1081 \DWTAGvolatiletype&0x35 \\
1082 \DWTAGdwarfprocedure&0x36 \\
1083 \DWTAGrestricttype&0x37 \\
1084 \DWTAGinterfacetype&0x38 \\
1085 \DWTAGnamespace&0x39 \\
1086 \DWTAGimportedmodule&0x3a \\
1087 \DWTAGunspecifiedtype&0x3b \\
1088 \DWTAGpartialunit&0x3c \\
1089 \DWTAGimportedunit&0x3d \\
1090 \DWTAGcondition&\xiiif \\
1091 \DWTAGsharedtype&0x40 \\
1092 \DWTAGtypeunit & 0x41 \\
1093 \DWTAGrvaluereferencetype & 0x42 \\
1094 \DWTAGtemplatealias & 0x43 \\
1095 \DWTAGcoarraytype~\ddag & 0x44 \\
1096 \DWTAGgenericsubrange~\ddag & 0x45 \\
1097 \DWTAGdynamictype~\ddag & 0x46 \\
1098 \DWTAGatomictype~\ddag & 0x47 \\
1099 \DWTAGcallsite~\ddag & 0x48 \\
1100 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1101 \DWTAGlouser&0x4080 \\
1102 \DWTAGhiuser&\xffff \\
1106 Following the tag encoding is a 1\dash byte value that determines
1107 whether a debugging information entry using this abbreviation
1108 has child entries or not. If the value is
1110 the next physically succeeding entry of any debugging
1111 information entry using this abbreviation is the first
1112 child of that entry. If the 1\dash byte value following the
1113 abbreviation\textquoteright s tag encoding is
1114 \DWCHILDRENnoTARG, the next
1115 physically succeeding entry of any debugging information entry
1116 using this abbreviation is a sibling of that entry. (Either
1117 the first child or sibling entries may be null entries). The
1118 encodings for the child determination byte are given in
1119 Table \refersec{tab:childdeterminationencodings}
1121 Section \refersec{chap:relationshipofdebugginginformationentries},
1122 each chain of sibling entries is terminated by a null entry.)
1126 \setlength{\extrarowheight}{0.1cm}
1127 \begin{longtable}{l|c}
1128 \caption{Child determination encodings}
1129 \label{tab:childdeterminationencodings}
1130 \addtoindexx{Child determination encodings} \\
1131 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1133 \bfseries Children determination name&\bfseries Value \\ \hline
1135 \hline \emph{Continued on next page}
1139 \DWCHILDRENno&0x00 \\
1140 \DWCHILDRENyes&0x01 \\ \hline
1145 Finally, the child encoding is followed by a series of
1146 attribute specifications. Each attribute specification
1147 consists of two parts. The first part is an
1148 unsigned LEB128\addtoindexx{LEB128!unsigned}
1149 number representing the attribute\textquoteright s name.
1150 The second part is an
1151 unsigned LEB128\addtoindexx{LEB128!unsigned}
1152 number representing the attribute\textquoteright s form.
1153 The series of attribute specifications ends with an
1154 entry containing 0 for the name and 0 for the form.
1157 \DWFORMindirectTARG{} is a special case. For
1158 attributes with this form, the attribute value itself in the
1160 section begins with an unsigned
1161 LEB128 number that represents its form. This allows producers
1162 to choose forms for particular attributes
1163 \addtoindexx{abbreviations table!dynamic forms in}
1165 without having to add a new entry to the abbreviations table.
1167 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1168 For attributes with this form, the attribute specification contains
1169 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1170 number. The value of this number is used as the value of the
1171 attribute, and no value is stored in the \dotdebuginfo{} section.
1173 The abbreviations for a given compilation unit end with an
1174 entry consisting of a 0 byte for the abbreviation code.
1177 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1178 for a depiction of the organization of the
1179 debugging information.}
1182 \subsection{Attribute Encodings}
1183 \label{datarep:attributeencodings}
1185 The encodings for the attribute names are given in
1186 Table \refersec{tab:attributeencodings}.
1188 The attribute form governs how the value of the attribute is
1189 encoded. There are nine classes of form, listed below. Each
1190 class is a set of forms which have related representations
1191 and which are given a common interpretation according to the
1192 attribute in which the form is used.
1194 Form \DWFORMsecoffsetTARG{}
1196 \addtoindexx{rangelistptr class}
1198 \addtoindexx{macptr class}
1200 \addtoindexx{loclistptr class}
1202 \addtoindexx{lineptr class}
1208 \CLASSrangelistptr{} or
1209 \CLASSstroffsetsptr;
1210 the list of classes allowed by the applicable attribute in
1211 Table \refersec{tab:attributeencodings}
1212 determines the class of the form.
1216 Each possible form belongs to one or more of the following classes:
1219 \item \livelinki{chap:classaddress}{address}{address class} \\
1220 \livetarg{datarep:classaddress}{}
1221 Represented as either:
1223 \item An object of appropriate size to hold an
1224 address on the target machine
1226 The size is encoded in the compilation unit header
1227 (see Section \refersec{datarep:compilationunitheader}).
1228 This address is relocatable in a relocatable object file and
1229 is relocated in an executable file or shared object.
1231 \item An indirect index into a table of addresses (as
1232 described in the previous bullet) in the
1233 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1234 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1235 \addtoindex{LEB128} value, which is interpreted as a zero-based
1236 index into an array of addresses in the \dotdebugaddr{} section.
1237 The index is relative to the value of the \DWATaddrbase{} attribute
1238 of the associated compilation unit.
1242 \item \livelink{chap:classaddrptr}{addrptr} \\
1243 \livetarg{datarep:classaddrptr}{}
1244 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1245 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1246 beginning of the list of machine addresses information for the
1247 referencing entity. It is relocatable in
1248 a relocatable object file, and relocated in an executable or
1249 shared object. In the \thirtytwobitdwarfformat, this offset
1250 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1251 format, it is an 8\dash byte unsigned value (see Section
1252 \refersec{datarep:32bitand64bitdwarfformats}).
1254 \textit{This class is new in \DWARFVersionV.}
1257 \item \livelink{chap:classblock}{block} \\
1258 \livetarg{datarep:classblock}{}
1259 Blocks come in four forms:
1261 \begin{myindentpara}{1cm}
1262 A 1\dash byte length followed by 0 to 255 contiguous information
1263 bytes (\DWFORMblockoneTARG).
1266 \begin{myindentpara}{1cm}
1267 A 2\dash byte length followed by 0 to 65,535 contiguous information
1268 bytes (\DWFORMblocktwoTARG).
1271 \begin{myindentpara}{1cm}
1272 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
1273 information bytes (\DWFORMblockfourTARG).
1276 \begin{myindentpara}{1cm}
1277 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1278 length followed by the number of bytes
1279 specified by the length (\DWFORMblockTARG).
1282 In all forms, the length is the number of information bytes
1283 that follow. The information bytes may contain any mixture
1284 of relocated (or relocatable) addresses, references to other
1285 debugging information entries or data bytes.
1287 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1288 \livetarg{datarep:classconstant}{}
1289 There are eight forms of constants. There are fixed length
1290 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1294 \DWFORMdatafourTARG,
1295 \DWFORMdataeightTARG{} and
1296 \DWFORMdatasixteenTARG).
1297 There are also variable length constant
1298 data forms encoded using LEB128 numbers (see below).
1299 Both signed (\DWFORMsdataTARG) and unsigned
1300 (\DWFORMudataTARG) variable length constants are available.
1301 There is also an implicit constant (\DWFORMimplicitconst),
1302 whose value is provided as part of the abbreviation
1306 The data in \DWFORMdataone,
1309 \DWFORMdataeight{} and
1310 \DWFORMdatasixteen{}
1311 can be anything. Depending on context, it may
1312 be a signed integer, an unsigned integer, a floating\dash point
1313 constant, or anything else. A consumer must use context to
1314 know how to interpret the bits, which if they are target
1315 machine data (such as an integer or floating point constant)
1316 will be in target machine byte\dash order.
1318 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1319 forms is used to represent a
1320 signed or unsigned integer, it can be hard for a consumer
1321 to discover the context necessary to determine which
1322 interpretation is intended. Producers are therefore strongly
1323 encouraged to use \DWFORMsdata{} or
1324 \DWFORMudata{} for signed and
1325 unsigned integers respectively, rather than
1326 \DWFORMdata\textless n\textgreater.}
1329 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1330 \livetarg{datarep:classexprloc}{}
1331 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1332 number of information bytes specified by the length
1333 (\DWFORMexprlocTARG).
1334 The information bytes contain a DWARF expression
1335 (see Section \refersec{chap:dwarfexpressions})
1336 or location description
1337 (see Section \refersec{chap:locationdescriptions}).
1339 \item \livelinki{chap:classflag}{flag}{flag class} \\
1340 \livetarg{datarep:classflag}{}
1341 A flag \addtoindexx{flag class}
1342 is represented explicitly as a single byte of data
1343 (\DWFORMflagTARG) or
1344 implicitly (\DWFORMflagpresentTARG).
1346 first case, if the \nolink{flag} has value zero, it indicates the
1347 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1348 it indicates the presence of the attribute. In the second
1349 case, the attribute is implicitly indicated as present, and
1350 no value is encoded in the debugging information entry itself.
1352 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1353 \livetarg{datarep:classlineptr}{}
1354 This is an offset into
1355 \addtoindexx{section offset!in class lineptr value}
1357 \dotdebugline{} or \dotdebuglinedwo{} section
1359 It consists of an offset from the beginning of the
1361 section to the first byte of
1362 the data making up the line number list for the compilation
1364 It is relocatable in a relocatable object file, and
1365 relocated in an executable or shared object. In the
1366 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1367 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1368 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1371 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1372 \livetarg{datarep:classloclistptr}{}
1373 This is an offset into the
1377 It consists of an offset from the
1378 \addtoindexx{section offset!in class loclistptr value}
1381 section to the first byte of
1382 the data making up the
1383 \addtoindex{location list} for the compilation unit.
1384 It is relocatable in a relocatable object file, and
1385 relocated in an executable or shared object. In the
1386 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1387 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1388 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1391 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1392 \livetarg{datarep:classmacptr}{}
1394 \addtoindexx{section offset!in class macptr value}
1396 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1398 It consists of an offset from the beginning of the
1399 \dotdebugmacro{} or \dotdebugmacrodwo{}
1400 section to the the header making up the
1401 macro information list for the compilation unit.
1402 It is relocatable in a relocatable object file, and
1403 relocated in an executable or shared object. In the
1404 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1405 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1406 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1409 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1410 \livetarg{datarep:classrangelistptr}{}
1412 \addtoindexx{section offset!in class rangelistptr value}
1413 offset into the \dotdebugranges{} section
1416 offset from the beginning of the
1417 \dotdebugranges{} section
1418 to the beginning of the non\dash contiguous address ranges
1419 information for the referencing entity.
1420 It is relocatable in
1421 a relocatable object file, and relocated in an executable or
1422 shared object. In the \thirtytwobitdwarfformat, this offset
1423 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1424 format, it is an 8\dash byte unsigned value (see Section
1425 \refersec{datarep:32bitand64bitdwarfformats}).
1428 \textit{Because classes
1433 \CLASSrangelistptr{} and
1434 \CLASSstroffsetsptr{}
1435 share a common representation, it is not possible for an
1436 attribute to allow more than one of these classes}
1440 \item \livelinki{chap:classreference}{reference}{reference class} \\
1441 \livetarg{datarep:classreference}{}
1442 There are four types of reference.
1445 \addtoindexx{reference class}
1446 first type of reference can identify any debugging
1447 information entry within the containing unit.
1450 \addtoindexx{section offset!in class reference value}
1451 offset from the first byte of the compilation
1452 header for the compilation unit containing the reference. There
1453 are five forms for this type of reference. There are fixed
1454 length forms for one, two, four and eight byte offsets
1460 and \DWFORMrefeightTARG).
1461 There is also an unsigned variable
1462 length offset encoded form that uses
1463 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1464 (\DWFORMrefudataTARG).
1465 Because this type of reference is within
1466 the containing compilation unit no relocation of the value
1469 The second type of reference can identify any debugging
1470 information entry within a
1471 \dotdebuginfo{} section; in particular,
1472 it may refer to an entry in a different compilation unit
1473 from the unit containing the reference, and may refer to an
1474 entry in a different shared object. This type of reference
1475 (\DWFORMrefaddrTARG)
1476 is an offset from the beginning of the
1478 section of the target executable or shared object, or, for
1479 references within a \addtoindex{supplementary object file},
1480 an offset from the beginning of the local \dotdebuginfo{} section;
1481 it is relocatable in a relocatable object file and frequently
1482 relocated in an executable file or shared object. For
1483 references from one shared object or static executable file
1484 to another, the relocation and identification of the target
1485 object must be performed by the consumer. In the
1486 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1487 in the \sixtyfourbitdwarfformat, it is an 8\dash byte
1489 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1491 \textit{A debugging information entry that may be referenced by
1492 another compilation unit using
1493 \DWFORMrefaddr{} must have a global symbolic name.}
1495 \textit{For a reference from one executable or shared object to
1496 another, the reference is resolved by the debugger to identify
1497 the shared object or executable and the offset into that
1498 object\textquoteright s \dotdebuginfo{}
1499 section in the same fashion as the run
1500 time loader, either when the debug information is first read,
1501 or when the reference is used.}
1503 The third type of reference can identify any debugging
1504 information type entry that has been placed in its own
1505 \addtoindex{type unit}. This type of
1506 reference (\DWFORMrefsigeightTARG) is the
1507 \addtoindexx{type signature}
1508 64\dash bit type signature
1509 (see Section \refersec{datarep:typesignaturecomputation})
1510 that was computed for the type.
1512 The fourth type of reference is a reference from within the
1513 \dotdebuginfo{} section of the executable or shared object to
1514 a debugging information entry in the \dotdebuginfo{} section of
1515 a \addtoindex{supplementary object file}.
1516 This type of reference (\DWFORMrefsupTARG) is an offset from the
1517 beginning of the \dotdebuginfo{} section in the supplementary
1520 \textit{The use of compilation unit relative references will reduce the
1521 number of link\dash time relocations and so speed up linking. The
1522 use of the second, third and fourth type of reference allows for the
1523 sharing of information, such as types, across compilation
1524 units, while the fourth type further allows for sharing of information
1525 across compilation units from different executables or shared objects.}
1527 \textit{A reference to any kind of compilation unit identifies the
1528 debugging information entry for that unit, not the preceding
1532 \item \livelinki{chap:classstring}{string}{string class} \\
1533 \livetarg{datarep:classstring}{}
1534 A string is a sequence of contiguous non\dash null bytes followed by
1536 \addtoindexx{string class}
1537 A string may be represented:
1539 \setlength{\itemsep}{0em}
1540 \item immediately in the debugging information entry itself
1541 (\DWFORMstringTARG),
1544 \addtoindexx{section offset!in class string value}
1545 offset into a string table contained in
1546 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
1547 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
1548 or as an offset into a string table contained in the
1549 \dotdebugstr{} section of a \addtoindex{supplementary object file}
1550 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
1551 section of a \addtoindex{supplementary object file}
1552 refer to the local \dotdebugstr{} section of that same file.
1553 In the \thirtytwobitdwarfformat, the representation of a
1554 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
1555 value is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
1556 it is an 8\dash byte unsigned offset
1557 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1559 \item as an indirect offset into the string table using an
1560 index into a table of offsets contained in the
1561 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1562 The representation of a \DWFORMstrxNAME{} value is an unsigned
1563 \addtoindex{LEB128} value, which is interpreted as a zero-based
1564 index into an array of offsets in the \dotdebugstroffsets{} section.
1565 The offset entries in the \dotdebugstroffsets{} section have the
1566 same representation as \DWFORMstrp{} values.
1568 Any combination of these three forms may be used within a single compilation.
1570 If the \DWATuseUTFeight{}
1571 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1572 compilation, partial, skeleton or type unit entry, string values are encoded using the
1573 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1574 Character Set standard (ISO/IEC 10646\dash 1:1993).
1575 \addtoindexx{ISO 10646 character set standard}
1576 Otherwise, the string representation is unspecified.
1578 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1579 ISO/IEC 10646\dash 1:1993.
1580 \addtoindexx{ISO 10646 character set standard}
1581 It contains all the same characters
1582 and encoding points as ISO/IEC 10646, as well as additional
1583 information about the characters and their use.}
1585 \textit{Earlier versions of DWARF did not specify the representation
1586 of strings; for compatibility, this version also does
1587 not. However, the UTF\dash 8 representation is strongly recommended.}
1590 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1591 \livetarg{datarep:classstroffsetsptr}{}
1592 This is an offset into the \dotdebugstroffsets{} section
1593 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1594 \dotdebugstroffsets{} section to the
1595 beginning of the string offsets information for the
1596 referencing entity. It is relocatable in
1597 a relocatable object file, and relocated in an executable or
1598 shared object. In the \thirtytwobitdwarfformat, this offset
1599 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1600 format, it is an 8\dash byte unsigned value (see Section
1601 \refersec{datarep:32bitand64bitdwarfformats}).
1603 \textit{This class is new in \DWARFVersionV.}
1607 In no case does an attribute use one of the classes
1612 \CLASSrangelistptr{} or
1613 \CLASSstroffsetsptr{}
1614 to point into either the
1615 \dotdebuginfo{} or \dotdebugstr{} section.
1617 The form encodings are listed in
1618 Table \refersec{tab:attributeformencodings}.
1622 \setlength{\extrarowheight}{0.1cm}
1623 \begin{longtable}{l|c|l}
1624 \caption{Attribute encodings}
1625 \label{tab:attributeencodings}
1626 \addtoindexx{attribute encodings} \\
1627 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1629 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1631 \hline \emph{Continued on next page}
1633 \hline \ddag\ \textit{New in DWARF Version 5}
1635 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1636 \addtoindexx{sibling attribute} \\
1637 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1638 \livelink{chap:classloclistptr}{loclistptr}
1639 \addtoindexx{location attribute} \\
1640 \DWATname&0x03&\livelink{chap:classstring}{string}
1641 \addtoindexx{name attribute} \\
1642 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1643 \addtoindexx{ordering attribute} \\
1644 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1645 \livelink{chap:classexprloc}{exprloc},
1646 \livelink{chap:classreference}{reference}
1647 \addtoindexx{byte size attribute} \\
1648 \DWATbitoffset&0x0c&\livelink{chap:classconstant}{constant},
1649 \livelink{chap:classexprloc}{exprloc},
1650 \livelink{chap:classreference}{reference}
1651 \addtoindexx{bit offset attribute (Version 3)} \\
1652 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1653 \livelink{chap:classexprloc}{exprloc},
1654 \livelink{chap:classreference}{reference}
1655 \addtoindexx{bit size attribute} \\
1656 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1657 \addtoindexx{statement list attribute} \\
1658 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1659 \addtoindexx{low PC attribute} \\
1660 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1661 \livelink{chap:classconstant}{constant}
1662 \addtoindexx{high PC attribute} \\
1663 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1664 \addtoindexx{language attribute} \\
1665 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1666 \addtoindexx{discriminant attribute} \\
1667 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1668 \addtoindexx{discriminant value attribute} \\
1669 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1670 \addtoindexx{visibility attribute} \\
1671 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1672 \addtoindexx{import attribute} \\
1673 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1674 \livelink{chap:classloclistptr}{loclistptr}
1675 \addtoindexx{string length attribute} \\
1676 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1677 \addtoindexx{common reference attribute} \\
1678 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1679 \addtoindexx{compilation directory attribute} \\
1680 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1681 \livelink{chap:classconstant}{constant},
1682 \livelink{chap:classstring}{string}
1683 \addtoindexx{constant value attribute} \\
1684 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1685 \addtoindexx{containing type attribute} \\
1686 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1687 \livelink{chap:classreference}{reference},
1688 \livelink{chap:classflag}{flag}
1689 \addtoindexx{default value attribute} \\
1690 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1691 \addtoindexx{inline attribute} \\
1692 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1693 \addtoindexx{is optional attribute} \\
1694 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1695 \livelink{chap:classexprloc}{exprloc},
1696 \livelink{chap:classreference}{reference}
1697 \addtoindexx{lower bound attribute} \\
1698 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1699 \addtoindexx{producer attribute} \\
1700 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1701 \addtoindexx{prototyped attribute} \\
1702 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1703 \livelink{chap:classloclistptr}{loclistptr}
1704 \addtoindexx{return address attribute} \\
1705 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1706 \livelink{chap:classrangelistptr}{rangelistptr}
1707 \addtoindexx{start scope attribute} \\
1708 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1709 \livelink{chap:classexprloc}{exprloc},
1710 \livelink{chap:classreference}{reference}
1711 \addtoindexx{bit stride attribute} \\
1712 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1713 \livelink{chap:classexprloc}{exprloc},
1714 \livelink{chap:classreference}{reference}
1715 \addtoindexx{upper bound attribute} \\
1716 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1717 \addtoindexx{abstract origin attribute} \\
1718 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1719 \addtoindexx{accessibility attribute} \\
1720 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1721 \addtoindexx{address class attribute} \\
1722 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1723 \addtoindexx{artificial attribute} \\
1724 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1725 \addtoindexx{base types attribute} \\
1726 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1727 \addtoindexx{calling convention attribute} \\
1728 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1729 \livelink{chap:classexprloc}{exprloc},
1730 \livelink{chap:classreference}{reference}
1731 \addtoindexx{count attribute} \\
1732 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1733 \livelink{chap:classexprloc}{exprloc},
1734 \livelink{chap:classloclistptr}{loclistptr}
1735 \addtoindexx{data member attribute} \\
1736 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1737 \addtoindexx{declaration column attribute} \\
1738 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1739 \addtoindexx{declaration file attribute} \\
1740 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1741 \addtoindexx{declaration line attribute} \\
1742 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1743 \addtoindexx{declaration attribute} \\
1744 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1745 \addtoindexx{discriminant list attribute} \\
1746 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1747 \addtoindexx{encoding attribute} \\
1748 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1749 \addtoindexx{external attribute} \\
1750 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1751 \livelink{chap:classloclistptr}{loclistptr}
1752 \addtoindexx{frame base attribute} \\
1753 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1754 \addtoindexx{friend attribute} \\
1755 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1756 \addtoindexx{identifier case attribute} \\
1757 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1758 Reserved for compatibility and coexistence
1759 with prior DWARF versions.}
1760 &0x43&\livelink{chap:classmacptr}{macptr}
1761 \addtoindexx{macro information attribute (legacy)!encoding} \\
1762 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1763 \addtoindexx{name list item attribute} \\
1764 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1765 \addtoindexx{priority attribute} \\
1766 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1767 \livelink{chap:classloclistptr}{loclistptr}
1768 \addtoindexx{segment attribute} \\
1769 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1770 \addtoindexx{specification attribute} \\
1771 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1772 \livelink{chap:classloclistptr}{loclistptr}
1773 \addtoindexx{static link attribute} \\
1774 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1775 \addtoindexx{type attribute} \\
1776 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1777 \livelink{chap:classloclistptr}{loclistptr}
1778 \addtoindexx{location list attribute} \\
1779 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1780 \addtoindexx{variable parameter attribute} \\
1781 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1782 \addtoindexx{virtuality attribute} \\
1783 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1784 \livelink{chap:classloclistptr}{loclistptr}
1785 \addtoindexx{vtable element location attribute} \\
1786 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1787 \livelink{chap:classexprloc}{exprloc},
1788 \livelink{chap:classreference}{reference}
1789 \addtoindexx{allocated attribute} \\
1790 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1791 \livelink{chap:classexprloc}{exprloc},
1792 \livelink{chap:classreference}{reference}
1793 \addtoindexx{associated attribute} \\
1794 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1795 \addtoindexx{data location attribute} \\
1796 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1797 \livelink{chap:classexprloc}{exprloc},
1798 \livelink{chap:classreference}{reference}
1799 \addtoindexx{byte stride attribute} \\
1800 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1801 \livelink{chap:classconstant}{constant}
1802 \addtoindexx{entry pc attribute} \\
1803 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1804 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1805 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1806 \addtoindexx{extension attribute} \\
1807 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1808 \addtoindexx{ranges attribute} \\
1809 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1810 \livelink{chap:classflag}{flag},
1811 \livelink{chap:classreference}{reference},
1812 \livelink{chap:classstring}{string}
1813 \addtoindexx{trampoline attribute} \\
1814 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1815 \addtoindexx{call column attribute} \\
1816 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1817 \addtoindexx{call file attribute} \\
1818 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1819 \addtoindexx{call line attribute} \\
1820 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1821 \addtoindexx{description attribute} \\
1822 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1823 \addtoindexx{binary scale attribute} \\
1824 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1825 \addtoindexx{decimal scale attribute} \\
1826 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1827 \addtoindexx{small attribute} \\
1828 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1829 \addtoindexx{decimal scale attribute} \\
1830 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1831 \addtoindexx{digit count attribute} \\
1832 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1833 \addtoindexx{picture string attribute} \\
1834 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1835 \addtoindexx{mutable attribute} \\
1836 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1837 \addtoindexx{thread scaled attribute} \\
1838 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1839 \addtoindexx{explicit attribute} \\
1840 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1841 \addtoindexx{object pointer attribute} \\
1842 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1843 \addtoindexx{endianity attribute} \\
1844 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1845 \addtoindexx{elemental attribute} \\
1846 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1847 \addtoindexx{pure attribute} \\
1848 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1849 \addtoindexx{recursive attribute} \\
1850 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1851 \addtoindexx{signature attribute} \\
1852 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1853 \addtoindexx{main subprogram attribute} \\
1854 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1855 \addtoindexx{data bit offset attribute} \\
1856 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1857 \addtoindexx{constant expression attribute} \\
1858 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1859 \addtoindexx{enumeration class attribute} \\
1860 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1861 \addtoindexx{linkage name attribute} \\
1862 \DWATstringlengthbitsize{}~\ddag&0x6f&
1863 \livelink{chap:classconstant}{constant}
1864 \addtoindexx{string length attribute!size of length} \\
1865 \DWATstringlengthbytesize{}~\ddag&0x70&
1866 \livelink{chap:classconstant}{constant}
1867 \addtoindexx{string length attribute!size of length} \\
1868 \DWATrank~\ddag&0x71&
1869 \livelink{chap:classconstant}{constant},
1870 \livelink{chap:classexprloc}{exprloc}
1871 \addtoindexx{rank attribute} \\
1872 \DWATstroffsetsbase~\ddag&0x72&
1873 \livelinki{chap:classstring}{stroffsetsptr}{stroffsetsptr class}
1874 \addtoindexx{string offsets base!encoding} \\
1875 \DWATaddrbase~\ddag &0x73&
1876 \livelinki{chap:DWATaddrbase}{addrptr}{addrptr class}
1877 \addtoindexx{address table base!encoding} \\
1878 \DWATrangesbase~\ddag&0x74&
1879 \livelinki{chap:DWATrangesbase}{rangelistptr}{rangelistptr class}
1880 \addtoindexx{ranges base!encoding} \\
1881 \DWATdwoid~\ddag &0x75&
1882 \livelink{chap:DWATdwoid}{constant}
1883 \addtoindexx{split DWARF object id!encoding} \\
1884 \DWATdwoname~\ddag &0x76&
1885 \livelink{chap:DWATdwoname}{string}
1886 \addtoindexx{split DWARF object file name!encoding} \\
1887 \DWATreference~\ddag &0x77&
1888 \livelink{chap:DWATreference}{flag} \\
1889 \DWATrvaluereference~\ddag &0x78&
1890 \livelink{chap:DWATrvaluereference}{flag} \\
1891 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1892 \addtoindexx{macro information attribute} \\
1893 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1894 \addtoindexx{all calls summary attribute} \\
1895 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1896 \addtoindexx{all source calls summary attribute} \\
1897 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1898 \addtoindexx{all tail calls summary attribute} \\
1899 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1900 \addtoindexx{call return pc attribute} \\
1901 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1902 \addtoindexx{call value attribute} \\
1903 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1904 \addtoindexx{call origin attribute} \\
1905 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1906 \addtoindexx{call parameter attribute} \\
1907 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1908 \addtoindexx{call pc attribute} \\
1909 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1910 \addtoindexx{call tail call attribute} \\
1911 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1912 \addtoindexx{call target attribute} \\
1913 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1914 \addtoindexx{call target clobbered attribute} \\
1915 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1916 \addtoindexx{call data location attribute} \\
1917 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1918 \addtoindexx{call data value attribute} \\
1919 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1920 \addtoindexx{noreturn attribute} \\
1921 \DWATalignment~\ddag &0x88 &\CLASSconstant
1922 \addtoindexx{alignment attribute} \\
1923 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1924 \addtoindexx{export symbols attribute} \\
1925 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1926 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1927 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1928 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1935 \setlength{\extrarowheight}{0.1cm}
1936 \begin{longtable}{l|c|l}
1937 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1938 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1940 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1942 \hline \emph{Continued on next page}
1944 \hline \ddag\ \textit{New in DWARF Version 5}
1947 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1948 \textit{Reserved} &0x02& \\
1949 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1950 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1951 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1952 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1953 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1954 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1955 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1956 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1957 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1958 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1959 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1960 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1961 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1962 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1963 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1964 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1965 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1966 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
1967 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
1968 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1969 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
1970 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
1971 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
1972 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
1973 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
1974 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
1975 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
1976 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
1977 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
1978 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
1979 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
1980 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
1986 \section{Variable Length Data}
1987 \label{datarep:variablelengthdata}
1988 \addtoindexx{variable length data|see {LEB128}}
1990 \addtoindexx{Little Endian Base 128|see{LEB128}}
1991 encoded using \doublequote{Little Endian Base 128}
1992 \addtoindexx{little-endian encoding|see{endian attribute}}
1994 \addtoindexx{LEB128}
1995 LEB128 is a scheme for encoding integers
1996 densely that exploits the assumption that most integers are
1999 \textit{This encoding is equally suitable whether the target machine
2000 architecture represents data in big\dash\ endian or little\dash endian
2001 order. It is \doublequote{little\dash endian} only in the sense that it
2002 avoids using space to represent the \doublequote{big} end of an
2003 unsigned integer, when the big end is all zeroes or sign
2006 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2007 numbers are encoded as follows:
2008 \addtoindexx{LEB128!unsigned, encoding as}
2009 start at the low order end of an unsigned integer and chop
2010 it into 7\dash bit chunks. Place each chunk into the low order 7
2011 bits of a byte. Typically, several of the high order bytes
2012 will be zero; discard them. Emit the remaining bytes in a
2013 stream, starting with the low order byte; set the high order
2014 bit on each byte except the last emitted byte. The high bit
2015 of zero on the last byte indicates to the decoder that it
2016 has encountered the last byte.
2018 The integer zero is a special case, consisting of a single
2021 Table \refersec{tab:examplesofunsignedleb128encodings}
2022 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2024 0x80 in each case is the high order bit of the byte, indicating
2025 that an additional byte follows.
2028 The encoding for signed, two\textquoteright s complement LEB128
2029 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2030 numbers is similar, except that the criterion for discarding
2031 high order bytes is not whether they are zero, but whether
2032 they consist entirely of sign extension bits. Consider the
2033 32\dash bit integer -2. The three high level bytes of the number
2034 are sign extension, thus LEB128 would represent it as a single
2035 byte containing the low order 7 bits, with the high order
2036 bit cleared to indicate the end of the byte stream. Note
2037 that there is nothing within the LEB128 representation that
2038 indicates whether an encoded number is signed or unsigned. The
2039 decoder must know what type of number to expect.
2040 Table \refersec{tab:examplesofunsignedleb128encodings}
2041 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2042 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2043 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2046 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2047 \addtoindexx{LEB128!examples}
2048 gives algorithms for encoding and decoding these forms.}
2052 \setlength{\extrarowheight}{0.1cm}
2053 \begin{longtable}{c|c|c}
2054 \caption{Examples of unsigned LEB128 encodings}
2055 \label{tab:examplesofunsignedleb128encodings}
2056 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2057 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2059 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2061 \hline \emph{Continued on next page}
2067 128& 0 + 0x80 & 1 \\
2068 129& 1 + 0x80 & 1 \\
2069 %130& 2 + 0x80 & 1 \\
2070 12857& 57 + 0x80 & 100 \\
2077 \setlength{\extrarowheight}{0.1cm}
2078 \begin{longtable}{c|c|c}
2079 \caption{Examples of signed LEB128 encodings}
2080 \label{tab:examplesofsignedleb128encodings}
2081 \addtoindexx{LEB128!signed} \\
2082 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2084 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2086 \hline \emph{Continued on next page}
2092 127& 127 + 0x80 & 0 \\
2093 -127& 1 + 0x80 & 0x7f \\
2094 128& 0 + 0x80 & 1 \\
2095 -128& 0 + 0x80 & 0x7f \\
2096 129& 1 + 0x80 & 1 \\
2097 -129& 0x7f + 0x80 & 0x7e \\
2104 \section{DWARF Expressions and Location Descriptions}
2105 \label{datarep:dwarfexpressionsandlocationdescriptions}
2106 \subsection{DWARF Expressions}
2107 \label{datarep:dwarfexpressions}
2110 \addtoindexx{DWARF expression!operator encoding}
2111 DWARF expression is stored in a \nolink{block} of contiguous
2112 bytes. The bytes form a sequence of operations. Each operation
2113 is a 1\dash byte code that identifies that operation, followed by
2114 zero or more bytes of additional data. The encodings for the
2115 operations are described in
2116 Table \refersec{tab:dwarfoperationencodings}.
2119 \setlength{\extrarowheight}{0.1cm}
2120 \begin{longtable}{l|c|c|l}
2121 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2122 \hline & &\bfseries No. of &\\
2123 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2125 & &\bfseries No. of &\\
2126 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2128 \hline \emph{Continued on next page}
2130 \hline \ddag\ \textit{New in DWARF Version 5}
2133 \DWOPaddr&0x03&1 & constant address \\
2134 & & &(size is target specific) \\
2136 \DWOPderef&0x06&0 & \\
2138 \DWOPconstoneu&0x08&1&1\dash byte constant \\
2139 \DWOPconstones&0x09&1&1\dash byte constant \\
2140 \DWOPconsttwou&0x0a&1&2\dash byte constant \\
2141 \DWOPconsttwos&0x0b&1&2\dash byte constant \\
2142 \DWOPconstfouru&0x0c&1&4\dash byte constant \\
2143 \DWOPconstfours&0x0d&1&4\dash byte constant \\
2144 \DWOPconsteightu&0x0e&1&8\dash byte constant \\
2145 \DWOPconsteights&0x0f&1&8\dash byte constant \\
2146 \DWOPconstu&0x10&1&ULEB128 constant \\
2147 \DWOPconsts&0x11&1&SLEB128 constant \\
2148 \DWOPdup&0x12&0 & \\
2149 \DWOPdrop&0x13&0 & \\
2150 \DWOPover&0x14&0 & \\
2151 \DWOPpick&0x15&1&1\dash byte stack index \\
2152 \DWOPswap&0x16&0 & \\
2153 \DWOProt&0x17&0 & \\
2154 \DWOPxderef&0x18&0 & \\
2155 \DWOPabs&0x19&0 & \\
2156 \DWOPand&0x1a&0 & \\
2157 \DWOPdiv&0x1b&0 & \\
2158 \DWOPminus&0x1c&0 & \\
2159 \DWOPmod&0x1d&0 & \\
2160 \DWOPmul&0x1e&0 & \\
2161 \DWOPneg&0x1f&0 & \\
2162 \DWOPnot&0x20&0 & \\
2164 \DWOPplus&0x22&0 & \\
2165 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2166 \DWOPshl&0x24&0 & \\
2167 \DWOPshr&0x25&0 & \\
2168 \DWOPshra&0x26&0 & \\
2169 \DWOPxor&0x27&0 & \\
2171 \DWOPbra&0x28&1 & signed 2\dash byte constant \\
2178 \DWOPskip&0x2f&1&signed 2\dash byte constant \\ \hline
2180 \DWOPlitzero & 0x30 & 0 & \\
2181 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2182 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2183 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2185 \DWOPregzero & 0x50 & 0 & \\*
2186 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2187 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2188 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2190 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2191 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2192 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2193 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2195 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2196 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2197 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2198 & & &SLEB128 offset \\
2199 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2200 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2201 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2202 \DWOPnop{} & 0x96 &0& \\
2204 \DWOPpushobjectaddress&0x97&0 & \\
2205 \DWOPcalltwo&0x98&1& 2\dash byte offset of DIE \\
2206 \DWOPcallfour&0x99&1& 4\dash byte offset of DIE \\
2207 \DWOPcallref&0x9a&1& 4\dash\ or 8\dash byte offset of DIE \\
2208 \DWOPformtlsaddress&0x9b &0& \\
2209 \DWOPcallframecfa{} &0x9c &0& \\
2210 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2212 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2213 &&&\nolink{block} of that size\\
2214 \DWOPstackvalue{} &0x9f &0& \\
2215 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2216 &&&SLEB128 constant offset \\
2217 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2218 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2219 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2220 &&&\nolink{block} of that size\\
2221 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2222 & & & 1-byte size, \\*
2223 & & & constant value \\
2224 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2225 &&& ULEB128 constant offset \\
2226 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2227 &&& ULEB128 type entry offset \\
2228 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2229 &&& ULEB128 type entry offset \\
2230 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2231 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2232 \DWOPlouser{} &0xe0 && \\
2233 \DWOPhiuser{} &\xff && \\
2239 \subsection{Location Descriptions}
2240 \label{datarep:locationdescriptions}
2242 A location description is used to compute the
2243 location of a variable or other entity.
2245 \subsection{Location Lists}
2246 \label{datarep:locationlists}
2248 Each entry in a \addtoindex{location list} is either a location list entry,
2249 a base address selection entry, or an
2250 \addtoindexx{end of list entry!in location list}
2254 \subsubsection{Location List Entries in Non-Split Objects}
2255 A \addtoindex{location list} entry consists of two address offsets followed
2256 by an unsigned 2\dash byte length, followed by a block of contiguous bytes
2257 that contains a DWARF location description. The length
2258 specifies the number of bytes in that block. The two offsets
2259 are the same size as an address on the target machine.
2262 A base address selection entry and an
2263 \addtoindexx{end of list entry!in location list}
2264 end of list entry each
2265 consist of two (constant or relocated) address offsets. The two
2266 offsets are the same size as an address on the target machine.
2268 For a \addtoindex{location list} to be specified, the base address of
2269 \addtoindexx{base address selection entry!in location list}
2270 the corresponding compilation unit must be defined
2271 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2273 \subsubsection{Location List Entries in Split Objects}
2274 \label{datarep:locationlistentriesinsplitobjects}
2275 An alternate form for location list entries is used in split objects.
2276 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2277 that follows. The encodings for these constants are given in
2278 Table \refersec{tab:locationlistentryencodingvalues}.
2281 \setlength{\extrarowheight}{0.1cm}
2282 \begin{longtable}{l|c}
2283 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2284 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2286 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2288 \hline \emph{Continued on next page}
2292 \DWLLEendoflistentry & 0x0 \\
2293 \DWLLEbaseaddressselectionentry & 0x01 \\
2294 \DWLLEstartendentry & 0x02 \\
2295 \DWLLEstartlengthentry & 0x03 \\
2296 \DWLLEoffsetpairentry & 0x04 \\
2300 \section{Base Type Attribute Encodings}
2301 \label{datarep:basetypeattributeencodings}
2303 The encodings of the
2304 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2306 \addtoindexx{encoding attribute}
2309 attribute are given in
2310 Table \refersec{tab:basetypeencodingvalues}
2313 \setlength{\extrarowheight}{0.1cm}
2314 \begin{longtable}{l|c}
2315 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2316 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2318 \bfseries Base type encoding name&\bfseries Value\\ \hline
2320 \hline \emph{Continued on next page}
2323 \ddag \ \textit{New in \DWARFVersionV}
2325 \DWATEaddress&0x01 \\
2326 \DWATEboolean&0x02 \\
2327 \DWATEcomplexfloat&0x03 \\
2329 \DWATEsigned&0x05 \\
2330 \DWATEsignedchar&0x06 \\
2331 \DWATEunsigned&0x07 \\
2332 \DWATEunsignedchar&0x08 \\
2333 \DWATEimaginaryfloat&0x09 \\
2334 \DWATEpackeddecimal&0x0a \\
2335 \DWATEnumericstring&0x0b \\
2336 \DWATEedited&0x0c \\
2337 \DWATEsignedfixed&0x0d \\
2338 \DWATEunsignedfixed&0x0e \\
2339 \DWATEdecimalfloat & 0x0f \\
2340 \DWATEUTF{} & 0x10 \\
2341 \DWATEUCS~\ddag & 0x11 \\
2342 \DWATEASCII~\ddag & 0x12 \\
2343 \DWATElouser{} & 0x80 \\
2344 \DWATEhiuser{} & \xff \\
2349 The encodings of the constants used in the
2350 \DWATdecimalsign{} attribute
2352 Table \refersec{tab:decimalsignencodings}.
2355 \setlength{\extrarowheight}{0.1cm}
2356 \begin{longtable}{l|c}
2357 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2358 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2360 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2362 \hline \emph{Continued on next page}
2367 \DWDSunsigned{} & 0x01 \\
2368 \DWDSleadingoverpunch{} & 0x02 \\
2369 \DWDStrailingoverpunch{} & 0x03 \\
2370 \DWDSleadingseparate{} & 0x04 \\
2371 \DWDStrailingseparate{} & 0x05 \\
2377 The encodings of the constants used in the
2378 \DWATendianity{} attribute are given in
2379 Table \refersec{tab:endianityencodings}.
2382 \setlength{\extrarowheight}{0.1cm}
2383 \begin{longtable}{l|c}
2384 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2385 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2387 \bfseries Endian code name&\bfseries Value\\ \hline
2389 \hline \emph{Continued on next page}
2394 \DWENDdefault{} & 0x00 \\
2395 \DWENDbig{} & 0x01 \\
2396 \DWENDlittle{} & 0x02 \\
2397 \DWENDlouser{} & 0x40 \\
2398 \DWENDhiuser{} & \xff \\
2403 \section{Accessibility Codes}
2404 \label{datarep:accessibilitycodes}
2405 The encodings of the constants used in the
2406 \DWATaccessibility{}
2408 \addtoindexx{accessibility attribute}
2410 Table \refersec{tab:accessibilityencodings}.
2413 \setlength{\extrarowheight}{0.1cm}
2414 \begin{longtable}{l|c}
2415 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2416 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2418 \bfseries Accessibility code name&\bfseries Value\\ \hline
2420 \hline \emph{Continued on next page}
2425 \DWACCESSpublic&0x01 \\
2426 \DWACCESSprotected&0x02 \\
2427 \DWACCESSprivate&0x03 \\
2433 \section{Visibility Codes}
2434 \label{datarep:visibilitycodes}
2435 The encodings of the constants used in the
2436 \DWATvisibility{} attribute are given in
2437 Table \refersec{tab:visibilityencodings}.
2440 \setlength{\extrarowheight}{0.1cm}
2441 \begin{longtable}{l|c}
2442 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2443 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2445 \bfseries Visibility code name&\bfseries Value\\ \hline
2447 \hline \emph{Continued on next page}
2453 \DWVISexported&0x02 \\
2454 \DWVISqualified&0x03 \\
2459 \section{Virtuality Codes}
2460 \label{datarep:vitualitycodes}
2462 The encodings of the constants used in the
2463 \DWATvirtuality{} attribute are given in
2464 Table \refersec{tab:virtualityencodings}.
2467 \setlength{\extrarowheight}{0.1cm}
2468 \begin{longtable}{l|c}
2469 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2470 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2472 \bfseries Virtuality code name&\bfseries Value\\ \hline
2474 \hline \emph{Continued on next page}
2479 \DWVIRTUALITYnone&0x00 \\
2480 \DWVIRTUALITYvirtual&0x01 \\
2481 \DWVIRTUALITYpurevirtual&0x02 \\
2489 \DWVIRTUALITYnone{} is equivalent to the absence of the
2493 \section{Source Languages}
2494 \label{datarep:sourcelanguages}
2496 The encodings of the constants used
2497 \addtoindexx{language attribute, encoding}
2499 \addtoindexx{language name encoding}
2502 attribute are given in
2503 Table \refersec{tab:languageencodings}.
2505 % If we don't force a following space it looks odd
2507 and their associated values are reserved, but the
2508 languages they represent are not well supported.
2509 Table \refersec{tab:languageencodings}
2511 \addtoindexx{lower bound attribute!default}
2512 default lower bound, if any, assumed for
2513 an omitted \DWATlowerbound{} attribute in the context of a
2514 \DWTAGsubrangetype{} debugging information entry for each
2518 \setlength{\extrarowheight}{0.1cm}
2519 \begin{longtable}{l|c|c}
2520 \caption{Language encodings} \label{tab:languageencodings}\\
2521 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2523 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2525 \hline \emph{Continued on next page}
2528 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2530 \addtoindexx{ISO-defined language names}
2532 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2533 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2534 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2535 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2536 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2537 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2538 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2539 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2540 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2541 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2542 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2543 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2544 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2545 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2546 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2547 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2548 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2549 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2550 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2551 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2552 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2553 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2554 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2555 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2556 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2557 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2558 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2559 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2560 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2561 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2562 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2563 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2564 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++:2014 (ISO)} \\
2565 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2566 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2567 \DWLANGlouser{} &0x8000 & \\
2568 \DWLANGhiuser{} &\xffff & \\
2573 \section{Address Class Encodings}
2574 \label{datarep:addressclassencodings}
2576 The value of the common
2577 \addtoindex{address class} encoding
2581 \section{Identifier Case}
2582 \label{datarep:identifiercase}
2584 The encodings of the constants used in the
2585 \DWATidentifiercase{} attribute are given in
2586 Table \refersec{tab:identifiercaseencodings}.
2589 \setlength{\extrarowheight}{0.1cm}
2590 \begin{longtable}{l|c}
2591 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2592 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2594 \bfseries Identifier case name&\bfseries Value\\ \hline
2596 \hline \emph{Continued on next page}
2600 \DWIDcasesensitive&0x00 \\
2602 \DWIDdowncase&0x02 \\
2603 \DWIDcaseinsensitive&0x03 \\
2607 \section{Calling Convention Encodings}
2608 \label{datarep:callingconventionencodings}
2609 The encodings of the constants used in the
2610 \DWATcallingconvention{} attribute are given in
2611 Table \refersec{tab:callingconventionencodings}.
2614 \setlength{\extrarowheight}{0.1cm}
2615 \begin{longtable}{l|c}
2616 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2617 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2619 \bfseries Calling convention name&\bfseries Value\\ \hline
2621 \hline \emph{Continued on next page}
2623 \hline \ddag\ \textit{New in DWARF Version 5}
2626 \DWCCnormal &0x01 \\
2627 \DWCCprogram&0x02 \\
2628 \DWCCnocall &0x03 \\
2629 \DWCCpassbyreference~\ddag &0x04 \\
2630 \DWCCpassbyvalue~\ddag &0x05 \\
2631 \DWCClouser &0x40 \\
2638 \section{Inline Codes}
2639 \label{datarep:inlinecodes}
2641 The encodings of the constants used in
2642 \addtoindexx{inline attribute}
2644 \DWATinline{} attribute are given in
2645 Table \refersec{tab:inlineencodings}.
2649 \setlength{\extrarowheight}{0.1cm}
2650 \begin{longtable}{l|c}
2651 \caption{Inline encodings} \label{tab:inlineencodings}\\
2652 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2654 \bfseries Inline Code name&\bfseries Value\\ \hline
2656 \hline \emph{Continued on next page}
2661 \DWINLnotinlined&0x00 \\
2662 \DWINLinlined&0x01 \\
2663 \DWINLdeclarednotinlined&0x02 \\
2664 \DWINLdeclaredinlined&0x03 \\
2669 % this clearpage is ugly, but the following table came
2670 % out oddly without it.
2672 \section{Array Ordering}
2673 \label{datarep:arrayordering}
2675 The encodings of the constants used in the
2676 \DWATordering{} attribute are given in
2677 Table \refersec{tab:orderingencodings}.
2681 \setlength{\extrarowheight}{0.1cm}
2682 \begin{longtable}{l|c}
2683 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2684 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2686 \bfseries Ordering name&\bfseries Value\\ \hline
2688 \hline \emph{Continued on next page}
2693 \DWORDrowmajor&0x00 \\
2694 \DWORDcolmajor&0x01 \\
2700 \section{Discriminant Lists}
2701 \label{datarep:discriminantlists}
2703 The descriptors used in
2704 \addtoindexx{discriminant list attribute}
2706 \DWATdiscrlist{} attribute are
2707 encoded as 1\dash byte constants. The
2708 defined values are given in
2709 Table \refersec{tab:discriminantdescriptorencodings}.
2711 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2713 \setlength{\extrarowheight}{0.1cm}
2714 \begin{longtable}{l|c}
2715 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2716 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2718 \bfseries Descriptor name&\bfseries Value\\ \hline
2720 \hline \emph{Continued on next page}
2732 \section{Name Index Table}
2733 \label{datarep:nameindextable}
2734 Each name index table in the \dotdebugnames{} section
2735 begins with a header consisting of:
2736 \begin{enumerate}[1. ]
2737 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2738 \addttindexx{unit\_length}
2739 A 4-byte or 12-byte initial length field that
2740 contains the size in bytes of this contribution to the \dotdebugnames{}
2741 section, not including the length field itself
2742 (see Section \refersec{datarep:initiallengthvalues}).
2744 \item \texttt{version} (\addtoindex{uhalf}) \\
2745 A 2-byte version number\addtoindexx{version number!name index table}
2746 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2747 This number is specific to the name index table and is
2748 independent of the DWARF version number.
2750 The value in this field is \versiondotdebugnames.
2752 \item padding (\addtoindex{uhalf}) \\
2754 \item \texttt{comp\_unit\_count} (4-byte unsigned integer) \\
2755 The number of CUs in the CU list.
2757 \item \texttt{local\_type\_unit\_count} (4-byte unsigned integer) \\
2758 The number of TUs in the first TU list.
2760 \item \texttt{foreign\_type\_unit\_count} (4-byte unsigned integer) \\
2761 The number of TUs in the second TU list.
2763 \item \texttt{bucket\_count} (4-byte unsigned integer) \\
2764 The number of hash buckets in the hash lookup table.
2765 If there is no hash lookup table, this field contains 0.
2767 \item \texttt{name\_count} (4-byte unsigned integer) \\
2768 The number of unique names in the index.
2770 \item \texttt{abbrev\_table\_size} (4-byte unsigned integer) \\
2771 The size in bytes of the abbreviations table.
2773 \item \texttt{augmentation\_string\_size} (4-byte unsigned integer) \\
2774 The size in bytes of the augmentation string. This value should be
2775 rounded up to a multiple of 4.
2777 \item \texttt{augmentation\_string} (sequence of characters) \\
2778 A vendor-specific augmentation string, which provides additional
2779 information about the contents of this index. If provided, the string
2780 should begin with a 4-byte vendor ID. The remainder of the
2781 string is meant to be read by a cooperating consumer, and its
2782 contents and interpretation are not specified here. The
2783 string should be padded with null characters to a multiple of
2784 four bytes in length.
2788 The index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
2791 \setlength{\extrarowheight}{0.1cm}
2792 \begin{longtable}{l|c|l}
2793 \caption{Index attribute encodings} \label{datarep:indexattributeencodings}\\
2794 \hline \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2796 \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2798 \hline \emph{Continued on next page}
2801 \ddag \ \textit{New in \DWARFVersionV}
2803 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
2804 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
2805 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
2806 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
2807 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
2808 \DWIDXlouser~\ddag & 0x2000 & \\
2809 \DWIDXhiuser~\ddag & \xiiifff & \\
2813 The abbreviations table ends with an entry consisting of a single 0
2814 byte for the abbreviation code. The size of the table given by
2815 \texttt{abbrev\_table\_size} may include optional padding following the
2821 \section{Address Range Table}
2822 \label{datarep:addrssrangetable}
2824 Each set of entries in the table of address ranges contained
2825 in the \dotdebugaranges{}
2826 section begins with a header containing:
2827 \begin{enumerate}[1. ]
2828 % FIXME The unit length text is not fully consistent across
2831 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2832 \addttindexx{unit\_length}
2833 A 4-byte or 12-byte length containing the length of the
2834 \addtoindexx{initial length}
2835 set of entries for this compilation unit, not including the
2836 length field itself. In the \thirtytwobitdwarfformat, this is a
2837 4-byte unsigned integer (which must be less than \xfffffffzero);
2838 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2839 \wffffffff followed by an 8-byte unsigned integer that gives
2841 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2843 \item version (\addtoindex{uhalf}) \\
2844 A 2\dash byte version identifier representing the version of the
2845 DWARF information for the address range table
2846 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2848 This value in this field \addtoindexx{version number!address range table} is 2.
2850 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2852 \addtoindexx{section offset!in .debug\_aranges header}
2853 4\dash byte or 8\dash byte offset into the
2854 \dotdebuginfo{} section of
2855 the compilation unit header. In the \thirtytwobitdwarfformat,
2856 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2857 this is an 8\dash byte unsigned offset
2858 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2860 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2861 A 1\dash byte unsigned integer containing the size in bytes of an
2862 \addttindexx{address\_size}
2864 \addtoindexx{size of an address}
2865 (or the offset portion of an address for segmented
2866 \addtoindexx{address space!segmented}
2867 addressing) on the target system.
2869 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2871 \addttindexx{segment\_size}
2872 1\dash byte unsigned integer containing the size in bytes of a
2873 segment selector on the target system.
2877 This header is followed by a series of tuples. Each tuple
2878 consists of a segment, an address and a length.
2880 size is given by the \addttindex{segment\_size} field of the header; the
2881 address and length size are each given by the \addttindex{address\_size}
2882 field of the header.
2883 The first tuple following the header in
2884 each set begins at an offset that is a multiple of the size
2885 of a single tuple (that is, the size of a segment selector
2886 plus twice the \addtoindex{size of an address}).
2887 The header is padded, if
2888 necessary, to that boundary. Each set of tuples is terminated
2889 by a 0 for the segment, a 0 for the address and 0 for the
2890 length. If the \addttindex{segment\_size} field in the header is zero,
2891 the segment selectors are omitted from all tuples, including
2892 the terminating tuple.
2895 \section{Line Number Information}
2896 \label{datarep:linenumberinformation}
2898 The \addtoindexi{version number}{version number!line number information}
2899 in the line number program header is \versiondotdebugline{}
2900 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2902 The boolean values \doublequote{true} and \doublequote{false}
2903 used by the line number information program are encoded
2904 as a single byte containing the value 0
2905 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2909 The encodings for the standard opcodes are given in
2910 \addtoindexx{line number opcodes!standard opcode encoding}
2911 Table \refersec{tab:linenumberstandardopcodeencodings}.
2913 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2915 \setlength{\extrarowheight}{0.1cm}
2916 \begin{longtable}{l|c}
2917 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2918 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2920 \bfseries Opcode name&\bfseries Value\\ \hline
2922 \hline \emph{Continued on next page}
2928 \DWLNSadvancepc&0x02 \\
2929 \DWLNSadvanceline&0x03 \\
2930 \DWLNSsetfile&0x04 \\
2931 \DWLNSsetcolumn&0x05 \\
2932 \DWLNSnegatestmt&0x06 \\
2933 \DWLNSsetbasicblock&0x07 \\
2934 \DWLNSconstaddpc&0x08 \\
2935 \DWLNSfixedadvancepc&0x09 \\
2936 \DWLNSsetprologueend&0x0a \\*
2937 \DWLNSsetepiloguebegin&0x0b \\*
2938 \DWLNSsetisa&0x0c \\*
2944 The encodings for the extended opcodes are given in
2945 \addtoindexx{line number opcodes!extended opcode encoding}
2946 Table \refersec{tab:linenumberextendedopcodeencodings}.
2949 \setlength{\extrarowheight}{0.1cm}
2950 \begin{longtable}{l|c}
2951 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2952 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2954 \bfseries Opcode name&\bfseries Value\\ \hline
2956 \hline \emph{Continued on next page}
2958 \hline %\ddag~\textit{New in DWARF Version 5}
2961 \DWLNEendsequence &0x01 \\
2962 \DWLNEsetaddress &0x02 \\
2963 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
2964 \texttt{DW\_LNE\_define\_file} operation which was defined prior to \DWARFVersionV.} \\
2965 \DWLNEsetdiscriminator &0x04 \\
2966 \DWLNElouser &0x80 \\
2967 \DWLNEhiuser &\xff \\
2974 The encodings for the line number header entry formats are given in
2975 \addtoindexx{line number opcodes!file entry format encoding}
2976 Table \refersec{tab:linenumberheaderentryformatencodings}.
2979 \setlength{\extrarowheight}{0.1cm}
2980 \begin{longtable}{l|c}
2981 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
2982 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
2984 \bfseries Line number header entry format name&\bfseries Value\\ \hline
2986 \hline \emph{Continued on next page}
2988 \hline \ddag~\textit{New in DWARF Version 5}
2990 \DWLNCTpath~\ddag & 0x1 \\
2991 \DWLNCTdirectoryindex~\ddag & 0x2 \\
2992 \DWLNCTtimestamp~\ddag & 0x3 \\
2993 \DWLNCTsize~\ddag & 0x4 \\
2994 \DWLNCTMDfive~\ddag & 0x5 \\
2995 \DWLNCTlouser~\ddag & 0x2000 \\
2996 \DWLNCThiuser~\ddag & \xiiifff \\
3000 \section{Macro Information}
3001 \label{datarep:macroinformation}
3002 The \addtoindexi{version number}{version number!macro information}
3003 in the macro information header is \versiondotdebugmacro{}
3004 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3006 The source line numbers and source file indices encoded in the
3007 macro information section are represented as
3008 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3011 The macro information entry type is encoded as a single unsigned byte.
3013 \addtoindexx{macro information entry types!encoding}
3015 Table \refersec{tab:macroinfoentrytypeencodings}.
3019 \setlength{\extrarowheight}{0.1cm}
3020 \begin{longtable}{l|c}
3021 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3022 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3024 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3026 \hline \emph{Continued on next page}
3028 \hline \ddag~\textit{New in DWARF Version 5}
3031 \DWMACROdefine~\ddag &0x01 \\
3032 \DWMACROundef~\ddag &0x02 \\
3033 \DWMACROstartfile~\ddag &0x03 \\
3034 \DWMACROendfile~\ddag &0x04 \\
3035 \DWMACROdefineindirect~\ddag &0x05 \\
3036 \DWMACROundefindirect~\ddag &0x06 \\
3037 \DWMACROtransparentinclude~\ddag &0x07 \\
3038 \DWMACROdefineindirectsup~\ddag &0x08 \\
3039 \DWMACROundefindirectsup~\ddag &0x09 \\
3040 \DWMACROtransparentincludesup~\ddag&0x0a \\
3041 \DWMACROdefineindirectx~\ddag &0x0b \\
3042 \DWMACROundefindirectx~\ddag &0x0c \\
3043 \DWMACROlouser~\ddag &0xe0 \\
3044 \DWMACROhiuser~\ddag &\xff \\
3050 \section{Call Frame Information}
3051 \label{datarep:callframeinformation}
3053 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3054 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3055 value is \xffffffffffffffff.
3057 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3058 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3060 Call frame instructions are encoded in one or more bytes. The
3061 primary opcode is encoded in the high order two bits of
3062 the first byte (that is, opcode = byte $\gg$ 6). An operand
3063 or extended opcode may be encoded in the low order 6
3064 bits. Additional operands are encoded in subsequent bytes.
3065 The instructions and their encodings are presented in
3066 Table \refersec{tab:callframeinstructionencodings}.
3069 \setlength{\extrarowheight}{0.1cm}
3070 \begin{longtable}{l|c|c|l|l}
3071 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3072 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3073 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3075 & \bfseries High 2 &\bfseries Low 6 & &\\
3076 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3078 \hline \emph{Continued on next page}
3083 \DWCFAadvanceloc&0x1&delta & \\
3084 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3085 \DWCFArestore&0x3®ister & & \\
3086 \DWCFAnop&0&0 & & \\
3087 \DWCFAsetloc&0&0x01&address & \\
3088 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
3089 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
3090 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
3091 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3092 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3093 \DWCFAundefined&0&0x07&ULEB128 register & \\
3094 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3095 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3096 \DWCFArememberstate&0&0x0a & & \\
3097 \DWCFArestorestate&0&0x0b & & \\
3098 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3099 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3100 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3101 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3102 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3104 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3105 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3106 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3107 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3108 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3109 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3110 \DWCFAlouser&0&0x1c & & \\
3111 \DWCFAhiuser&0&\xiiif & & \\
3115 \section{Non-contiguous Address Ranges}
3116 \label{datarep:noncontiguousaddressranges}
3118 Each entry in a \addtoindex{range list}
3119 (see Section \refersec{chap:noncontiguousaddressranges})
3121 \addtoindexx{base address selection entry!in range list}
3123 \addtoindexx{range list}
3124 a base address selection entry, or an end
3127 A \addtoindex{range list} entry consists of two relative addresses. The
3128 addresses are the same size as addresses on the target machine.
3131 A base address selection entry and an
3132 \addtoindexx{end of list entry!in range list}
3133 end of list entry each
3134 \addtoindexx{base address selection entry!in range list}
3135 consist of two (constant or relocated) addresses. The two
3136 addresses are the same size as addresses on the target machine.
3138 For a \addtoindex{range list} to be specified, the base address of the
3139 \addtoindexx{base address selection entry!in range list}
3140 corresponding compilation unit must be defined
3141 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
3144 \section{String Offsets Table}
3145 \label{chap:stringoffsetstable}
3146 Each set of entries in the string offsets table contained in the
3147 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3148 section begins with a header containing:
3149 \begin{enumerate}[1. ]
3150 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3151 \addttindexx{unit\_length}
3152 A 4-byte or 12-byte length containing the length of
3153 the set of entries for this compilation unit, not
3154 including the length field itself. In the 32-bit
3155 DWARF format, this is a 4-byte unsigned integer
3156 (which must be less than \xfffffffzero); in the 64-bit
3157 DWARF format, this consists of the 4-byte value
3158 \wffffffff followed by an 8-byte unsigned integer
3159 that gives the actual length (see
3160 Section \refersec{datarep:32bitand64bitdwarfformats}).
3163 \item \texttt{version} (\addtoindex{uhalf}) \\
3164 A 2-byte version identifier containing the value
3165 \versiondotdebugstroffsets{}
3166 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3168 \item \texttt{padding} (\addtoindex{uhalf}) \\
3171 This header is followed by a series of string table offsets
3172 that have the same representation as \DWFORMstrp.
3173 For the 32-bit DWARF format, each offset is 4 bytes long; for
3174 the 64-bit DWARF format, each offset is 8 bytes long.
3176 The \DWATstroffsetsbase{} attribute points to the first
3177 entry following the header. The entries are indexed
3178 sequentially from this base entry, starting from 0.
3180 \section{Address Table}
3181 \label{chap:addresstable}
3182 Each set of entries in the address table contained in the
3183 \dotdebugaddr{} section begins with a header containing:
3184 \begin{enumerate}[1. ]
3185 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3186 \addttindexx{unit\_length}
3187 A 4-byte or 12-byte length containing the length of
3188 the set of entries for this compilation unit, not
3189 including the length field itself. In the 32-bit
3190 DWARF format, this is a 4-byte unsigned integer
3191 (which must be less than \xfffffffzero); in the 64-bit
3192 DWARF format, this consists of the 4-byte value
3193 \wffffffff followed by an 8-byte unsigned integer
3194 that gives the actual length (see
3195 Section \refersec{datarep:32bitand64bitdwarfformats}).
3198 \item \texttt{version} (\addtoindex{uhalf}) \\
3199 A 2-byte version identifier containing the value
3200 \versiondotdebugaddr{}
3201 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3204 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3205 A 1-byte unsigned integer containing the size in
3206 bytes of an address (or the offset portion of an
3207 address for segmented addressing) on the target
3211 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3212 A 1-byte unsigned integer containing the size in
3213 bytes of a segment selector on the target system.
3216 This header is followed by a series of segment/address pairs.
3217 The segment size is given by the \addttindex{segment\_size} field of the
3218 header, and the address size is given by the \addttindex{address\_size}
3219 field of the header. If the \addttindex{segment\_size} field in the header
3220 is zero, the entries consist only of an addresses.
3222 The \DWATaddrbase{} attribute points to the first entry
3223 following the header. The entries are indexed sequentially
3224 from this base entry, starting from 0.
3226 \section{Range List Table}
3227 \label{app:rangelisttable}
3228 Each set of entries in the range list table contained in the
3229 \dotdebugranges{} section begins with a header containing:
3230 \begin{enumerate}[1. ]
3231 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3232 \addttindexx{unit\_length}
3233 A 4-byte or 12-byte length containing the length of
3234 the set of entries for this compilation unit, not
3235 including the length field itself. In the 32-bit
3236 DWARF format, this is a 4-byte unsigned integer
3237 (which must be less than \xfffffffzero); in the 64-bit
3238 DWARF format, this consists of the 4-byte value
3239 \wffffffff followed by an 8-byte unsigned integer
3240 that gives the actual length (see
3241 Section \refersec{datarep:32bitand64bitdwarfformats}).
3244 \item \texttt{version} (\addtoindex{uhalf}) \\
3245 A 2-byte version identifier containing the value
3246 \versiondotdebugranges{}
3247 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3250 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3251 A 1-byte unsigned integer containing the size in
3252 bytes of an address (or the offset portion of an
3253 address for segmented addressing) on the target
3257 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3258 A 1-byte unsigned integer containing the size in
3259 bytes of a segment selector on the target system.
3262 This header is followed by a series of range list entries as
3263 described in Section \refersec{chap:noncontiguousaddressranges}.
3264 The segment size is given by the
3265 \addttindex{segment\_size} field of the header, and the address size is
3266 given by the \addttindex{address\_size} field of the header. If the
3267 \addttindex{segment\_size} field in the header is zero, the segment
3268 selector is omitted from the range list entries.
3270 The \DWATrangesbase{} attribute points to the first entry
3271 following the header. The entries are referenced by a byte
3272 offset relative to this base address.
3275 \section{Location List Table}
3276 \label{datarep:locationlisttable}
3277 Each set of entries in the location list table contained in the
3278 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3279 \begin{enumerate}[1. ]
3280 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3281 \addttindexx{unit\_length}
3282 A 4-byte or 12-byte length containing the length of
3283 the set of entries for this compilation unit, not
3284 including the length field itself. In the 32-bit
3285 DWARF format, this is a 4-byte unsigned integer
3286 (which must be less than \xfffffffzero); in the 64-bit
3287 DWARF format, this consists of the 4-byte value
3288 \wffffffff followed by an 8-byte unsigned integer
3289 that gives the actual length (see
3290 Section \refersec{datarep:32bitand64bitdwarfformats}).
3293 \item \texttt{version} (\addtoindex{uhalf}) \\
3294 A 2-byte version identifier containing the value
3295 \versiondotdebugloc{}
3296 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3299 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3300 A 1-byte unsigned integer containing the size in
3301 bytes of an address (or the offset portion of an
3302 address for segmented addressing) on the target
3306 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3307 A 1-byte unsigned integer containing the size in
3308 bytes of a segment selector on the target system.
3311 This header is followed by a series of location list entries as
3312 described in Section \refersec{chap:locationlists}.
3313 The segment size is given by the
3314 \addttindex{segment\_size} field of the header, and the address size is
3315 given by the \texttt{address\_size} field of the header. If the
3316 \addttindex{segment\_size} field in the header is zero, the segment
3317 selector is omitted from the range list entries.
3319 The entries are referenced by a byte offset relative to the first
3320 location list following this header.
3323 \section{Dependencies and Constraints}
3324 \label{datarep:dependenciesandconstraints}
3325 The debugging information in this format is intended to
3327 \addtoindexx{DWARF section names!list of}
3342 \dotdebugstroffsets{}
3343 sections of an object file, or equivalent
3344 separate file or database. The information is not
3345 word\dash aligned. Consequently:
3348 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3349 32\dash bit addresses, an assembler or compiler must provide a way
3350 to produce 2\dash byte and 4\dash byte quantities without alignment
3351 restrictions, and the linker must be able to relocate a
3352 4\dash byte address or
3353 \addtoindexx{section offset!alignment of}
3354 section offset that occurs at an arbitrary
3357 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3358 64\dash bit addresses, an assembler or compiler must provide a
3359 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3360 alignment restrictions, and the linker must be able to relocate
3361 an 8\dash byte address or 4\dash byte
3362 \addtoindexx{section offset!alignment of}
3363 section offset that occurs at an
3364 arbitrary alignment.
3366 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3367 32\dash bit addresses, an assembler or compiler must provide a
3368 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3369 alignment restrictions, and the linker must be able to relocate
3370 a 4\dash byte address or 8\dash byte
3371 \addtoindexx{section offset!alignment of}
3372 section offset that occurs at an
3373 arbitrary alignment.
3375 \textit{It is expected that this will be required only for very large
3376 32\dash bit programs or by those architectures which support
3377 a mix of 32\dash bit and 64\dash bit code and data within the same
3380 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3381 64\dash bit addresses, an assembler or compiler must provide a
3382 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3383 alignment restrictions, and the linker must be able to
3384 relocate an 8\dash byte address or
3385 \addtoindexx{section offset!alignment of}
3386 section offset that occurs at
3387 an arbitrary alignment.
3391 \section{Integer Representation Names}
3392 \label{datarep:integerrepresentationnames}
3393 The sizes of the integers used in the lookup by name, lookup
3394 by address, line number and call frame information sections
3396 Table \ref{tab:integerrepresentationnames}.
3400 \setlength{\extrarowheight}{0.1cm}
3401 \begin{longtable}{c|l}
3402 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3403 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3405 \bfseries Representation name&\bfseries Representation\\ \hline
3407 \hline \emph{Continued on next page}
3412 \addtoindex{sbyte}& signed, 1\dash byte integer \\
3413 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
3414 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
3415 \addtoindex{uword}&unsigned, 4\dash byte integer \\
3421 \section{Type Signature Computation}
3422 \label{datarep:typesignaturecomputation}
3424 A type signature is computed only by the DWARF producer;
3425 \addtoindexx{type signature!computation}
3426 it is used by a DWARF consumer to resolve type references to
3427 the type definitions that are contained in
3428 \addtoindexx{type unit}
3432 The type signature for a type T0 is formed from the
3433 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3434 R.L. Rivest, RFC 1321, April 1992}
3435 hash of a flattened description of the type. The flattened
3436 description of the type is a byte sequence derived from the
3437 DWARF encoding of the type as follows:
3438 \begin{enumerate}[1. ]
3440 \item Start with an empty sequence S and a list V of visited
3441 types, where V is initialized to a list containing the type
3442 T0 as its single element. Elements in V are indexed from 1,
3445 \item If the debugging information entry represents a type that
3446 is nested inside another type or a namespace, append to S
3447 the type\textquoteright s context as follows: For each surrounding type
3448 or namespace, beginning with the outermost such construct,
3449 append the letter 'C', the DWARF tag of the construct, and
3450 the name (taken from
3451 \addtoindexx{name attribute}
3452 the \DWATname{} attribute) of the type
3453 \addtoindexx{name attribute}
3454 or namespace (including its trailing null byte).
3456 \item Append to S the letter 'D', followed by the DWARF tag of
3457 the debugging information entry.
3459 \item For each of the attributes in
3460 Table \refersec{tab:attributesusedintypesignaturecomputation}
3462 the debugging information entry, in the order listed,
3463 append to S a marker letter (see below), the DWARF attribute
3464 code, and the attribute value.
3467 \caption{Attributes used in type signature computation}
3468 \label{tab:attributesusedintypesignaturecomputation}
3469 \simplerule[\textwidth]
3471 \autocols[0pt]{c}{2}{l}{
3487 \DWATcontainingtype,
3491 \DWATdatamemberlocation,
3512 \DWATrvaluereference,
3516 \DWATstringlengthbitsize,
3517 \DWATstringlengthbytesize,
3522 \DWATvariableparameter,
3525 \DWATvtableelemlocation
3528 \simplerule[\textwidth]
3531 Note that except for the initial
3532 \DWATname{} attribute,
3533 \addtoindexx{name attribute}
3534 attributes are appended in order according to the alphabetical
3535 spelling of their identifier.
3537 If an implementation defines any vendor-specific attributes,
3538 any such attributes that are essential to the definition of
3539 the type should also be included at the end of the above list,
3540 in their own alphabetical suborder.
3542 An attribute that refers to another type entry T is processed
3543 as follows: (a) If T is in the list V at some V[x], use the
3544 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3545 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3546 as the marker, process the type T recursively by performing
3547 Steps 2 through 7, and use the result as the attribute value.
3549 Other attribute values use the letter 'A' as the marker, and
3550 the value consists of the form code (encoded as an unsigned
3551 LEB128 value) followed by the encoding of the value according
3552 to the form code. To ensure reproducibility of the signature,
3553 the set of forms used in the signature computation is limited
3562 \item If the tag in Step 3 is one of \DWTAGpointertype,
3563 \DWTAGreferencetype,
3564 \DWTAGrvaluereferencetype,
3565 \DWTAGptrtomembertype,
3566 or \DWTAGfriend, and the referenced
3567 type (via the \DWATtype{} or
3568 \DWATfriend{} attribute) has a
3569 \DWATname{} attribute, append to S the letter 'N', the DWARF
3570 attribute code (\DWATtype{} or
3571 \DWATfriend), the context of
3572 the type (according to the method in Step 2), the letter 'E',
3573 and the name of the type. For \DWTAGfriend, if the referenced
3574 entry is a \DWTAGsubprogram, the context is omitted and the
3575 name to be used is the ABI-specific name of the subprogram
3576 (for example, the mangled linker name).
3579 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3580 \DWTAGreferencetype,
3581 \DWTAGrvaluereferencetype,
3582 \DWTAGptrtomembertype, or
3583 \DWTAGfriend, but has
3584 a \DWATtype{} attribute, or if the referenced type (via
3586 \DWATfriend{} attribute) does not have a
3587 \DWATname{} attribute, the attribute is processed according to
3588 the method in Step 4 for an attribute that refers to another
3592 \item Visit each child C of the debugging information
3593 entry as follows: If C is a nested type entry or a member
3594 function entry, and has
3595 a \DWATname{} attribute, append to
3596 \addtoindexx{name attribute}
3597 S the letter 'S', the tag of C, and its name; otherwise,
3598 process C recursively by performing Steps 3 through 7,
3599 appending the result to S. Following the last child (or if
3600 there are no children), append a zero byte.
3605 For the purposes of this algorithm, if a debugging information
3607 \DWATspecification{}
3608 attribute that refers to
3609 another entry D (which has a
3612 then S inherits the attributes and children of D, and S is
3613 processed as if those attributes and children were present in
3614 the entry S. Exception: if a particular attribute is found in
3615 both S and D, the attribute in S is used and the corresponding
3616 one in D is ignored.
3619 DWARF tag and attribute codes are appended to the sequence
3620 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3621 using the values defined earlier in this chapter.
3623 \textit{A grammar describing this computation may be found in
3624 Appendix \refersec{app:typesignaturecomputationgrammar}.
3627 \textit{An attribute that refers to another type entry should
3628 be recursively processed or replaced with the name of the
3629 referent (in Step 4, 5 or 6). If neither treatment applies to
3630 an attribute that references another type entry, the entry
3631 that contains that attribute should not be considered for a
3632 separate \addtoindex{type unit}.}
3634 \textit{If a debugging information entry contains an attribute from
3635 the list above that would require an unsupported form, that
3636 entry should not be considered for a separate
3637 \addtoindex{type unit}.}
3639 \textit{A type should be considered for a separate
3640 \addtoindex{type unit} only
3641 if all of the type entries that it contains or refers to in
3642 Steps 6 and 7 can themselves each be considered for a separate
3643 \addtoindex{type unit}.}
3646 Where the DWARF producer may reasonably choose two or more
3647 different forms for a given attribute, it should choose
3648 the simplest possible form in computing the signature. (For
3649 example, a constant value should be preferred to a location
3650 expression when possible.)
3652 Once the string S has been formed from the DWARF encoding,
3653 an \MDfive{} hash is computed for the string and the
3654 least significant 64 bits are taken as the type signature.
3656 \textit{The string S is intended to be a flattened representation of
3657 the type that uniquely identifies that type (that is, a different
3658 type is highly unlikely to produce the same string).}
3661 \textit{A debugging information entry should not be placed in a
3662 separate \addtoindex{type unit}
3663 if any of the following apply:}
3667 \item \textit{The entry has an attribute whose value is a location
3668 expression, and the location expression contains a reference to
3669 another debugging information entry (for example, a \DWOPcallref{}
3670 operator), as it is unlikely that the entry will remain
3671 identical across compilation units.}
3673 \item \textit{The entry has an attribute whose value refers
3674 to a code location or a \addtoindex{location list}.}
3676 \item \textit{The entry has an attribute whose value refers
3677 to another debugging information entry that does not represent
3683 \textit{Certain attributes are not included in the type signature:}
3686 \item \textit{The \DWATdeclaration{} attribute is not included because it
3687 indicates that the debugging information entry represents an
3688 incomplete declaration, and incomplete declarations should
3690 \addtoindexx{type unit}
3691 separate type units.}
3693 \item \textit{The \DWATdescription{} attribute is not included because
3694 it does not provide any information unique to the defining
3695 declaration of the type.}
3697 \item \textit{The \DWATdeclfile,
3699 \DWATdeclcolumn{} attributes are not included because they
3700 may vary from one source file to the next, and would prevent
3701 two otherwise identical type declarations from producing the
3702 same \MDfive{} hash.}
3704 \item \textit{The \DWATobjectpointer{} attribute is not included
3705 because the information it provides is not necessary for the
3706 computation of a unique type signature.}
3710 \textit{Nested types and some types referred to by a debugging
3711 information entry are encoded by name rather than by recursively
3712 encoding the type to allow for cases where a complete definition
3713 of the type might not be available in all compilation units.}
3716 \textit{If a type definition contains the definition of a member function,
3717 it cannot be moved as is into a type unit, because the member function
3718 contains attributes that are unique to that compilation unit.
3719 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3720 moving the member function declaration into a separate declaration tree,
3721 and replacing the function definition in the type with a non-defining
3722 declaration of the function (as if the function had been defined out of
3725 An example that illustrates the computation of an \MDfive{} hash may be found in
3726 Appendix \refersec{app:usingtypeunits}.