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 A 2-byte unsigned integer representing the version of the DWARF
540 information for the compilation unit (see Appendix G). The
541 value in this field is \versiondotdebugsup.
543 \item \texttt{is\_supplementary} (ubyte) \\
544 A 1-byte unsigned integer, which contains the value 1 if it is
545 in the \addtoindex{supplementary object file} that other executables or
546 shared objects refer to, or 0 if it is an executable or shared object
547 referring to a supplemental object file file.
550 \item \texttt{sup\_filename} (null terminated filename string) \\
551 If \texttt{is\_supplementary} is 0, this contains either an absolute
552 filename for the supplementary object file, or a filename relative to
553 the object file containing the \dotdebugsup{} section.
554 If \texttt{is\_supplementary} is 1, then \texttt{sup\_filename}
555 is not needed and must be an empty string (a single nul byte).
558 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
559 Length of the following \texttt{sup\_checksum} field;
560 his value can be 0 if no checksum is provided.
563 \item \texttt{sup\_checksum} (array of ubyte) \\
564 Some checksum or cryptographic hash function of the \dotdebuginfo{},
565 \dotdebugstr{} and \dotdebugmacro{} sections of the
566 \addtoindex{supplementary object file}, or some unique identifier
567 which the implementation can choose to verify that the supplementary
568 section object file matches what the debug information in the executables
569 or shared objects expects.
572 Debug information entries that refer to an executable's or shared
573 object's addresses must \emph{not} be moved to supplementary files (the
574 addesses will likely not be the same). Similarly,
575 entries referenced from within locationexpressions or using loclistptr
576 form attributes must not be moved.
578 Executable or shared object compilation units can use
579 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
580 to import entries from the supplementary object file, other \DWFORMrefsup{}
581 attributes to refer to them and \DWFORMstrpsup{} form attributes to
582 refer to strings that are used by debug information of multiple
583 executables or shared objects. Within the \addtoindex{supplementary object file}'s
584 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} should
585 not be used, and all reference forms referring to some other sections
586 refer to the local sections in the supplementary object file.
588 In macro information, \DWMACROdefineindirectsup{} or
589 \DWMACROundefindirectsup{} opcodes can refer to strings in the
590 \dotdebugstr section of the supplementary file, or \DWMACROtransparentincludesup{}
591 can refer to \dotdebugmacro section entries. Within the
592 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
593 \DWMACROdefineindirect{} and \DWMACROundefindirect{}
594 opcodes refer to the local \dotdebugstr{} section, not the one in
595 the executable or shared object."
599 \section{32-Bit and 64-Bit DWARF Formats}
600 \label{datarep:32bitand64bitdwarfformats}
601 \hypertarget{datarep:xxbitdwffmt}{}
602 \addtoindexx{32-bit DWARF format}
603 \addtoindexx{64-bit DWARF format}
604 There are two closely related file formats. In the 32\dash bit DWARF
605 format, all values that represent lengths of DWARF sections
606 and offsets relative to the beginning of DWARF sections are
607 represented using 32\dash bits. In the 64\dash bit DWARF format, all
608 values that represent lengths of DWARF sections and offsets
609 relative to the beginning of DWARF sections are represented
610 using 64\dash bits. A special convention applies to the initial
611 length field of certain DWARF sections, as well as the CIE and
612 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
613 can coexist and be distinguished within a single linked object.
615 The differences between the 32\dash\ and 64\dash bit
617 detailed in the following:
618 \begin{enumerate}[1. ]
620 \item In the 32\dash bit DWARF format, an
621 \addtoindex{initial length} field (see
622 \addtoindexx{initial length!encoding}
623 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
624 is an unsigned 32\dash bit integer (which
625 must be less than \xfffffffzero); in the 64\dash bit DWARF format,
626 an \addtoindex{initial length} field is 96 bits in size,
629 \item The first 32\dash bits have the value \xffffffff.
631 \item The following 64\dash bits contain the actual length
632 represented as an unsigned 64\dash bit integer.
635 \textit{This representation allows a DWARF consumer to dynamically
636 detect that a DWARF section contribution is using the 64\dash bit
637 format and to adapt its processing accordingly.}
639 \item Section offset and section length
640 \hypertarget{datarep:sectionoffsetlength}{}
641 \addtoindexx{section length!use in headers}
643 \addtoindexx{section offset!use in headers}
644 in the headers of DWARF sections (other than initial length
645 \addtoindexx{initial length}
646 fields) are listed following. In the 32\dash bit DWARF format these
647 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
649 \addtoindexx{section length!in .debug\_aranges header}
651 \addtoindexx{section length!in .debug\_pubnames header}
653 \addtoindexx{section length!in .debug\_pubtypes header}
654 unsigned integer values.
658 Section &Name & Role \\ \hline
659 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
660 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
661 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
662 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
663 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
664 \dotdebugpubnames{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
665 & \addttindex{debug\_info\_length} & length of \dotdebuginfo{} \\
667 \dotdebugpubtypes{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
668 & \addttindex{debug\_info\_length} & length of \dotdebuginfo{} \\
673 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
674 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
675 union must be accessed to distinguish whether a CIE or FDE is
676 present, consequently, these two fields must exactly overlay
677 each other (both offset and size).
679 \item Within the body of the \dotdebuginfo{}
680 section, certain forms of attribute value depend on the choice
681 of DWARF format as follows. For the 32\dash bit DWARF format,
682 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
683 format, the value is a 64\dash bit unsigned integer.
685 \begin{tabular}{lp{6cm}}
686 Form & Role \\ \hline
687 \DWFORMlinestrp & offset in \dotdebuglinestr \\
688 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
689 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
690 \addtoindexx{supplementary object file}
691 \DWFORMsecoffset & offset in a section other than \\
692 & \dotdebuginfo{} or \dotdebugstr{} \\
693 \DWFORMstrp & offset in \dotdebugstr{} \\
694 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
695 \DWOPcallref & offset in \dotdebuginfo{} \\
700 \item Within the body of the \dotdebugline{} section, certain forms of content
701 description depend on the choice of DWARF format as follows: for the
702 32-bit DWARF format, the value is a 32-bit unsigned integer; for the
703 64-bit DWARF format, the value is a 64-bit unsigned integer.
705 \begin{tabular}{lp{6cm}}
706 Form & Role \\ \hline
707 \DWFORMlinestrp & offset in \dotdebuglinestr
711 \item Within the body of the \dotdebugpubnames{} and
713 sections, the representation of the first field
714 of each tuple (which represents an offset in the
716 section) depends on the DWARF format as follows: in the
717 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
718 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
721 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
722 sections, the size of entries in the body depend on the DWARF
723 format as follows: in the 32-bit DWARF format, entries are 32-bit
724 unsigned integer values; in the 64-bit DWARF format, they are
725 64-bit unsigned integers.
727 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
728 sections, the contents of the address size fields depends on the
729 DWARF format as follows: in the 32-bit DWARF format, these fields
730 contain 4; in the 64-bit DWARF format these fields contain 8.
734 The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
735 intermixed within a single compilation unit.
737 \textit{Attribute values and section header fields that represent
738 addresses in the target program are not affected by these
741 A DWARF consumer that supports the 64\dash bit DWARF format must
742 support executables in which some compilation units use the
743 32\dash bit format and others use the 64\dash bit format provided that
744 the combination links correctly (that is, provided that there
745 are no link\dash time errors due to truncation or overflow). (An
746 implementation is not required to guarantee detection and
747 reporting of all such errors.)
749 \textit{It is expected that DWARF producing compilers will \emph{not} use
750 the 64\dash bit format \emph{by default}. In most cases, the division of
751 even very large applications into a number of executable and
752 shared objects will suffice to assure that the DWARF sections
753 within each individual linked object are less than 4 GBytes
754 in size. However, for those cases where needed, the 64\dash bit
755 format allows the unusual case to be handled as well. Even
756 in this case, it is expected that only application supplied
757 objects will need to be compiled using the 64\dash bit format;
758 separate 32\dash bit format versions of system supplied shared
759 executable libraries can still be used.}
763 \section{Format of Debugging Information}
764 \label{datarep:formatofdebugginginformation}
766 For each compilation unit compiled with a DWARF producer,
767 a contribution is made to the \dotdebuginfo{} section of
768 the object file. Each such contribution consists of a
769 compilation unit header
770 (see Section \refersec{datarep:compilationunitheader})
772 single \DWTAGcompileunit{} or
773 \DWTAGpartialunit{} debugging
774 information entry, together with its children.
776 For each type defined in a compilation unit, a separate
777 contribution may also be made to the
779 section of the object file. Each
780 such contribution consists of a
781 \addtoindex{type unit} header
782 (see Section \refersec{datarep:typeunitheader})
783 followed by a \DWTAGtypeunit{} entry, together with
786 Each debugging information entry begins with a code that
787 represents an entry in a separate
788 \addtoindex{abbreviations table}. This
789 code is followed directly by a series of attribute values.
791 The appropriate entry in the
792 \addtoindex{abbreviations table} guides the
793 interpretation of the information contained directly in the
794 \dotdebuginfo{} section.
797 Multiple debugging information entries may share the same
798 abbreviation table entry. Each compilation unit is associated
799 with a particular abbreviation table, but multiple compilation
800 units may share the same table.
802 \subsection{Unit Headers}
803 \label{datarep:unitheaders}
804 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
805 compilation unit that follows. The encodings for the unit type
806 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
810 \setlength{\extrarowheight}{0.1cm}
811 \begin{longtable}{l|c}
812 \caption{Unit header unit type encodings}
813 \label{tab:unitheaderunitkindencodings}
814 \addtoindexx{unit header unit type encodings} \\
815 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
817 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
819 \hline \emph{Continued on next page}
821 \hline \ddag\ \textit{New in DWARF Version 5}
823 \DWUTcompileTARG~\ddag &0x01 \\
824 \DWUTtypeTARG~\ddag &0x02 \\
825 \DWUTpartialTARG~\ddag &0x03 \\ \hline
830 \subsubsection{Compilation Unit Header}
831 \label{datarep:compilationunitheader}
832 \begin{enumerate}[1. ]
834 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
835 \addttindexx{unit\_length}
836 A 4\dash byte or 12\dash byte
837 \addtoindexx{initial length}
838 unsigned integer representing the length
839 of the \dotdebuginfo{}
840 contribution for that compilation unit,
841 not including the length field itself. In the \thirtytwobitdwarfformat,
842 this is a 4\dash byte unsigned integer (which must be less
843 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
844 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
845 integer that gives the actual length
846 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
848 \item \texttt{version} (\addtoindex{uhalf}) \\
849 A 2\dash byte unsigned integer representing the version of the
850 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
851 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
852 The value in this field is \versiondotdebuginfo.
855 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
856 A 1-byte unsigned integer identifying this unit as a compilation unit.
857 The value of this field is
858 \DWUTcompile{} for a {normal compilation} unit or
859 \DWUTpartial{} for a {partial compilation} unit
860 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
862 \textit{This field is new in \DWARFVersionV.}
865 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
867 \addtoindexx{section offset!in .debug\_info header}
868 4\dash byte or 8\dash byte unsigned offset into the
870 section. This offset associates the compilation unit with a
871 particular set of debugging information entry abbreviations. In
872 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
873 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
874 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
876 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
877 A 1\dash byte unsigned integer representing the size in bytes of
878 \addttindexx{address\_size}
879 an address on the target architecture. If the system uses
880 \addtoindexx{address space!segmented}
881 segmented addressing, this value represents the size of the
882 offset portion of an address.
886 \subsubsection{Type Unit Header}
887 \label{datarep:typeunitheader}
889 The header for the series of debugging information entries
890 contributing to the description of a type that has been
891 placed in its own \addtoindex{type unit}, within the
892 \dotdebuginfo{} section,
893 consists of the following information:
894 \begin{enumerate}[1. ]
896 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
897 \addttindexx{unit\_length}
898 A 4\dash byte or 12\dash byte unsigned integer
899 \addtoindexx{initial length}
900 representing the length
901 of the \dotdebuginfo{} contribution for that type unit,
902 not including the length field itself. In the \thirtytwobitdwarfformat,
903 this is a 4\dash byte unsigned integer (which must be
904 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
905 consists of the 4\dash byte value \wffffffff followed by an
906 8\dash byte unsigned integer that gives the actual length
907 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
910 \item \texttt{version} (\addtoindex{uhalf}) \\
911 A 2\dash byte unsigned integer representing the version of the
912 DWARF information for the
913 type unit\addtoindexx{version number!type unit}
914 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
915 The value in this field is \versiondotdebuginfo.
917 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
918 A 1-byte unsigned integer identifying this unit as a type unit.
919 The value of this field is \DWUTtype{} for a type unit
920 (see Section \refersec{chap:separatetypeunitentries}).
922 \textit{This field is new in \DWARFVersionV.}
925 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
927 \addtoindexx{section offset!in .debug\_info header}
928 4\dash byte or 8\dash byte unsigned offset into the
930 section. This offset associates the type unit with a
931 particular set of debugging information entry abbreviations. In
932 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
933 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
934 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
937 \item \texttt{address\_size} (addtoindex{ubyte}) \\
938 A 1\dash byte unsigned integer representing the size
939 \addtoindexx{size of an address}
941 \addttindexx{address\_size}
942 an address on the target architecture. If the system uses
943 \addtoindexx{address space!segmented}
944 segmented addressing, this value represents the size of the
945 offset portion of an address.
947 \item \texttt{type\_signature} (8\dash byte unsigned integer) \\
948 \addtoindexx{type signature}
950 \addttindexx{type\_signature}
951 64\dash bit unique signature (see Section
952 \refersec{datarep:typesignaturecomputation})
953 of the type described in this type
956 \textit{An attribute that refers (using
957 \DWFORMrefsigeight{}) to
958 the primary type contained in this
959 \addtoindex{type unit} uses this value.}
961 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
962 \addttindexx{type\_offset}
963 A 4\dash byte or 8\dash byte unsigned offset
964 \addtoindexx{section offset!in .debug\_info header}
965 relative to the beginning
966 of the \addtoindex{type unit} header.
967 This offset refers to the debugging
968 information entry that describes the type. Because the type
969 may be nested inside a namespace or other structures, and may
970 contain references to other types that have not been placed in
971 separate type units, it is not necessarily either the first or
972 the only entry in the type unit. In the \thirtytwobitdwarfformat,
973 this is a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat,
974 this is an 8\dash byte unsigned length
975 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
979 \subsection{Debugging Information Entry}
980 \label{datarep:debugginginformationentry}
982 Each debugging information entry begins with an
983 unsigned LEB128\addtoindexx{LEB128!unsigned}
984 number containing the abbreviation code for the entry. This
985 code represents an entry within the abbreviations table
986 associated with the compilation unit containing this entry. The
987 abbreviation code is followed by a series of attribute values.
989 On some architectures, there are alignment constraints on
990 section boundaries. To make it easier to pad debugging
991 information sections to satisfy such constraints, the
992 abbreviation code 0 is reserved. Debugging information entries
993 consisting of only the abbreviation code 0 are considered
996 \subsection{Abbreviations Tables}
997 \label{datarep:abbreviationstables}
999 The abbreviations tables for all compilation units
1000 are contained in a separate object file section called
1002 As mentioned before, multiple compilation
1003 units may share the same abbreviations table.
1005 The abbreviations table for a single compilation unit consists
1006 of a series of abbreviation declarations. Each declaration
1007 specifies the tag and attributes for a particular form of
1008 debugging information entry. Each declaration begins with
1009 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1010 number representing the abbreviation
1011 code itself. It is this code that appears at the beginning
1012 of a debugging information entry in the
1014 section. As described above, the abbreviation
1015 code 0 is reserved for null debugging information entries. The
1016 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1017 number that encodes the entry\textquoteright s tag. The encodings for the
1018 tag names are given in
1019 Table \refersec{tab:tagencodings}.
1022 \setlength{\extrarowheight}{0.1cm}
1023 \begin{longtable}{l|c}
1025 \caption{Tag encodings} \label{tab:tagencodings} \\
1026 \hline \bfseries Tag name&\bfseries Value\\ \hline
1028 \bfseries Tag name&\bfseries Value \\ \hline
1030 \hline \emph{Continued on next page}
1032 \hline \ddag\ \textit{New in DWARF Version 5}
1034 \DWTAGarraytype{} &0x01 \\
1035 \DWTAGclasstype&0x02 \\
1036 \DWTAGentrypoint&0x03 \\
1037 \DWTAGenumerationtype&0x04 \\
1038 \DWTAGformalparameter&0x05 \\
1039 \DWTAGimporteddeclaration&0x08 \\
1041 \DWTAGlexicalblock&0x0b \\
1042 \DWTAGmember&0x0d \\
1043 \DWTAGpointertype&0x0f \\
1044 \DWTAGreferencetype&0x10 \\
1045 \DWTAGcompileunit&0x11 \\
1046 \DWTAGstringtype&0x12 \\
1047 \DWTAGstructuretype&0x13 \\
1048 \DWTAGsubroutinetype&0x15 \\
1049 \DWTAGtypedef&0x16 \\
1050 \DWTAGuniontype&0x17 \\
1051 \DWTAGunspecifiedparameters&0x18 \\
1052 \DWTAGvariant&0x19 \\
1053 \DWTAGcommonblock&0x1a \\
1054 \DWTAGcommoninclusion&0x1b \\
1055 \DWTAGinheritance&0x1c \\
1056 \DWTAGinlinedsubroutine&0x1d \\
1057 \DWTAGmodule&0x1e \\
1058 \DWTAGptrtomembertype&0x1f \\
1059 \DWTAGsettype&0x20 \\
1060 \DWTAGsubrangetype&0x21 \\
1061 \DWTAGwithstmt&0x22 \\
1062 \DWTAGaccessdeclaration&0x23 \\
1063 \DWTAGbasetype&0x24 \\
1064 \DWTAGcatchblock&0x25 \\
1065 \DWTAGconsttype&0x26 \\
1066 \DWTAGconstant&0x27 \\
1067 \DWTAGenumerator&0x28 \\
1068 \DWTAGfiletype&0x29 \\
1069 \DWTAGfriend&0x2a \\
1070 \DWTAGnamelist&0x2b \\
1071 \DWTAGnamelistitem&0x2c \\
1072 \DWTAGpackedtype&0x2d \\
1073 \DWTAGsubprogram&0x2e \\
1074 \DWTAGtemplatetypeparameter&0x2f \\
1075 \DWTAGtemplatevalueparameter&0x30 \\
1076 \DWTAGthrowntype&0x31 \\
1077 \DWTAGtryblock&0x32 \\
1078 \DWTAGvariantpart&0x33 \\
1079 \DWTAGvariable&0x34 \\
1080 \DWTAGvolatiletype&0x35 \\
1081 \DWTAGdwarfprocedure&0x36 \\
1082 \DWTAGrestricttype&0x37 \\
1083 \DWTAGinterfacetype&0x38 \\
1084 \DWTAGnamespace&0x39 \\
1085 \DWTAGimportedmodule&0x3a \\
1086 \DWTAGunspecifiedtype&0x3b \\
1087 \DWTAGpartialunit&0x3c \\
1088 \DWTAGimportedunit&0x3d \\
1089 \DWTAGcondition&\xiiif \\
1090 \DWTAGsharedtype&0x40 \\
1091 \DWTAGtypeunit & 0x41 \\
1092 \DWTAGrvaluereferencetype & 0x42 \\
1093 \DWTAGtemplatealias & 0x43 \\
1094 \DWTAGcoarraytype~\ddag & 0x44 \\
1095 \DWTAGgenericsubrange~\ddag & 0x45 \\
1096 \DWTAGdynamictype~\ddag & 0x46 \\
1097 \DWTAGatomictype~\ddag & 0x47 \\
1098 \DWTAGcallsite~\ddag & 0x48 \\
1099 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1100 \DWTAGlouser&0x4080 \\
1101 \DWTAGhiuser&\xffff \\
1105 Following the tag encoding is a 1\dash byte value that determines
1106 whether a debugging information entry using this abbreviation
1107 has child entries or not. If the value is
1109 the next physically succeeding entry of any debugging
1110 information entry using this abbreviation is the first
1111 child of that entry. If the 1\dash byte value following the
1112 abbreviation\textquoteright s tag encoding is
1113 \DWCHILDRENnoTARG, the next
1114 physically succeeding entry of any debugging information entry
1115 using this abbreviation is a sibling of that entry. (Either
1116 the first child or sibling entries may be null entries). The
1117 encodings for the child determination byte are given in
1118 Table \refersec{tab:childdeterminationencodings}
1120 Section \refersec{chap:relationshipofdebugginginformationentries},
1121 each chain of sibling entries is terminated by a null entry.)
1125 \setlength{\extrarowheight}{0.1cm}
1126 \begin{longtable}{l|c}
1127 \caption{Child determination encodings}
1128 \label{tab:childdeterminationencodings}
1129 \addtoindexx{Child determination encodings} \\
1130 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1132 \bfseries Children determination name&\bfseries Value \\ \hline
1134 \hline \emph{Continued on next page}
1138 \DWCHILDRENno&0x00 \\
1139 \DWCHILDRENyes&0x01 \\ \hline
1144 Finally, the child encoding is followed by a series of
1145 attribute specifications. Each attribute specification
1146 consists of two parts. The first part is an
1147 unsigned LEB128\addtoindexx{LEB128!unsigned}
1148 number representing the attribute\textquoteright s name.
1149 The second part is an
1150 unsigned LEB128\addtoindexx{LEB128!unsigned}
1151 number representing the attribute\textquoteright s form.
1152 The series of attribute specifications ends with an
1153 entry containing 0 for the name and 0 for the form.
1156 \DWFORMindirectTARG{} is a special case. For
1157 attributes with this form, the attribute value itself in the
1159 section begins with an unsigned
1160 LEB128 number that represents its form. This allows producers
1161 to choose forms for particular attributes
1162 \addtoindexx{abbreviations table!dynamic forms in}
1164 without having to add a new entry to the abbreviations table.
1166 The abbreviations for a given compilation unit end with an
1167 entry consisting of a 0 byte for the abbreviation code.
1170 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1171 for a depiction of the organization of the
1172 debugging information.}
1175 \subsection{Attribute Encodings}
1176 \label{datarep:attributeencodings}
1178 The encodings for the attribute names are given in
1179 Table \refersec{tab:attributeencodings}.
1181 The attribute form governs how the value of the attribute is
1182 encoded. There are nine classes of form, listed below. Each
1183 class is a set of forms which have related representations
1184 and which are given a common interpretation according to the
1185 attribute in which the form is used.
1187 Form \DWFORMsecoffsetTARG{}
1189 \addtoindexx{rangelistptr class}
1191 \addtoindexx{macptr class}
1193 \addtoindexx{loclistptr class}
1195 \addtoindexx{lineptr class}
1201 \CLASSrangelistptr{} or
1202 \CLASSstroffsetsptr;
1203 the list of classes allowed by the applicable attribute in
1204 Table \refersec{tab:attributeencodings}
1205 determines the class of the form.
1209 Each possible form belongs to one or more of the following classes:
1212 \item \livelinki{chap:classaddress}{address}{address class} \\
1213 \livetarg{datarep:classaddress}{}
1214 Represented as either:
1216 \item An object of appropriate size to hold an
1217 address on the target machine
1219 The size is encoded in the compilation unit header
1220 (see Section \refersec{datarep:compilationunitheader}).
1221 This address is relocatable in a relocatable object file and
1222 is relocated in an executable file or shared object.
1224 \item An indirect index into a table of addresses (as
1225 described in the previous bullet) in the
1226 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1227 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1228 \addtoindex{LEB128} value, which is interpreted as a zero-based
1229 index into an array of addresses in the \dotdebugaddr{} section.
1230 The index is relative to the value of the \DWATaddrbase{} attribute
1231 of the associated compilation unit.
1235 \item \livelink{chap:classaddrptr}{addrptr} \\
1236 \livetarg{datarep:classaddrptr}{}
1237 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1238 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1239 beginning of the list of machine addresses information for the
1240 referencing entity. It is relocatable in
1241 a relocatable object file, and relocated in an executable or
1242 shared object. In the \thirtytwobitdwarfformat, this offset
1243 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1244 format, it is an 8\dash byte unsigned value (see Section
1245 \refersec{datarep:32bitand64bitdwarfformats}).
1247 \textit{This class is new in \DWARFVersionV.}
1250 \item \livelink{chap:classblock}{block} \\
1251 \livetarg{datarep:classblock}{}
1252 Blocks come in four forms:
1254 \begin{myindentpara}{1cm}
1255 A 1\dash byte length followed by 0 to 255 contiguous information
1256 bytes (\DWFORMblockoneTARG).
1259 \begin{myindentpara}{1cm}
1260 A 2\dash byte length followed by 0 to 65,535 contiguous information
1261 bytes (\DWFORMblocktwoTARG).
1264 \begin{myindentpara}{1cm}
1265 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
1266 information bytes (\DWFORMblockfourTARG).
1269 \begin{myindentpara}{1cm}
1270 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1271 length followed by the number of bytes
1272 specified by the length (\DWFORMblockTARG).
1275 In all forms, the length is the number of information bytes
1276 that follow. The information bytes may contain any mixture
1277 of relocated (or relocatable) addresses, references to other
1278 debugging information entries or data bytes.
1280 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1281 \livetarg{datarep:classconstant}{}
1282 There are seven forms of constants. There are fixed length
1283 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1287 \DWFORMdatafourTARG,
1288 \DWFORMdataeightTARG{} and
1289 \DWFORMdatasixteenTARG).
1290 There are also variable length constant
1291 data forms encoded using LEB128 numbers (see below). Both
1292 signed (\DWFORMsdataTARG) and unsigned
1293 (\DWFORMudataTARG) variable
1294 length constants are available
1297 The data in \DWFORMdataone,
1300 \DWFORMdataeight{} and
1301 \DWFORMdatasixteen{}
1302 can be anything. Depending on context, it may
1303 be a signed integer, an unsigned integer, a floating\dash point
1304 constant, or anything else. A consumer must use context to
1305 know how to interpret the bits, which if they are target
1306 machine data (such as an integer or floating point constant)
1307 will be in target machine byte\dash order.
1309 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1310 forms is used to represent a
1311 signed or unsigned integer, it can be hard for a consumer
1312 to discover the context necessary to determine which
1313 interpretation is intended. Producers are therefore strongly
1314 encouraged to use \DWFORMsdata{} or
1315 \DWFORMudata{} for signed and
1316 unsigned integers respectively, rather than
1317 \DWFORMdata\textless n\textgreater.}
1320 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1321 \livetarg{datarep:classexprloc}{}
1322 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1323 number of information bytes specified by the length
1324 (\DWFORMexprlocTARG).
1325 The information bytes contain a DWARF expression
1326 (see Section \refersec{chap:dwarfexpressions})
1327 or location description
1328 (see Section \refersec{chap:locationdescriptions}).
1330 \item \livelinki{chap:classflag}{flag}{flag class} \\
1331 \livetarg{datarep:classflag}{}
1332 A flag \addtoindexx{flag class}
1333 is represented explicitly as a single byte of data
1334 (\DWFORMflagTARG) or
1335 implicitly (\DWFORMflagpresentTARG).
1337 first case, if the \nolink{flag} has value zero, it indicates the
1338 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1339 it indicates the presence of the attribute. In the second
1340 case, the attribute is implicitly indicated as present, and
1341 no value is encoded in the debugging information entry itself.
1343 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1344 \livetarg{datarep:classlineptr}{}
1345 This is an offset into
1346 \addtoindexx{section offset!in class lineptr value}
1348 \dotdebugline{} or \dotdebuglinedwo{} section
1350 It consists of an offset from the beginning of the
1352 section to the first byte of
1353 the data making up the line number list for the compilation
1355 It is relocatable in a relocatable object file, and
1356 relocated in an executable or shared object. In the
1357 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1358 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1359 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1362 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1363 \livetarg{datarep:classloclistptr}{}
1364 This is an offset into the
1368 It consists of an offset from the
1369 \addtoindexx{section offset!in class loclistptr value}
1372 section to the first byte of
1373 the data making up the
1374 \addtoindex{location list} for the compilation unit.
1375 It is relocatable in a relocatable object file, and
1376 relocated in an executable or shared object. In the
1377 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1378 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1379 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1382 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1383 \livetarg{datarep:classmacptr}{}
1385 \addtoindexx{section offset!in class macptr value}
1387 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1389 It consists of an offset from the beginning of the
1390 \dotdebugmacro{} or \dotdebugmacrodwo{}
1391 section to the the header making up the
1392 macro information list for the compilation unit.
1393 It is relocatable in a relocatable object file, and
1394 relocated in an executable or shared object. In the
1395 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1396 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1397 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1400 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1401 \livetarg{datarep:classrangelistptr}{}
1403 \addtoindexx{section offset!in class rangelistptr value}
1404 offset into the \dotdebugranges{} section
1407 offset from the beginning of the
1408 \dotdebugranges{} section
1409 to the beginning of the non\dash contiguous address ranges
1410 information for the referencing entity.
1411 It is relocatable in
1412 a relocatable object file, and relocated in an executable or
1413 shared object. In the \thirtytwobitdwarfformat, this offset
1414 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1415 format, it is an 8\dash byte unsigned value (see Section
1416 \refersec{datarep:32bitand64bitdwarfformats}).
1419 \textit{Because classes
1424 \CLASSrangelistptr{} and
1425 \CLASSstroffsetsptr{}
1426 share a common representation, it is not possible for an
1427 attribute to allow more than one of these classes}
1431 \item \livelinki{chap:classreference}{reference}{reference class} \\
1432 \livetarg{datarep:classreference}{}
1433 There are four types of reference.
1436 \addtoindexx{reference class}
1437 first type of reference can identify any debugging
1438 information entry within the containing unit.
1441 \addtoindexx{section offset!in class reference value}
1442 offset from the first byte of the compilation
1443 header for the compilation unit containing the reference. There
1444 are five forms for this type of reference. There are fixed
1445 length forms for one, two, four and eight byte offsets
1451 and \DWFORMrefeightTARG).
1452 There is also an unsigned variable
1453 length offset encoded form that uses
1454 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1455 (\DWFORMrefudataTARG).
1456 Because this type of reference is within
1457 the containing compilation unit no relocation of the value
1460 The second type of reference can identify any debugging
1461 information entry within a
1462 \dotdebuginfo{} section; in particular,
1463 it may refer to an entry in a different compilation unit
1464 from the unit containing the reference, and may refer to an
1465 entry in a different shared object. This type of reference
1466 (\DWFORMrefaddrTARG)
1467 is an offset from the beginning of the
1469 section of the target executable or shared object, or, for
1470 references within a \addtoindex{supplementary object file},
1471 an offset from the beginning of the local \dotdebuginfo{} section;
1472 it is relocatable in a relocatable object file and frequently
1473 relocated in an executable file or shared object. For
1474 references from one shared object or static executable file
1475 to another, the relocation and identification of the target
1476 object must be performed by the consumer. In the
1477 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1478 in the \sixtyfourbitdwarfformat, it is an 8\dash byte
1480 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1482 \textit{A debugging information entry that may be referenced by
1483 another compilation unit using
1484 \DWFORMrefaddr{} must have a global symbolic name.}
1486 \textit{For a reference from one executable or shared object to
1487 another, the reference is resolved by the debugger to identify
1488 the shared object or executable and the offset into that
1489 object\textquoteright s \dotdebuginfo{}
1490 section in the same fashion as the run
1491 time loader, either when the debug information is first read,
1492 or when the reference is used.}
1494 The third type of reference can identify any debugging
1495 information type entry that has been placed in its own
1496 \addtoindex{type unit}. This type of
1497 reference (\DWFORMrefsigeightTARG) is the
1498 \addtoindexx{type signature}
1499 64\dash bit type signature
1500 (see Section \refersec{datarep:typesignaturecomputation})
1501 that was computed for the type.
1503 The fourth type of reference is a reference from within the
1504 \dotdebuginfo{} section of the executable or shared object to
1505 a debugging information entry in the \dotdebuginfo{} section of
1506 a \addtoindex{supplementary object file}.
1507 This type of reference (\DWFORMrefsupTARG) is an offset from the
1508 beginning of the \dotdebuginfo{} section in the supplementary
1511 \textit{The use of compilation unit relative references will reduce the
1512 number of link\dash time relocations and so speed up linking. The
1513 use of the second, third and fourth type of reference allows for the
1514 sharing of information, such as types, across compilation
1515 units, while the fourth type further allows for sharing of information
1516 across compilation units from different executables or shared objects.}
1518 \textit{A reference to any kind of compilation unit identifies the
1519 debugging information entry for that unit, not the preceding
1523 \item \livelinki{chap:classstring}{string}{string class} \\
1524 \livetarg{datarep:classstring}{}
1525 A string is a sequence of contiguous non\dash null bytes followed by
1527 \addtoindexx{string class}
1528 A string may be represented:
1530 \setlength{\itemsep}{0em}
1531 \item immediately in the debugging information entry itself
1532 (\DWFORMstringTARG),
1535 \addtoindexx{section offset!in class string value}
1536 offset into a string table contained in
1537 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
1538 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
1539 or as an offset into a string table contained in the
1540 \dotdebugstr{} section of a \addtoindex{supplementary object file}
1541 (\DWFORMstrpsupTARG). \DWFORMstrpNAME{} offsets from the \dotdebuginfo{}
1542 section of a \addtoindex{supplementary object file}
1543 refer to the local \dotdebugstr{} section of that same file.
1544 In the \thirtytwobitdwarfformat, the representation of a
1546 value is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
1547 it is an 8\dash byte unsigned offset
1548 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1550 \item as an indirect offset into the string table using an
1551 index into a table of offsets contained in the
1552 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1553 The representation of a \DWFORMstrxNAME{} value is an unsigned
1554 \addtoindex{LEB128} value, which is interpreted as a zero-based
1555 index into an array of offsets in the \dotdebugstroffsets{} section.
1556 The offset entries in the \dotdebugstroffsets{} section have the
1557 same representation as \DWFORMstrp{} values.
1559 Any combination of these three forms may be used within a single compilation.
1561 If the \DWATuseUTFeight{}
1562 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1563 compilation, partial, skeleton or type unit entry, string values are encoded using the
1564 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1565 Character Set standard (ISO/IEC 10646\dash 1:1993).
1566 \addtoindexx{ISO 10646 character set standard}
1567 Otherwise, the string representation is unspecified.
1569 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1570 ISO/IEC 10646\dash 1:1993.
1571 \addtoindexx{ISO 10646 character set standard}
1572 It contains all the same characters
1573 and encoding points as ISO/IEC 10646, as well as additional
1574 information about the characters and their use.}
1576 \textit{Earlier versions of DWARF did not specify the representation
1577 of strings; for compatibility, this version also does
1578 not. However, the UTF\dash 8 representation is strongly recommended.}
1581 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1582 \livetarg{datarep:classstroffsetsptr}{}
1583 This is an offset into the \dotdebugstroffsets{} section
1584 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1585 \dotdebugstroffsets{} section to the
1586 beginning of the string offsets information for the
1587 referencing entity. It is relocatable in
1588 a relocatable object file, and relocated in an executable or
1589 shared object. In the \thirtytwobitdwarfformat, this offset
1590 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1591 format, it is an 8\dash byte unsigned value (see Section
1592 \refersec{datarep:32bitand64bitdwarfformats}).
1594 \textit{This class is new in \DWARFVersionV.}
1598 In no case does an attribute use one of the classes
1603 \CLASSrangelistptr{} or
1604 \CLASSstroffsetsptr{}
1605 to point into either the
1606 \dotdebuginfo{} or \dotdebugstr{} section.
1608 The form encodings are listed in
1609 Table \refersec{tab:attributeformencodings}.
1613 \setlength{\extrarowheight}{0.1cm}
1614 \begin{longtable}{l|c|l}
1615 \caption{Attribute encodings}
1616 \label{tab:attributeencodings}
1617 \addtoindexx{attribute encodings} \\
1618 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1620 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1622 \hline \emph{Continued on next page}
1624 \hline \ddag\ \textit{New in DWARF Version 5}
1626 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1627 \addtoindexx{sibling attribute} \\
1628 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1629 \livelink{chap:classloclistptr}{loclistptr}
1630 \addtoindexx{location attribute} \\
1631 \DWATname&0x03&\livelink{chap:classstring}{string}
1632 \addtoindexx{name attribute} \\
1633 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1634 \addtoindexx{ordering attribute} \\
1635 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1636 \livelink{chap:classexprloc}{exprloc},
1637 \livelink{chap:classreference}{reference}
1638 \addtoindexx{byte size attribute} \\
1639 \DWATbitoffset&0x0c&\livelink{chap:classconstant}{constant},
1640 \livelink{chap:classexprloc}{exprloc},
1641 \livelink{chap:classreference}{reference}
1642 \addtoindexx{bit offset attribute (Version 3)} \\
1643 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1644 \livelink{chap:classexprloc}{exprloc},
1645 \livelink{chap:classreference}{reference}
1646 \addtoindexx{bit size attribute} \\
1647 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1648 \addtoindexx{statement list attribute} \\
1649 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1650 \addtoindexx{low PC attribute} \\
1651 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1652 \livelink{chap:classconstant}{constant}
1653 \addtoindexx{high PC attribute} \\
1654 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1655 \addtoindexx{language attribute} \\
1656 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1657 \addtoindexx{discriminant attribute} \\
1658 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1659 \addtoindexx{discriminant value attribute} \\
1660 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1661 \addtoindexx{visibility attribute} \\
1662 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1663 \addtoindexx{import attribute} \\
1664 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1665 \livelink{chap:classloclistptr}{loclistptr}
1666 \addtoindexx{string length attribute} \\
1667 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1668 \addtoindexx{common reference attribute} \\
1669 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1670 \addtoindexx{compilation directory attribute} \\
1671 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1672 \livelink{chap:classconstant}{constant},
1673 \livelink{chap:classstring}{string}
1674 \addtoindexx{constant value attribute} \\
1675 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1676 \addtoindexx{containing type attribute} \\
1677 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1678 \livelink{chap:classreference}{reference},
1679 \livelink{chap:classflag}{flag}
1680 \addtoindexx{default value attribute} \\
1681 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1682 \addtoindexx{inline attribute} \\
1683 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1684 \addtoindexx{is optional attribute} \\
1685 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1686 \livelink{chap:classexprloc}{exprloc},
1687 \livelink{chap:classreference}{reference}
1688 \addtoindexx{lower bound attribute} \\
1689 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1690 \addtoindexx{producer attribute} \\
1691 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1692 \addtoindexx{prototyped attribute} \\
1693 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1694 \livelink{chap:classloclistptr}{loclistptr}
1695 \addtoindexx{return address attribute} \\
1696 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1697 \livelink{chap:classrangelistptr}{rangelistptr}
1698 \addtoindexx{start scope attribute} \\
1699 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1700 \livelink{chap:classexprloc}{exprloc},
1701 \livelink{chap:classreference}{reference}
1702 \addtoindexx{bit stride attribute} \\
1703 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1704 \livelink{chap:classexprloc}{exprloc},
1705 \livelink{chap:classreference}{reference}
1706 \addtoindexx{upper bound attribute} \\
1707 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1708 \addtoindexx{abstract origin attribute} \\
1709 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1710 \addtoindexx{accessibility attribute} \\
1711 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1712 \addtoindexx{address class attribute} \\
1713 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1714 \addtoindexx{artificial attribute} \\
1715 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1716 \addtoindexx{base types attribute} \\
1717 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1718 \addtoindexx{calling convention attribute} \\
1719 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1720 \livelink{chap:classexprloc}{exprloc},
1721 \livelink{chap:classreference}{reference}
1722 \addtoindexx{count attribute} \\
1723 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1724 \livelink{chap:classexprloc}{exprloc},
1725 \livelink{chap:classloclistptr}{loclistptr}
1726 \addtoindexx{data member attribute} \\
1727 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1728 \addtoindexx{declaration column attribute} \\
1729 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1730 \addtoindexx{declaration file attribute} \\
1731 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1732 \addtoindexx{declaration line attribute} \\
1733 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1734 \addtoindexx{declaration attribute} \\
1735 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1736 \addtoindexx{discriminant list attribute} \\
1737 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1738 \addtoindexx{encoding attribute} \\
1739 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1740 \addtoindexx{external attribute} \\
1741 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1742 \livelink{chap:classloclistptr}{loclistptr}
1743 \addtoindexx{frame base attribute} \\
1744 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1745 \addtoindexx{friend attribute} \\
1746 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1747 \addtoindexx{identifier case attribute} \\
1748 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1749 Reserved for compatibility and coexistence
1750 with prior DWARF versions.}
1751 &0x43&\livelink{chap:classmacptr}{macptr}
1752 \addtoindexx{macro information attribute (legacy)!encoding} \\
1753 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1754 \addtoindexx{name list item attribute} \\
1755 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1756 \addtoindexx{priority attribute} \\
1757 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1758 \livelink{chap:classloclistptr}{loclistptr}
1759 \addtoindexx{segment attribute} \\
1760 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1761 \addtoindexx{specification attribute} \\
1762 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1763 \livelink{chap:classloclistptr}{loclistptr}
1764 \addtoindexx{static link attribute} \\
1765 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1766 \addtoindexx{type attribute} \\
1767 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1768 \livelink{chap:classloclistptr}{loclistptr}
1769 \addtoindexx{location list attribute} \\
1770 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1771 \addtoindexx{variable parameter attribute} \\
1772 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1773 \addtoindexx{virtuality attribute} \\
1774 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1775 \livelink{chap:classloclistptr}{loclistptr}
1776 \addtoindexx{vtable element location attribute} \\
1777 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1778 \livelink{chap:classexprloc}{exprloc},
1779 \livelink{chap:classreference}{reference}
1780 \addtoindexx{allocated attribute} \\
1781 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1782 \livelink{chap:classexprloc}{exprloc},
1783 \livelink{chap:classreference}{reference}
1784 \addtoindexx{associated attribute} \\
1785 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1786 \addtoindexx{data location attribute} \\
1787 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1788 \livelink{chap:classexprloc}{exprloc},
1789 \livelink{chap:classreference}{reference}
1790 \addtoindexx{byte stride attribute} \\
1791 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1792 \livelink{chap:classconstant}{constant}
1793 \addtoindexx{entry pc attribute} \\
1794 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1795 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1796 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1797 \addtoindexx{extension attribute} \\
1798 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1799 \addtoindexx{ranges attribute} \\
1800 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1801 \livelink{chap:classflag}{flag},
1802 \livelink{chap:classreference}{reference},
1803 \livelink{chap:classstring}{string}
1804 \addtoindexx{trampoline attribute} \\
1805 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1806 \addtoindexx{call column attribute} \\
1807 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1808 \addtoindexx{call file attribute} \\
1809 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1810 \addtoindexx{call line attribute} \\
1811 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1812 \addtoindexx{description attribute} \\
1813 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1814 \addtoindexx{binary scale attribute} \\
1815 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1816 \addtoindexx{decimal scale attribute} \\
1817 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1818 \addtoindexx{small attribute} \\
1819 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1820 \addtoindexx{decimal scale attribute} \\
1821 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1822 \addtoindexx{digit count attribute} \\
1823 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1824 \addtoindexx{picture string attribute} \\
1825 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1826 \addtoindexx{mutable attribute} \\
1827 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1828 \addtoindexx{thread scaled attribute} \\
1829 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1830 \addtoindexx{explicit attribute} \\
1831 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1832 \addtoindexx{object pointer attribute} \\
1833 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1834 \addtoindexx{endianity attribute} \\
1835 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1836 \addtoindexx{elemental attribute} \\
1837 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1838 \addtoindexx{pure attribute} \\
1839 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1840 \addtoindexx{recursive attribute} \\
1841 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1842 \addtoindexx{signature attribute} \\
1843 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1844 \addtoindexx{main subprogram attribute} \\
1845 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1846 \addtoindexx{data bit offset attribute} \\
1847 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1848 \addtoindexx{constant expression attribute} \\
1849 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1850 \addtoindexx{enumeration class attribute} \\
1851 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1852 \addtoindexx{linkage name attribute} \\
1853 \DWATstringlengthbitsize{}~\ddag&0x6f&
1854 \livelink{chap:classconstant}{constant}
1855 \addtoindexx{string length attribute!size of length} \\
1856 \DWATstringlengthbytesize{}~\ddag&0x70&
1857 \livelink{chap:classconstant}{constant}
1858 \addtoindexx{string length attribute!size of length} \\
1859 \DWATrank~\ddag&0x71&
1860 \livelink{chap:classconstant}{constant},
1861 \livelink{chap:classexprloc}{exprloc}
1862 \addtoindexx{rank attribute} \\
1863 \DWATstroffsetsbase~\ddag&0x72&
1864 \livelinki{chap:classstring}{stroffsetsptr}{stroffsetsptr class}
1865 \addtoindexx{string offsets base!encoding} \\
1866 \DWATaddrbase~\ddag &0x73&
1867 \livelinki{chap:DWATaddrbase}{addrptr}{addrptr class}
1868 \addtoindexx{address table base!encoding} \\
1869 \DWATrangesbase~\ddag&0x74&
1870 \livelinki{chap:DWATrangesbase}{rangelistptr}{rangelistptr class}
1871 \addtoindexx{ranges base!encoding} \\
1872 \DWATdwoid~\ddag &0x75&
1873 \livelink{chap:DWATdwoid}{constant}
1874 \addtoindexx{split DWARF object id!encoding} \\
1875 \DWATdwoname~\ddag &0x76&
1876 \livelink{chap:DWATdwoname}{string}
1877 \addtoindexx{split DWARF object file name!encoding} \\
1878 \DWATreference~\ddag &0x77&
1879 \livelink{chap:DWATreference}{flag} \\
1880 \DWATrvaluereference~\ddag &0x78&
1881 \livelink{chap:DWATrvaluereference}{flag} \\
1882 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1883 \addtoindexx{macro information attribute} \\
1884 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1885 \addtoindexx{all calls summary attribute} \\
1886 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1887 \addtoindexx{all source calls summary attribute} \\
1888 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1889 \addtoindexx{all tail calls summary attribute} \\
1890 \DWATcalldatalocation~\ddag &0x7d &\CLASSexprloc
1891 \addtoindexx{call data location attribute} \\
1892 \DWATcalldatavalue~\ddag &0x7e &\CLASSexprloc
1893 \addtoindexx{call data value attribute} \\
1894 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1895 \addtoindexx{call origin attribute} \\
1896 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1897 \addtoindexx{call parameter attribute} \\
1898 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1899 \addtoindexx{call pc attribute} \\
1900 \DWATcallreturnpc~\ddag &0x82 &\CLASSaddress
1901 \addtoindexx{call return pc attribute} \\
1902 \DWATcalltailcall~\ddag &0x83 &\CLASSflag
1903 \addtoindexx{call tail call attribute} \\
1904 \DWATcalltarget~\ddag &0x84 &\CLASSexprloc
1905 \addtoindexx{call target attribute} \\
1906 \DWATcalltargetclobbered~\ddag &0x85 &\CLASSexprloc
1907 \addtoindexx{call target clobbered attribute} \\
1908 \DWATcallvalue~\ddag &0x86 &\CLASSexprloc
1909 \addtoindexx{call value attribute} \\
1910 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1911 \addtoindexx{noreturn attribute} \\
1912 \DWATalignment~\ddag &0x88 &\CLASSconstant
1913 \addtoindexx{alignment attribute} \\
1914 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1915 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1922 \setlength{\extrarowheight}{0.1cm}
1923 \begin{longtable}{l|c|l}
1924 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1925 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1927 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1929 \hline \emph{Continued on next page}
1931 \hline \ddag\ \textit{New in DWARF Version 5}
1934 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1935 \textit{Reserved} &0x02& \\
1936 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1937 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1938 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1939 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1940 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1941 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1942 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1943 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1944 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1945 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1946 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1947 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1948 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1949 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1950 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1951 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1952 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1953 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
1954 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
1955 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1956 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
1957 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
1958 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
1959 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
1960 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
1961 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
1962 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
1963 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
1964 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
1965 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
1972 \section{Variable Length Data}
1973 \label{datarep:variablelengthdata}
1974 \addtoindexx{variable length data|see {LEB128}}
1976 \addtoindexx{Little Endian Base 128|see{LEB128}}
1977 encoded using \doublequote{Little Endian Base 128}
1978 \addtoindexx{little-endian encoding|see{endian attribute}}
1980 \addtoindexx{LEB128}
1981 LEB128 is a scheme for encoding integers
1982 densely that exploits the assumption that most integers are
1985 \textit{This encoding is equally suitable whether the target machine
1986 architecture represents data in big\dash\ endian or little\dash endian
1987 order. It is \doublequote{little\dash endian} only in the sense that it
1988 avoids using space to represent the \doublequote{big} end of an
1989 unsigned integer, when the big end is all zeroes or sign
1992 Unsigned LEB128\addtoindexx{LEB128!unsigned} (ULEB128) numbers are encoded as follows:
1993 \addtoindexx{LEB128!unsigned, encoding as}
1994 start at the low order end of an unsigned integer and chop
1995 it into 7\dash bit chunks. Place each chunk into the low order 7
1996 bits of a byte. Typically, several of the high order bytes
1997 will be zero; discard them. Emit the remaining bytes in a
1998 stream, starting with the low order byte; set the high order
1999 bit on each byte except the last emitted byte. The high bit
2000 of zero on the last byte indicates to the decoder that it
2001 has encountered the last byte.
2003 The integer zero is a special case, consisting of a single
2006 Table \refersec{tab:examplesofunsignedleb128encodings}
2007 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2009 0x80 in each case is the high order bit of the byte, indicating
2010 that an additional byte follows.
2013 The encoding for signed, two\textquoteright s complement LEB128 (SLEB128)
2014 \addtoindexx{LEB128!signed, encoding as}
2015 numbers is similar, except that the criterion for discarding
2016 high order bytes is not whether they are zero, but whether
2017 they consist entirely of sign extension bits. Consider the
2018 32\dash bit integer -2. The three high level bytes of the number
2019 are sign extension, thus LEB128 would represent it as a single
2020 byte containing the low order 7 bits, with the high order
2021 bit cleared to indicate the end of the byte stream. Note
2022 that there is nothing within the LEB128 representation that
2023 indicates whether an encoded number is signed or unsigned. The
2024 decoder must know what type of number to expect.
2025 Table \refersec{tab:examplesofunsignedleb128encodings}
2026 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2027 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2028 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2031 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2032 \addtoindexx{LEB128!examples}
2033 gives algorithms for encoding and decoding these forms.}
2037 \setlength{\extrarowheight}{0.1cm}
2038 \begin{longtable}{c|c|c}
2039 \caption{Examples of unsigned LEB128 encodings}
2040 \label{tab:examplesofunsignedleb128encodings}
2041 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2042 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2044 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2046 \hline \emph{Continued on next page}
2052 128& 0 + 0x80 & 1 \\
2053 129& 1 + 0x80 & 1 \\
2054 %130& 2 + 0x80 & 1 \\
2055 12857& 57 + 0x80 & 100 \\
2062 \setlength{\extrarowheight}{0.1cm}
2063 \begin{longtable}{c|c|c}
2064 \caption{Examples of signed LEB128 encodings}
2065 \label{tab:examplesofsignedleb128encodings}
2066 \addtoindexx{LEB128!signed} \\
2067 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2069 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2071 \hline \emph{Continued on next page}
2077 127& 127 + 0x80 & 0 \\
2078 -127& 1 + 0x80 & 0x7f \\
2079 128& 0 + 0x80 & 1 \\
2080 -128& 0 + 0x80 & 0x7f \\
2081 129& 1 + 0x80 & 1 \\
2082 -129& 0x7f + 0x80 & 0x7e \\
2089 \section{DWARF Expressions and Location Descriptions}
2090 \label{datarep:dwarfexpressionsandlocationdescriptions}
2091 \subsection{DWARF Expressions}
2092 \label{datarep:dwarfexpressions}
2095 \addtoindexx{DWARF expression!operator encoding}
2096 DWARF expression is stored in a \nolink{block} of contiguous
2097 bytes. The bytes form a sequence of operations. Each operation
2098 is a 1\dash byte code that identifies that operation, followed by
2099 zero or more bytes of additional data. The encodings for the
2100 operations are described in
2101 Table \refersec{tab:dwarfoperationencodings}.
2104 \setlength{\extrarowheight}{0.1cm}
2105 \begin{longtable}{l|c|c|l}
2106 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2107 \hline & &\bfseries No. of &\\
2108 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2110 & &\bfseries No. of &\\
2111 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2113 \hline \emph{Continued on next page}
2115 \hline \ddag\ \textit{New in DWARF Version 5}
2118 \DWOPaddr&0x03&1 & constant address \\
2119 & & &(size is target specific) \\
2121 \DWOPderef&0x06&0 & \\
2123 \DWOPconstoneu&0x08&1&1\dash byte constant \\
2124 \DWOPconstones&0x09&1&1\dash byte constant \\
2125 \DWOPconsttwou&0x0a&1&2\dash byte constant \\
2126 \DWOPconsttwos&0x0b&1&2\dash byte constant \\
2127 \DWOPconstfouru&0x0c&1&4\dash byte constant \\
2128 \DWOPconstfours&0x0d&1&4\dash byte constant \\
2129 \DWOPconsteightu&0x0e&1&8\dash byte constant \\
2130 \DWOPconsteights&0x0f&1&8\dash byte constant \\
2131 \DWOPconstu&0x10&1&ULEB128 constant \\
2132 \DWOPconsts&0x11&1&SLEB128 constant \\
2133 \DWOPdup&0x12&0 & \\
2134 \DWOPdrop&0x13&0 & \\
2135 \DWOPover&0x14&0 & \\
2136 \DWOPpick&0x15&1&1\dash byte stack index \\
2137 \DWOPswap&0x16&0 & \\
2138 \DWOProt&0x17&0 & \\
2139 \DWOPxderef&0x18&0 & \\
2140 \DWOPabs&0x19&0 & \\
2141 \DWOPand&0x1a&0 & \\
2142 \DWOPdiv&0x1b&0 & \\
2143 \DWOPminus&0x1c&0 & \\
2144 \DWOPmod&0x1d&0 & \\
2145 \DWOPmul&0x1e&0 & \\
2146 \DWOPneg&0x1f&0 & \\
2147 \DWOPnot&0x20&0 & \\
2149 \DWOPplus&0x22&0 & \\
2150 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2151 \DWOPshl&0x24&0 & \\
2152 \DWOPshr&0x25&0 & \\
2153 \DWOPshra&0x26&0 & \\
2154 \DWOPxor&0x27&0 & \\
2156 \DWOPbra&0x28&1 & signed 2\dash byte constant \\
2163 \DWOPskip&0x2f&1&signed 2\dash byte constant \\ \hline
2165 \DWOPlitzero & 0x30 & 0 & \\
2166 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2167 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2168 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2170 \DWOPregzero & 0x50 & 0 & \\*
2171 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2172 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2173 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2175 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2176 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2177 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2178 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2180 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2181 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2182 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2183 & & &SLEB128 offset \\
2184 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2185 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2186 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2187 \DWOPnop{} & 0x96 &0& \\
2189 \DWOPpushobjectaddress&0x97&0 & \\
2190 \DWOPcalltwo&0x98&1& 2\dash byte offset of DIE \\
2191 \DWOPcallfour&0x99&1& 4\dash byte offset of DIE \\
2192 \DWOPcallref&0x9a&1& 4\dash\ or 8\dash byte offset of DIE \\
2193 \DWOPformtlsaddress&0x9b &0& \\
2194 \DWOPcallframecfa{} &0x9c &0& \\
2195 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2197 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2198 &&&\nolink{block} of that size\\
2199 \DWOPstackvalue{} &0x9f &0& \\
2200 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2201 &&&SLEB128 constant offset \\
2202 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2203 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2204 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2205 &&&\nolink{block} of that size\\
2206 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2207 & & & 1-byte size, \\*
2208 & & & constant value \\
2209 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2210 &&& ULEB128 constant offset \\
2211 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2212 &&& ULEB128 type entry offset \\
2213 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2214 &&& ULEB128 type entry offset \\
2215 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2216 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2217 \DWOPlouser{} &0xe0 && \\
2218 \DWOPhiuser{} &\xff && \\
2224 \subsection{Location Descriptions}
2225 \label{datarep:locationdescriptions}
2227 A location description is used to compute the
2228 location of a variable or other entity.
2230 \subsection{Location Lists}
2231 \label{datarep:locationlists}
2233 Each entry in a \addtoindex{location list} is either a location list entry,
2234 a base address selection entry, or an
2235 \addtoindexx{end of list entry!in location list}
2239 \subsubsection{Location List Entries in Non-Split Objects}
2240 A \addtoindex{location list} entry consists of two address offsets followed
2241 by an unsigned 2\dash byte length, followed by a block of contiguous bytes
2242 that contains a DWARF location description. The length
2243 specifies the number of bytes in that block. The two offsets
2244 are the same size as an address on the target machine.
2247 A base address selection entry and an
2248 \addtoindexx{end of list entry!in location list}
2249 end of list entry each
2250 consist of two (constant or relocated) address offsets. The two
2251 offsets are the same size as an address on the target machine.
2253 For a \addtoindex{location list} to be specified, the base address of
2254 \addtoindexx{base address selection entry!in location list}
2255 the corresponding compilation unit must be defined
2256 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2258 \subsubsection{Location List Entries in Split Objects}
2259 An alternate form for location list entries is used in split objects.
2260 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2261 that follows. The encodings for these constants are given in
2262 Table \refersec{tab:locationlistentryencodingvalues}.
2265 \setlength{\extrarowheight}{0.1cm}
2266 \begin{longtable}{l|c}
2267 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2268 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2270 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2272 \hline \emph{Continued on next page}
2276 \DWLLEendoflistentry & 0x0 \\
2277 \DWLLEbaseaddressselectionentry & 0x01 \\
2278 \DWLLEstartendentry & 0x02 \\
2279 \DWLLEstartlengthentry & 0x03 \\
2280 \DWLLEoffsetpairentry & 0x04 \\
2284 \section{Base Type Attribute Encodings}
2285 \label{datarep:basetypeattributeencodings}
2287 The encodings of the
2288 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2290 \addtoindexx{encoding attribute}
2293 attribute are given in
2294 Table \refersec{tab:basetypeencodingvalues}
2297 \setlength{\extrarowheight}{0.1cm}
2298 \begin{longtable}{l|c}
2299 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2300 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2302 \bfseries Base type encoding name&\bfseries Value\\ \hline
2304 \hline \emph{Continued on next page}
2307 \ddag \ \textit{New in \DWARFVersionV}
2309 \DWATEaddress&0x01 \\
2310 \DWATEboolean&0x02 \\
2311 \DWATEcomplexfloat&0x03 \\
2313 \DWATEsigned&0x05 \\
2314 \DWATEsignedchar&0x06 \\
2315 \DWATEunsigned&0x07 \\
2316 \DWATEunsignedchar&0x08 \\
2317 \DWATEimaginaryfloat&0x09 \\
2318 \DWATEpackeddecimal&0x0a \\
2319 \DWATEnumericstring&0x0b \\
2320 \DWATEedited&0x0c \\
2321 \DWATEsignedfixed&0x0d \\
2322 \DWATEunsignedfixed&0x0e \\
2323 \DWATEdecimalfloat & 0x0f \\
2324 \DWATEUTF{} & 0x10 \\
2325 \DWATEUCS~\ddag & 0x11 \\
2326 \DWATEASCII~\ddag & 0x12 \\
2327 \DWATElouser{} & 0x80 \\
2328 \DWATEhiuser{} & \xff \\
2333 The encodings of the constants used in the
2334 \DWATdecimalsign{} attribute
2336 Table \refersec{tab:decimalsignencodings}.
2339 \setlength{\extrarowheight}{0.1cm}
2340 \begin{longtable}{l|c}
2341 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2342 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2344 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2346 \hline \emph{Continued on next page}
2351 \DWDSunsigned{} & 0x01 \\
2352 \DWDSleadingoverpunch{} & 0x02 \\
2353 \DWDStrailingoverpunch{} & 0x03 \\
2354 \DWDSleadingseparate{} & 0x04 \\
2355 \DWDStrailingseparate{} & 0x05 \\
2361 The encodings of the constants used in the
2362 \DWATendianity{} attribute are given in
2363 Table \refersec{tab:endianityencodings}.
2366 \setlength{\extrarowheight}{0.1cm}
2367 \begin{longtable}{l|c}
2368 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2369 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2371 \bfseries Endian code name&\bfseries Value\\ \hline
2373 \hline \emph{Continued on next page}
2378 \DWENDdefault{} & 0x00 \\
2379 \DWENDbig{} & 0x01 \\
2380 \DWENDlittle{} & 0x02 \\
2381 \DWENDlouser{} & 0x40 \\
2382 \DWENDhiuser{} & \xff \\
2387 \section{Accessibility Codes}
2388 \label{datarep:accessibilitycodes}
2389 The encodings of the constants used in the
2390 \DWATaccessibility{}
2392 \addtoindexx{accessibility attribute}
2394 Table \refersec{tab:accessibilityencodings}.
2397 \setlength{\extrarowheight}{0.1cm}
2398 \begin{longtable}{l|c}
2399 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2400 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2402 \bfseries Accessibility code name&\bfseries Value\\ \hline
2404 \hline \emph{Continued on next page}
2409 \DWACCESSpublic&0x01 \\
2410 \DWACCESSprotected&0x02 \\
2411 \DWACCESSprivate&0x03 \\
2417 \section{Visibility Codes}
2418 \label{datarep:visibilitycodes}
2419 The encodings of the constants used in the
2420 \DWATvisibility{} attribute are given in
2421 Table \refersec{tab:visibilityencodings}.
2424 \setlength{\extrarowheight}{0.1cm}
2425 \begin{longtable}{l|c}
2426 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2427 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2429 \bfseries Visibility code name&\bfseries Value\\ \hline
2431 \hline \emph{Continued on next page}
2437 \DWVISexported&0x02 \\
2438 \DWVISqualified&0x03 \\
2443 \section{Virtuality Codes}
2444 \label{datarep:vitualitycodes}
2446 The encodings of the constants used in the
2447 \DWATvirtuality{} attribute are given in
2448 Table \refersec{tab:virtualityencodings}.
2451 \setlength{\extrarowheight}{0.1cm}
2452 \begin{longtable}{l|c}
2453 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2454 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2456 \bfseries Virtuality code name&\bfseries Value\\ \hline
2458 \hline \emph{Continued on next page}
2463 \DWVIRTUALITYnone&0x00 \\
2464 \DWVIRTUALITYvirtual&0x01 \\
2465 \DWVIRTUALITYpurevirtual&0x02 \\
2473 \DWVIRTUALITYnone{} is equivalent to the absence of the
2477 \section{Source Languages}
2478 \label{datarep:sourcelanguages}
2480 The encodings of the constants used
2481 \addtoindexx{language attribute, encoding}
2483 \addtoindexx{language name encoding}
2486 attribute are given in
2487 Table \refersec{tab:languageencodings}.
2489 % If we don't force a following space it looks odd
2491 and their associated values are reserved, but the
2492 languages they represent are not well supported.
2493 Table \refersec{tab:languageencodings}
2495 \addtoindexx{lower bound attribute!default}
2496 default lower bound, if any, assumed for
2497 an omitted \DWATlowerbound{} attribute in the context of a
2498 \DWTAGsubrangetype{} debugging information entry for each
2502 \setlength{\extrarowheight}{0.1cm}
2503 \begin{longtable}{l|c|c}
2504 \caption{Language encodings} \label{tab:languageencodings}\\
2505 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2507 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2509 \hline \emph{Continued on next page}
2512 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2514 \addtoindexx{ISO-defined language names}
2516 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2517 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2518 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2519 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2520 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2521 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2522 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2523 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2524 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2525 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2526 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2527 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2528 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2529 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2530 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2531 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2532 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2533 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2534 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2535 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2536 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2537 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2538 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2539 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2540 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2541 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2542 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2543 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2544 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2545 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2546 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2547 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2548 \DWLANGlouser{} &0x8000 & \\
2549 \DWLANGhiuser{} &\xffff & \\
2554 \section{Address Class Encodings}
2555 \label{datarep:addressclassencodings}
2557 The value of the common
2558 \addtoindex{address class} encoding
2562 \section{Identifier Case}
2563 \label{datarep:identifiercase}
2565 The encodings of the constants used in the
2566 \DWATidentifiercase{} attribute are given in
2567 Table \refersec{tab:identifiercaseencodings}.
2570 \setlength{\extrarowheight}{0.1cm}
2571 \begin{longtable}{l|c}
2572 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2573 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2575 \bfseries Identifier case name&\bfseries Value\\ \hline
2577 \hline \emph{Continued on next page}
2581 \DWIDcasesensitive&0x00 \\
2583 \DWIDdowncase&0x02 \\
2584 \DWIDcaseinsensitive&0x03 \\
2588 \section{Calling Convention Encodings}
2589 \label{datarep:callingconventionencodings}
2590 The encodings of the constants used in the
2591 \DWATcallingconvention{} attribute are given in
2592 Table \refersec{tab:callingconventionencodings}.
2595 \setlength{\extrarowheight}{0.1cm}
2596 \begin{longtable}{l|c}
2597 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2598 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2600 \bfseries Calling convention name&\bfseries Value\\ \hline
2602 \hline \emph{Continued on next page}
2608 \DWCCprogram&0x02 \\
2617 \section{Inline Codes}
2618 \label{datarep:inlinecodes}
2620 The encodings of the constants used in
2621 \addtoindexx{inline attribute}
2623 \DWATinline{} attribute are given in
2624 Table \refersec{tab:inlineencodings}.
2628 \setlength{\extrarowheight}{0.1cm}
2629 \begin{longtable}{l|c}
2630 \caption{Inline encodings} \label{tab:inlineencodings}\\
2631 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2633 \bfseries Inline Code name&\bfseries Value\\ \hline
2635 \hline \emph{Continued on next page}
2640 \DWINLnotinlined&0x00 \\
2641 \DWINLinlined&0x01 \\
2642 \DWINLdeclarednotinlined&0x02 \\
2643 \DWINLdeclaredinlined&0x03 \\
2648 % this clearpage is ugly, but the following table came
2649 % out oddly without it.
2651 \section{Array Ordering}
2652 \label{datarep:arrayordering}
2654 The encodings of the constants used in the
2655 \DWATordering{} attribute are given in
2656 Table \refersec{tab:orderingencodings}.
2660 \setlength{\extrarowheight}{0.1cm}
2661 \begin{longtable}{l|c}
2662 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2663 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2665 \bfseries Ordering name&\bfseries Value\\ \hline
2667 \hline \emph{Continued on next page}
2672 \DWORDrowmajor&0x00 \\
2673 \DWORDcolmajor&0x01 \\
2679 \section{Discriminant Lists}
2680 \label{datarep:discriminantlists}
2682 The descriptors used in
2683 \addtoindexx{discriminant list attribute}
2685 \DWATdiscrlist{} attribute are
2686 encoded as 1\dash byte constants. The
2687 defined values are given in
2688 Table \refersec{tab:discriminantdescriptorencodings}.
2690 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2692 \setlength{\extrarowheight}{0.1cm}
2693 \begin{longtable}{l|c}
2694 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2695 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2697 \bfseries Descriptor name&\bfseries Value\\ \hline
2699 \hline \emph{Continued on next page}
2711 \section{Name Lookup Tables}
2712 \label{datarep:namelookuptables}
2714 Each set of entries in the table of global names contained
2715 in the \dotdebugpubnames{} and
2716 \dotdebugpubtypes{} sections begins
2717 with a header consisting of:
2718 \begin{enumerate}[1. ]
2720 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2721 \addttindexx{unit\_length}
2722 A 4\dash byte or 12\dash byte unsigned integer
2723 \addtoindexx{initial length}
2724 representing the length
2725 of the \dotdebuginfo{}
2726 contribution for that compilation unit,
2727 not including the length field itself. In the
2728 \thirtytwobitdwarfformat, this is a 4\dash byte unsigned integer (which must be less
2729 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
2730 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
2731 integer that gives the actual length
2732 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2734 \item version (\addtoindex{uhalf}) \\
2735 A 2\dash byte unsigned integer representing the version of the
2736 DWARF information for the name lookup table
2737 \addtoindexx{version number!name lookup table}
2738 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2739 The value in this field is 2.
2742 \item \addttindex{debug\_info\_offset} (section offset) \\
2744 \addtoindexx{section offset!in name lookup table set of entries}
2745 4\dash byte or 8\dash byte
2747 \dotdebuginfo{} or \dotdebuginfodwo{}
2748 section of the compilation unit header.
2749 In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned offset;
2750 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned offsets
2751 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2753 \item \addttindex{debug\_info\_length} (\livelink{datarep:sectionoffsetlength}{section length}) \\
2754 \addtoindexx{section length!in .debug\_pubnames header}
2756 \addtoindexx{section length!in .debug\_pubtypes header}
2757 4\dash byte or 8\dash byte length containing the size in bytes of the
2758 contents of the \dotdebuginfo{}
2759 section generated to represent
2760 this compilation unit. In the \thirtytwobitdwarfformat, this is
2761 a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat, this
2762 is an 8-byte unsigned length
2763 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2768 This header is followed by a series of tuples. Each tuple
2769 consists of a 4\dash byte or 8\dash byte offset followed by a string
2770 of non\dash null bytes terminated by one null byte.
2772 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2773 format, it is an 8\dash byte offset.
2774 Each set is terminated by an
2775 offset containing the value 0.
2779 \section{Address Range Table}
2780 \label{datarep:addrssrangetable}
2782 Each set of entries in the table of address ranges contained
2783 in the \dotdebugaranges{}
2784 section begins with a header containing:
2785 \begin{enumerate}[1. ]
2786 % FIXME The unit length text is not fully consistent across
2789 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2790 \addttindexx{unit\_length}
2791 A 4-byte or 12-byte length containing the length of the
2792 \addtoindexx{initial length}
2793 set of entries for this compilation unit, not including the
2794 length field itself. In the \thirtytwobitdwarfformat, this is a
2795 4-byte unsigned integer (which must be less than \xfffffffzero);
2796 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2797 \wffffffff followed by an 8-byte unsigned integer that gives
2799 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2801 \item version (\addtoindex{uhalf}) \\
2802 A 2\dash byte version identifier representing the version of the
2803 DWARF information for the address range table
2804 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2805 This value in this field \addtoindexx{version number!address range table} is 2.
2808 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2810 \addtoindexx{section offset!in .debug\_aranges header}
2811 4\dash byte or 8\dash byte offset into the
2812 \dotdebuginfo{} section of
2813 the compilation unit header. In the \thirtytwobitdwarfformat,
2814 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2815 this is an 8\dash byte unsigned offset
2816 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2818 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2819 A 1\dash byte unsigned integer containing the size in bytes of an
2820 \addttindexx{address\_size}
2822 \addtoindexx{size of an address}
2823 (or the offset portion of an address for segmented
2824 \addtoindexx{address space!segmented}
2825 addressing) on the target system.
2827 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2829 \addttindexx{segment\_size}
2830 1\dash byte unsigned integer containing the size in bytes of a
2831 segment selector on the target system.
2835 This header is followed by a series of tuples. Each tuple
2836 consists of a segment, an address and a length.
2838 size is given by the \addttindex{segment\_size} field of the header; the
2839 address and length size are each given by the \addttindex{address\_size}
2840 field of the header.
2841 The first tuple following the header in
2842 each set begins at an offset that is a multiple of the size
2843 of a single tuple (that is, the size of a segment selector
2844 plus twice the \addtoindex{size of an address}).
2845 The header is padded, if
2846 necessary, to that boundary. Each set of tuples is terminated
2847 by a 0 for the segment, a 0 for the address and 0 for the
2848 length. If the \addttindex{segment\_size} field in the header is zero,
2849 the segment selectors are omitted from all tuples, including
2850 the terminating tuple.
2853 \section{Line Number Information}
2854 \label{datarep:linenumberinformation}
2856 The \addtoindexi{version number}{version number!line number information}
2857 in the line number program header is \versiondotdebugline{}
2858 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2860 The boolean values \doublequote{true} and \doublequote{false}
2861 used by the line number information program are encoded
2862 as a single byte containing the value 0
2863 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2865 The encodings for the standard opcodes are given in
2866 \addtoindexx{line number opcodes!standard opcode encoding}
2867 Table \refersec{tab:linenumberstandardopcodeencodings}.
2869 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2871 \setlength{\extrarowheight}{0.1cm}
2872 \begin{longtable}{l|c}
2873 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2874 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2876 \bfseries Opcode name&\bfseries Value\\ \hline
2878 \hline \emph{Continued on next page}
2884 \DWLNSadvancepc&0x02 \\
2885 \DWLNSadvanceline&0x03 \\
2886 \DWLNSsetfile&0x04 \\
2887 \DWLNSsetcolumn&0x05 \\
2888 \DWLNSnegatestmt&0x06 \\
2889 \DWLNSsetbasicblock&0x07 \\
2890 \DWLNSconstaddpc&0x08 \\
2891 \DWLNSfixedadvancepc&0x09 \\
2892 \DWLNSsetprologueend&0x0a \\*
2893 \DWLNSsetepiloguebegin&0x0b \\*
2894 \DWLNSsetisa&0x0c \\*
2901 The encodings for the extended opcodes are given in
2902 \addtoindexx{line number opcodes!extended opcode encoding}
2903 Table \refersec{tab:linenumberextendedopcodeencodings}.
2907 \setlength{\extrarowheight}{0.1cm}
2908 \begin{longtable}{l|c}
2909 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2910 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2912 \bfseries Opcode name&\bfseries Value\\ \hline
2914 \hline \emph{Continued on next page}
2916 \hline %\ddag~\textit{New in DWARF Version 5}
2919 \DWLNEendsequence &0x01 \\
2920 \DWLNEsetaddress &0x02 \\
2921 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
2922 \texttt{DW\_LNE\_define\_file} operation which was defined prior to \DWARFVersionV.} \\
2923 \DWLNEsetdiscriminator &0x04 \\
2924 \DWLNElouser &0x80 \\
2925 \DWLNEhiuser &\xff \\
2931 The encodings for the line number header entry formats are given in
2932 \addtoindexx{line number opcodes!file entry format encoding}
2933 Table \refersec{tab:linenumberheaderentryformatencodings}.
2936 \setlength{\extrarowheight}{0.1cm}
2937 \begin{longtable}{l|c}
2938 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
2939 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
2941 \bfseries Line number header entry format name&\bfseries Value\\ \hline
2943 \hline \emph{Continued on next page}
2945 \hline \ddag~\textit{New in DWARF Version 5}
2947 \DWLNCTpath~\ddag & 0x1 \\
2948 \DWLNCTdirectoryindex~\ddag & 0x2 \\
2949 \DWLNCTtimestamp~\ddag & 0x3 \\
2950 \DWLNCTsize~\ddag & 0x4 \\
2951 \DWLNCTMDfive~\ddag & 0x5 \\
2952 \DWLNCTlouser~\ddag & 0x2000 \\
2953 \DWLNCThiuser~\ddag & \xiiifff \\
2957 \section{Macro Information}
2958 \label{datarep:macroinformation}
2959 The \addtoindexi{version number}{version number!macro information}
2960 in the macro information header is \versiondotdebugmacro{}
2961 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2963 The source line numbers and source file indices encoded in the
2964 macro information section are represented as
2965 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
2968 The macro information entry type is encoded as a single unsigned byte.
2970 \addtoindexx{macro information entry types!encoding}
2972 Table \refersec{tab:macroinfoentrytypeencodings}.
2976 \setlength{\extrarowheight}{0.1cm}
2977 \begin{longtable}{l|c}
2978 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
2979 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
2981 \bfseries Macro information entry type name&\bfseries Value\\ \hline
2983 \hline \emph{Continued on next page}
2985 \hline \ddag~\textit{New in DWARF Version 5}
2988 \DWMACROdefine~\ddag &0x01 \\
2989 \DWMACROundef~\ddag &0x02 \\
2990 \DWMACROstartfile~\ddag &0x03 \\
2991 \DWMACROendfile~\ddag &0x04 \\
2992 \DWMACROdefineindirect~\ddag &0x05 \\
2993 \DWMACROundefindirect~\ddag &0x06 \\
2994 \DWMACROtransparentinclude~\ddag &0x07 \\
2995 \DWMACROdefineindirectsup~\ddag &0x08 \\
2996 \DWMACROundefindirectsup~\ddag &0x09 \\
2997 \DWMACROtransparentincludesup~\ddag&0x0a \\
2998 \DWMACROdefineindirectx~\ddag &0x0b \\
2999 \DWMACROundefindirectx~\ddag &0x0c \\
3000 \DWMACROlouser~\ddag &0xe0 \\
3001 \DWMACROhiuser~\ddag &\xff \\
3007 \section{Call Frame Information}
3008 \label{datarep:callframeinformation}
3010 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3011 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3012 value is \xffffffffffffffff.
3014 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3015 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3017 Call frame instructions are encoded in one or more bytes. The
3018 primary opcode is encoded in the high order two bits of
3019 the first byte (that is, opcode = byte $\gg$ 6). An operand
3020 or extended opcode may be encoded in the low order 6
3021 bits. Additional operands are encoded in subsequent bytes.
3022 The instructions and their encodings are presented in
3023 Table \refersec{tab:callframeinstructionencodings}.
3026 \setlength{\extrarowheight}{0.1cm}
3027 \begin{longtable}{l|c|c|l|l}
3028 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3029 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3030 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3032 & \bfseries High 2 &\bfseries Low 6 & &\\
3033 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3035 \hline \emph{Continued on next page}
3040 \DWCFAadvanceloc&0x1&delta & \\
3041 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3042 \DWCFArestore&0x3®ister & & \\
3043 \DWCFAnop&0&0 & & \\
3044 \DWCFAsetloc&0&0x01&address & \\
3045 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
3046 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
3047 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
3048 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3049 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3050 \DWCFAundefined&0&0x07&ULEB128 register & \\
3051 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3052 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3053 \DWCFArememberstate&0&0x0a & & \\
3054 \DWCFArestorestate&0&0x0b & & \\
3055 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3056 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3057 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3058 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3059 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3061 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3062 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3063 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3064 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3065 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3066 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3067 \DWCFAlouser&0&0x1c & & \\
3068 \DWCFAhiuser&0&\xiiif & & \\
3072 \section{Non-contiguous Address Ranges}
3073 \label{datarep:noncontiguousaddressranges}
3075 Each entry in a \addtoindex{range list}
3076 (see Section \refersec{chap:noncontiguousaddressranges})
3078 \addtoindexx{base address selection entry!in range list}
3080 \addtoindexx{range list}
3081 a base address selection entry, or an end
3084 A \addtoindex{range list} entry consists of two relative addresses. The
3085 addresses are the same size as addresses on the target machine.
3088 A base address selection entry and an
3089 \addtoindexx{end of list entry!in range list}
3090 end of list entry each
3091 \addtoindexx{base address selection entry!in range list}
3092 consist of two (constant or relocated) addresses. The two
3093 addresses are the same size as addresses on the target machine.
3095 For a \addtoindex{range list} to be specified, the base address of the
3096 \addtoindexx{base address selection entry!in range list}
3097 corresponding compilation unit must be defined
3098 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
3101 \section{String Offsets Table}
3102 \label{chap:stringoffsetstable}
3103 Each set of entries in the string offsets table contained in the
3104 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3105 section begins with a header containing:
3106 \begin{enumerate}[1. ]
3107 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3108 A 4-byte or 12-byte length containing the length of
3109 the set of entries for this compilation unit, not
3110 including the length field itself. In the 32-bit
3111 DWARF format, this is a 4-byte unsigned integer
3112 (which must be less than \xfffffffzero); in the 64-bit
3113 DWARF format, this consists of the 4-byte value
3114 \wffffffff followed by an 8-byte unsigned integer
3115 that gives the actual length (see
3116 Section \refersec{datarep:32bitand64bitdwarfformats}).
3119 \item \texttt{version} (\addtoindex{uhalf}) \\
3120 A 2-byte version identifier containing the value
3121 \versiondotdebugstroffsets{}
3122 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3124 \item \texttt{padding} (\addtoindex{uhalf}) \\
3127 This header is followed by a series of string table offsets
3128 that have the same representation as \DWFORMstrp.
3129 For the 32-bit DWARF format, each offset is 4 bytes long; for
3130 the 64-bit DWARF format, each offset is 8 bytes long.
3132 The \DWATstroffsetsbase{} attribute points to the first
3133 entry following the header. The entries are indexed
3134 sequentially from this base entry, starting from 0.
3136 \section{Address Table}
3137 \label{chap:addresstable}
3138 Each set of entries in the address table contained in the
3139 \dotdebugaddr{} section begins with a header containing:
3140 \begin{enumerate}[1. ]
3141 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3142 A 4-byte or 12-byte length containing the length of
3143 the set of entries for this compilation unit, not
3144 including the length field itself. In the 32-bit
3145 DWARF format, this is a 4-byte unsigned integer
3146 (which must be less than \xfffffffzero); in the 64-bit
3147 DWARF format, this consists of the 4-byte value
3148 \wffffffff followed by an 8-byte unsigned integer
3149 that gives the actual length (see
3150 Section \refersec{datarep:32bitand64bitdwarfformats}).
3153 \item \texttt{version} (\addtoindex{uhalf}) \\
3154 A 2-byte version identifier containing the value
3155 \versiondotdebugaddr{}
3156 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3159 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3160 A 1-byte unsigned integer containing the size in
3161 bytes of an address (or the offset portion of an
3162 address for segmented addressing) on the target
3166 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3167 A 1-byte unsigned integer containing the size in
3168 bytes of a segment selector on the target system.
3171 This header is followed by a series of segment/address pairs.
3172 The segment size is given by the \addttindex{segment\_size} field of the
3173 header, and the address size is given by the \addttindex{address\_size}
3174 field of the header. If the \addttindex{segment\_size} field in the header
3175 is zero, the entries consist only of an addresses.
3177 The \DWATaddrbase{} attribute points to the first entry
3178 following the header. The entries are indexed sequentially
3179 from this base entry, starting from 0.
3181 \section{Range List Table}
3182 \label{app:rangelisttable}
3183 Each set of entries in the range list table contained in the
3184 \dotdebugranges{} section begins with a header containing:
3185 \begin{enumerate}[1. ]
3186 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3187 A 4-byte or 12-byte length containing the length of
3188 the set of entries for this compilation unit, not
3189 including the length field itself. In the 32-bit
3190 DWARF format, this is a 4-byte unsigned integer
3191 (which must be less than \xfffffffzero); in the 64-bit
3192 DWARF format, this consists of the 4-byte value
3193 \wffffffff followed by an 8-byte unsigned integer
3194 that gives the actual length (see
3195 Section \refersec{datarep:32bitand64bitdwarfformats}).
3198 \item \texttt{version} (\addtoindex{uhalf}) \\
3199 A 2-byte version identifier containing the value
3200 \versiondotdebugranges{}
3201 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3204 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3205 A 1-byte unsigned integer containing the size in
3206 bytes of an address (or the offset portion of an
3207 address for segmented addressing) on the target
3211 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3212 A 1-byte unsigned integer containing the size in
3213 bytes of a segment selector on the target system.
3216 This header is followed by a series of range list entries as
3217 described in Section \refersec{chap:locationlists}.
3218 The segment size is given by the
3219 \addttindex{segment\_size} field of the header, and the address size is
3220 given by the \addttindex{address\_size} field of the header. If the
3221 \addttindex{segment\_size} field in the header is zero, the segment
3222 selector is omitted from the range list entries.
3224 The \DWATrangesbase{} attribute points to the first entry
3225 following the header. The entries are referenced by a byte
3226 offset relative to this base address.
3229 \section{Location List Table}
3230 \label{datarep:locationlisttable}
3231 Each set of entries in the location list table contained in the
3232 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3233 \begin{enumerate}[1. ]
3234 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3235 A 4-byte or 12-byte length containing the length of
3236 the set of entries for this compilation unit, not
3237 including the length field itself. In the 32-bit
3238 DWARF format, this is a 4-byte unsigned integer
3239 (which must be less than \xfffffffzero); in the 64-bit
3240 DWARF format, this consists of the 4-byte value
3241 \wffffffff followed by an 8-byte unsigned integer
3242 that gives the actual length (see
3243 Section \refersec{datarep:32bitand64bitdwarfformats}).
3246 \item \texttt{version} (\addtoindex{uhalf}) \\
3247 A 2-byte version identifier containing the value
3248 \versiondotdebugloc{}
3249 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3252 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3253 A 1-byte unsigned integer containing the size in
3254 bytes of an address (or the offset portion of an
3255 address for segmented addressing) on the target
3259 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3260 A 1-byte unsigned integer containing the size in
3261 bytes of a segment selector on the target system.
3264 This header is followed by a series of location list entries as
3265 described in Section \refersec{chap:locationlists}.
3266 The segment size is given by the
3267 \addttindex{segment\_size} field of the header, and the address size is
3268 given by the \texttt{address\_size} field of the header. If the
3269 \addttindex{segment\_size} field in the header is zero, the segment
3270 selector is omitted from the range list entries.
3272 The entries are referenced by a byte offset relative to the first
3273 location list following this header.
3276 \section{Dependencies and Constraints}
3277 \label{datarep:dependenciesandconstraints}
3278 The debugging information in this format is intended to
3280 \addtoindexx{DWARF section names!list of}
3291 \dotdebugpubnames{},
3292 \dotdebugpubtypes{},
3296 \dotdebugstroffsets{}
3297 sections of an object file, or equivalent
3298 separate file or database. The information is not
3299 word\dash aligned. Consequently:
3302 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3303 32\dash bit addresses, an assembler or compiler must provide a way
3304 to produce 2\dash byte and 4\dash byte quantities without alignment
3305 restrictions, and the linker must be able to relocate a
3306 4\dash byte address or
3307 \addtoindexx{section offset!alignment of}
3308 section offset that occurs at an arbitrary
3311 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3312 64\dash bit addresses, an assembler or compiler must provide a
3313 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3314 alignment restrictions, and the linker must be able to relocate
3315 an 8\dash byte address or 4\dash byte
3316 \addtoindexx{section offset!alignment of}
3317 section offset that occurs at an
3318 arbitrary alignment.
3320 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3321 32\dash bit addresses, an assembler or compiler must provide a
3322 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3323 alignment restrictions, and the linker must be able to relocate
3324 a 4\dash byte address or 8\dash byte
3325 \addtoindexx{section offset!alignment of}
3326 section offset that occurs at an
3327 arbitrary alignment.
3329 \textit{It is expected that this will be required only for very large
3330 32\dash bit programs or by those architectures which support
3331 a mix of 32\dash bit and 64\dash bit code and data within the same
3334 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3335 64\dash bit addresses, an assembler or compiler must provide a
3336 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3337 alignment restrictions, and the linker must be able to
3338 relocate an 8\dash byte address or
3339 \addtoindexx{section offset!alignment of}
3340 section offset that occurs at
3341 an arbitrary alignment.
3345 \section{Integer Representation Names}
3346 \label{datarep:integerrepresentationnames}
3347 The sizes of the integers used in the lookup by name, lookup
3348 by address, line number and call frame information sections
3350 Table \ref{tab:integerrepresentationnames}.
3354 \setlength{\extrarowheight}{0.1cm}
3355 \begin{longtable}{c|l}
3356 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3357 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3359 \bfseries Representation name&\bfseries Representation\\ \hline
3361 \hline \emph{Continued on next page}
3366 \addtoindex{sbyte}& signed, 1\dash byte integer \\
3367 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
3368 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
3369 \addtoindex{uword}&unsigned, 4\dash byte integer \\
3375 \section{Type Signature Computation}
3376 \label{datarep:typesignaturecomputation}
3378 A type signature is computed only by the DWARF producer;
3379 \addtoindexx{type signature!computation}
3380 it is used by a DWARF consumer to resolve type references to
3381 the type definitions that are contained in
3382 \addtoindexx{type unit}
3386 The type signature for a type T0 is formed from the
3387 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3388 R.L. Rivest, RFC 1321, April 1992}
3389 hash of a flattened description of the type. The flattened
3390 description of the type is a byte sequence derived from the
3391 DWARF encoding of the type as follows:
3392 \begin{enumerate}[1. ]
3394 \item Start with an empty sequence S and a list V of visited
3395 types, where V is initialized to a list containing the type
3396 T0 as its single element. Elements in V are indexed from 1,
3399 \item If the debugging information entry represents a type that
3400 is nested inside another type or a namespace, append to S
3401 the type\textquoteright s context as follows: For each surrounding type
3402 or namespace, beginning with the outermost such construct,
3403 append the letter 'C', the DWARF tag of the construct, and
3404 the name (taken from
3405 \addtoindexx{name attribute}
3406 the \DWATname{} attribute) of the type
3407 \addtoindexx{name attribute}
3408 or namespace (including its trailing null byte).
3410 \item Append to S the letter 'D', followed by the DWARF tag of
3411 the debugging information entry.
3413 \item For each of the attributes in
3414 Table \refersec{tab:attributesusedintypesignaturecomputation}
3416 the debugging information entry, in the order listed,
3417 append to S a marker letter (see below), the DWARF attribute
3418 code, and the attribute value.
3421 \caption{Attributes used in type signature computation}
3422 \label{tab:attributesusedintypesignaturecomputation}
3423 \simplerule[\textwidth]
3425 \autocols[0pt]{c}{2}{l}{
3441 \DWATcontainingtype,
3445 \DWATdatamemberlocation,
3466 \DWATrvaluereference,
3470 \DWATstringlengthbitsize,
3471 \DWATstringlengthbytesize,
3476 \DWATvariableparameter,
3479 \DWATvtableelemlocation
3482 \simplerule[\textwidth]
3485 Note that except for the initial
3486 \DWATname{} attribute,
3487 \addtoindexx{name attribute}
3488 attributes are appended in order according to the alphabetical
3489 spelling of their identifier.
3491 If an implementation defines any vendor-specific attributes,
3492 any such attributes that are essential to the definition of
3493 the type should also be included at the end of the above list,
3494 in their own alphabetical suborder.
3496 An attribute that refers to another type entry T is processed
3497 as follows: (a) If T is in the list V at some V[x], use the
3498 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3499 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3500 as the marker, process the type T recursively by performing
3501 Steps 2 through 7, and use the result as the attribute value.
3503 Other attribute values use the letter 'A' as the marker, and
3504 the value consists of the form code (encoded as an unsigned
3505 LEB128 value) followed by the encoding of the value according
3506 to the form code. To ensure reproducibility of the signature,
3507 the set of forms used in the signature computation is limited
3516 \item If the tag in Step 3 is one of \DWTAGpointertype,
3517 \DWTAGreferencetype,
3518 \DWTAGrvaluereferencetype,
3519 \DWTAGptrtomembertype,
3520 or \DWTAGfriend, and the referenced
3521 type (via the \DWATtype{} or
3522 \DWATfriend{} attribute) has a
3523 \DWATname{} attribute, append to S the letter 'N', the DWARF
3524 attribute code (\DWATtype{} or
3525 \DWATfriend), the context of
3526 the type (according to the method in Step 2), the letter 'E',
3527 and the name of the type. For \DWTAGfriend, if the referenced
3528 entry is a \DWTAGsubprogram, the context is omitted and the
3529 name to be used is the ABI-specific name of the subprogram
3530 (for example, the mangled linker name).
3533 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3534 \DWTAGreferencetype,
3535 \DWTAGrvaluereferencetype,
3536 \DWTAGptrtomembertype, or
3537 \DWTAGfriend, but has
3538 a \DWATtype{} attribute, or if the referenced type (via
3540 \DWATfriend{} attribute) does not have a
3541 \DWATname{} attribute, the attribute is processed according to
3542 the method in Step 4 for an attribute that refers to another
3546 \item Visit each child C of the debugging information
3547 entry as follows: If C is a nested type entry or a member
3548 function entry, and has
3549 a \DWATname{} attribute, append to
3550 \addtoindexx{name attribute}
3551 S the letter 'S', the tag of C, and its name; otherwise,
3552 process C recursively by performing Steps 3 through 7,
3553 appending the result to S. Following the last child (or if
3554 there are no children), append a zero byte.
3559 For the purposes of this algorithm, if a debugging information
3561 \DWATspecification{}
3562 attribute that refers to
3563 another entry D (which has a
3566 then S inherits the attributes and children of D, and S is
3567 processed as if those attributes and children were present in
3568 the entry S. Exception: if a particular attribute is found in
3569 both S and D, the attribute in S is used and the corresponding
3570 one in D is ignored.
3573 DWARF tag and attribute codes are appended to the sequence
3574 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3575 using the values defined earlier in this chapter.
3577 \textit{A grammar describing this computation may be found in
3578 Appendix \refersec{app:typesignaturecomputationgrammar}.
3581 \textit{An attribute that refers to another type entry should
3582 be recursively processed or replaced with the name of the
3583 referent (in Step 4, 5 or 6). If neither treatment applies to
3584 an attribute that references another type entry, the entry
3585 that contains that attribute should not be considered for a
3586 separate \addtoindex{type unit}.}
3588 \textit{If a debugging information entry contains an attribute from
3589 the list above that would require an unsupported form, that
3590 entry should not be considered for a separate
3591 \addtoindex{type unit}.}
3593 \textit{A type should be considered for a separate
3594 \addtoindex{type unit} only
3595 if all of the type entries that it contains or refers to in
3596 Steps 6 and 7 can themselves each be considered for a separate
3597 \addtoindex{type unit}.}
3600 Where the DWARF producer may reasonably choose two or more
3601 different forms for a given attribute, it should choose
3602 the simplest possible form in computing the signature. (For
3603 example, a constant value should be preferred to a location
3604 expression when possible.)
3606 Once the string S has been formed from the DWARF encoding,
3607 an \MDfive{} hash is computed for the string and the
3608 least significant 64 bits are taken as the type signature.
3610 \textit{The string S is intended to be a flattened representation of
3611 the type that uniquely identifies that type (that is, a different
3612 type is highly unlikely to produce the same string).}
3615 \textit{A debugging information entry should not be placed in a
3616 separate \addtoindex{type unit}
3617 if any of the following apply:}
3621 \item \textit{The entry has an attribute whose value is a location
3622 expression, and the location expression contains a reference to
3623 another debugging information entry (for example, a \DWOPcallref{}
3624 operator), as it is unlikely that the entry will remain
3625 identical across compilation units.}
3627 \item \textit{The entry has an attribute whose value refers
3628 to a code location or a \addtoindex{location list}.}
3630 \item \textit{The entry has an attribute whose value refers
3631 to another debugging information entry that does not represent
3637 \textit{Certain attributes are not included in the type signature:}
3640 \item \textit{The \DWATdeclaration{} attribute is not included because it
3641 indicates that the debugging information entry represents an
3642 incomplete declaration, and incomplete declarations should
3644 \addtoindexx{type unit}
3645 separate type units.}
3647 \item \textit{The \DWATdescription{} attribute is not included because
3648 it does not provide any information unique to the defining
3649 declaration of the type.}
3651 \item \textit{The \DWATdeclfile,
3653 \DWATdeclcolumn{} attributes are not included because they
3654 may vary from one source file to the next, and would prevent
3655 two otherwise identical type declarations from producing the
3656 same \MDfive{} hash.}
3658 \item \textit{The \DWATobjectpointer{} attribute is not included
3659 because the information it provides is not necessary for the
3660 computation of a unique type signature.}
3664 \textit{Nested types and some types referred to by a debugging
3665 information entry are encoded by name rather than by recursively
3666 encoding the type to allow for cases where a complete definition
3667 of the type might not be available in all compilation units.}
3670 \textit{If a type definition contains the definition of a member function,
3671 it cannot be moved as is into a type unit, because the member function
3672 contains attributes that are unique to that compilation unit.
3673 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3674 moving the member function declaration into a separate declaration tree,
3675 and replacing the function definition in the type with a non-defining
3676 declaration of the function (as if the function had been defined out of
3679 An example that illustrates the computation of an \MDfive{} hash may be found in
3680 Appendix \refersec{app:usingtypeunits}.