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 \addtoindex{initial length field|see{initial length}}
109 is one of the length fields that occur at the beginning
110 of those DWARF sections that have a header
114 \dotdebugpubnames{}, and
115 \dotdebugpubtypes{}) or the length field
116 that occurs at the beginning of the CIE and FDE structures
117 in the \dotdebugframe{} section.
120 In an \addtoindex{initial length} field, the values \wfffffffzero through
121 \wffffffff are reserved by DWARF to indicate some form of
122 extension relative to \DWARFVersionII; such values must not
123 be interpreted as a length field. The use of one such value,
124 \xffffffff, is defined below
125 (see Section \refersec{datarep:32bitand64bitdwarfformats});
127 the other values is reserved for possible future extensions.
131 \section{Relocatable, Split, Executable, Shared and Package Object Files}
132 \label{datarep:executableobjectsandsharedobjects}
134 \subsection{Relocatable Objects}
135 \label{data:relocatableobjects}
136 A DWARF producer (for example, a compiler) typically generates its
137 debugging information as part of a relocatable object file.
138 Relocatable object files are then combined by a linker to form an
139 executable file. During the linking process, the linker resolves
140 (binds) symbolic references between the various object files, and
141 relocates the contents of each object file into a combined virtual
144 The DWARF debugging information is placed in several sections (see
145 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
146 requires an object file format capable of
147 representing these separate sections. There are symbolic references
148 between these sections, and also between the debugging information
149 sections and the other sections that contain the text and data of the
150 program itself. Many of these references require relocation, and the
151 producer must emit the relocation information appropriate to the
152 object file format and the target processor architecture. These
153 references include the following:
156 \item The compilation unit header (see Section
157 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
158 section contains a reference to the \dotdebugabbrev{} table. This
159 reference requires a relocation so that after linking, it refers to
160 that contribution to the combined \dotdebugabbrev{} section in the
163 \item Debugging information entries may have attributes with the form
164 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
165 These attributes represent locations
166 within the virtual address space of the program, and require
169 \item Debugging information entries may have attributes with the form
170 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
171 These attributes refer to
172 debugging information in other debugging information sections within
173 the object file, and must be relocated during the linking process.
174 Exception: attributes whose values are relative to a base offset given
175 by \DWATrangesbase{} do not need relocation.
177 \item Debugging information entries may have attributes with the form
178 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
179 \DWFORMrefudata{} (see Section \refersec{datarep:attributeencodings}).
180 These attributes refer to other
181 debugging information entries within the same compilation unit, and
182 are relative to the beginning of the current compilation unit. These
183 values do not need relocation.
185 \item Debugging information entries may have attributes with the form
186 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
187 These attributes refer to
188 debugging information entries that may be outside the current
189 compilation unit. These values require both symbolic binding and
192 \item Debugging information entries may have attributes with the form
193 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
194 These attributes refer to strings in
195 the \dotdebugstr{} section. These values require relocation.
197 \item Entries in the \dotdebugloc{}, \dotdebugranges{}, and \dotdebugaranges{}
198 sections contain references to locations within the virtual address
199 space of the program, and require relocation.
201 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
202 opcode is a reference to a location within the virtual address space
203 of the program, and requires relocation.
205 The \dotdebugstroffsets{} section contains a list of string offsets,
206 each of which is an offset of a string in the \dotdebugstr{} section. Each
207 of these offsets requires relocation. Depending on the implementation,
208 these relocations may be implicit (i.e., the producer may not need to
209 emit any explicit relocation information for these offsets).
212 \subsection{Split DWARF Objects}
213 \label{datarep:splitdwarfobjects}
214 A DWARF producer may partition the debugging
215 information such that the majority of the debugging
216 information can remain in individual object files without
217 being processed by the linker. The first partition contains
218 debugging information that must still be processed by the linker,
219 and includes the following:
222 The line number tables, range tables, frame tables, and
223 accelerated access tables, in the usual sections:
224 \dotdebugline, \dotdebuglinestr, \dotdebugranges, \dotdebugframe,
225 \dotdebugpubnames, \dotdebugpubtypes{} and \dotdebugaranges,
229 An address table, in the \dotdebugaddr{} section. This table
230 contains all addresses and constants that require
231 link-time relocation, and items in the table can be
232 referenced indirectly from the debugging information via
233 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
234 \DWOPconstx{} operators.
236 A skeleton compilation unit, as described in Section
237 \refersec{chap:skeletoncompilationunitentries},
238 in the \dotdebuginfo{} section.
240 An abbreviations table for the skeleton compilation unit,
241 in the \dotdebugabbrev{} section.
243 A string table, in the \dotdebugstr{} section. The string
244 table is necessary only if the skeleton compilation unit
245 uses either indirect string form, \DWFORMstrp{} or
248 A string offsets table, in the \dotdebugstroffsets{}
249 section. The string offsets table is necessary only if
250 the skeleton compilation unit uses the \DWFORMstrx{} form.
252 The attributes contained in the skeleton compilation
253 unit can be used by a DWARF consumer to find the object file
254 or DWARF object file that contains the second partition.
256 The second partition contains the debugging information that
257 does not need to be processed by the linker. These sections
258 may be left in the object files and ignored by the linker
259 (that is, not combined and copied to the executable object), or
260 they may be placed by the producer in a separate DWARF object
261 file. This partition includes the following:
264 The full compilation unit, in the \dotdebuginfodwo{} section.
265 Attributes in debugging information entries may refer to
266 machine addresses indirectly using the \DWFORMaddrx{} form,
267 and location expressions may do so using the \DWOPaddrx{} and
268 \DWOPconstx{} forms. Attributes may refer to range table
269 entries with an offset relative to a base offset in the
270 range table for the compilation unit.
272 \item Separate type units, in the \dotdebuginfodwo{} section.
275 Abbreviations table(s) for the compilation unit and type
276 units, in the \dotdebugabbrevdwo{} section.
278 \item Location lists, in the \dotdebuglocdwo{} section.
281 A skeleton line number table (for the type units), in the
282 \dotdebuglinedwo{} section (see
283 Section \refersec{chap:skeletoncompilationunitentries}).
285 \item Macro information, in the \dotdebugmacrodwo{} section.
287 \item A string table, in the \dotdebugstrdwo{} section.
289 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
293 Except where noted otherwise, all references in this document
294 to a debugging information section (for example, \dotdebuginfo),
295 applies also to the corresponding split DWARF section (for example,
298 \subsection{Executable Objects}
299 \label{chap:executableobjects}
300 The relocated addresses in the debugging information for an
301 executable object are virtual addresses.
303 \subsection{Shared Objects}
304 \label{datarep:sharedobjects}
306 addresses in the debugging information for a shared object
307 are offsets relative to the start of the lowest region of
308 memory loaded from that shared object.
311 \textit{This requirement makes the debugging information for
312 shared objects position independent. Virtual addresses in a
313 shared object may be calculated by adding the offset to the
314 base address at which the object was attached. This offset
315 is available in the run\dash time linker\textquoteright s data structures.}
317 \subsection{DWARF Package Files}
318 \label{datarep:dwarfpackagefiles}
319 \textit{Using split DWARF objects allows the developer to compile,
320 link, and debug an application quickly with less link-time overhead,
321 but a more convenient format is needed for saving the debug
322 information for later debugging of a deployed application. A
323 DWARF package file can be used to collect the debugging
324 information from the object (or separate DWARF object) files
325 produced during the compilation of an application.}
327 \textit{The package file is typically placed in the same directory as the
328 application, and is given the same name with a \doublequote{\texttt{.dwp}}
329 extension.\addtoindexx{\texttt{.dwp} file extension}}
331 A DWARF package file is itself an object file, using the
332 \addtoindexx{package files}
333 \addtoindexx{DWARF package files}
334 same object file format (including byte order) as the
335 corresponding application binary. It consists only of a file
336 header, section table, a number of DWARF debug information
337 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,
654 \addtoindexx{section length!in .debug\_aranges header}
656 \addtoindexx{section length!in .debug\_pubnames header}
658 \addtoindexx{section length!in .debug\_pubtypes header}
659 unsigned integer values.
663 Section &Name & Role \\ \hline
664 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
665 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
666 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
667 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
668 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
669 \dotdebugpubnames{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
670 & \addttindex{debug\_info\_length} & length of \dotdebuginfo{} \\
672 \dotdebugpubtypes{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
673 & \addttindex{debug\_info\_length} & length of \dotdebuginfo{} \\
678 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
679 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
680 union must be accessed to distinguish whether a CIE or FDE is
681 present, consequently, these two fields must exactly overlay
682 each other (both offset and size).
684 \item Within the body of the \dotdebuginfo{}
685 section, certain forms of attribute value depend on the choice
686 of DWARF format as follows. For the 32\dash bit DWARF format,
687 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
688 format, the value is a 64\dash bit unsigned integer.
690 \begin{tabular}{lp{6cm}}
691 Form & Role \\ \hline
692 \DWFORMlinestrp & offset in \dotdebuglinestr \\
693 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
694 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
695 \addtoindexx{supplementary object file}
696 \DWFORMsecoffset & offset in a section other than \\
697 & \dotdebuginfo{} or \dotdebugstr{} \\
698 \DWFORMstrp & offset in \dotdebugstr{} \\
699 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
700 \DWOPcallref & offset in \dotdebuginfo{} \\
705 \item Within the body of the \dotdebugline{} section, certain forms of content
706 description depend on the choice of DWARF format as follows: for the
707 32-bit DWARF format, the value is a 32-bit unsigned integer; for the
708 64-bit DWARF format, the value is a 64-bit unsigned integer.
710 \begin{tabular}{lp{6cm}}
711 Form & Role \\ \hline
712 \DWFORMlinestrp & offset in \dotdebuglinestr
716 \item Within the body of the \dotdebugpubnames{} and
718 sections, the representation of the first field
719 of each tuple (which represents an offset in the
721 section) depends on the DWARF format as follows: in the
722 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
723 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
726 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
727 sections, the size of entries in the body depend on the DWARF
728 format as follows: in the 32-bit DWARF format, entries are 32-bit
729 unsigned integer values; in the 64-bit DWARF format, they are
730 64-bit unsigned integers.
732 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
733 sections, the contents of the address size fields depends on the
734 DWARF format as follows: in the 32-bit DWARF format, these fields
735 contain 4; in the 64-bit DWARF format these fields contain 8.
739 The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
740 intermixed within a single compilation unit.
742 \textit{Attribute values and section header fields that represent
743 addresses in the target program are not affected by these
746 A DWARF consumer that supports the 64\dash bit DWARF format must
747 support executables in which some compilation units use the
748 32\dash bit format and others use the 64\dash bit format provided that
749 the combination links correctly (that is, provided that there
750 are no link\dash time errors due to truncation or overflow). (An
751 implementation is not required to guarantee detection and
752 reporting of all such errors.)
754 \textit{It is expected that DWARF producing compilers will \emph{not} use
755 the 64\dash bit format \emph{by default}. In most cases, the division of
756 even very large applications into a number of executable and
757 shared objects will suffice to assure that the DWARF sections
758 within each individual linked object are less than 4 GBytes
759 in size. However, for those cases where needed, the 64\dash bit
760 format allows the unusual case to be handled as well. Even
761 in this case, it is expected that only application supplied
762 objects will need to be compiled using the 64\dash bit format;
763 separate 32\dash bit format versions of system supplied shared
764 executable libraries can still be used.}
768 \section{Format of Debugging Information}
769 \label{datarep:formatofdebugginginformation}
771 For each compilation unit compiled with a DWARF producer,
772 a contribution is made to the \dotdebuginfo{} section of
773 the object file. Each such contribution consists of a
774 compilation unit header
775 (see Section \refersec{datarep:compilationunitheader})
777 single \DWTAGcompileunit{} or
778 \DWTAGpartialunit{} debugging
779 information entry, together with its children.
781 For each type defined in a compilation unit, a separate
782 contribution may also be made to the
784 section of the object file. Each
785 such contribution consists of a
786 \addtoindex{type unit} header
787 (see Section \refersec{datarep:typeunitheader})
788 followed by a \DWTAGtypeunit{} entry, together with
791 Each debugging information entry begins with a code that
792 represents an entry in a separate
793 \addtoindex{abbreviations table}. This
794 code is followed directly by a series of attribute values.
796 The appropriate entry in the
797 \addtoindex{abbreviations table} guides the
798 interpretation of the information contained directly in the
799 \dotdebuginfo{} section.
802 Multiple debugging information entries may share the same
803 abbreviation table entry. Each compilation unit is associated
804 with a particular abbreviation table, but multiple compilation
805 units may share the same table.
807 \subsection{Unit Headers}
808 \label{datarep:unitheaders}
809 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
810 compilation unit that follows. The encodings for the unit type
811 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
815 \setlength{\extrarowheight}{0.1cm}
816 \begin{longtable}{l|c}
817 \caption{Unit header unit type encodings}
818 \label{tab:unitheaderunitkindencodings}
819 \addtoindexx{unit header unit type encodings} \\
820 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
822 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
824 \hline \emph{Continued on next page}
826 \hline \ddag\ \textit{New in DWARF Version 5}
828 \DWUTcompileTARG~\ddag &0x01 \\
829 \DWUTtypeTARG~\ddag &0x02 \\
830 \DWUTpartialTARG~\ddag &0x03 \\ \hline
835 \subsubsection{Compilation Unit Header}
836 \label{datarep:compilationunitheader}
837 \begin{enumerate}[1. ]
839 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
840 \addttindexx{unit\_length}
841 A 4\dash byte or 12\dash byte
842 \addtoindexx{initial length}
843 unsigned integer representing the length
844 of the \dotdebuginfo{}
845 contribution for that compilation unit,
846 not including the length field itself. In the \thirtytwobitdwarfformat,
847 this is a 4\dash byte unsigned integer (which must be less
848 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
849 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
850 integer that gives the actual length
851 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
853 \item \texttt{version} (\addtoindex{uhalf}) \\
854 \addttindexx{version}
855 A 2\dash byte unsigned integer representing the version of the
856 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
857 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
858 The value in this field is \versiondotdebuginfo.
861 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
862 \addttindexx{unit\_type}
863 A 1-byte unsigned integer identifying this unit as a compilation unit.
864 The value of this field is
865 \DWUTcompile{} for a {normal compilation} unit or
866 \DWUTpartial{} for a {partial compilation} unit
867 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
869 \textit{This field is new in \DWARFVersionV.}
872 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
873 \addttindexx{debug\_abbrev\_offset}
875 \addtoindexx{section offset!in .debug\_info header}
876 4\dash byte or 8\dash byte unsigned offset into the
878 section. This offset associates the compilation unit with a
879 particular set of debugging information entry abbreviations. In
880 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
881 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
882 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
884 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
885 \addttindexx{address\_size}
886 A 1\dash byte unsigned integer representing the size in bytes of
887 an address on the target architecture. If the system uses
888 \addtoindexx{address space!segmented}
889 segmented addressing, this value represents the size of the
890 offset portion of an address.
894 \subsubsection{Type Unit Header}
895 \label{datarep:typeunitheader}
897 The header for the series of debugging information entries
898 contributing to the description of a type that has been
899 placed in its own \addtoindex{type unit}, within the
900 \dotdebuginfo{} section,
901 consists of the following information:
902 \begin{enumerate}[1. ]
904 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
905 \addttindexx{unit\_length}
906 A 4\dash byte or 12\dash byte unsigned integer
907 \addtoindexx{initial length}
908 representing the length
909 of the \dotdebuginfo{} contribution for that type unit,
910 not including the length field itself. In the \thirtytwobitdwarfformat,
911 this is a 4\dash byte unsigned integer (which must be
912 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
913 consists of the 4\dash byte value \wffffffff followed by an
914 8\dash byte unsigned integer that gives the actual length
915 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
918 \item \texttt{version} (\addtoindex{uhalf}) \\
919 \addttindexx{version}
920 A 2\dash byte unsigned integer representing the version of the
921 DWARF information for the
922 type unit\addtoindexx{version number!type unit}
923 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
924 The value in this field is \versiondotdebuginfo.
926 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
927 \addttindexx{unit\_type}
928 A 1-byte unsigned integer identifying this unit as a type unit.
929 The value of this field is \DWUTtype{} for a type unit
930 (see Section \refersec{chap:separatetypeunitentries}).
932 \textit{This field is new in \DWARFVersionV.}
935 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
936 \addttindexx{debug\_abbrev\_offset}
938 \addtoindexx{section offset!in .debug\_info header}
939 4\dash byte or 8\dash byte unsigned offset into the
941 section. This offset associates the type unit with a
942 particular set of debugging information entry abbreviations. In
943 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
944 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
945 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
948 \item \texttt{address\_size} (addtoindex{ubyte}) \\
949 \addttindexx{address\_size}
950 A 1\dash byte unsigned integer representing the size
951 \addtoindexx{size of an address}
953 an address on the target architecture. If the system uses
954 \addtoindexx{address space!segmented}
955 segmented addressing, this value represents the size of the
956 offset portion of an address.
958 \item \texttt{type\_signature} (8\dash byte unsigned integer) \\
959 \addttindexx{type\_signature}
960 \addtoindexx{type signature}
961 A 64\dash bit unique signature (see Section
962 \refersec{datarep:typesignaturecomputation})
963 of the type described in this type
966 \textit{An attribute that refers (using
967 \DWFORMrefsigeight{}) to
968 the primary type contained in this
969 \addtoindex{type unit} uses this value.}
971 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
972 \addttindexx{type\_offset}
973 A 4\dash byte or 8\dash byte unsigned offset
974 \addtoindexx{section offset!in .debug\_info header}
975 relative to the beginning
976 of the \addtoindex{type unit} header.
977 This offset refers to the debugging
978 information entry that describes the type. Because the type
979 may be nested inside a namespace or other structures, and may
980 contain references to other types that have not been placed in
981 separate type units, it is not necessarily either the first or
982 the only entry in the type unit. In the \thirtytwobitdwarfformat,
983 this is a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat,
984 this is an 8\dash byte unsigned length
985 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
989 \subsection{Debugging Information Entry}
990 \label{datarep:debugginginformationentry}
992 Each debugging information entry begins with an
993 unsigned LEB128\addtoindexx{LEB128!unsigned}
994 number containing the abbreviation code for the entry. This
995 code represents an entry within the abbreviations table
996 associated with the compilation unit containing this entry. The
997 abbreviation code is followed by a series of attribute values.
999 On some architectures, there are alignment constraints on
1000 section boundaries. To make it easier to pad debugging
1001 information sections to satisfy such constraints, the
1002 abbreviation code 0 is reserved. Debugging information entries
1003 consisting of only the abbreviation code 0 are considered
1006 \subsection{Abbreviations Tables}
1007 \label{datarep:abbreviationstables}
1009 The abbreviations tables for all compilation units
1010 are contained in a separate object file section called
1012 As mentioned before, multiple compilation
1013 units may share the same abbreviations table.
1015 The abbreviations table for a single compilation unit consists
1016 of a series of abbreviation declarations. Each declaration
1017 specifies the tag and attributes for a particular form of
1018 debugging information entry. Each declaration begins with
1019 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1020 number representing the abbreviation
1021 code itself. It is this code that appears at the beginning
1022 of a debugging information entry in the
1024 section. As described above, the abbreviation
1025 code 0 is reserved for null debugging information entries. The
1026 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1027 number that encodes the entry\textquoteright s tag. The encodings for the
1028 tag names are given in
1029 Table \refersec{tab:tagencodings}.
1032 \setlength{\extrarowheight}{0.1cm}
1033 \begin{longtable}{l|c}
1035 \caption{Tag encodings} \label{tab:tagencodings} \\
1036 \hline \bfseries Tag name&\bfseries Value\\ \hline
1038 \bfseries Tag name&\bfseries Value \\ \hline
1040 \hline \emph{Continued on next page}
1042 \hline \ddag\ \textit{New in DWARF Version 5}
1044 \DWTAGarraytype{} &0x01 \\
1045 \DWTAGclasstype&0x02 \\
1046 \DWTAGentrypoint&0x03 \\
1047 \DWTAGenumerationtype&0x04 \\
1048 \DWTAGformalparameter&0x05 \\
1049 \DWTAGimporteddeclaration&0x08 \\
1051 \DWTAGlexicalblock&0x0b \\
1052 \DWTAGmember&0x0d \\
1053 \DWTAGpointertype&0x0f \\
1054 \DWTAGreferencetype&0x10 \\
1055 \DWTAGcompileunit&0x11 \\
1056 \DWTAGstringtype&0x12 \\
1057 \DWTAGstructuretype&0x13 \\
1058 \DWTAGsubroutinetype&0x15 \\
1059 \DWTAGtypedef&0x16 \\
1060 \DWTAGuniontype&0x17 \\
1061 \DWTAGunspecifiedparameters&0x18 \\
1062 \DWTAGvariant&0x19 \\
1063 \DWTAGcommonblock&0x1a \\
1064 \DWTAGcommoninclusion&0x1b \\
1065 \DWTAGinheritance&0x1c \\
1066 \DWTAGinlinedsubroutine&0x1d \\
1067 \DWTAGmodule&0x1e \\
1068 \DWTAGptrtomembertype&0x1f \\
1069 \DWTAGsettype&0x20 \\
1070 \DWTAGsubrangetype&0x21 \\
1071 \DWTAGwithstmt&0x22 \\
1072 \DWTAGaccessdeclaration&0x23 \\
1073 \DWTAGbasetype&0x24 \\
1074 \DWTAGcatchblock&0x25 \\
1075 \DWTAGconsttype&0x26 \\
1076 \DWTAGconstant&0x27 \\
1077 \DWTAGenumerator&0x28 \\
1078 \DWTAGfiletype&0x29 \\
1079 \DWTAGfriend&0x2a \\
1080 \DWTAGnamelist&0x2b \\
1081 \DWTAGnamelistitem&0x2c \\
1082 \DWTAGpackedtype&0x2d \\
1083 \DWTAGsubprogram&0x2e \\
1084 \DWTAGtemplatetypeparameter&0x2f \\
1085 \DWTAGtemplatevalueparameter&0x30 \\
1086 \DWTAGthrowntype&0x31 \\
1087 \DWTAGtryblock&0x32 \\
1088 \DWTAGvariantpart&0x33 \\
1089 \DWTAGvariable&0x34 \\
1090 \DWTAGvolatiletype&0x35 \\
1091 \DWTAGdwarfprocedure&0x36 \\
1092 \DWTAGrestricttype&0x37 \\
1093 \DWTAGinterfacetype&0x38 \\
1094 \DWTAGnamespace&0x39 \\
1095 \DWTAGimportedmodule&0x3a \\
1096 \DWTAGunspecifiedtype&0x3b \\
1097 \DWTAGpartialunit&0x3c \\
1098 \DWTAGimportedunit&0x3d \\
1099 \DWTAGcondition&\xiiif \\
1100 \DWTAGsharedtype&0x40 \\
1101 \DWTAGtypeunit & 0x41 \\
1102 \DWTAGrvaluereferencetype & 0x42 \\
1103 \DWTAGtemplatealias & 0x43 \\
1104 \DWTAGcoarraytype~\ddag & 0x44 \\
1105 \DWTAGgenericsubrange~\ddag & 0x45 \\
1106 \DWTAGdynamictype~\ddag & 0x46 \\
1107 \DWTAGatomictype~\ddag & 0x47 \\
1108 \DWTAGcallsite~\ddag & 0x48 \\
1109 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1110 \DWTAGlouser&0x4080 \\
1111 \DWTAGhiuser&\xffff \\
1115 Following the tag encoding is a 1\dash byte value that determines
1116 whether a debugging information entry using this abbreviation
1117 has child entries or not. If the value is
1119 the next physically succeeding entry of any debugging
1120 information entry using this abbreviation is the first
1121 child of that entry. If the 1\dash byte value following the
1122 abbreviation\textquoteright s tag encoding is
1123 \DWCHILDRENnoTARG, the next
1124 physically succeeding entry of any debugging information entry
1125 using this abbreviation is a sibling of that entry. (Either
1126 the first child or sibling entries may be null entries). The
1127 encodings for the child determination byte are given in
1128 Table \refersec{tab:childdeterminationencodings}
1130 Section \refersec{chap:relationshipofdebugginginformationentries},
1131 each chain of sibling entries is terminated by a null entry.)
1135 \setlength{\extrarowheight}{0.1cm}
1136 \begin{longtable}{l|c}
1137 \caption{Child determination encodings}
1138 \label{tab:childdeterminationencodings}
1139 \addtoindexx{Child determination encodings} \\
1140 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1142 \bfseries Children determination name&\bfseries Value \\ \hline
1144 \hline \emph{Continued on next page}
1148 \DWCHILDRENno&0x00 \\
1149 \DWCHILDRENyes&0x01 \\ \hline
1154 Finally, the child encoding is followed by a series of
1155 attribute specifications. Each attribute specification
1156 consists of two parts. The first part is an
1157 unsigned LEB128\addtoindexx{LEB128!unsigned}
1158 number representing the attribute\textquoteright s name.
1159 The second part is an
1160 unsigned LEB128\addtoindexx{LEB128!unsigned}
1161 number representing the attribute\textquoteright s form.
1162 The series of attribute specifications ends with an
1163 entry containing 0 for the name and 0 for the form.
1166 \DWFORMindirectTARG{} is a special case. For
1167 attributes with this form, the attribute value itself in the
1169 section begins with an unsigned
1170 LEB128 number that represents its form. This allows producers
1171 to choose forms for particular attributes
1172 \addtoindexx{abbreviations table!dynamic forms in}
1174 without having to add a new entry to the abbreviations table.
1176 The abbreviations for a given compilation unit end with an
1177 entry consisting of a 0 byte for the abbreviation code.
1180 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1181 for a depiction of the organization of the
1182 debugging information.}
1185 \subsection{Attribute Encodings}
1186 \label{datarep:attributeencodings}
1188 The encodings for the attribute names are given in
1189 Table \refersec{tab:attributeencodings}.
1191 The attribute form governs how the value of the attribute is
1192 encoded. There are nine classes of form, listed below. Each
1193 class is a set of forms which have related representations
1194 and which are given a common interpretation according to the
1195 attribute in which the form is used.
1197 Form \DWFORMsecoffsetTARG{}
1199 \addtoindexx{rangelistptr class}
1201 \addtoindexx{macptr class}
1203 \addtoindexx{loclistptr class}
1205 \addtoindexx{lineptr class}
1211 \CLASSrangelistptr{} or
1212 \CLASSstroffsetsptr;
1213 the list of classes allowed by the applicable attribute in
1214 Table \refersec{tab:attributeencodings}
1215 determines the class of the form.
1219 Each possible form belongs to one or more of the following classes:
1222 \item \livelinki{chap:classaddress}{address}{address class} \\
1223 \livetarg{datarep:classaddress}{}
1224 Represented as either:
1226 \item An object of appropriate size to hold an
1227 address on the target machine
1229 The size is encoded in the compilation unit header
1230 (see Section \refersec{datarep:compilationunitheader}).
1231 This address is relocatable in a relocatable object file and
1232 is relocated in an executable file or shared object.
1234 \item An indirect index into a table of addresses (as
1235 described in the previous bullet) in the
1236 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1237 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1238 \addtoindex{LEB128} value, which is interpreted as a zero-based
1239 index into an array of addresses in the \dotdebugaddr{} section.
1240 The index is relative to the value of the \DWATaddrbase{} attribute
1241 of the associated compilation unit.
1245 \item \livelink{chap:classaddrptr}{addrptr} \\
1246 \livetarg{datarep:classaddrptr}{}
1247 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1248 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1249 beginning of the list of machine addresses information for the
1250 referencing entity. It is relocatable in
1251 a relocatable object file, and relocated in an executable or
1252 shared object. In the \thirtytwobitdwarfformat, this offset
1253 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1254 format, it is an 8\dash byte unsigned value (see Section
1255 \refersec{datarep:32bitand64bitdwarfformats}).
1257 \textit{This class is new in \DWARFVersionV.}
1260 \item \livelink{chap:classblock}{block} \\
1261 \livetarg{datarep:classblock}{}
1262 Blocks come in four forms:
1264 \begin{myindentpara}{1cm}
1265 A 1\dash byte length followed by 0 to 255 contiguous information
1266 bytes (\DWFORMblockoneTARG).
1269 \begin{myindentpara}{1cm}
1270 A 2\dash byte length followed by 0 to 65,535 contiguous information
1271 bytes (\DWFORMblocktwoTARG).
1274 \begin{myindentpara}{1cm}
1275 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
1276 information bytes (\DWFORMblockfourTARG).
1279 \begin{myindentpara}{1cm}
1280 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1281 length followed by the number of bytes
1282 specified by the length (\DWFORMblockTARG).
1285 In all forms, the length is the number of information bytes
1286 that follow. The information bytes may contain any mixture
1287 of relocated (or relocatable) addresses, references to other
1288 debugging information entries or data bytes.
1290 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1291 \livetarg{datarep:classconstant}{}
1292 There are seven forms of constants. There are fixed length
1293 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1297 \DWFORMdatafourTARG,
1298 \DWFORMdataeightTARG{} and
1299 \DWFORMdatasixteenTARG).
1300 There are also variable length constant
1301 data forms encoded using LEB128 numbers (see below). Both
1302 signed (\DWFORMsdataTARG) and unsigned
1303 (\DWFORMudataTARG) variable
1304 length constants are available
1307 The data in \DWFORMdataone,
1310 \DWFORMdataeight{} and
1311 \DWFORMdatasixteen{}
1312 can be anything. Depending on context, it may
1313 be a signed integer, an unsigned integer, a floating\dash point
1314 constant, or anything else. A consumer must use context to
1315 know how to interpret the bits, which if they are target
1316 machine data (such as an integer or floating point constant)
1317 will be in target machine byte\dash order.
1319 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1320 forms is used to represent a
1321 signed or unsigned integer, it can be hard for a consumer
1322 to discover the context necessary to determine which
1323 interpretation is intended. Producers are therefore strongly
1324 encouraged to use \DWFORMsdata{} or
1325 \DWFORMudata{} for signed and
1326 unsigned integers respectively, rather than
1327 \DWFORMdata\textless n\textgreater.}
1330 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1331 \livetarg{datarep:classexprloc}{}
1332 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1333 number of information bytes specified by the length
1334 (\DWFORMexprlocTARG).
1335 The information bytes contain a DWARF expression
1336 (see Section \refersec{chap:dwarfexpressions})
1337 or location description
1338 (see Section \refersec{chap:locationdescriptions}).
1340 \item \livelinki{chap:classflag}{flag}{flag class} \\
1341 \livetarg{datarep:classflag}{}
1342 A flag \addtoindexx{flag class}
1343 is represented explicitly as a single byte of data
1344 (\DWFORMflagTARG) or
1345 implicitly (\DWFORMflagpresentTARG).
1347 first case, if the \nolink{flag} has value zero, it indicates the
1348 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1349 it indicates the presence of the attribute. In the second
1350 case, the attribute is implicitly indicated as present, and
1351 no value is encoded in the debugging information entry itself.
1353 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1354 \livetarg{datarep:classlineptr}{}
1355 This is an offset into
1356 \addtoindexx{section offset!in class lineptr value}
1358 \dotdebugline{} or \dotdebuglinedwo{} section
1360 It consists of an offset from the beginning of the
1362 section to the first byte of
1363 the data making up the line number list for the compilation
1365 It is relocatable in a relocatable object file, and
1366 relocated in an executable or shared object. In the
1367 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1368 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1369 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1372 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1373 \livetarg{datarep:classloclistptr}{}
1374 This is an offset into the
1378 It consists of an offset from the
1379 \addtoindexx{section offset!in class loclistptr value}
1382 section to the first byte of
1383 the data making up the
1384 \addtoindex{location list} for the compilation unit.
1385 It is relocatable in a relocatable object file, and
1386 relocated in an executable or shared object. In the
1387 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1388 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1389 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1392 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1393 \livetarg{datarep:classmacptr}{}
1395 \addtoindexx{section offset!in class macptr value}
1397 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1399 It consists of an offset from the beginning of the
1400 \dotdebugmacro{} or \dotdebugmacrodwo{}
1401 section to the the header making up the
1402 macro information list for the compilation unit.
1403 It is relocatable in a relocatable object file, and
1404 relocated in an executable or shared object. In the
1405 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1406 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1407 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1410 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1411 \livetarg{datarep:classrangelistptr}{}
1413 \addtoindexx{section offset!in class rangelistptr value}
1414 offset into the \dotdebugranges{} section
1417 offset from the beginning of the
1418 \dotdebugranges{} section
1419 to the beginning of the non\dash contiguous address ranges
1420 information for the referencing entity.
1421 It is relocatable in
1422 a relocatable object file, and relocated in an executable or
1423 shared object. In the \thirtytwobitdwarfformat, this offset
1424 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1425 format, it is an 8\dash byte unsigned value (see Section
1426 \refersec{datarep:32bitand64bitdwarfformats}).
1429 \textit{Because classes
1434 \CLASSrangelistptr{} and
1435 \CLASSstroffsetsptr{}
1436 share a common representation, it is not possible for an
1437 attribute to allow more than one of these classes}
1441 \item \livelinki{chap:classreference}{reference}{reference class} \\
1442 \livetarg{datarep:classreference}{}
1443 There are four types of reference.
1446 \addtoindexx{reference class}
1447 first type of reference can identify any debugging
1448 information entry within the containing unit.
1451 \addtoindexx{section offset!in class reference value}
1452 offset from the first byte of the compilation
1453 header for the compilation unit containing the reference. There
1454 are five forms for this type of reference. There are fixed
1455 length forms for one, two, four and eight byte offsets
1461 and \DWFORMrefeightTARG).
1462 There is also an unsigned variable
1463 length offset encoded form that uses
1464 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1465 (\DWFORMrefudataTARG).
1466 Because this type of reference is within
1467 the containing compilation unit no relocation of the value
1470 The second type of reference can identify any debugging
1471 information entry within a
1472 \dotdebuginfo{} section; in particular,
1473 it may refer to an entry in a different compilation unit
1474 from the unit containing the reference, and may refer to an
1475 entry in a different shared object. This type of reference
1476 (\DWFORMrefaddrTARG)
1477 is an offset from the beginning of the
1479 section of the target executable or shared object, or, for
1480 references within a \addtoindex{supplementary object file},
1481 an offset from the beginning of the local \dotdebuginfo{} section;
1482 it is relocatable in a relocatable object file and frequently
1483 relocated in an executable file or shared object. For
1484 references from one shared object or static executable file
1485 to another, the relocation and identification of the target
1486 object must be performed by the consumer. In the
1487 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1488 in the \sixtyfourbitdwarfformat, it is an 8\dash byte
1490 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1492 \textit{A debugging information entry that may be referenced by
1493 another compilation unit using
1494 \DWFORMrefaddr{} must have a global symbolic name.}
1496 \textit{For a reference from one executable or shared object to
1497 another, the reference is resolved by the debugger to identify
1498 the shared object or executable and the offset into that
1499 object\textquoteright s \dotdebuginfo{}
1500 section in the same fashion as the run
1501 time loader, either when the debug information is first read,
1502 or when the reference is used.}
1504 The third type of reference can identify any debugging
1505 information type entry that has been placed in its own
1506 \addtoindex{type unit}. This type of
1507 reference (\DWFORMrefsigeightTARG) is the
1508 \addtoindexx{type signature}
1509 64\dash bit type signature
1510 (see Section \refersec{datarep:typesignaturecomputation})
1511 that was computed for the type.
1513 The fourth type of reference is a reference from within the
1514 \dotdebuginfo{} section of the executable or shared object to
1515 a debugging information entry in the \dotdebuginfo{} section of
1516 a \addtoindex{supplementary object file}.
1517 This type of reference (\DWFORMrefsupTARG) is an offset from the
1518 beginning of the \dotdebuginfo{} section in the supplementary
1521 \textit{The use of compilation unit relative references will reduce the
1522 number of link\dash time relocations and so speed up linking. The
1523 use of the second, third and fourth type of reference allows for the
1524 sharing of information, such as types, across compilation
1525 units, while the fourth type further allows for sharing of information
1526 across compilation units from different executables or shared objects.}
1528 \textit{A reference to any kind of compilation unit identifies the
1529 debugging information entry for that unit, not the preceding
1533 \item \livelinki{chap:classstring}{string}{string class} \\
1534 \livetarg{datarep:classstring}{}
1535 A string is a sequence of contiguous non\dash null bytes followed by
1537 \addtoindexx{string class}
1538 A string may be represented:
1540 \setlength{\itemsep}{0em}
1541 \item immediately in the debugging information entry itself
1542 (\DWFORMstringTARG),
1545 \addtoindexx{section offset!in class string value}
1546 offset into a string table contained in
1547 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
1548 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
1549 or as an offset into a string table contained in the
1550 \dotdebugstr{} section of a \addtoindex{supplementary object file}
1551 (\DWFORMstrpsupTARG). \DWFORMstrpNAME{} offsets from the \dotdebuginfo{}
1552 section of a \addtoindex{supplementary object file}
1553 refer to the local \dotdebugstr{} section of that same file.
1554 In the \thirtytwobitdwarfformat, the representation of a
1556 value is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
1557 it is an 8\dash byte unsigned offset
1558 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1560 \item as an indirect offset into the string table using an
1561 index into a table of offsets contained in the
1562 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1563 The representation of a \DWFORMstrxNAME{} value is an unsigned
1564 \addtoindex{LEB128} value, which is interpreted as a zero-based
1565 index into an array of offsets in the \dotdebugstroffsets{} section.
1566 The offset entries in the \dotdebugstroffsets{} section have the
1567 same representation as \DWFORMstrp{} values.
1569 Any combination of these three forms may be used within a single compilation.
1571 If the \DWATuseUTFeight{}
1572 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1573 compilation, partial, skeleton or type unit entry, string values are encoded using the
1574 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1575 Character Set standard (ISO/IEC 10646\dash 1:1993).
1576 \addtoindexx{ISO 10646 character set standard}
1577 Otherwise, the string representation is unspecified.
1579 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1580 ISO/IEC 10646\dash 1:1993.
1581 \addtoindexx{ISO 10646 character set standard}
1582 It contains all the same characters
1583 and encoding points as ISO/IEC 10646, as well as additional
1584 information about the characters and their use.}
1586 \textit{Earlier versions of DWARF did not specify the representation
1587 of strings; for compatibility, this version also does
1588 not. However, the UTF\dash 8 representation is strongly recommended.}
1591 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1592 \livetarg{datarep:classstroffsetsptr}{}
1593 This is an offset into the \dotdebugstroffsets{} section
1594 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1595 \dotdebugstroffsets{} section to the
1596 beginning of the string offsets information for the
1597 referencing entity. It is relocatable in
1598 a relocatable object file, and relocated in an executable or
1599 shared object. In the \thirtytwobitdwarfformat, this offset
1600 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1601 format, it is an 8\dash byte unsigned value (see Section
1602 \refersec{datarep:32bitand64bitdwarfformats}).
1604 \textit{This class is new in \DWARFVersionV.}
1608 In no case does an attribute use one of the classes
1613 \CLASSrangelistptr{} or
1614 \CLASSstroffsetsptr{}
1615 to point into either the
1616 \dotdebuginfo{} or \dotdebugstr{} section.
1618 The form encodings are listed in
1619 Table \refersec{tab:attributeformencodings}.
1623 \setlength{\extrarowheight}{0.1cm}
1624 \begin{longtable}{l|c|l}
1625 \caption{Attribute encodings}
1626 \label{tab:attributeencodings}
1627 \addtoindexx{attribute encodings} \\
1628 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1630 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1632 \hline \emph{Continued on next page}
1634 \hline \ddag\ \textit{New in DWARF Version 5}
1636 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1637 \addtoindexx{sibling attribute} \\
1638 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1639 \livelink{chap:classloclistptr}{loclistptr}
1640 \addtoindexx{location attribute} \\
1641 \DWATname&0x03&\livelink{chap:classstring}{string}
1642 \addtoindexx{name attribute} \\
1643 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1644 \addtoindexx{ordering attribute} \\
1645 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1646 \livelink{chap:classexprloc}{exprloc},
1647 \livelink{chap:classreference}{reference}
1648 \addtoindexx{byte size attribute} \\
1649 \DWATbitoffset&0x0c&\livelink{chap:classconstant}{constant},
1650 \livelink{chap:classexprloc}{exprloc},
1651 \livelink{chap:classreference}{reference}
1652 \addtoindexx{bit offset attribute (Version 3)} \\
1653 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1654 \livelink{chap:classexprloc}{exprloc},
1655 \livelink{chap:classreference}{reference}
1656 \addtoindexx{bit size attribute} \\
1657 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1658 \addtoindexx{statement list attribute} \\
1659 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1660 \addtoindexx{low PC attribute} \\
1661 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1662 \livelink{chap:classconstant}{constant}
1663 \addtoindexx{high PC attribute} \\
1664 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1665 \addtoindexx{language attribute} \\
1666 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1667 \addtoindexx{discriminant attribute} \\
1668 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1669 \addtoindexx{discriminant value attribute} \\
1670 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1671 \addtoindexx{visibility attribute} \\
1672 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1673 \addtoindexx{import attribute} \\
1674 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1675 \livelink{chap:classloclistptr}{loclistptr}
1676 \addtoindexx{string length attribute} \\
1677 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1678 \addtoindexx{common reference attribute} \\
1679 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1680 \addtoindexx{compilation directory attribute} \\
1681 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1682 \livelink{chap:classconstant}{constant},
1683 \livelink{chap:classstring}{string}
1684 \addtoindexx{constant value attribute} \\
1685 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1686 \addtoindexx{containing type attribute} \\
1687 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1688 \livelink{chap:classreference}{reference},
1689 \livelink{chap:classflag}{flag}
1690 \addtoindexx{default value attribute} \\
1691 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1692 \addtoindexx{inline attribute} \\
1693 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1694 \addtoindexx{is optional attribute} \\
1695 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1696 \livelink{chap:classexprloc}{exprloc},
1697 \livelink{chap:classreference}{reference}
1698 \addtoindexx{lower bound attribute} \\
1699 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1700 \addtoindexx{producer attribute} \\
1701 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1702 \addtoindexx{prototyped attribute} \\
1703 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1704 \livelink{chap:classloclistptr}{loclistptr}
1705 \addtoindexx{return address attribute} \\
1706 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1707 \livelink{chap:classrangelistptr}{rangelistptr}
1708 \addtoindexx{start scope attribute} \\
1709 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1710 \livelink{chap:classexprloc}{exprloc},
1711 \livelink{chap:classreference}{reference}
1712 \addtoindexx{bit stride attribute} \\
1713 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1714 \livelink{chap:classexprloc}{exprloc},
1715 \livelink{chap:classreference}{reference}
1716 \addtoindexx{upper bound attribute} \\
1717 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1718 \addtoindexx{abstract origin attribute} \\
1719 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1720 \addtoindexx{accessibility attribute} \\
1721 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1722 \addtoindexx{address class attribute} \\
1723 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1724 \addtoindexx{artificial attribute} \\
1725 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1726 \addtoindexx{base types attribute} \\
1727 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1728 \addtoindexx{calling convention attribute} \\
1729 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1730 \livelink{chap:classexprloc}{exprloc},
1731 \livelink{chap:classreference}{reference}
1732 \addtoindexx{count attribute} \\
1733 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1734 \livelink{chap:classexprloc}{exprloc},
1735 \livelink{chap:classloclistptr}{loclistptr}
1736 \addtoindexx{data member attribute} \\
1737 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1738 \addtoindexx{declaration column attribute} \\
1739 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1740 \addtoindexx{declaration file attribute} \\
1741 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1742 \addtoindexx{declaration line attribute} \\
1743 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1744 \addtoindexx{declaration attribute} \\
1745 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1746 \addtoindexx{discriminant list attribute} \\
1747 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1748 \addtoindexx{encoding attribute} \\
1749 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1750 \addtoindexx{external attribute} \\
1751 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1752 \livelink{chap:classloclistptr}{loclistptr}
1753 \addtoindexx{frame base attribute} \\
1754 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1755 \addtoindexx{friend attribute} \\
1756 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1757 \addtoindexx{identifier case attribute} \\
1758 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1759 Reserved for compatibility and coexistence
1760 with prior DWARF versions.}
1761 &0x43&\livelink{chap:classmacptr}{macptr}
1762 \addtoindexx{macro information attribute (legacy)!encoding} \\
1763 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1764 \addtoindexx{name list item attribute} \\
1765 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1766 \addtoindexx{priority attribute} \\
1767 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1768 \livelink{chap:classloclistptr}{loclistptr}
1769 \addtoindexx{segment attribute} \\
1770 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1771 \addtoindexx{specification attribute} \\
1772 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1773 \livelink{chap:classloclistptr}{loclistptr}
1774 \addtoindexx{static link attribute} \\
1775 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1776 \addtoindexx{type attribute} \\
1777 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1778 \livelink{chap:classloclistptr}{loclistptr}
1779 \addtoindexx{location list attribute} \\
1780 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1781 \addtoindexx{variable parameter attribute} \\
1782 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1783 \addtoindexx{virtuality attribute} \\
1784 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1785 \livelink{chap:classloclistptr}{loclistptr}
1786 \addtoindexx{vtable element location attribute} \\
1787 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1788 \livelink{chap:classexprloc}{exprloc},
1789 \livelink{chap:classreference}{reference}
1790 \addtoindexx{allocated attribute} \\
1791 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1792 \livelink{chap:classexprloc}{exprloc},
1793 \livelink{chap:classreference}{reference}
1794 \addtoindexx{associated attribute} \\
1795 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1796 \addtoindexx{data location attribute} \\
1797 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1798 \livelink{chap:classexprloc}{exprloc},
1799 \livelink{chap:classreference}{reference}
1800 \addtoindexx{byte stride attribute} \\
1801 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1802 \livelink{chap:classconstant}{constant}
1803 \addtoindexx{entry pc attribute} \\
1804 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1805 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1806 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1807 \addtoindexx{extension attribute} \\
1808 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1809 \addtoindexx{ranges attribute} \\
1810 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1811 \livelink{chap:classflag}{flag},
1812 \livelink{chap:classreference}{reference},
1813 \livelink{chap:classstring}{string}
1814 \addtoindexx{trampoline attribute} \\
1815 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1816 \addtoindexx{call column attribute} \\
1817 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1818 \addtoindexx{call file attribute} \\
1819 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1820 \addtoindexx{call line attribute} \\
1821 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1822 \addtoindexx{description attribute} \\
1823 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1824 \addtoindexx{binary scale attribute} \\
1825 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1826 \addtoindexx{decimal scale attribute} \\
1827 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1828 \addtoindexx{small attribute} \\
1829 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1830 \addtoindexx{decimal scale attribute} \\
1831 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1832 \addtoindexx{digit count attribute} \\
1833 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1834 \addtoindexx{picture string attribute} \\
1835 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1836 \addtoindexx{mutable attribute} \\
1837 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1838 \addtoindexx{thread scaled attribute} \\
1839 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1840 \addtoindexx{explicit attribute} \\
1841 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1842 \addtoindexx{object pointer attribute} \\
1843 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1844 \addtoindexx{endianity attribute} \\
1845 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1846 \addtoindexx{elemental attribute} \\
1847 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1848 \addtoindexx{pure attribute} \\
1849 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1850 \addtoindexx{recursive attribute} \\
1851 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1852 \addtoindexx{signature attribute} \\
1853 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1854 \addtoindexx{main subprogram attribute} \\
1855 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1856 \addtoindexx{data bit offset attribute} \\
1857 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1858 \addtoindexx{constant expression attribute} \\
1859 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1860 \addtoindexx{enumeration class attribute} \\
1861 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1862 \addtoindexx{linkage name attribute} \\
1863 \DWATstringlengthbitsize{}~\ddag&0x6f&
1864 \livelink{chap:classconstant}{constant}
1865 \addtoindexx{string length attribute!size of length} \\
1866 \DWATstringlengthbytesize{}~\ddag&0x70&
1867 \livelink{chap:classconstant}{constant}
1868 \addtoindexx{string length attribute!size of length} \\
1869 \DWATrank~\ddag&0x71&
1870 \livelink{chap:classconstant}{constant},
1871 \livelink{chap:classexprloc}{exprloc}
1872 \addtoindexx{rank attribute} \\
1873 \DWATstroffsetsbase~\ddag&0x72&
1874 \livelinki{chap:classstring}{stroffsetsptr}{stroffsetsptr class}
1875 \addtoindexx{string offsets base!encoding} \\
1876 \DWATaddrbase~\ddag &0x73&
1877 \livelinki{chap:DWATaddrbase}{addrptr}{addrptr class}
1878 \addtoindexx{address table base!encoding} \\
1879 \DWATrangesbase~\ddag&0x74&
1880 \livelinki{chap:DWATrangesbase}{rangelistptr}{rangelistptr class}
1881 \addtoindexx{ranges base!encoding} \\
1882 \DWATdwoid~\ddag &0x75&
1883 \livelink{chap:DWATdwoid}{constant}
1884 \addtoindexx{split DWARF object id!encoding} \\
1885 \DWATdwoname~\ddag &0x76&
1886 \livelink{chap:DWATdwoname}{string}
1887 \addtoindexx{split DWARF object file name!encoding} \\
1888 \DWATreference~\ddag &0x77&
1889 \livelink{chap:DWATreference}{flag} \\
1890 \DWATrvaluereference~\ddag &0x78&
1891 \livelink{chap:DWATrvaluereference}{flag} \\
1892 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1893 \addtoindexx{macro information attribute} \\
1894 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1895 \addtoindexx{all calls summary attribute} \\
1896 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1897 \addtoindexx{all source calls summary attribute} \\
1898 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1899 \addtoindexx{all tail calls summary attribute} \\
1900 \DWATcalldatalocation~\ddag &0x7d &\CLASSexprloc
1901 \addtoindexx{call data location attribute} \\
1902 \DWATcalldatavalue~\ddag &0x7e &\CLASSexprloc
1903 \addtoindexx{call data value attribute} \\
1904 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1905 \addtoindexx{call origin attribute} \\
1906 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1907 \addtoindexx{call parameter attribute} \\
1908 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1909 \addtoindexx{call pc attribute} \\
1910 \DWATcallreturnpc~\ddag &0x82 &\CLASSaddress
1911 \addtoindexx{call return pc attribute} \\
1912 \DWATcalltailcall~\ddag &0x83 &\CLASSflag
1913 \addtoindexx{call tail call attribute} \\
1914 \DWATcalltarget~\ddag &0x84 &\CLASSexprloc
1915 \addtoindexx{call target attribute} \\
1916 \DWATcalltargetclobbered~\ddag &0x85 &\CLASSexprloc
1917 \addtoindexx{call target clobbered attribute} \\
1918 \DWATcallvalue~\ddag &0x86 &\CLASSexprloc
1919 \addtoindexx{call value attribute} \\
1920 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1921 \addtoindexx{noreturn attribute} \\
1922 \DWATalignment~\ddag &0x88 &\CLASSconstant
1923 \addtoindexx{alignment attribute} \\
1924 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1925 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1932 \setlength{\extrarowheight}{0.1cm}
1933 \begin{longtable}{l|c|l}
1934 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1935 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1937 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1939 \hline \emph{Continued on next page}
1941 \hline \ddag\ \textit{New in DWARF Version 5}
1944 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1945 \textit{Reserved} &0x02& \\
1946 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1947 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1948 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1949 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1950 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1951 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1952 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1953 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1954 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1955 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1956 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1957 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1958 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1959 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1960 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1961 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1962 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1963 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
1964 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
1965 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1966 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
1967 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
1968 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
1969 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
1970 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
1971 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
1972 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
1973 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
1974 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
1975 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
1982 \section{Variable Length Data}
1983 \label{datarep:variablelengthdata}
1984 \addtoindexx{variable length data|see {LEB128}}
1986 \addtoindexx{Little Endian Base 128|see{LEB128}}
1987 encoded using \doublequote{Little Endian Base 128}
1988 \addtoindexx{little-endian encoding|see{endian attribute}}
1990 \addtoindexx{LEB128}
1991 LEB128 is a scheme for encoding integers
1992 densely that exploits the assumption that most integers are
1995 \textit{This encoding is equally suitable whether the target machine
1996 architecture represents data in big\dash\ endian or little\dash endian
1997 order. It is \doublequote{little\dash endian} only in the sense that it
1998 avoids using space to represent the \doublequote{big} end of an
1999 unsigned integer, when the big end is all zeroes or sign
2002 Unsigned LEB128\addtoindexx{LEB128!unsigned} (ULEB128) numbers are encoded as follows:
2003 \addtoindexx{LEB128!unsigned, encoding as}
2004 start at the low order end of an unsigned integer and chop
2005 it into 7\dash bit chunks. Place each chunk into the low order 7
2006 bits of a byte. Typically, several of the high order bytes
2007 will be zero; discard them. Emit the remaining bytes in a
2008 stream, starting with the low order byte; set the high order
2009 bit on each byte except the last emitted byte. The high bit
2010 of zero on the last byte indicates to the decoder that it
2011 has encountered the last byte.
2013 The integer zero is a special case, consisting of a single
2016 Table \refersec{tab:examplesofunsignedleb128encodings}
2017 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2019 0x80 in each case is the high order bit of the byte, indicating
2020 that an additional byte follows.
2023 The encoding for signed, two\textquoteright s complement LEB128 (SLEB128)
2024 \addtoindexx{LEB128!signed, encoding as}
2025 numbers is similar, except that the criterion for discarding
2026 high order bytes is not whether they are zero, but whether
2027 they consist entirely of sign extension bits. Consider the
2028 32\dash bit integer -2. The three high level bytes of the number
2029 are sign extension, thus LEB128 would represent it as a single
2030 byte containing the low order 7 bits, with the high order
2031 bit cleared to indicate the end of the byte stream. Note
2032 that there is nothing within the LEB128 representation that
2033 indicates whether an encoded number is signed or unsigned. The
2034 decoder must know what type of number to expect.
2035 Table \refersec{tab:examplesofunsignedleb128encodings}
2036 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2037 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2038 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2041 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2042 \addtoindexx{LEB128!examples}
2043 gives algorithms for encoding and decoding these forms.}
2047 \setlength{\extrarowheight}{0.1cm}
2048 \begin{longtable}{c|c|c}
2049 \caption{Examples of unsigned LEB128 encodings}
2050 \label{tab:examplesofunsignedleb128encodings}
2051 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2052 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2054 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2056 \hline \emph{Continued on next page}
2062 128& 0 + 0x80 & 1 \\
2063 129& 1 + 0x80 & 1 \\
2064 %130& 2 + 0x80 & 1 \\
2065 12857& 57 + 0x80 & 100 \\
2072 \setlength{\extrarowheight}{0.1cm}
2073 \begin{longtable}{c|c|c}
2074 \caption{Examples of signed LEB128 encodings}
2075 \label{tab:examplesofsignedleb128encodings}
2076 \addtoindexx{LEB128!signed} \\
2077 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2079 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2081 \hline \emph{Continued on next page}
2087 127& 127 + 0x80 & 0 \\
2088 -127& 1 + 0x80 & 0x7f \\
2089 128& 0 + 0x80 & 1 \\
2090 -128& 0 + 0x80 & 0x7f \\
2091 129& 1 + 0x80 & 1 \\
2092 -129& 0x7f + 0x80 & 0x7e \\
2099 \section{DWARF Expressions and Location Descriptions}
2100 \label{datarep:dwarfexpressionsandlocationdescriptions}
2101 \subsection{DWARF Expressions}
2102 \label{datarep:dwarfexpressions}
2105 \addtoindexx{DWARF expression!operator encoding}
2106 DWARF expression is stored in a \nolink{block} of contiguous
2107 bytes. The bytes form a sequence of operations. Each operation
2108 is a 1\dash byte code that identifies that operation, followed by
2109 zero or more bytes of additional data. The encodings for the
2110 operations are described in
2111 Table \refersec{tab:dwarfoperationencodings}.
2114 \setlength{\extrarowheight}{0.1cm}
2115 \begin{longtable}{l|c|c|l}
2116 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2117 \hline & &\bfseries No. of &\\
2118 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2120 & &\bfseries No. of &\\
2121 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2123 \hline \emph{Continued on next page}
2125 \hline \ddag\ \textit{New in DWARF Version 5}
2128 \DWOPaddr&0x03&1 & constant address \\
2129 & & &(size is target specific) \\
2131 \DWOPderef&0x06&0 & \\
2133 \DWOPconstoneu&0x08&1&1\dash byte constant \\
2134 \DWOPconstones&0x09&1&1\dash byte constant \\
2135 \DWOPconsttwou&0x0a&1&2\dash byte constant \\
2136 \DWOPconsttwos&0x0b&1&2\dash byte constant \\
2137 \DWOPconstfouru&0x0c&1&4\dash byte constant \\
2138 \DWOPconstfours&0x0d&1&4\dash byte constant \\
2139 \DWOPconsteightu&0x0e&1&8\dash byte constant \\
2140 \DWOPconsteights&0x0f&1&8\dash byte constant \\
2141 \DWOPconstu&0x10&1&ULEB128 constant \\
2142 \DWOPconsts&0x11&1&SLEB128 constant \\
2143 \DWOPdup&0x12&0 & \\
2144 \DWOPdrop&0x13&0 & \\
2145 \DWOPover&0x14&0 & \\
2146 \DWOPpick&0x15&1&1\dash byte stack index \\
2147 \DWOPswap&0x16&0 & \\
2148 \DWOProt&0x17&0 & \\
2149 \DWOPxderef&0x18&0 & \\
2150 \DWOPabs&0x19&0 & \\
2151 \DWOPand&0x1a&0 & \\
2152 \DWOPdiv&0x1b&0 & \\
2153 \DWOPminus&0x1c&0 & \\
2154 \DWOPmod&0x1d&0 & \\
2155 \DWOPmul&0x1e&0 & \\
2156 \DWOPneg&0x1f&0 & \\
2157 \DWOPnot&0x20&0 & \\
2159 \DWOPplus&0x22&0 & \\
2160 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2161 \DWOPshl&0x24&0 & \\
2162 \DWOPshr&0x25&0 & \\
2163 \DWOPshra&0x26&0 & \\
2164 \DWOPxor&0x27&0 & \\
2166 \DWOPbra&0x28&1 & signed 2\dash byte constant \\
2173 \DWOPskip&0x2f&1&signed 2\dash byte constant \\ \hline
2175 \DWOPlitzero & 0x30 & 0 & \\
2176 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2177 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2178 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2180 \DWOPregzero & 0x50 & 0 & \\*
2181 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2182 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2183 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2185 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2186 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2187 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2188 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2190 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2191 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2192 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2193 & & &SLEB128 offset \\
2194 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2195 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2196 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2197 \DWOPnop{} & 0x96 &0& \\
2199 \DWOPpushobjectaddress&0x97&0 & \\
2200 \DWOPcalltwo&0x98&1& 2\dash byte offset of DIE \\
2201 \DWOPcallfour&0x99&1& 4\dash byte offset of DIE \\
2202 \DWOPcallref&0x9a&1& 4\dash\ or 8\dash byte offset of DIE \\
2203 \DWOPformtlsaddress&0x9b &0& \\
2204 \DWOPcallframecfa{} &0x9c &0& \\
2205 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2207 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2208 &&&\nolink{block} of that size\\
2209 \DWOPstackvalue{} &0x9f &0& \\
2210 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2211 &&&SLEB128 constant offset \\
2212 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2213 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2214 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2215 &&&\nolink{block} of that size\\
2216 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2217 & & & 1-byte size, \\*
2218 & & & constant value \\
2219 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2220 &&& ULEB128 constant offset \\
2221 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2222 &&& ULEB128 type entry offset \\
2223 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2224 &&& ULEB128 type entry offset \\
2225 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2226 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2227 \DWOPlouser{} &0xe0 && \\
2228 \DWOPhiuser{} &\xff && \\
2234 \subsection{Location Descriptions}
2235 \label{datarep:locationdescriptions}
2237 A location description is used to compute the
2238 location of a variable or other entity.
2240 \subsection{Location Lists}
2241 \label{datarep:locationlists}
2243 Each entry in a \addtoindex{location list} is either a location list entry,
2244 a base address selection entry, or an
2245 \addtoindexx{end of list entry!in location list}
2249 \subsubsection{Location List Entries in Non-Split Objects}
2250 A \addtoindex{location list} entry consists of two address offsets followed
2251 by an unsigned 2\dash byte length, followed by a block of contiguous bytes
2252 that contains a DWARF location description. The length
2253 specifies the number of bytes in that block. The two offsets
2254 are the same size as an address on the target machine.
2257 A base address selection entry and an
2258 \addtoindexx{end of list entry!in location list}
2259 end of list entry each
2260 consist of two (constant or relocated) address offsets. The two
2261 offsets are the same size as an address on the target machine.
2263 For a \addtoindex{location list} to be specified, the base address of
2264 \addtoindexx{base address selection entry!in location list}
2265 the corresponding compilation unit must be defined
2266 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2268 \subsubsection{Location List Entries in Split Objects}
2269 An alternate form for location list entries is used in split objects.
2270 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2271 that follows. The encodings for these constants are given in
2272 Table \refersec{tab:locationlistentryencodingvalues}.
2275 \setlength{\extrarowheight}{0.1cm}
2276 \begin{longtable}{l|c}
2277 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2278 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2280 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2282 \hline \emph{Continued on next page}
2286 \DWLLEendoflistentry & 0x0 \\
2287 \DWLLEbaseaddressselectionentry & 0x01 \\
2288 \DWLLEstartendentry & 0x02 \\
2289 \DWLLEstartlengthentry & 0x03 \\
2290 \DWLLEoffsetpairentry & 0x04 \\
2294 \section{Base Type Attribute Encodings}
2295 \label{datarep:basetypeattributeencodings}
2297 The encodings of the
2298 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2300 \addtoindexx{encoding attribute}
2303 attribute are given in
2304 Table \refersec{tab:basetypeencodingvalues}
2307 \setlength{\extrarowheight}{0.1cm}
2308 \begin{longtable}{l|c}
2309 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2310 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2312 \bfseries Base type encoding name&\bfseries Value\\ \hline
2314 \hline \emph{Continued on next page}
2317 \ddag \ \textit{New in \DWARFVersionV}
2319 \DWATEaddress&0x01 \\
2320 \DWATEboolean&0x02 \\
2321 \DWATEcomplexfloat&0x03 \\
2323 \DWATEsigned&0x05 \\
2324 \DWATEsignedchar&0x06 \\
2325 \DWATEunsigned&0x07 \\
2326 \DWATEunsignedchar&0x08 \\
2327 \DWATEimaginaryfloat&0x09 \\
2328 \DWATEpackeddecimal&0x0a \\
2329 \DWATEnumericstring&0x0b \\
2330 \DWATEedited&0x0c \\
2331 \DWATEsignedfixed&0x0d \\
2332 \DWATEunsignedfixed&0x0e \\
2333 \DWATEdecimalfloat & 0x0f \\
2334 \DWATEUTF{} & 0x10 \\
2335 \DWATEUCS~\ddag & 0x11 \\
2336 \DWATEASCII~\ddag & 0x12 \\
2337 \DWATElouser{} & 0x80 \\
2338 \DWATEhiuser{} & \xff \\
2343 The encodings of the constants used in the
2344 \DWATdecimalsign{} attribute
2346 Table \refersec{tab:decimalsignencodings}.
2349 \setlength{\extrarowheight}{0.1cm}
2350 \begin{longtable}{l|c}
2351 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2352 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2354 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2356 \hline \emph{Continued on next page}
2361 \DWDSunsigned{} & 0x01 \\
2362 \DWDSleadingoverpunch{} & 0x02 \\
2363 \DWDStrailingoverpunch{} & 0x03 \\
2364 \DWDSleadingseparate{} & 0x04 \\
2365 \DWDStrailingseparate{} & 0x05 \\
2371 The encodings of the constants used in the
2372 \DWATendianity{} attribute are given in
2373 Table \refersec{tab:endianityencodings}.
2376 \setlength{\extrarowheight}{0.1cm}
2377 \begin{longtable}{l|c}
2378 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2379 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2381 \bfseries Endian code name&\bfseries Value\\ \hline
2383 \hline \emph{Continued on next page}
2388 \DWENDdefault{} & 0x00 \\
2389 \DWENDbig{} & 0x01 \\
2390 \DWENDlittle{} & 0x02 \\
2391 \DWENDlouser{} & 0x40 \\
2392 \DWENDhiuser{} & \xff \\
2397 \section{Accessibility Codes}
2398 \label{datarep:accessibilitycodes}
2399 The encodings of the constants used in the
2400 \DWATaccessibility{}
2402 \addtoindexx{accessibility attribute}
2404 Table \refersec{tab:accessibilityencodings}.
2407 \setlength{\extrarowheight}{0.1cm}
2408 \begin{longtable}{l|c}
2409 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2410 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2412 \bfseries Accessibility code name&\bfseries Value\\ \hline
2414 \hline \emph{Continued on next page}
2419 \DWACCESSpublic&0x01 \\
2420 \DWACCESSprotected&0x02 \\
2421 \DWACCESSprivate&0x03 \\
2427 \section{Visibility Codes}
2428 \label{datarep:visibilitycodes}
2429 The encodings of the constants used in the
2430 \DWATvisibility{} attribute are given in
2431 Table \refersec{tab:visibilityencodings}.
2434 \setlength{\extrarowheight}{0.1cm}
2435 \begin{longtable}{l|c}
2436 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2437 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2439 \bfseries Visibility code name&\bfseries Value\\ \hline
2441 \hline \emph{Continued on next page}
2447 \DWVISexported&0x02 \\
2448 \DWVISqualified&0x03 \\
2453 \section{Virtuality Codes}
2454 \label{datarep:vitualitycodes}
2456 The encodings of the constants used in the
2457 \DWATvirtuality{} attribute are given in
2458 Table \refersec{tab:virtualityencodings}.
2461 \setlength{\extrarowheight}{0.1cm}
2462 \begin{longtable}{l|c}
2463 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2464 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2466 \bfseries Virtuality code name&\bfseries Value\\ \hline
2468 \hline \emph{Continued on next page}
2473 \DWVIRTUALITYnone&0x00 \\
2474 \DWVIRTUALITYvirtual&0x01 \\
2475 \DWVIRTUALITYpurevirtual&0x02 \\
2483 \DWVIRTUALITYnone{} is equivalent to the absence of the
2487 \section{Source Languages}
2488 \label{datarep:sourcelanguages}
2490 The encodings of the constants used
2491 \addtoindexx{language attribute, encoding}
2493 \addtoindexx{language name encoding}
2496 attribute are given in
2497 Table \refersec{tab:languageencodings}.
2499 % If we don't force a following space it looks odd
2501 and their associated values are reserved, but the
2502 languages they represent are not well supported.
2503 Table \refersec{tab:languageencodings}
2505 \addtoindexx{lower bound attribute!default}
2506 default lower bound, if any, assumed for
2507 an omitted \DWATlowerbound{} attribute in the context of a
2508 \DWTAGsubrangetype{} debugging information entry for each
2512 \setlength{\extrarowheight}{0.1cm}
2513 \begin{longtable}{l|c|c}
2514 \caption{Language encodings} \label{tab:languageencodings}\\
2515 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2517 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2519 \hline \emph{Continued on next page}
2522 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2524 \addtoindexx{ISO-defined language names}
2526 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2527 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2528 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2529 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2530 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2531 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2532 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2533 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2534 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2535 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2536 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2537 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2538 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2539 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2540 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2541 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2542 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2543 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2544 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2545 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2546 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2547 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2548 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2549 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2550 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2551 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2552 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2553 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2554 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2555 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2556 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2557 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2558 \DWLANGCplusplusfourteen{} \ddag &0x0021 &0 \addtoindexx{C++:2014 (ISO)}\\
2559 \DWLANGlouser{} &0x8000 & \\
2560 \DWLANGhiuser{} &\xffff & \\
2565 \section{Address Class Encodings}
2566 \label{datarep:addressclassencodings}
2568 The value of the common
2569 \addtoindex{address class} encoding
2573 \section{Identifier Case}
2574 \label{datarep:identifiercase}
2576 The encodings of the constants used in the
2577 \DWATidentifiercase{} attribute are given in
2578 Table \refersec{tab:identifiercaseencodings}.
2581 \setlength{\extrarowheight}{0.1cm}
2582 \begin{longtable}{l|c}
2583 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2584 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2586 \bfseries Identifier case name&\bfseries Value\\ \hline
2588 \hline \emph{Continued on next page}
2592 \DWIDcasesensitive&0x00 \\
2594 \DWIDdowncase&0x02 \\
2595 \DWIDcaseinsensitive&0x03 \\
2599 \section{Calling Convention Encodings}
2600 \label{datarep:callingconventionencodings}
2601 The encodings of the constants used in the
2602 \DWATcallingconvention{} attribute are given in
2603 Table \refersec{tab:callingconventionencodings}.
2606 \setlength{\extrarowheight}{0.1cm}
2607 \begin{longtable}{l|c}
2608 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2609 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2611 \bfseries Calling convention name&\bfseries Value\\ \hline
2613 \hline \emph{Continued on next page}
2619 \DWCCprogram&0x02 \\
2628 \section{Inline Codes}
2629 \label{datarep:inlinecodes}
2631 The encodings of the constants used in
2632 \addtoindexx{inline attribute}
2634 \DWATinline{} attribute are given in
2635 Table \refersec{tab:inlineencodings}.
2639 \setlength{\extrarowheight}{0.1cm}
2640 \begin{longtable}{l|c}
2641 \caption{Inline encodings} \label{tab:inlineencodings}\\
2642 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2644 \bfseries Inline Code name&\bfseries Value\\ \hline
2646 \hline \emph{Continued on next page}
2651 \DWINLnotinlined&0x00 \\
2652 \DWINLinlined&0x01 \\
2653 \DWINLdeclarednotinlined&0x02 \\
2654 \DWINLdeclaredinlined&0x03 \\
2659 % this clearpage is ugly, but the following table came
2660 % out oddly without it.
2662 \section{Array Ordering}
2663 \label{datarep:arrayordering}
2665 The encodings of the constants used in the
2666 \DWATordering{} attribute are given in
2667 Table \refersec{tab:orderingencodings}.
2671 \setlength{\extrarowheight}{0.1cm}
2672 \begin{longtable}{l|c}
2673 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2674 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2676 \bfseries Ordering name&\bfseries Value\\ \hline
2678 \hline \emph{Continued on next page}
2683 \DWORDrowmajor&0x00 \\
2684 \DWORDcolmajor&0x01 \\
2690 \section{Discriminant Lists}
2691 \label{datarep:discriminantlists}
2693 The descriptors used in
2694 \addtoindexx{discriminant list attribute}
2696 \DWATdiscrlist{} attribute are
2697 encoded as 1\dash byte constants. The
2698 defined values are given in
2699 Table \refersec{tab:discriminantdescriptorencodings}.
2701 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2703 \setlength{\extrarowheight}{0.1cm}
2704 \begin{longtable}{l|c}
2705 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2706 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2708 \bfseries Descriptor name&\bfseries Value\\ \hline
2710 \hline \emph{Continued on next page}
2722 \section{Name Lookup Tables}
2723 \label{datarep:namelookuptables}
2725 Each set of entries in the table of global names contained
2726 in the \dotdebugpubnames{} and
2727 \dotdebugpubtypes{} sections begins
2728 with a header consisting of:
2729 \begin{enumerate}[1. ]
2731 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2732 \addttindexx{unit\_length}
2733 A 4\dash byte or 12\dash byte unsigned integer
2734 \addtoindexx{initial length}
2735 representing the length
2736 of the \dotdebuginfo{}
2737 contribution for that compilation unit,
2738 not including the length field itself. In the
2739 \thirtytwobitdwarfformat, this is a 4\dash byte unsigned integer (which must be less
2740 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
2741 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
2742 integer that gives the actual length
2743 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2745 \item version (\addtoindex{uhalf}) \\
2746 A 2\dash byte unsigned integer representing the version of the
2747 DWARF information for the name lookup table
2748 \addtoindexx{version number!name lookup table}
2749 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2750 The value in this field is 2.
2753 \item \addttindex{debug\_info\_offset} (section offset) \\
2755 \addtoindexx{section offset!in name lookup table set of entries}
2756 4\dash byte or 8\dash byte
2758 \dotdebuginfo{} or \dotdebuginfodwo{}
2759 section of the compilation unit header.
2760 In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned offset;
2761 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned offsets
2762 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2764 \item \addttindex{debug\_info\_length} (\livelink{datarep:sectionoffsetlength}{section length}) \\
2765 \addtoindexx{section length!in .debug\_pubnames header}
2767 \addtoindexx{section length!in .debug\_pubtypes header}
2768 4\dash byte or 8\dash byte length containing the size in bytes of the
2769 contents of the \dotdebuginfo{}
2770 section generated to represent
2771 this compilation unit. In the \thirtytwobitdwarfformat, this is
2772 a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat, this
2773 is an 8-byte unsigned length
2774 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2779 This header is followed by a series of tuples. Each tuple
2780 consists of a 4\dash byte or 8\dash byte offset followed by a string
2781 of non\dash null bytes terminated by one null byte.
2783 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2784 format, it is an 8\dash byte offset.
2785 Each set is terminated by an
2786 offset containing the value 0.
2790 \section{Address Range Table}
2791 \label{datarep:addrssrangetable}
2793 Each set of entries in the table of address ranges contained
2794 in the \dotdebugaranges{}
2795 section begins with a header containing:
2796 \begin{enumerate}[1. ]
2797 % FIXME The unit length text is not fully consistent across
2800 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2801 \addttindexx{unit\_length}
2802 A 4-byte or 12-byte length containing the length of the
2803 \addtoindexx{initial length}
2804 set of entries for this compilation unit, not including the
2805 length field itself. In the \thirtytwobitdwarfformat, this is a
2806 4-byte unsigned integer (which must be less than \xfffffffzero);
2807 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2808 \wffffffff followed by an 8-byte unsigned integer that gives
2810 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2812 \item version (\addtoindex{uhalf}) \\
2813 A 2\dash byte version identifier representing the version of the
2814 DWARF information for the address range table
2815 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2816 This value in this field \addtoindexx{version number!address range table} is 2.
2819 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2821 \addtoindexx{section offset!in .debug\_aranges header}
2822 4\dash byte or 8\dash byte offset into the
2823 \dotdebuginfo{} section of
2824 the compilation unit header. In the \thirtytwobitdwarfformat,
2825 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2826 this is an 8\dash byte unsigned offset
2827 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2829 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2830 A 1\dash byte unsigned integer containing the size in bytes of an
2831 \addttindexx{address\_size}
2833 \addtoindexx{size of an address}
2834 (or the offset portion of an address for segmented
2835 \addtoindexx{address space!segmented}
2836 addressing) on the target system.
2838 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2840 \addttindexx{segment\_size}
2841 1\dash byte unsigned integer containing the size in bytes of a
2842 segment selector on the target system.
2846 This header is followed by a series of tuples. Each tuple
2847 consists of a segment, an address and a length.
2849 size is given by the \addttindex{segment\_size} field of the header; the
2850 address and length size are each given by the \addttindex{address\_size}
2851 field of the header.
2852 The first tuple following the header in
2853 each set begins at an offset that is a multiple of the size
2854 of a single tuple (that is, the size of a segment selector
2855 plus twice the \addtoindex{size of an address}).
2856 The header is padded, if
2857 necessary, to that boundary. Each set of tuples is terminated
2858 by a 0 for the segment, a 0 for the address and 0 for the
2859 length. If the \addttindex{segment\_size} field in the header is zero,
2860 the segment selectors are omitted from all tuples, including
2861 the terminating tuple.
2864 \section{Line Number Information}
2865 \label{datarep:linenumberinformation}
2867 The \addtoindexi{version number}{version number!line number information}
2868 in the line number program header is \versiondotdebugline{}
2869 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2871 The boolean values \doublequote{true} and \doublequote{false}
2872 used by the line number information program are encoded
2873 as a single byte containing the value 0
2874 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2876 The encodings for the standard opcodes are given in
2877 \addtoindexx{line number opcodes!standard opcode encoding}
2878 Table \refersec{tab:linenumberstandardopcodeencodings}.
2880 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2882 \setlength{\extrarowheight}{0.1cm}
2883 \begin{longtable}{l|c}
2884 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2885 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2887 \bfseries Opcode name&\bfseries Value\\ \hline
2889 \hline \emph{Continued on next page}
2895 \DWLNSadvancepc&0x02 \\
2896 \DWLNSadvanceline&0x03 \\
2897 \DWLNSsetfile&0x04 \\
2898 \DWLNSsetcolumn&0x05 \\
2899 \DWLNSnegatestmt&0x06 \\
2900 \DWLNSsetbasicblock&0x07 \\
2901 \DWLNSconstaddpc&0x08 \\
2902 \DWLNSfixedadvancepc&0x09 \\
2903 \DWLNSsetprologueend&0x0a \\*
2904 \DWLNSsetepiloguebegin&0x0b \\*
2905 \DWLNSsetisa&0x0c \\*
2912 The encodings for the extended opcodes are given in
2913 \addtoindexx{line number opcodes!extended opcode encoding}
2914 Table \refersec{tab:linenumberextendedopcodeencodings}.
2918 \setlength{\extrarowheight}{0.1cm}
2919 \begin{longtable}{l|c}
2920 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2921 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2923 \bfseries Opcode name&\bfseries Value\\ \hline
2925 \hline \emph{Continued on next page}
2927 \hline %\ddag~\textit{New in DWARF Version 5}
2930 \DWLNEendsequence &0x01 \\
2931 \DWLNEsetaddress &0x02 \\
2932 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
2933 \texttt{DW\_LNE\_define\_file} operation which was defined prior to \DWARFVersionV.} \\
2934 \DWLNEsetdiscriminator &0x04 \\
2935 \DWLNElouser &0x80 \\
2936 \DWLNEhiuser &\xff \\
2942 The encodings for the line number header entry formats are given in
2943 \addtoindexx{line number opcodes!file entry format encoding}
2944 Table \refersec{tab:linenumberheaderentryformatencodings}.
2947 \setlength{\extrarowheight}{0.1cm}
2948 \begin{longtable}{l|c}
2949 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
2950 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
2952 \bfseries Line number header entry format name&\bfseries Value\\ \hline
2954 \hline \emph{Continued on next page}
2956 \hline \ddag~\textit{New in DWARF Version 5}
2958 \DWLNCTpath~\ddag & 0x1 \\
2959 \DWLNCTdirectoryindex~\ddag & 0x2 \\
2960 \DWLNCTtimestamp~\ddag & 0x3 \\
2961 \DWLNCTsize~\ddag & 0x4 \\
2962 \DWLNCTMDfive~\ddag & 0x5 \\
2963 \DWLNCTlouser~\ddag & 0x2000 \\
2964 \DWLNCThiuser~\ddag & \xiiifff \\
2968 \section{Macro Information}
2969 \label{datarep:macroinformation}
2970 The \addtoindexi{version number}{version number!macro information}
2971 in the macro information header is \versiondotdebugmacro{}
2972 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2974 The source line numbers and source file indices encoded in the
2975 macro information section are represented as
2976 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
2979 The macro information entry type is encoded as a single unsigned byte.
2981 \addtoindexx{macro information entry types!encoding}
2983 Table \refersec{tab:macroinfoentrytypeencodings}.
2987 \setlength{\extrarowheight}{0.1cm}
2988 \begin{longtable}{l|c}
2989 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
2990 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
2992 \bfseries Macro information entry type name&\bfseries Value\\ \hline
2994 \hline \emph{Continued on next page}
2996 \hline \ddag~\textit{New in DWARF Version 5}
2999 \DWMACROdefine~\ddag &0x01 \\
3000 \DWMACROundef~\ddag &0x02 \\
3001 \DWMACROstartfile~\ddag &0x03 \\
3002 \DWMACROendfile~\ddag &0x04 \\
3003 \DWMACROdefineindirect~\ddag &0x05 \\
3004 \DWMACROundefindirect~\ddag &0x06 \\
3005 \DWMACROtransparentinclude~\ddag &0x07 \\
3006 \DWMACROdefineindirectsup~\ddag &0x08 \\
3007 \DWMACROundefindirectsup~\ddag &0x09 \\
3008 \DWMACROtransparentincludesup~\ddag&0x0a \\
3009 \DWMACROdefineindirectx~\ddag &0x0b \\
3010 \DWMACROundefindirectx~\ddag &0x0c \\
3011 \DWMACROlouser~\ddag &0xe0 \\
3012 \DWMACROhiuser~\ddag &\xff \\
3018 \section{Call Frame Information}
3019 \label{datarep:callframeinformation}
3021 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3022 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3023 value is \xffffffffffffffff.
3025 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3026 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3028 Call frame instructions are encoded in one or more bytes. The
3029 primary opcode is encoded in the high order two bits of
3030 the first byte (that is, opcode = byte $\gg$ 6). An operand
3031 or extended opcode may be encoded in the low order 6
3032 bits. Additional operands are encoded in subsequent bytes.
3033 The instructions and their encodings are presented in
3034 Table \refersec{tab:callframeinstructionencodings}.
3037 \setlength{\extrarowheight}{0.1cm}
3038 \begin{longtable}{l|c|c|l|l}
3039 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3040 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3041 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3043 & \bfseries High 2 &\bfseries Low 6 & &\\
3044 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3046 \hline \emph{Continued on next page}
3051 \DWCFAadvanceloc&0x1&delta & \\
3052 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3053 \DWCFArestore&0x3®ister & & \\
3054 \DWCFAnop&0&0 & & \\
3055 \DWCFAsetloc&0&0x01&address & \\
3056 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
3057 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
3058 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
3059 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3060 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3061 \DWCFAundefined&0&0x07&ULEB128 register & \\
3062 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3063 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3064 \DWCFArememberstate&0&0x0a & & \\
3065 \DWCFArestorestate&0&0x0b & & \\
3066 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3067 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3068 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3069 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3070 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3072 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3073 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3074 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3075 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3076 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3077 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3078 \DWCFAlouser&0&0x1c & & \\
3079 \DWCFAhiuser&0&\xiiif & & \\
3083 \section{Non-contiguous Address Ranges}
3084 \label{datarep:noncontiguousaddressranges}
3086 Each entry in a \addtoindex{range list}
3087 (see Section \refersec{chap:noncontiguousaddressranges})
3089 \addtoindexx{base address selection entry!in range list}
3091 \addtoindexx{range list}
3092 a base address selection entry, or an end
3095 A \addtoindex{range list} entry consists of two relative addresses. The
3096 addresses are the same size as addresses on the target machine.
3099 A base address selection entry and an
3100 \addtoindexx{end of list entry!in range list}
3101 end of list entry each
3102 \addtoindexx{base address selection entry!in range list}
3103 consist of two (constant or relocated) addresses. The two
3104 addresses are the same size as addresses on the target machine.
3106 For a \addtoindex{range list} to be specified, the base address of the
3107 \addtoindexx{base address selection entry!in range list}
3108 corresponding compilation unit must be defined
3109 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
3112 \section{String Offsets Table}
3113 \label{chap:stringoffsetstable}
3114 Each set of entries in the string offsets table contained in the
3115 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3116 section begins with a header containing:
3117 \begin{enumerate}[1. ]
3118 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3119 \addttindexx{unit\_length}
3120 A 4-byte or 12-byte length containing the length of
3121 the set of entries for this compilation unit, not
3122 including the length field itself. In the 32-bit
3123 DWARF format, this is a 4-byte unsigned integer
3124 (which must be less than \xfffffffzero); in the 64-bit
3125 DWARF format, this consists of the 4-byte value
3126 \wffffffff followed by an 8-byte unsigned integer
3127 that gives the actual length (see
3128 Section \refersec{datarep:32bitand64bitdwarfformats}).
3131 \item \texttt{version} (\addtoindex{uhalf}) \\
3132 A 2-byte version identifier containing the value
3133 \versiondotdebugstroffsets{}
3134 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3136 \item \texttt{padding} (\addtoindex{uhalf}) \\
3139 This header is followed by a series of string table offsets
3140 that have the same representation as \DWFORMstrp.
3141 For the 32-bit DWARF format, each offset is 4 bytes long; for
3142 the 64-bit DWARF format, each offset is 8 bytes long.
3144 The \DWATstroffsetsbase{} attribute points to the first
3145 entry following the header. The entries are indexed
3146 sequentially from this base entry, starting from 0.
3148 \section{Address Table}
3149 \label{chap:addresstable}
3150 Each set of entries in the address table contained in the
3151 \dotdebugaddr{} section begins with a header containing:
3152 \begin{enumerate}[1. ]
3153 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3154 \addttindexx{unit\_length}
3155 A 4-byte or 12-byte length containing the length of
3156 the set of entries for this compilation unit, not
3157 including the length field itself. In the 32-bit
3158 DWARF format, this is a 4-byte unsigned integer
3159 (which must be less than \xfffffffzero); in the 64-bit
3160 DWARF format, this consists of the 4-byte value
3161 \wffffffff followed by an 8-byte unsigned integer
3162 that gives the actual length (see
3163 Section \refersec{datarep:32bitand64bitdwarfformats}).
3166 \item \texttt{version} (\addtoindex{uhalf}) \\
3167 A 2-byte version identifier containing the value
3168 \versiondotdebugaddr{}
3169 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3172 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3173 A 1-byte unsigned integer containing the size in
3174 bytes of an address (or the offset portion of an
3175 address for segmented addressing) on the target
3179 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3180 A 1-byte unsigned integer containing the size in
3181 bytes of a segment selector on the target system.
3184 This header is followed by a series of segment/address pairs.
3185 The segment size is given by the \addttindex{segment\_size} field of the
3186 header, and the address size is given by the \addttindex{address\_size}
3187 field of the header. If the \addttindex{segment\_size} field in the header
3188 is zero, the entries consist only of an addresses.
3190 The \DWATaddrbase{} attribute points to the first entry
3191 following the header. The entries are indexed sequentially
3192 from this base entry, starting from 0.
3194 \section{Range List Table}
3195 \label{app:rangelisttable}
3196 Each set of entries in the range list table contained in the
3197 \dotdebugranges{} section begins with a header containing:
3198 \begin{enumerate}[1. ]
3199 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3200 \addttindexx{unit\_length}
3201 A 4-byte or 12-byte length containing the length of
3202 the set of entries for this compilation unit, not
3203 including the length field itself. In the 32-bit
3204 DWARF format, this is a 4-byte unsigned integer
3205 (which must be less than \xfffffffzero); in the 64-bit
3206 DWARF format, this consists of the 4-byte value
3207 \wffffffff followed by an 8-byte unsigned integer
3208 that gives the actual length (see
3209 Section \refersec{datarep:32bitand64bitdwarfformats}).
3212 \item \texttt{version} (\addtoindex{uhalf}) \\
3213 A 2-byte version identifier containing the value
3214 \versiondotdebugranges{}
3215 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3218 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3219 A 1-byte unsigned integer containing the size in
3220 bytes of an address (or the offset portion of an
3221 address for segmented addressing) on the target
3225 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3226 A 1-byte unsigned integer containing the size in
3227 bytes of a segment selector on the target system.
3230 This header is followed by a series of range list entries as
3231 described in Section \refersec{chap:noncontiguousaddressranges}.
3232 The segment size is given by the
3233 \addttindex{segment\_size} field of the header, and the address size is
3234 given by the \addttindex{address\_size} field of the header. If the
3235 \addttindex{segment\_size} field in the header is zero, the segment
3236 selector is omitted from the range list entries.
3238 The \DWATrangesbase{} attribute points to the first entry
3239 following the header. The entries are referenced by a byte
3240 offset relative to this base address.
3243 \section{Location List Table}
3244 \label{datarep:locationlisttable}
3245 Each set of entries in the location list table contained in the
3246 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3247 \begin{enumerate}[1. ]
3248 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3249 \addttindexx{unit\_length}
3250 A 4-byte or 12-byte length containing the length of
3251 the set of entries for this compilation unit, not
3252 including the length field itself. In the 32-bit
3253 DWARF format, this is a 4-byte unsigned integer
3254 (which must be less than \xfffffffzero); in the 64-bit
3255 DWARF format, this consists of the 4-byte value
3256 \wffffffff followed by an 8-byte unsigned integer
3257 that gives the actual length (see
3258 Section \refersec{datarep:32bitand64bitdwarfformats}).
3261 \item \texttt{version} (\addtoindex{uhalf}) \\
3262 A 2-byte version identifier containing the value
3263 \versiondotdebugloc{}
3264 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3267 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3268 A 1-byte unsigned integer containing the size in
3269 bytes of an address (or the offset portion of an
3270 address for segmented addressing) on the target
3274 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3275 A 1-byte unsigned integer containing the size in
3276 bytes of a segment selector on the target system.
3279 This header is followed by a series of location list entries as
3280 described in Section \refersec{chap:locationlists}.
3281 The segment size is given by the
3282 \addttindex{segment\_size} field of the header, and the address size is
3283 given by the \texttt{address\_size} field of the header. If the
3284 \addttindex{segment\_size} field in the header is zero, the segment
3285 selector is omitted from the range list entries.
3287 The entries are referenced by a byte offset relative to the first
3288 location list following this header.
3291 \section{Dependencies and Constraints}
3292 \label{datarep:dependenciesandconstraints}
3293 The debugging information in this format is intended to
3295 \addtoindexx{DWARF section names!list of}
3306 \dotdebugpubnames{},
3307 \dotdebugpubtypes{},
3311 \dotdebugstroffsets{}
3312 sections of an object file, or equivalent
3313 separate file or database. The information is not
3314 word\dash aligned. Consequently:
3317 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3318 32\dash bit addresses, an assembler or compiler must provide a way
3319 to produce 2\dash byte and 4\dash byte quantities without alignment
3320 restrictions, and the linker must be able to relocate a
3321 4\dash byte address or
3322 \addtoindexx{section offset!alignment of}
3323 section offset that occurs at an arbitrary
3326 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3327 64\dash bit addresses, an assembler or compiler must provide a
3328 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3329 alignment restrictions, and the linker must be able to relocate
3330 an 8\dash byte address or 4\dash byte
3331 \addtoindexx{section offset!alignment of}
3332 section offset that occurs at an
3333 arbitrary alignment.
3335 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3336 32\dash bit addresses, an assembler or compiler must provide a
3337 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3338 alignment restrictions, and the linker must be able to relocate
3339 a 4\dash byte address or 8\dash byte
3340 \addtoindexx{section offset!alignment of}
3341 section offset that occurs at an
3342 arbitrary alignment.
3344 \textit{It is expected that this will be required only for very large
3345 32\dash bit programs or by those architectures which support
3346 a mix of 32\dash bit and 64\dash bit code and data within the same
3349 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3350 64\dash bit addresses, an assembler or compiler must provide a
3351 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3352 alignment restrictions, and the linker must be able to
3353 relocate an 8\dash byte address or
3354 \addtoindexx{section offset!alignment of}
3355 section offset that occurs at
3356 an arbitrary alignment.
3360 \section{Integer Representation Names}
3361 \label{datarep:integerrepresentationnames}
3362 The sizes of the integers used in the lookup by name, lookup
3363 by address, line number and call frame information sections
3365 Table \ref{tab:integerrepresentationnames}.
3369 \setlength{\extrarowheight}{0.1cm}
3370 \begin{longtable}{c|l}
3371 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3372 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3374 \bfseries Representation name&\bfseries Representation\\ \hline
3376 \hline \emph{Continued on next page}
3381 \addtoindex{sbyte}& signed, 1\dash byte integer \\
3382 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
3383 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
3384 \addtoindex{uword}&unsigned, 4\dash byte integer \\
3390 \section{Type Signature Computation}
3391 \label{datarep:typesignaturecomputation}
3393 A type signature is computed only by the DWARF producer;
3394 \addtoindexx{type signature!computation}
3395 it is used by a DWARF consumer to resolve type references to
3396 the type definitions that are contained in
3397 \addtoindexx{type unit}
3401 The type signature for a type T0 is formed from the
3402 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3403 R.L. Rivest, RFC 1321, April 1992}
3404 hash of a flattened description of the type. The flattened
3405 description of the type is a byte sequence derived from the
3406 DWARF encoding of the type as follows:
3407 \begin{enumerate}[1. ]
3409 \item Start with an empty sequence S and a list V of visited
3410 types, where V is initialized to a list containing the type
3411 T0 as its single element. Elements in V are indexed from 1,
3414 \item If the debugging information entry represents a type that
3415 is nested inside another type or a namespace, append to S
3416 the type\textquoteright s context as follows: For each surrounding type
3417 or namespace, beginning with the outermost such construct,
3418 append the letter 'C', the DWARF tag of the construct, and
3419 the name (taken from
3420 \addtoindexx{name attribute}
3421 the \DWATname{} attribute) of the type
3422 \addtoindexx{name attribute}
3423 or namespace (including its trailing null byte).
3425 \item Append to S the letter 'D', followed by the DWARF tag of
3426 the debugging information entry.
3428 \item For each of the attributes in
3429 Table \refersec{tab:attributesusedintypesignaturecomputation}
3431 the debugging information entry, in the order listed,
3432 append to S a marker letter (see below), the DWARF attribute
3433 code, and the attribute value.
3436 \caption{Attributes used in type signature computation}
3437 \label{tab:attributesusedintypesignaturecomputation}
3438 \simplerule[\textwidth]
3440 \autocols[0pt]{c}{2}{l}{
3456 \DWATcontainingtype,
3460 \DWATdatamemberlocation,
3481 \DWATrvaluereference,
3485 \DWATstringlengthbitsize,
3486 \DWATstringlengthbytesize,
3491 \DWATvariableparameter,
3494 \DWATvtableelemlocation
3497 \simplerule[\textwidth]
3500 Note that except for the initial
3501 \DWATname{} attribute,
3502 \addtoindexx{name attribute}
3503 attributes are appended in order according to the alphabetical
3504 spelling of their identifier.
3506 If an implementation defines any vendor-specific attributes,
3507 any such attributes that are essential to the definition of
3508 the type should also be included at the end of the above list,
3509 in their own alphabetical suborder.
3511 An attribute that refers to another type entry T is processed
3512 as follows: (a) If T is in the list V at some V[x], use the
3513 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3514 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3515 as the marker, process the type T recursively by performing
3516 Steps 2 through 7, and use the result as the attribute value.
3518 Other attribute values use the letter 'A' as the marker, and
3519 the value consists of the form code (encoded as an unsigned
3520 LEB128 value) followed by the encoding of the value according
3521 to the form code. To ensure reproducibility of the signature,
3522 the set of forms used in the signature computation is limited
3531 \item If the tag in Step 3 is one of \DWTAGpointertype,
3532 \DWTAGreferencetype,
3533 \DWTAGrvaluereferencetype,
3534 \DWTAGptrtomembertype,
3535 or \DWTAGfriend, and the referenced
3536 type (via the \DWATtype{} or
3537 \DWATfriend{} attribute) has a
3538 \DWATname{} attribute, append to S the letter 'N', the DWARF
3539 attribute code (\DWATtype{} or
3540 \DWATfriend), the context of
3541 the type (according to the method in Step 2), the letter 'E',
3542 and the name of the type. For \DWTAGfriend, if the referenced
3543 entry is a \DWTAGsubprogram, the context is omitted and the
3544 name to be used is the ABI-specific name of the subprogram
3545 (for example, the mangled linker name).
3548 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3549 \DWTAGreferencetype,
3550 \DWTAGrvaluereferencetype,
3551 \DWTAGptrtomembertype, or
3552 \DWTAGfriend, but has
3553 a \DWATtype{} attribute, or if the referenced type (via
3555 \DWATfriend{} attribute) does not have a
3556 \DWATname{} attribute, the attribute is processed according to
3557 the method in Step 4 for an attribute that refers to another
3561 \item Visit each child C of the debugging information
3562 entry as follows: If C is a nested type entry or a member
3563 function entry, and has
3564 a \DWATname{} attribute, append to
3565 \addtoindexx{name attribute}
3566 S the letter 'S', the tag of C, and its name; otherwise,
3567 process C recursively by performing Steps 3 through 7,
3568 appending the result to S. Following the last child (or if
3569 there are no children), append a zero byte.
3574 For the purposes of this algorithm, if a debugging information
3576 \DWATspecification{}
3577 attribute that refers to
3578 another entry D (which has a
3581 then S inherits the attributes and children of D, and S is
3582 processed as if those attributes and children were present in
3583 the entry S. Exception: if a particular attribute is found in
3584 both S and D, the attribute in S is used and the corresponding
3585 one in D is ignored.
3588 DWARF tag and attribute codes are appended to the sequence
3589 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3590 using the values defined earlier in this chapter.
3592 \textit{A grammar describing this computation may be found in
3593 Appendix \refersec{app:typesignaturecomputationgrammar}.
3596 \textit{An attribute that refers to another type entry should
3597 be recursively processed or replaced with the name of the
3598 referent (in Step 4, 5 or 6). If neither treatment applies to
3599 an attribute that references another type entry, the entry
3600 that contains that attribute should not be considered for a
3601 separate \addtoindex{type unit}.}
3603 \textit{If a debugging information entry contains an attribute from
3604 the list above that would require an unsupported form, that
3605 entry should not be considered for a separate
3606 \addtoindex{type unit}.}
3608 \textit{A type should be considered for a separate
3609 \addtoindex{type unit} only
3610 if all of the type entries that it contains or refers to in
3611 Steps 6 and 7 can themselves each be considered for a separate
3612 \addtoindex{type unit}.}
3615 Where the DWARF producer may reasonably choose two or more
3616 different forms for a given attribute, it should choose
3617 the simplest possible form in computing the signature. (For
3618 example, a constant value should be preferred to a location
3619 expression when possible.)
3621 Once the string S has been formed from the DWARF encoding,
3622 an \MDfive{} hash is computed for the string and the
3623 least significant 64 bits are taken as the type signature.
3625 \textit{The string S is intended to be a flattened representation of
3626 the type that uniquely identifies that type (that is, a different
3627 type is highly unlikely to produce the same string).}
3630 \textit{A debugging information entry should not be placed in a
3631 separate \addtoindex{type unit}
3632 if any of the following apply:}
3636 \item \textit{The entry has an attribute whose value is a location
3637 expression, and the location expression contains a reference to
3638 another debugging information entry (for example, a \DWOPcallref{}
3639 operator), as it is unlikely that the entry will remain
3640 identical across compilation units.}
3642 \item \textit{The entry has an attribute whose value refers
3643 to a code location or a \addtoindex{location list}.}
3645 \item \textit{The entry has an attribute whose value refers
3646 to another debugging information entry that does not represent
3652 \textit{Certain attributes are not included in the type signature:}
3655 \item \textit{The \DWATdeclaration{} attribute is not included because it
3656 indicates that the debugging information entry represents an
3657 incomplete declaration, and incomplete declarations should
3659 \addtoindexx{type unit}
3660 separate type units.}
3662 \item \textit{The \DWATdescription{} attribute is not included because
3663 it does not provide any information unique to the defining
3664 declaration of the type.}
3666 \item \textit{The \DWATdeclfile,
3668 \DWATdeclcolumn{} attributes are not included because they
3669 may vary from one source file to the next, and would prevent
3670 two otherwise identical type declarations from producing the
3671 same \MDfive{} hash.}
3673 \item \textit{The \DWATobjectpointer{} attribute is not included
3674 because the information it provides is not necessary for the
3675 computation of a unique type signature.}
3679 \textit{Nested types and some types referred to by a debugging
3680 information entry are encoded by name rather than by recursively
3681 encoding the type to allow for cases where a complete definition
3682 of the type might not be available in all compilation units.}
3685 \textit{If a type definition contains the definition of a member function,
3686 it cannot be moved as is into a type unit, because the member function
3687 contains attributes that are unique to that compilation unit.
3688 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3689 moving the member function declaration into a separate declaration tree,
3690 and replacing the function definition in the type with a non-defining
3691 declaration of the function (as if the function had been defined out of
3694 An example that illustrates the computation of an \MDfive{} hash may be found in
3695 Appendix \refersec{app:usingtypeunits}.