1 \chapter{Data Representation}
2 \label{datarep:datarepresentation}
4 This section describes the binary representation of the
5 debugging information entry itself, of the attribute types
6 and of other fundamental elements described above.
9 \section{Vendor Extensibility}
10 \label{datarep:vendorextensibility}
11 \addtoindexx{vendor extensibility}
12 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
15 \addtoindexx{extensibility|see{vendor extensibility}}
16 reserve a portion of the DWARF name space and ranges of
17 enumeration values for use for vendor specific extensions,
18 special labels are reserved for tag names, attribute names,
19 base type encodings, location operations, language names,
20 calling conventions and call frame instructions.
22 The labels denoting the beginning and end of the reserved
23 \hypertarget{chap:DWXXXlohiuser}{}
24 value range for vendor specific extensions consist of the
26 (\DWATlouserMARK{}\DWAThiuserMARK{} DW\_AT,
27 \DWATElouserMARK{}\DWATEhiuserMARK{} DW\_ATE,
28 \DWCClouserMARK{}\DWCChiuserMARK{} DW\_CC,
29 \DWCFAlouserMARK{}\DWCFAhiuserMARK{} DW\_CFA
30 \DWENDlouserMARK{}\DWENDhiuserMARK{} DW\_END,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{} DW\_LANG,
32 \DWLNElouserMARK{}\DWLNEhiuserMARK{} DW\_LNE,
33 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
34 \DWOPlouserMARK{}\DWOPhiuserMARK{} DW\_OP or
35 \DWTAGlouserMARK{}\DWTAGhiuserMARK{} DW\_TAG,
36 respectively) followed by
37 \_lo\_user or \_hi\_user.
38 Values in the range between \textit{prefix}\_lo\_user
39 and \textit{prefix}\_hi\_user inclusive,
40 are reserved for vendor specific extensions. Vendors may
41 use values in this range without conflicting with current or
42 future system\dash defined values. All other values are reserved
43 for use by the system.
45 \textit{For example, for DIE tags, the special
46 labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
48 \textit{There may also be codes for vendor specific extensions
49 between the number of standard line number opcodes and
50 the first special line number opcode. However, since the
51 number of standard opcodes varies with the DWARF version,
52 the range for extensions is also version dependent. Thus,
53 \DWLNSlouserTARG{} and
54 \DWLNShiuserTARG{} symbols are not defined.
57 Vendor defined tags, attributes, base type encodings, location
58 atoms, language names, line number actions, calling conventions
59 and call frame instructions, conventionally use the form
60 \text{prefix\_vendor\_id\_name}, where
61 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
62 character sequence chosen so as to avoid conflicts with
65 To ensure that extensions added by one vendor may be safely
66 ignored by consumers that do not understand those extensions,
67 the following rules should be followed:
68 \begin{enumerate}[1. ]
70 \item New attributes should be added in such a way that a
71 debugger may recognize the format of a new attribute value
72 without knowing the content of that attribute value.
74 \item The semantics of any new attributes should not alter
75 the semantics of previously existing attributes.
77 \item The semantics of any new tags should not conflict with
78 the semantics of previously existing tags.
80 \item Do not add any new forms of attribute value.
85 \section{Reserved Values}
86 \label{datarep:reservedvalues}
87 \subsection{Error Values}
88 \label{datarep:errorvalues}
89 \addtoindexx{reserved values!error}
92 \addtoindexx{error value}
93 a convenience for consumers of DWARF information, the value
94 0 is reserved in the encodings for attribute names, attribute
95 forms, base type encodings, location operations, languages,
96 line number program opcodes, macro information entries and tag
97 names to represent an error condition or unknown value. DWARF
98 does not specify names for these reserved values, since they
99 do not represent valid encodings for the given type and should
100 not appear in DWARF debugging information.
103 \subsection{Initial Length Values}
104 \label{datarep:initiallengthvalues}
105 \addtoindexx{reserved values!initial length}
107 An \livetarg{datarep:initiallengthvalues}{initial length} field
108 \addtoindexx{initial length field|see{initial length}}
109 is one of the fields that occur at the beginning
110 of those DWARF sections that have a header
114 \dotdebugnames{}) or the length field
115 that occurs at the beginning of the CIE and FDE structures
116 in the \dotdebugframe{} section.
119 In an \addtoindex{initial length} field, the values \wfffffffzero through
120 \wffffffff are reserved by DWARF to indicate some form of
121 extension relative to \DWARFVersionII; such values must not
122 be interpreted as a length field. The use of one such value,
123 \xffffffff, is defined below
124 (see Section \refersec{datarep:32bitand64bitdwarfformats});
126 the other values is reserved for possible future extensions.
130 \section{Relocatable, Split, Executable, Shared and Package Object Files}
131 \label{datarep:executableobjectsandsharedobjects}
133 \subsection{Relocatable Object Files}
134 \label{datarep:relocatableobjectfiles}
135 A DWARF producer (for example, a compiler) typically generates its
136 debugging information as part of a relocatable object file.
137 Relocatable object files are then combined by a linker to form an
138 executable file. During the linking process, the linker resolves
139 (binds) symbolic references between the various object files, and
140 relocates the contents of each object file into a combined virtual
143 The DWARF debugging information is placed in several sections (see
144 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
145 requires an object file format capable of
146 representing these separate sections. There are symbolic references
147 between these sections, and also between the debugging information
148 sections and the other sections that contain the text and data of the
149 program itself. Many of these references require relocation, and the
150 producer must emit the relocation information appropriate to the
151 object file format and the target processor architecture. These
152 references include the following:
155 \item The compilation unit header (see Section
156 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
157 section contains a reference to the \dotdebugabbrev{} table. This
158 reference requires a relocation so that after linking, it refers to
159 that contribution to the combined \dotdebugabbrev{} section in the
162 \item Debugging information entries may have attributes with the form
163 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
164 These attributes represent locations
165 within the virtual address space of the program, and require
168 \item Debugging information entries may have attributes with the form
169 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
170 These attributes refer to
171 debugging information in other debugging information sections within
172 the object file, and must be relocated during the linking process.
173 Exception: attributes whose values are relative to a base offset given
174 by \DWATrangesbase{} do not need relocation.
176 \item Debugging information entries may have attributes with the form
177 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
178 \DWFORMrefudata{} (see Section \refersec{datarep:attributeencodings}).
179 These attributes refer to other
180 debugging information entries within the same compilation unit, and
181 are relative to the beginning of the current compilation unit. These
182 values do not need relocation.
184 \item Debugging information entries may have attributes with the form
185 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
186 These attributes refer to
187 debugging information entries that may be outside the current
188 compilation unit. These values require both symbolic binding and
191 \item Debugging information entries may have attributes with the form
192 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
193 These attributes refer to strings in
194 the \dotdebugstr{} section. These values require relocation.
196 \item Entries in the \dotdebugloc{}, \dotdebugranges{}, and \dotdebugaranges{}
197 sections contain references to locations within the virtual address
198 space of the program, and require relocation.
200 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
201 opcode is a reference to a location within the virtual address space
202 of the program, and requires relocation.
204 The \dotdebugstroffsets{} section contains a list of string offsets,
205 each of which is an offset of a string in the \dotdebugstr{} section. Each
206 of these offsets requires relocation. Depending on the implementation,
207 these relocations may be implicit (that is, the producer may not need to
208 emit any explicit relocation information for these offsets).
211 \subsection{Split DWARF Object Files}
212 \label{datarep:splitdwarfobjectfiles}
213 \addtoindexx{split DWARF object file}
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 \dotdebugnames{} 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 \addtoindex{specialized line number table} (for the type units),
282 in the \dotdebuglinedwo{} section. This table
283 contains only the directory and filename lists needed to
284 interpret \DWATdeclfile{} attributes in the debugging
287 \item Macro information, in the \dotdebugmacrodwo{} section.
289 \item A string table, in the \dotdebugstrdwo{} section.
291 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
295 Except where noted otherwise, all references in this document
296 to a debugging information section (for example, \dotdebuginfo),
297 applies also to the corresponding split DWARF section (for example,
300 \subsection{Executable Objects}
301 \label{chap:executableobjects}
302 The relocated addresses in the debugging information for an
303 executable object are virtual addresses.
305 \subsection{Shared Object Files}
306 \label{datarep:sharedobject Files}
308 addresses in the debugging information for a shared object file
309 are offsets relative to the start of the lowest region of
310 memory loaded from that shared object file.
313 \textit{This requirement makes the debugging information for
314 shared object files position independent. Virtual addresses in a
315 shared object file may be calculated by adding the offset to the
316 base address at which the object file was attached. This offset
317 is available in the run\dash time linker\textquoteright s data structures.}
319 \subsection{DWARF Package Files}
320 \label{datarep:dwarfpackagefiles}
321 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
322 link, and debug an application quickly with less link-time overhead,
323 but a more convenient format is needed for saving the debug
324 information for later debugging of a deployed application. A
325 DWARF package file can be used to collect the debugging
326 information from the object (or separate DWARF object) files
327 produced during the compilation of an application.}
329 \textit{The package file is typically placed in the same directory as the
330 application, and is given the same name with a \doublequote{\texttt{.dwp}}
331 extension.\addtoindexx{\texttt{.dwp} file extension}}
333 A DWARF package file is itself an object file, using the
334 \addtoindexx{package files}
335 \addtoindexx{DWARF package files}
336 same object file format (including byte order) as the
337 corresponding application binary. It consists only of a file
338 header, section table, a number of DWARF debug information
339 sections, and two index sections.
342 Each DWARF package file contains no more than one of each of the
343 following sections, copied from a set of object or DWARF object
344 files, and combined, section by section:
350 \dotdebugstroffsetsdwo
355 The string table section in \dotdebugstrdwo{} contains all the
356 strings referenced from DWARF attributes using the form
357 \DWFORMstrx. Any attribute in a compilation unit or a type
358 unit using this form will refer to an entry in that unit's
359 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
360 will provide the offset of a string in the \dotdebugstrdwo{}
363 The DWARF package file also contains two index sections that
364 provide a fast way to locate debug information by compilation
365 unit signature (\DWATdwoid) for compilation units, or by type
366 signature for type units:
372 \subsubsection{The Compilation Unit (CU) Index Section}
373 The \dotdebugcuindex{} section is a hashed lookup table that maps a
374 compilation unit signature to a set of contributions in the
375 various debug information sections. Each contribution is stored
376 as an offset within its corresponding section and a size.
378 Each compilation unit set may contain contributions from the
381 \dotdebuginfodwo{} (required)
382 \dotdebugabbrevdwo{} (required)
385 \dotdebugstroffsetsdwo
389 \textit{Note that a set is not able to represent \dotdebugmacinfo{}
390 information from \DWARFVersionIV{} or earlier formats.}
392 \subsubsection{The Type Unit (TU) Index Section}
393 The \dotdebugtuindex{} section is a hashed lookup table that maps a
394 type signature to a set of offsets into the various debug
395 information sections. Each contribution is stored as an offset
396 within its corresponding section and a size.
398 Each type unit set may contain contributions from the following
401 \dotdebuginfodwo{} (required)
402 \dotdebugabbrevdwo{} (required)
404 \dotdebugstroffsetsdwo
407 \subsubsection{Format of the CU and TU Index Sections}
408 Both index sections have the same format, and serve to map a
409 64-bit signature to a set of contributions to the debug sections.
410 Each section begins with a header, followed by a hash table of
411 signatures, a parallel table of indexes, a table of offsets, and
412 a table of sizes. The index sections are aligned at 8-byte
413 boundaries in the file.
416 The index section header contains the following fields:
417 \begin{enumerate}[1. ]
418 \item \texttt{version} (\HFTuhalf) \\
420 \addtoindexx{version number!CU index information}
421 \addtoindexx{version number!TU index information}
422 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
423 This number is specific to the CU and TU index information
424 and is independent of the DWARF version number.
426 The version number is \versiondotdebugcuindex.
428 \item \textit{padding} (\HFTuhalf) \\
431 \item \texttt{column\_count} (\HFTuword) \\
432 The number of columns in the table of section counts that follows.
433 For brevity, the contents of this field is referred to as $C$ below.
435 \item \texttt{unit\_count} (\HFTuword) \\
436 The number of compilation units or type units in the index.
437 For brevity, the contents of this field is referred to as $U$ below.
439 \item \texttt{slot\_count} (\HFTuword) \\
440 The number of slots in the hash table.
441 For brevity, the contents of this field is referred to as $S$ below.
445 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
447 The size of the hash table, $S$, must be $2^k$ such that:
448 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
450 The hash table begins at offset 16 in the section, and consists
451 of an array of $S$ 64-bit slots. Each slot contains a 64-bit
453 % (using the byte order of the application binary).
455 The parallel table of indices begins immediately after the hash table
456 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
457 consists of an array of $S$ 32-bit slots,
458 % (using the byte order of the application binary),
459 corresponding 1-1 with slots in the hash
460 table. Each entry in the parallel table contains a row index into
461 the tables of offsets and sizes.
463 Unused slots in the hash table have 0 in both the hash table
464 entry and the parallel table entry. While 0 is a valid hash
465 value, the row index in a used slot will always be non-zero.
467 Given a 64-bit compilation unit signature or a type signature $X$,
468 an entry in the hash table is located as follows:
469 \begin{enumerate}[1. ]
470 \item Calculate a primary hash $H = X\ \&\ MASK(k)$, where $MASK(k)$ is a
471 mask with the low-order $k$ bits all set to 1.
473 \item Calculate a secondary hash $H' = (((X>>32)\ \&\ MASK(k))\ |\ 1)$.
475 \item If the hash table entry at index $H$ matches the signature, use
476 that entry. If the hash table entry at index $H$ is unused (all
477 zeroes), terminate the search: the signature is not present
480 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 3.
483 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
484 guaranteed to stop at an unused slot or find the match.
487 The table of offsets begins immediately following the parallel
488 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
489 The table is a two-dimensional array of 32-bit words,
490 %(using the byte order of the application binary),
491 with $C$ columns and $U + 1$
492 rows, in row-major order. Each row in the array is indexed
493 starting from 0. The first row provides a key to the columns:
494 each column in this row provides a section identifier for a debug
495 section, and the offsets in the same column of subsequent rows
496 refer to that section. The section identifiers are shown in
497 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
501 \setlength{\extrarowheight}{0.1cm}
502 \begin{longtable}{l|c|l}
503 \caption{DWARF package file section identifier \mbox{encodings}}
504 \label{tab:dwarfpackagefilesectionidentifierencodings}
505 \addtoindexx{DWARF package files!section identifier encodings} \\
506 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
508 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
510 \hline \emph{Continued on next page}
514 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
515 \textit{Reserved} & 2 & \\
516 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
517 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
518 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
519 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
520 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
521 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
525 The offsets provided by the CU and TU index sections are the base
526 offsets for the contributions made by each CU or TU to the
527 corresponding section in the package file. Each CU and TU header
528 contains an \texttt{abbrev\_offset} field, used to find the abbreviations
529 table for that CU or TU within the contribution to the
530 \dotdebugabbrevdwo{} section for that CU or TU, and should be
531 interpreted as relative to the base offset given in the index
532 section. Likewise, offsets into \dotdebuglinedwo{} from
533 \DWATstmtlist{} attributes should be interpreted as relative to
534 the base offset for \dotdebuglinedwo{}, and offsets into other debug
535 sections obtained from DWARF attributes should also be
536 interpreted as relative to the corresponding base offset.
538 The table of sizes begins immediately following the table of
539 offsets, and provides the sizes of the contributions made by each
540 CU or TU to the corresponding section in the package file. Like
541 the table of offsets, it is a two-dimensional array of 32-bit
542 words, with $C$ columns and $U$ rows, in row-major order. Each row in
543 the array is indexed starting from 1 (row 0 of the table of
544 offsets also serves as the key for the table of sizes).
546 \subsection{DWARF Supplementary Object Files}
547 \label{datarep:dwarfsupplemetaryobjectfiles}
548 In order to minimize the size of debugging information, it is possible
549 to move duplicate debug information entries, strings and macro entries from
550 several executables or shared object files into a separate
551 \addtoindexi{\textit{supplementary object file}}{supplementary object file} by some
552 post-linking utility; the moved entries and strings can be then referenced
553 from the debugging information of each of those executable or shared object files.
556 A DWARF \addtoindex{supplementary object file} is itself an object file,
557 using the same object
558 file format, byte order, and size as the corresponding application executables
559 or shared libraries. It consists only of a file header, section table, and
560 a number of DWARF debug information sections. Both the
561 \addtoindex{supplementary object file}
562 and all the executable or shared object files that reference entries or strings in that
563 file must contain a \dotdebugsup{} section that establishes the relationship.
565 The \dotdebugsup{} section contains:
566 \begin{enumerate}[1. ]
567 \item \texttt{version} (\HFTuhalf) \\
568 \addttindexx{version}
569 A 2-byte unsigned integer representing the version of the DWARF
570 information for the compilation unit (see Appendix G). The
571 value in this field is \versiondotdebugsup.
573 \item \texttt{is\_supplementary} (\HFTubyte) \\
574 \addttindexx{is\_supplementary}
575 A 1-byte unsigned integer, which contains the value 1 if it is
576 in the \addtoindex{supplementary object file} that other executable or
577 shared object files refer to, or 0 if it is an executable or shared object
578 referring to a \addtoindex{supplementary object file}.
581 \item \texttt{sup\_filename} (null terminated filename string) \\
582 \addttindexx{sup\_filename}
583 If \addttindex{is\_supplementary} is 0, this contains either an absolute
584 filename for the \addtoindex{supplementary object file}, or a filename
585 relative to the object file containing the \dotdebugsup{} section.
586 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
587 is not needed and must be an empty string (a single null byte).
590 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
591 \addttindexx{sup\_checksum\_len}
592 Length of the following \addttindex{sup\_checksum} field;
593 his value can be 0 if no checksum is provided.
596 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
597 \addttindexx{sup\_checksum}
598 Some checksum or cryptographic hash function of the \dotdebuginfo{},
599 \dotdebugstr{} and \dotdebugmacro{} sections of the
600 \addtoindex{supplementary object file}, or some unique identifier
601 which the implementation can choose to verify that the supplementary
602 section object file matches what the debug information in the executable
603 or shared object file expects.
606 Debug information entries that refer to an executable's or shared
607 object's addresses must \emph{not} be moved to supplementary files (the
608 addesses will likely not be the same). Similarly,
609 entries referenced from within location expressions or using loclistptr
610 form attributes must not be moved to a \addtoindex{supplementary object file}.
612 Executable or shared object file compilation units can use
613 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
614 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
615 attributes to refer to them and \DWFORMstrpsup{} form attributes to
616 refer to strings that are used by debug information of multiple
617 executables or shared object files. Within the \addtoindex{supplementary object file}'s
618 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} should
619 not be used, and all reference forms referring to some other sections
620 refer to the local sections in the \addtoindex{supplementary object file}.
622 In macro information, \DWMACROdefineindirectsup{} or
623 \DWMACROundefindirectsup{} opcodes can refer to strings in the
624 \dotdebugstr{} section of the \addtoindex{supplementary object file},
625 or \DWMACROtransparentincludesup{}
626 can refer to \dotdebugmacro{} section entries. Within the
627 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
628 \DWMACROdefineindirect{} and \DWMACROundefindirect{}
629 opcodes refer to the local \dotdebugstr{} section, not the one in
630 the executable or shared object file.
634 \section{32-Bit and 64-Bit DWARF Formats}
635 \label{datarep:32bitand64bitdwarfformats}
636 \hypertarget{datarep:xxbitdwffmt}{}
637 \addtoindexx{32-bit DWARF format}
638 \addtoindexx{64-bit DWARF format}
639 There are two closely related file formats. In the 32-bit DWARF
640 format, all values that represent lengths of DWARF sections
641 and offsets relative to the beginning of DWARF sections are
642 represented using 32-bits. In the 64-bit DWARF format, all
643 values that represent lengths of DWARF sections and offsets
644 relative to the beginning of DWARF sections are represented
645 using 64-bits. A special convention applies to the initial
646 length field of certain DWARF sections, as well as the CIE and
647 FDE structures, so that the 32-bit and 64-bit DWARF formats
648 can coexist and be distinguished within a single linked object.
650 The differences between the 32- and 64-bit DWARF formats are
651 detailed in the following:
652 \begin{enumerate}[1. ]
654 \item In the 32-bit DWARF format, an
655 \addtoindex{initial length} field (see
656 \addtoindexx{initial length!encoding}
657 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
658 is an unsigned 32-bit integer (which
659 must be less than \xfffffffzero); in the 64-bit DWARF format,
660 an \addtoindex{initial length} field is 96 bits in size,
663 \item The first 32-bits have the value \xffffffff.
665 \item The following 64-bits contain the actual length
666 represented as an unsigned 64-bit integer.
669 \textit{This representation allows a DWARF consumer to dynamically
670 detect that a DWARF section contribution is using the 64-bit
671 format and to adapt its processing accordingly.}
674 \item Section offset and section length
675 \hypertarget{datarep:sectionoffsetlength}{}
676 \addtoindexx{section length!use in headers}
678 \addtoindexx{section offset!use in headers}
679 in the headers of DWARF sections (other than initial length
680 \addtoindexx{initial length}
681 fields) are listed following. In the 32-bit DWARF format these
682 are 32-bit unsigned integer values; in the 64-bit DWARF format,
683 they are 64-bit unsigned integer values.
687 Section &Name & Role \\ \hline
688 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
689 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
690 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
691 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
692 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
693 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
699 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
700 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
701 union must be accessed to distinguish whether a CIE or FDE is
702 present, consequently, these two fields must exactly overlay
703 each other (both offset and size).
705 \item Within the body of the \dotdebuginfo{}
706 section, certain forms of attribute value depend on the choice
707 of DWARF format as follows. For the 32-bit DWARF format,
708 the value is a 32-bit unsigned integer; for the 64-bit DWARF
709 format, the value is a 64-bit unsigned integer.
711 \begin{tabular}{lp{6cm}}
712 Form & Role \\ \hline
713 \DWFORMlinestrp & offset in \dotdebuglinestr \\
714 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
715 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
716 \addtoindexx{supplementary object file}
717 \DWFORMsecoffset & offset in a section other than \\
718 & \dotdebuginfo{} or \dotdebugstr{} \\
719 \DWFORMstrp & offset in \dotdebugstr{} \\
720 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
721 \DWOPcallref & offset in \dotdebuginfo{} \\
726 \item Within the body of the \dotdebugline{} section, certain forms of content
727 description depend on the choice of DWARF format as follows: for the
728 32-bit DWARF format, the value is a 32-bit unsigned integer; for the
729 64-bit DWARF format, the value is a 64-bit unsigned integer.
731 \begin{tabular}{lp{6cm}}
732 Form & Role \\ \hline
733 \DWFORMlinestrp & offset in \dotdebuglinestr
737 \item Within the body of the \dotdebugnames{}
738 sections, the representation of each entry in the array of
739 compilation units (CUs) and the array of local type units
740 (TUs), which represents an offset in the
742 section, depends on the DWARF format as follows: in the
743 32-bit DWARF format, each entry is a 32-bit unsigned integer;
744 in the 64-bit DWARF format, it is a 64-bit unsigned integer.
747 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
748 sections, the size of entries in the body depend on the DWARF
749 format as follows: in the 32-bit DWARF format, entries are 32-bit
750 unsigned integer values; in the 64-bit DWARF format, they are
751 64-bit unsigned integers.
753 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
754 sections, the contents of the address size fields depends on the
755 DWARF format as follows: in the 32-bit DWARF format, these fields
756 contain 4; in the 64-bit DWARF format these fields contain 8.
760 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
761 intermixed within a single compilation unit.
763 \textit{Attribute values and section header fields that represent
764 addresses in the target program are not affected by these
767 A DWARF consumer that supports the 64-bit DWARF format must
768 support executables in which some compilation units use the
769 32-bit format and others use the 64-bit format provided that
770 the combination links correctly (that is, provided that there
771 are no link\dash time errors due to truncation or overflow). (An
772 implementation is not required to guarantee detection and
773 reporting of all such errors.)
775 \textit{It is expected that DWARF producing compilers will \emph{not} use
776 the 64-bit format \emph{by default}. In most cases, the division of
777 even very large applications into a number of executable and
778 shared object files will suffice to assure that the DWARF sections
779 within each individual linked object are less than 4 GBytes
780 in size. However, for those cases where needed, the 64-bit
781 format allows the unusual case to be handled as well. Even
782 in this case, it is expected that only application supplied
783 objects will need to be compiled using the 64-bit format;
784 separate 32-bit format versions of system supplied shared
785 executable libraries can still be used.}
789 \section{Format of Debugging Information}
790 \label{datarep:formatofdebugginginformation}
792 For each compilation unit compiled with a DWARF producer,
793 a contribution is made to the \dotdebuginfo{} section of
794 the object file. Each such contribution consists of a
795 compilation unit header
796 (see Section \refersec{datarep:compilationunitheader})
798 single \DWTAGcompileunit{} or
799 \DWTAGpartialunit{} debugging
800 information entry, together with its children.
802 For each type defined in a compilation unit, a separate
803 contribution may also be made to the
805 section of the object file. Each
806 such contribution consists of a
807 \addtoindex{type unit} header
808 (see Section \refersec{datarep:typeunitheader})
809 followed by a \DWTAGtypeunit{} entry, together with
812 Each debugging information entry begins with a code that
813 represents an entry in a separate
814 \addtoindex{abbreviations table}. This
815 code is followed directly by a series of attribute values.
817 The appropriate entry in the
818 \addtoindex{abbreviations table} guides the
819 interpretation of the information contained directly in the
820 \dotdebuginfo{} section.
823 Multiple debugging information entries may share the same
824 abbreviation table entry. Each compilation unit is associated
825 with a particular abbreviation table, but multiple compilation
826 units may share the same table.
828 \subsection{Unit Headers}
829 \label{datarep:unitheaders}
830 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
831 compilation unit that follows. The encodings for the unit type
832 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
836 \setlength{\extrarowheight}{0.1cm}
837 \begin{longtable}{l|c}
838 \caption{Unit header unit type encodings}
839 \label{tab:unitheaderunitkindencodings}
840 \addtoindexx{unit header unit type encodings} \\
841 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
843 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
845 \hline \emph{Continued on next page}
847 \hline \ddag\ \textit{New in DWARF Version 5}
849 \DWUTcompileTARG~\ddag &0x01 \\
850 \DWUTtypeTARG~\ddag &0x02 \\
851 \DWUTpartialTARG~\ddag &0x03 \\ \hline
856 \subsubsection{Compilation Unit Header}
857 \label{datarep:compilationunitheader}
858 \begin{enumerate}[1. ]
860 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
861 \addttindexx{unit\_length}
863 \addtoindexx{initial length}
864 unsigned integer representing the length
865 of the \dotdebuginfo{}
866 contribution for that compilation unit,
867 not including the length field itself. In the \thirtytwobitdwarfformat,
868 this is a 4-byte unsigned integer (which must be less
869 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
870 of the 4-byte value \wffffffff followed by an 8-byte unsigned
871 integer that gives the actual length
872 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
874 \item \texttt{version} (\HFTuhalf) \\
875 \addttindexx{version}
876 A 2-byte unsigned integer representing the version of the
877 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
878 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
879 The value in this field is \versiondotdebuginfo.
882 \item \texttt{unit\_type} (\HFTubyte) \\
883 \addttindexx{unit\_type}
884 A 1-byte unsigned integer identifying this unit as a compilation unit.
885 The value of this field is
886 \DWUTcompile{} for a {normal compilation} unit or
887 \DWUTpartial{} for a {partial compilation} unit
888 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
890 \textit{This field is new in \DWARFVersionV.}
893 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
894 \addttindexx{debug\_abbrev\_offset}
896 \addtoindexx{section offset!in .debug\_info header}
897 4-byte or 8-byte unsigned offset into the
899 section. This offset associates the compilation unit with a
900 particular set of debugging information entry abbreviations. In
901 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
902 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
903 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
905 \item \texttt{address\_size} (\HFTubyte) \\
906 \addttindexx{address\_size}
907 A 1-byte unsigned integer representing the size in bytes of
908 an address on the target architecture. If the system uses
909 \addtoindexx{address space!segmented}
910 segmented addressing, this value represents the size of the
911 offset portion of an address.
915 \subsubsection{Type Unit Header}
916 \label{datarep:typeunitheader}
918 The header for the series of debugging information entries
919 contributing to the description of a type that has been
920 placed in its own \addtoindex{type unit}, within the
921 \dotdebuginfo{} section,
922 consists of the following information:
923 \begin{enumerate}[1. ]
925 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
926 \addttindexx{unit\_length}
927 A 4-byte or 12-byte unsigned integer
928 \addtoindexx{initial length}
929 representing the length
930 of the \dotdebuginfo{} contribution for that type unit,
931 not including the length field itself. In the \thirtytwobitdwarfformat,
932 this is a 4-byte unsigned integer (which must be
933 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
934 consists of the 4-byte value \wffffffff followed by an
935 8-byte unsigned integer that gives the actual length
936 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
939 \item \texttt{version} (\HFTuhalf) \\
940 \addttindexx{version}
941 A 2-byte unsigned integer representing the version of the
942 DWARF information for the
943 type unit\addtoindexx{version number!type unit}
944 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
945 The value in this field is \versiondotdebuginfo.
947 \item \texttt{unit\_type} (\HFTubyte) \\
948 \addttindexx{unit\_type}
949 A 1-byte unsigned integer identifying this unit as a type unit.
950 The value of this field is \DWUTtype{} for a type unit
951 (see Section \refersec{chap:typeunitentries}).
953 \textit{This field is new in \DWARFVersionV.}
956 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
957 \addttindexx{debug\_abbrev\_offset}
959 \addtoindexx{section offset!in .debug\_info header}
960 4-byte or 8-byte unsigned offset into the
962 section. This offset associates the type unit with a
963 particular set of debugging information entry abbreviations. In
964 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
965 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
966 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
969 \item \texttt{address\_size} (\HFTubyte) \\
970 \addttindexx{address\_size}
971 A 1-byte unsigned integer representing the size
972 \addtoindexx{size of an address}
974 an address on the target architecture. If the system uses
975 \addtoindexx{address space!segmented}
976 segmented addressing, this value represents the size of the
977 offset portion of an address.
979 \item \texttt{type\_signature} (8-byte unsigned integer) \\
980 \addttindexx{type\_signature}
981 \addtoindexx{type signature}
982 A 64-bit unique signature (see Section
983 \refersec{datarep:typesignaturecomputation})
984 of the type described in this type
987 \textit{An attribute that refers (using
988 \DWFORMrefsigeight{}) to
989 the primary type contained in this
990 \addtoindex{type unit} uses this value.}
992 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
993 \addttindexx{type\_offset}
994 A 4-byte or 8-byte unsigned offset
995 \addtoindexx{section offset!in .debug\_info header}
996 relative to the beginning
997 of the \addtoindex{type unit} header.
998 This offset refers to the debugging
999 information entry that describes the type. Because the type
1000 may be nested inside a namespace or other structures, and may
1001 contain references to other types that have not been placed in
1002 separate type units, it is not necessarily either the first or
1003 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1004 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1005 this is an 8-byte unsigned length
1006 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1010 \subsection{Debugging Information Entry}
1011 \label{datarep:debugginginformationentry}
1013 Each debugging information entry begins with an
1014 unsigned LEB128\addtoindexx{LEB128!unsigned}
1015 number containing the abbreviation code for the entry. This
1016 code represents an entry within the abbreviations table
1017 associated with the compilation unit containing this entry. The
1018 abbreviation code is followed by a series of attribute values.
1020 On some architectures, there are alignment constraints on
1021 section boundaries. To make it easier to pad debugging
1022 information sections to satisfy such constraints, the
1023 abbreviation code 0 is reserved. Debugging information entries
1024 consisting of only the abbreviation code 0 are considered
1027 \subsection{Abbreviations Tables}
1028 \label{datarep:abbreviationstables}
1030 The abbreviations tables for all compilation units
1031 are contained in a separate object file section called
1033 As mentioned before, multiple compilation
1034 units may share the same abbreviations table.
1036 The abbreviations table for a single compilation unit consists
1037 of a series of abbreviation declarations. Each declaration
1038 specifies the tag and attributes for a particular form of
1039 debugging information entry. Each declaration begins with
1040 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1041 number representing the abbreviation
1042 code itself. It is this code that appears at the beginning
1043 of a debugging information entry in the
1045 section. As described above, the abbreviation
1046 code 0 is reserved for null debugging information entries. The
1047 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1048 number that encodes the entry\textquoteright s tag. The encodings for the
1049 tag names are given in
1050 Table \refersec{tab:tagencodings}.
1053 \setlength{\extrarowheight}{0.1cm}
1054 \begin{longtable}{l|c}
1056 \caption{Tag encodings} \label{tab:tagencodings} \\
1057 \hline \bfseries Tag name&\bfseries Value\\ \hline
1059 \bfseries Tag name&\bfseries Value \\ \hline
1061 \hline \emph{Continued on next page}
1063 \hline \ddag\ \textit{New in DWARF Version 5}
1065 \DWTAGarraytype{} &0x01 \\
1066 \DWTAGclasstype&0x02 \\
1067 \DWTAGentrypoint&0x03 \\
1068 \DWTAGenumerationtype&0x04 \\
1069 \DWTAGformalparameter&0x05 \\
1070 \DWTAGimporteddeclaration&0x08 \\
1072 \DWTAGlexicalblock&0x0b \\
1073 \DWTAGmember&0x0d \\
1074 \DWTAGpointertype&0x0f \\
1075 \DWTAGreferencetype&0x10 \\
1076 \DWTAGcompileunit&0x11 \\
1077 \DWTAGstringtype&0x12 \\
1078 \DWTAGstructuretype&0x13 \\
1079 \DWTAGsubroutinetype&0x15 \\
1080 \DWTAGtypedef&0x16 \\
1081 \DWTAGuniontype&0x17 \\
1082 \DWTAGunspecifiedparameters&0x18 \\
1083 \DWTAGvariant&0x19 \\
1084 \DWTAGcommonblock&0x1a \\
1085 \DWTAGcommoninclusion&0x1b \\
1086 \DWTAGinheritance&0x1c \\
1087 \DWTAGinlinedsubroutine&0x1d \\
1088 \DWTAGmodule&0x1e \\
1089 \DWTAGptrtomembertype&0x1f \\
1090 \DWTAGsettype&0x20 \\
1091 \DWTAGsubrangetype&0x21 \\
1092 \DWTAGwithstmt&0x22 \\
1093 \DWTAGaccessdeclaration&0x23 \\
1094 \DWTAGbasetype&0x24 \\
1095 \DWTAGcatchblock&0x25 \\
1096 \DWTAGconsttype&0x26 \\
1097 \DWTAGconstant&0x27 \\
1098 \DWTAGenumerator&0x28 \\
1099 \DWTAGfiletype&0x29 \\
1100 \DWTAGfriend&0x2a \\
1101 \DWTAGnamelist&0x2b \\
1102 \DWTAGnamelistitem&0x2c \\
1103 \DWTAGpackedtype&0x2d \\
1104 \DWTAGsubprogram&0x2e \\
1105 \DWTAGtemplatetypeparameter&0x2f \\
1106 \DWTAGtemplatevalueparameter&0x30 \\
1107 \DWTAGthrowntype&0x31 \\
1108 \DWTAGtryblock&0x32 \\
1109 \DWTAGvariantpart&0x33 \\
1110 \DWTAGvariable&0x34 \\
1111 \DWTAGvolatiletype&0x35 \\
1112 \DWTAGdwarfprocedure&0x36 \\
1113 \DWTAGrestricttype&0x37 \\
1114 \DWTAGinterfacetype&0x38 \\
1115 \DWTAGnamespace&0x39 \\
1116 \DWTAGimportedmodule&0x3a \\
1117 \DWTAGunspecifiedtype&0x3b \\
1118 \DWTAGpartialunit&0x3c \\
1119 \DWTAGimportedunit&0x3d \\
1120 \DWTAGcondition&\xiiif \\
1121 \DWTAGsharedtype&0x40 \\
1122 \DWTAGtypeunit & 0x41 \\
1123 \DWTAGrvaluereferencetype & 0x42 \\
1124 \DWTAGtemplatealias & 0x43 \\
1125 \DWTAGcoarraytype~\ddag & 0x44 \\
1126 \DWTAGgenericsubrange~\ddag & 0x45 \\
1127 \DWTAGdynamictype~\ddag & 0x46 \\
1128 \DWTAGatomictype~\ddag & 0x47 \\
1129 \DWTAGcallsite~\ddag & 0x48 \\
1130 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1131 \DWTAGlouser&0x4080 \\
1132 \DWTAGhiuser&\xffff \\
1136 Following the tag encoding is a 1-byte value that determines
1137 whether a debugging information entry using this abbreviation
1138 has child entries or not. If the value is
1140 the next physically succeeding entry of any debugging
1141 information entry using this abbreviation is the first
1142 child of that entry. If the 1-byte value following the
1143 abbreviation\textquoteright s tag encoding is
1144 \DWCHILDRENnoTARG, the next
1145 physically succeeding entry of any debugging information entry
1146 using this abbreviation is a sibling of that entry. (Either
1147 the first child or sibling entries may be null entries). The
1148 encodings for the child determination byte are given in
1149 Table \refersec{tab:childdeterminationencodings}
1151 Section \refersec{chap:relationshipofdebugginginformationentries},
1152 each chain of sibling entries is terminated by a null entry.)
1156 \setlength{\extrarowheight}{0.1cm}
1157 \begin{longtable}{l|c}
1158 \caption{Child determination encodings}
1159 \label{tab:childdeterminationencodings}
1160 \addtoindexx{Child determination encodings} \\
1161 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1163 \bfseries Children determination name&\bfseries Value \\ \hline
1165 \hline \emph{Continued on next page}
1169 \DWCHILDRENno&0x00 \\
1170 \DWCHILDRENyes&0x01 \\ \hline
1175 Finally, the child encoding is followed by a series of
1176 attribute specifications. Each attribute specification
1177 consists of two parts. The first part is an
1178 unsigned LEB128\addtoindexx{LEB128!unsigned}
1179 number representing the attribute\textquoteright s name.
1180 The second part is an
1181 unsigned LEB128\addtoindexx{LEB128!unsigned}
1182 number representing the attribute\textquoteright s form.
1183 The series of attribute specifications ends with an
1184 entry containing 0 for the name and 0 for the form.
1187 \DWFORMindirectTARG{} is a special case. For
1188 attributes with this form, the attribute value itself in the
1190 section begins with an unsigned
1191 LEB128 number that represents its form. This allows producers
1192 to choose forms for particular attributes
1193 \addtoindexx{abbreviations table!dynamic forms in}
1195 without having to add a new entry to the abbreviations table.
1197 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1198 For attributes with this form, the attribute specification contains
1199 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1200 number. The value of this number is used as the value of the
1201 attribute, and no value is stored in the \dotdebuginfo{} section.
1203 The abbreviations for a given compilation unit end with an
1204 entry consisting of a 0 byte for the abbreviation code.
1207 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1208 for a depiction of the organization of the
1209 debugging information.}
1212 \subsection{Attribute Encodings}
1213 \label{datarep:attributeencodings}
1215 The encodings for the attribute names are given in
1216 Table \referfol{tab:attributeencodings}.
1219 \setlength{\extrarowheight}{0.1cm}
1220 \begin{longtable}{l|c|l}
1221 \caption{Attribute encodings}
1222 \label{tab:attributeencodings}
1223 \addtoindexx{attribute encodings} \\
1224 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1226 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1228 \hline \emph{Continued on next page}
1230 \hline \ddag\ \textit{New in DWARF Version 5}
1232 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1233 \addtoindexx{sibling attribute} \\
1234 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1235 \livelink{chap:classloclistptr}{loclistptr}
1236 \addtoindexx{location attribute} \\
1237 \DWATname&0x03&\livelink{chap:classstring}{string}
1238 \addtoindexx{name attribute} \\
1239 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1240 \addtoindexx{ordering attribute} \\
1241 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1242 \livelink{chap:classexprloc}{exprloc},
1243 \livelink{chap:classreference}{reference}
1244 \addtoindexx{byte size attribute} \\
1245 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1246 DW\_AT\_bit\_offset \mbox{attribute} which was
1247 defined in \DWARFVersionIII{} and earlier.}
1248 &\livelink{chap:classconstant}{constant},
1249 \livelink{chap:classexprloc}{exprloc},
1250 \livelink{chap:classreference}{reference}
1251 \addtoindexx{bit offset attribute (Version 3)}
1252 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1253 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1254 \livelink{chap:classexprloc}{exprloc},
1255 \livelink{chap:classreference}{reference}
1256 \addtoindexx{bit size attribute} \\
1257 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1258 \addtoindexx{statement list attribute} \\
1259 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1260 \addtoindexx{low PC attribute} \\
1261 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1262 \livelink{chap:classconstant}{constant}
1263 \addtoindexx{high PC attribute} \\
1264 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1265 \addtoindexx{language attribute} \\
1266 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1267 \addtoindexx{discriminant attribute} \\
1268 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1269 \addtoindexx{discriminant value attribute} \\
1270 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1271 \addtoindexx{visibility attribute} \\
1272 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1273 \addtoindexx{import attribute} \\
1274 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1275 \livelink{chap:classloclistptr}{loclistptr}
1276 \addtoindexx{string length attribute} \\
1277 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1278 \addtoindexx{common reference attribute} \\
1279 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1280 \addtoindexx{compilation directory attribute} \\
1281 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1282 \livelink{chap:classconstant}{constant},
1283 \livelink{chap:classstring}{string}
1284 \addtoindexx{constant value attribute} \\
1285 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1286 \addtoindexx{containing type attribute} \\
1287 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1288 \livelink{chap:classreference}{reference},
1289 \livelink{chap:classflag}{flag}
1290 \addtoindexx{default value attribute} \\
1291 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1292 \addtoindexx{inline attribute} \\
1293 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1294 \addtoindexx{is optional attribute} \\
1295 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1296 \livelink{chap:classexprloc}{exprloc},
1297 \livelink{chap:classreference}{reference}
1298 \addtoindexx{lower bound attribute} \\
1299 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1300 \addtoindexx{producer attribute} \\
1301 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1302 \addtoindexx{prototyped attribute} \\
1303 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1304 \livelink{chap:classloclistptr}{loclistptr}
1305 \addtoindexx{return address attribute} \\
1306 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1307 \livelink{chap:classrangelistptr}{rangelistptr}
1308 \addtoindexx{start scope attribute} \\
1309 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1310 \livelink{chap:classexprloc}{exprloc},
1311 \livelink{chap:classreference}{reference}
1312 \addtoindexx{bit stride attribute} \\
1313 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1314 \livelink{chap:classexprloc}{exprloc},
1315 \livelink{chap:classreference}{reference}
1316 \addtoindexx{upper bound attribute} \\
1317 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1318 \addtoindexx{abstract origin attribute} \\
1319 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1320 \addtoindexx{accessibility attribute} \\
1321 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1322 \addtoindexx{address class attribute} \\
1323 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1324 \addtoindexx{artificial attribute} \\
1325 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1326 \addtoindexx{base types attribute} \\
1327 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1328 \addtoindexx{calling convention attribute} \\
1329 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1330 \livelink{chap:classexprloc}{exprloc},
1331 \livelink{chap:classreference}{reference}
1332 \addtoindexx{count attribute} \\
1333 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1334 \livelink{chap:classexprloc}{exprloc},
1335 \livelink{chap:classloclistptr}{loclistptr}
1336 \addtoindexx{data member attribute} \\
1337 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1338 \addtoindexx{declaration column attribute} \\
1339 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1340 \addtoindexx{declaration file attribute} \\
1341 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1342 \addtoindexx{declaration line attribute} \\
1343 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1344 \addtoindexx{declaration attribute} \\
1345 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1346 \addtoindexx{discriminant list attribute} \\
1347 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1348 \addtoindexx{encoding attribute} \\
1349 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1350 \addtoindexx{external attribute} \\
1351 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1352 \livelink{chap:classloclistptr}{loclistptr}
1353 \addtoindexx{frame base attribute} \\
1354 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1355 \addtoindexx{friend attribute} \\
1356 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1357 \addtoindexx{identifier case attribute} \\
1358 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1359 Reserved for compatibility and coexistence
1360 with prior DWARF versions.}
1361 &0x43&\livelink{chap:classmacptr}{macptr}
1362 \addtoindexx{macro information attribute (legacy)!encoding} \\
1363 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1364 \addtoindexx{name list item attribute} \\
1365 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1366 \addtoindexx{priority attribute} \\
1367 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1368 \livelink{chap:classloclistptr}{loclistptr}
1369 \addtoindexx{segment attribute} \\
1370 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1371 \addtoindexx{specification attribute} \\
1372 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1373 \livelink{chap:classloclistptr}{loclistptr}
1374 \addtoindexx{static link attribute} \\
1375 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1376 \addtoindexx{type attribute} \\
1377 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1378 \livelink{chap:classloclistptr}{loclistptr}
1379 \addtoindexx{location list attribute} \\
1380 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1381 \addtoindexx{variable parameter attribute} \\
1382 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1383 \addtoindexx{virtuality attribute} \\
1384 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1385 \livelink{chap:classloclistptr}{loclistptr}
1386 \addtoindexx{vtable element location attribute} \\
1387 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1388 \livelink{chap:classexprloc}{exprloc},
1389 \livelink{chap:classreference}{reference}
1390 \addtoindexx{allocated attribute} \\
1391 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1392 \livelink{chap:classexprloc}{exprloc},
1393 \livelink{chap:classreference}{reference}
1394 \addtoindexx{associated attribute} \\
1395 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1396 \addtoindexx{data location attribute} \\
1397 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1398 \livelink{chap:classexprloc}{exprloc},
1399 \livelink{chap:classreference}{reference}
1400 \addtoindexx{byte stride attribute} \\
1401 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1402 \livelink{chap:classconstant}{constant}
1403 \addtoindexx{entry PC attribute} \\
1404 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1405 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1406 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1407 \addtoindexx{extension attribute} \\
1408 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1409 \addtoindexx{ranges attribute} \\
1410 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1411 \livelink{chap:classflag}{flag},
1412 \livelink{chap:classreference}{reference},
1413 \livelink{chap:classstring}{string}
1414 \addtoindexx{trampoline attribute} \\
1415 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1416 \addtoindexx{call column attribute} \\
1417 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1418 \addtoindexx{call file attribute} \\
1419 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1420 \addtoindexx{call line attribute} \\
1421 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1422 \addtoindexx{description attribute} \\
1423 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1424 \addtoindexx{binary scale attribute} \\
1425 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1426 \addtoindexx{decimal scale attribute} \\
1427 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1428 \addtoindexx{small attribute} \\
1429 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1430 \addtoindexx{decimal scale attribute} \\
1431 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1432 \addtoindexx{digit count attribute} \\
1433 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1434 \addtoindexx{picture string attribute} \\
1435 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1436 \addtoindexx{mutable attribute} \\
1437 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1438 \addtoindexx{thread scaled attribute} \\
1439 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1440 \addtoindexx{explicit attribute} \\
1441 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1442 \addtoindexx{object pointer attribute} \\
1443 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1444 \addtoindexx{endianity attribute} \\
1445 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1446 \addtoindexx{elemental attribute} \\
1447 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1448 \addtoindexx{pure attribute} \\
1449 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1450 \addtoindexx{recursive attribute} \\
1451 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1452 \addtoindexx{signature attribute} \\
1453 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1454 \addtoindexx{main subprogram attribute} \\
1455 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1456 \addtoindexx{data bit offset attribute} \\
1457 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1458 \addtoindexx{constant expression attribute} \\
1459 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1460 \addtoindexx{enumeration class attribute} \\
1461 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1462 \addtoindexx{linkage name attribute} \\
1463 \DWATstringlengthbitsize{}~\ddag&0x6f&
1464 \livelink{chap:classconstant}{constant}
1465 \addtoindexx{string length attribute!size of length} \\
1466 \DWATstringlengthbytesize{}~\ddag&0x70&
1467 \livelink{chap:classconstant}{constant}
1468 \addtoindexx{string length attribute!size of length} \\
1469 \DWATrank~\ddag&0x71&
1470 \livelink{chap:classconstant}{constant},
1471 \livelink{chap:classexprloc}{exprloc}
1472 \addtoindexx{rank attribute} \\
1473 \DWATstroffsetsbase~\ddag&0x72&
1474 \livelinki{chap:classstring}{stroffsetsptr}{stroffsetsptr class}
1475 \addtoindexx{string offsets base!encoding} \\
1476 \DWATaddrbase~\ddag &0x73&
1477 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1478 \addtoindexx{address table base!encoding} \\
1479 \DWATrangesbase~\ddag&0x74&
1480 \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class}
1481 \addtoindexx{ranges base!encoding} \\
1482 \DWATdwoid~\ddag &0x75&
1483 \livelink{chap:classconstant}{constant}
1484 \addtoindexx{split DWARF object file id!encoding} \\
1485 \DWATdwoname~\ddag &0x76&
1486 \livelink{chap:classstring}{string}
1487 \addtoindexx{split DWARF object file name!encoding} \\
1488 \DWATreference~\ddag &0x77&
1489 \livelink{chap:classflag}{flag} \\
1490 \DWATrvaluereference~\ddag &0x78&
1491 \livelink{chap:classflag}{flag} \\
1492 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1493 \addtoindexx{macro information attribute} \\
1494 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1495 \addtoindexx{all calls summary attribute} \\
1496 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1497 \addtoindexx{all source calls summary attribute} \\
1498 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1499 \addtoindexx{all tail calls summary attribute} \\
1500 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1501 \addtoindexx{call return PC attribute} \\
1502 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1503 \addtoindexx{call value attribute} \\
1504 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1505 \addtoindexx{call origin attribute} \\
1506 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1507 \addtoindexx{call parameter attribute} \\
1508 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1509 \addtoindexx{call PC attribute} \\
1510 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1511 \addtoindexx{call tail call attribute} \\
1512 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1513 \addtoindexx{call target attribute} \\
1514 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1515 \addtoindexx{call target clobbered attribute} \\
1516 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1517 \addtoindexx{call data location attribute} \\
1518 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1519 \addtoindexx{call data value attribute} \\
1520 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1521 \addtoindexx{noreturn attribute} \\
1522 \DWATalignment~\ddag &0x88 &\CLASSconstant
1523 \addtoindexx{alignment attribute} \\
1524 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1525 \addtoindexx{export symbols attribute} \\
1526 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1527 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1528 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1529 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1534 The attribute form governs how the value of the attribute is
1535 encoded. There are nine classes of form, listed below. Each
1536 class is a set of forms which have related representations
1537 and which are given a common interpretation according to the
1538 attribute in which the form is used.
1540 Form \DWFORMsecoffsetTARG{}
1542 \addtoindexx{rangelistptr class}
1544 \addtoindexx{macptr class}
1546 \addtoindexx{loclistptr class}
1548 \addtoindexx{lineptr class}
1554 \CLASSrangelistptr{} or
1555 \CLASSstroffsetsptr;
1556 the list of classes allowed by the applicable attribute in
1557 Table \refersec{tab:attributeencodings}
1558 determines the class of the form.
1562 Each possible form belongs to one or more of the following classes:
1565 \item \livelinki{chap:classaddress}{address}{address class} \\
1566 \livetarg{datarep:classaddress}{}
1567 Represented as either:
1569 \item An object of appropriate size to hold an
1570 address on the target machine
1572 The size is encoded in the compilation unit header
1573 (see Section \refersec{datarep:compilationunitheader}).
1574 This address is relocatable in a relocatable object file and
1575 is relocated in an executable file or shared object file.
1577 \item An indirect index into a table of addresses (as
1578 described in the previous bullet) in the
1579 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1580 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1581 \addtoindex{LEB128} value, which is interpreted as a zero-based
1582 index into an array of addresses in the \dotdebugaddr{} section.
1583 The index is relative to the value of the \DWATaddrbase{} attribute
1584 of the associated compilation unit.
1588 \item \livelink{chap:classaddrptr}{addrptr} \\
1589 \livetarg{datarep:classaddrptr}{}
1590 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1591 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1592 beginning of the list of machine addresses information for the
1593 referencing entity. It is relocatable in
1594 a relocatable object file, and relocated in an executable or
1595 shared object file. In the \thirtytwobitdwarfformat, this offset
1596 is a 4-byte unsigned value; in the 64-bit DWARF
1597 format, it is an 8-byte unsigned value (see Section
1598 \refersec{datarep:32bitand64bitdwarfformats}).
1600 \textit{This class is new in \DWARFVersionV.}
1603 \item \livelink{chap:classblock}{block} \\
1604 \livetarg{datarep:classblock}{}
1605 Blocks come in four forms:
1607 \begin{myindentpara}{1cm}
1608 A 1-byte length followed by 0 to 255 contiguous information
1609 bytes (\DWFORMblockoneTARG).
1612 \begin{myindentpara}{1cm}
1613 A 2-byte length followed by 0 to 65,535 contiguous information
1614 bytes (\DWFORMblocktwoTARG).
1617 \begin{myindentpara}{1cm}
1618 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1619 information bytes (\DWFORMblockfourTARG).
1622 \begin{myindentpara}{1cm}
1623 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1624 length followed by the number of bytes
1625 specified by the length (\DWFORMblockTARG).
1628 In all forms, the length is the number of information bytes
1629 that follow. The information bytes may contain any mixture
1630 of relocated (or relocatable) addresses, references to other
1631 debugging information entries or data bytes.
1633 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1634 \livetarg{datarep:classconstant}{}
1635 There are eight forms of constants. There are fixed length
1636 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1640 \DWFORMdatafourTARG,
1641 \DWFORMdataeightTARG{} and
1642 \DWFORMdatasixteenTARG).
1643 There are also variable length constant
1644 data forms encoded using LEB128 numbers (see below).
1645 Both signed (\DWFORMsdataTARG) and unsigned
1646 (\DWFORMudataTARG) variable length constants are available.
1647 There is also an implicit constant (\DWFORMimplicitconst),
1648 whose value is provided as part of the abbreviation
1652 The data in \DWFORMdataone,
1655 \DWFORMdataeight{} and
1656 \DWFORMdatasixteen{}
1657 can be anything. Depending on context, it may
1658 be a signed integer, an unsigned integer, a floating\dash point
1659 constant, or anything else. A consumer must use context to
1660 know how to interpret the bits, which if they are target
1661 machine data (such as an integer or floating-point constant)
1662 will be in target machine byte\dash order.
1664 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1665 forms is used to represent a
1666 signed or unsigned integer, it can be hard for a consumer
1667 to discover the context necessary to determine which
1668 interpretation is intended. Producers are therefore strongly
1669 encouraged to use \DWFORMsdata{} or
1670 \DWFORMudata{} for signed and
1671 unsigned integers respectively, rather than
1672 \DWFORMdata\textless n\textgreater.}
1675 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1676 \livetarg{datarep:classexprloc}{}
1677 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1678 number of information bytes specified by the length
1679 (\DWFORMexprlocTARG).
1680 The information bytes contain a DWARF expression
1681 (see Section \refersec{chap:dwarfexpressions})
1682 or location description
1683 (see Section \refersec{chap:locationdescriptions}).
1685 \item \livelinki{chap:classflag}{flag}{flag class} \\
1686 \livetarg{datarep:classflag}{}
1687 A flag \addtoindexx{flag class}
1688 is represented explicitly as a single byte of data
1689 (\DWFORMflagTARG) or
1690 implicitly (\DWFORMflagpresentTARG).
1692 first case, if the \nolink{flag} has value zero, it indicates the
1693 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1694 it indicates the presence of the attribute. In the second
1695 case, the attribute is implicitly indicated as present, and
1696 no value is encoded in the debugging information entry itself.
1698 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1699 \livetarg{datarep:classlineptr}{}
1700 This is an offset into
1701 \addtoindexx{section offset!in class lineptr value}
1703 \dotdebugline{} or \dotdebuglinedwo{} section
1705 It consists of an offset from the beginning of the
1707 section to the first byte of
1708 the data making up the line number list for the compilation
1710 It is relocatable in a relocatable object file, and
1711 relocated in an executable or shared object file. In the
1712 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1713 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1714 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1717 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1718 \livetarg{datarep:classloclistptr}{}
1719 This is an offset into the
1723 It consists of an offset from the
1724 \addtoindexx{section offset!in class loclistptr value}
1727 section to the first byte of
1728 the data making up the
1729 \addtoindex{location list} for the compilation unit.
1730 It is relocatable in a relocatable object file, and
1731 relocated in an executable or shared object file. In the
1732 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1733 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1734 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1737 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1738 \livetarg{datarep:classmacptr}{}
1740 \addtoindexx{section offset!in class macptr value}
1742 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1744 It consists of an offset from the beginning of the
1745 \dotdebugmacro{} or \dotdebugmacrodwo{}
1746 section to the the header making up the
1747 macro information list for the compilation unit.
1748 It is relocatable in a relocatable object file, and
1749 relocated in an executable or shared object file. In the
1750 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1751 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1752 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1755 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1756 \livetarg{datarep:classrangelistptr}{}
1758 \addtoindexx{section offset!in class rangelistptr value}
1759 offset into the \dotdebugranges{} section
1762 offset from the beginning of the
1763 \dotdebugranges{} section
1764 to the beginning of the non\dash contiguous address ranges
1765 information for the referencing entity.
1766 It is relocatable in
1767 a relocatable object file, and relocated in an executable or
1768 shared object file. In the \thirtytwobitdwarfformat, this offset
1769 is a 4-byte unsigned value; in the 64-bit DWARF
1770 format, it is an 8-byte unsigned value (see Section
1771 \refersec{datarep:32bitand64bitdwarfformats}).
1774 \textit{Because classes
1779 \CLASSrangelistptr{} and
1780 \CLASSstroffsetsptr{}
1781 share a common representation, it is not possible for an
1782 attribute to allow more than one of these classes}
1786 \item \livelinki{chap:classreference}{reference}{reference class} \\
1787 \livetarg{datarep:classreference}{}
1788 There are four types of reference.
1791 \addtoindexx{reference class}
1792 first type of reference can identify any debugging
1793 information entry within the containing unit.
1796 \addtoindexx{section offset!in class reference value}
1797 offset from the first byte of the compilation
1798 header for the compilation unit containing the reference. There
1799 are five forms for this type of reference. There are fixed
1800 length forms for one, two, four and eight byte offsets
1806 and \DWFORMrefeightTARG).
1807 There is also an unsigned variable
1808 length offset encoded form that uses
1809 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1810 (\DWFORMrefudataTARG).
1811 Because this type of reference is within
1812 the containing compilation unit no relocation of the value
1815 The second type of reference can identify any debugging
1816 information entry within a
1817 \dotdebuginfo{} section; in particular,
1818 it may refer to an entry in a different compilation unit
1819 from the unit containing the reference, and may refer to an
1820 entry in a different shared object file. This type of reference
1821 (\DWFORMrefaddrTARG)
1822 is an offset from the beginning of the
1824 section of the target executable or shared object file, or, for
1825 references within a \addtoindex{supplementary object file},
1826 an offset from the beginning of the local \dotdebuginfo{} section;
1827 it is relocatable in a relocatable object file and frequently
1828 relocated in an executable or shared object file. For
1829 references from one shared object or static executable file
1830 to another, the relocation and identification of the target
1831 object must be performed by the consumer. In the
1832 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1833 in the \sixtyfourbitdwarfformat, it is an 8-byte
1835 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1837 \textit{A debugging information entry that may be referenced by
1838 another compilation unit using
1839 \DWFORMrefaddr{} must have a global symbolic name.}
1841 \textit{For a reference from one executable or shared object file to
1842 another, the reference is resolved by the debugger to identify
1843 the executable or shared object file and the offset into that
1844 file\textquoteright s \dotdebuginfo{}
1845 section in the same fashion as the run
1846 time loader, either when the debug information is first read,
1847 or when the reference is used.}
1849 The third type of reference can identify any debugging
1850 information type entry that has been placed in its own
1851 \addtoindex{type unit}. This type of
1852 reference (\DWFORMrefsigeightTARG) is the
1853 \addtoindexx{type signature}
1854 64-bit type signature
1855 (see Section \refersec{datarep:typesignaturecomputation})
1856 that was computed for the type.
1858 The fourth type of reference is a reference from within the
1859 \dotdebuginfo{} section of the executable or shared object file to
1860 a debugging information entry in the \dotdebuginfo{} section of
1861 a \addtoindex{supplementary object file}.
1862 This type of reference (\DWFORMrefsupTARG) is an offset from the
1863 beginning of the \dotdebuginfo{} section in the
1864 \addtoindex{supplementary object file}.
1866 \textit{The use of compilation unit relative references will reduce the
1867 number of link\dash time relocations and so speed up linking. The
1868 use of the second, third and fourth type of reference allows for the
1869 sharing of information, such as types, across compilation
1870 units, while the fourth type further allows for sharing of information
1871 across compilation units from different executables or shared object files.}
1873 \textit{A reference to any kind of compilation unit identifies the
1874 debugging information entry for that unit, not the preceding
1878 \item \livelinki{chap:classstring}{string}{string class} \\
1879 \livetarg{datarep:classstring}{}
1880 A string is a sequence of contiguous non\dash null bytes followed by
1882 \addtoindexx{string class}
1883 A string may be represented:
1885 \setlength{\itemsep}{0em}
1886 \item immediately in the debugging information entry itself
1887 (\DWFORMstringTARG),
1890 \addtoindexx{section offset!in class string value}
1891 offset into a string table contained in
1892 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
1893 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
1894 or as an offset into a string table contained in the
1895 \dotdebugstr{} section of a \addtoindex{supplementary object file}
1896 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
1897 section of a \addtoindex{supplementary object file}
1898 refer to the local \dotdebugstr{} section of that same file.
1899 In the \thirtytwobitdwarfformat, the representation of a
1900 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
1901 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
1902 it is an 8-byte unsigned offset
1903 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1906 \item as an indirect offset into the string table using an
1907 index into a table of offsets contained in the
1908 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1909 The representation of a \DWFORMstrxNAME{} value is an unsigned
1910 \addtoindex{LEB128} value, which is interpreted as a zero-based
1911 index into an array of offsets in the \dotdebugstroffsets{} section.
1912 The offset entries in the \dotdebugstroffsets{} section have the
1913 same representation as \DWFORMstrp{} values.
1915 Any combination of these three forms may be used within a single compilation.
1917 If the \DWATuseUTFeight{}
1918 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1919 compilation, partial, skeleton or type unit entry, string values are encoded using the
1920 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1921 Character Set standard (ISO/IEC 10646\dash 1:1993).
1922 \addtoindexx{ISO 10646 character set standard}
1923 Otherwise, the string representation is unspecified.
1925 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1926 ISO/IEC 10646\dash 1:1993.
1927 \addtoindexx{ISO 10646 character set standard}
1928 It contains all the same characters
1929 and encoding points as ISO/IEC 10646, as well as additional
1930 information about the characters and their use.}
1932 \textit{Earlier versions of DWARF did not specify the representation
1933 of strings; for compatibility, this version also does
1934 not. However, the UTF\dash 8 representation is strongly recommended.}
1937 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1938 \livetarg{datarep:classstroffsetsptr}{}
1939 This is an offset into the \dotdebugstroffsets{} section
1940 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1941 \dotdebugstroffsets{} section to the
1942 beginning of the string offsets information for the
1943 referencing entity. It is relocatable in
1944 a relocatable object file, and relocated in an executable or
1945 shared object file. In the \thirtytwobitdwarfformat, this offset
1946 is a 4-byte unsigned value; in the 64-bit DWARF
1947 format, it is an 8-byte unsigned value (see Section
1948 \refersec{datarep:32bitand64bitdwarfformats}).
1950 \textit{This class is new in \DWARFVersionV.}
1954 In no case does an attribute use one of the classes
1959 \CLASSrangelistptr{} or
1960 \CLASSstroffsetsptr{}
1961 to point into either the
1962 \dotdebuginfo{} or \dotdebugstr{} section.
1964 The form encodings are listed in
1965 Table \referfol{tab:attributeformencodings}.
1969 \setlength{\extrarowheight}{0.1cm}
1970 \begin{longtable}{l|c|l}
1971 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1972 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1974 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1976 \hline \emph{Continued on next page}
1978 \hline \ddag\ \textit{New in DWARF Version 5}
1981 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1982 \textit{Reserved} &0x02& \\
1983 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1984 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1985 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1986 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1987 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1988 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1989 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1990 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1991 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1992 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1993 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1994 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1995 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1996 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1997 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1998 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1999 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2000 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2001 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2002 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2003 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
2004 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
2005 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2006 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2007 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2008 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2009 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2010 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2011 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2012 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2013 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2014 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2020 \section{Variable Length Data}
2021 \label{datarep:variablelengthdata}
2022 \addtoindexx{variable length data|see {LEB128}}
2024 \addtoindexx{Little Endian Base 128|see{LEB128}}
2025 encoded using \doublequote{Little Endian Base 128}
2026 \addtoindexx{little-endian encoding|see{endian attribute}}
2028 \addtoindexx{LEB128}
2029 LEB128 is a scheme for encoding integers
2030 densely that exploits the assumption that most integers are
2033 \textit{This encoding is equally suitable whether the target machine
2034 architecture represents data in big\dash\ endian or little\dash endian
2035 order. It is \doublequote{little\dash endian} only in the sense that it
2036 avoids using space to represent the \doublequote{big} end of an
2037 unsigned integer, when the big end is all zeroes or sign
2040 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2041 numbers are encoded as follows:
2042 \addtoindexx{LEB128!unsigned, encoding as}
2043 start at the low order end of an unsigned integer and chop
2044 it into 7-bit chunks. Place each chunk into the low order 7
2045 bits of a byte. Typically, several of the high order bytes
2046 will be zero; discard them. Emit the remaining bytes in a
2047 stream, starting with the low order byte; set the high order
2048 bit on each byte except the last emitted byte. The high bit
2049 of zero on the last byte indicates to the decoder that it
2050 has encountered the last byte.
2052 The integer zero is a special case, consisting of a single
2055 Table \refersec{tab:examplesofunsignedleb128encodings}
2056 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2058 0x80 in each case is the high order bit of the byte, indicating
2059 that an additional byte follows.
2062 The encoding for signed, two\textquoteright s complement LEB128
2063 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2064 numbers is similar, except that the criterion for discarding
2065 high order bytes is not whether they are zero, but whether
2066 they consist entirely of sign extension bits. Consider the
2067 32-bit integer -2. The three high level bytes of the number
2068 are sign extension, thus LEB128 would represent it as a single
2069 byte containing the low order 7 bits, with the high order
2070 bit cleared to indicate the end of the byte stream. Note
2071 that there is nothing within the LEB128 representation that
2072 indicates whether an encoded number is signed or unsigned. The
2073 decoder must know what type of number to expect.
2074 Table \refersec{tab:examplesofunsignedleb128encodings}
2075 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2076 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2077 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2080 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2081 \addtoindexx{LEB128!examples}
2082 gives algorithms for encoding and decoding these forms.}
2086 \setlength{\extrarowheight}{0.1cm}
2087 \begin{longtable}{c|c|c}
2088 \caption{Examples of unsigned LEB128 encodings}
2089 \label{tab:examplesofunsignedleb128encodings}
2090 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2091 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2093 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2095 \hline \emph{Continued on next page}
2101 128& 0 + 0x80 & 1 \\
2102 129& 1 + 0x80 & 1 \\
2103 %130& 2 + 0x80 & 1 \\
2104 12857& 57 + 0x80 & 100 \\
2111 \setlength{\extrarowheight}{0.1cm}
2112 \begin{longtable}{c|c|c}
2113 \caption{Examples of signed LEB128 encodings}
2114 \label{tab:examplesofsignedleb128encodings}
2115 \addtoindexx{LEB128!signed} \\
2116 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2118 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2120 \hline \emph{Continued on next page}
2126 127& 127 + 0x80 & 0 \\
2127 -127& 1 + 0x80 & 0x7f \\
2128 128& 0 + 0x80 & 1 \\
2129 -128& 0 + 0x80 & 0x7f \\
2130 129& 1 + 0x80 & 1 \\
2131 -129& 0x7f + 0x80 & 0x7e \\
2138 \section{DWARF Expressions and Location Descriptions}
2139 \label{datarep:dwarfexpressionsandlocationdescriptions}
2140 \subsection{DWARF Expressions}
2141 \label{datarep:dwarfexpressions}
2144 \addtoindexx{DWARF expression!operator encoding}
2145 DWARF expression is stored in a \nolink{block} of contiguous
2146 bytes. The bytes form a sequence of operations. Each operation
2147 is a 1-byte code that identifies that operation, followed by
2148 zero or more bytes of additional data. The encodings for the
2149 operations are described in
2150 Table \refersec{tab:dwarfoperationencodings}.
2153 \setlength{\extrarowheight}{0.1cm}
2154 \begin{longtable}{l|c|c|l}
2155 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2156 \hline & &\bfseries No. of &\\
2157 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2159 & &\bfseries No. of &\\
2160 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2162 \hline \emph{Continued on next page}
2164 \hline \ddag\ \textit{New in DWARF Version 5}
2167 \DWOPaddr&0x03&1 & constant address \\
2168 & & &(size is target specific) \\
2170 \DWOPderef&0x06&0 & \\
2172 \DWOPconstoneu&0x08&1&1-byte constant \\
2173 \DWOPconstones&0x09&1&1-byte constant \\
2174 \DWOPconsttwou&0x0a&1&2-byte constant \\
2175 \DWOPconsttwos&0x0b&1&2-byte constant \\
2176 \DWOPconstfouru&0x0c&1&4-byte constant \\
2177 \DWOPconstfours&0x0d&1&4-byte constant \\
2178 \DWOPconsteightu&0x0e&1&8-byte constant \\
2179 \DWOPconsteights&0x0f&1&8-byte constant \\
2180 \DWOPconstu&0x10&1&ULEB128 constant \\
2181 \DWOPconsts&0x11&1&SLEB128 constant \\
2182 \DWOPdup&0x12&0 & \\
2183 \DWOPdrop&0x13&0 & \\
2184 \DWOPover&0x14&0 & \\
2185 \DWOPpick&0x15&1&1-byte stack index \\
2186 \DWOPswap&0x16&0 & \\
2187 \DWOProt&0x17&0 & \\
2188 \DWOPxderef&0x18&0 & \\
2189 \DWOPabs&0x19&0 & \\
2190 \DWOPand&0x1a&0 & \\
2191 \DWOPdiv&0x1b&0 & \\
2192 \DWOPminus&0x1c&0 & \\
2193 \DWOPmod&0x1d&0 & \\
2194 \DWOPmul&0x1e&0 & \\
2195 \DWOPneg&0x1f&0 & \\
2196 \DWOPnot&0x20&0 & \\
2198 \DWOPplus&0x22&0 & \\
2199 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2200 \DWOPshl&0x24&0 & \\
2201 \DWOPshr&0x25&0 & \\
2202 \DWOPshra&0x26&0 & \\
2203 \DWOPxor&0x27&0 & \\
2205 \DWOPbra&0x28&1 & signed 2-byte constant \\
2212 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2214 \DWOPlitzero & 0x30 & 0 & \\
2215 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2216 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2217 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2219 \DWOPregzero & 0x50 & 0 & \\*
2220 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2221 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2222 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2224 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2225 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2226 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2227 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2229 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2230 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2231 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2232 & & &SLEB128 offset \\
2233 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2234 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2235 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2236 \DWOPnop{} & 0x96 &0& \\
2238 \DWOPpushobjectaddress&0x97&0 & \\
2239 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2240 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2241 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2242 \DWOPformtlsaddress&0x9b &0& \\
2243 \DWOPcallframecfa{} &0x9c &0& \\
2244 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2246 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2247 &&&\nolink{block} of that size\\
2248 \DWOPstackvalue{} &0x9f &0& \\
2249 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2250 &&&SLEB128 constant offset \\
2251 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2252 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2253 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2254 &&&\nolink{block} of that size\\
2255 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2256 & & & 1-byte size, \\*
2257 & & & constant value \\
2258 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2259 &&& ULEB128 constant offset \\
2260 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2261 &&& ULEB128 type entry offset \\
2262 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2263 &&& ULEB128 type entry offset \\
2264 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2265 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2266 \DWOPlouser{} &0xe0 && \\
2267 \DWOPhiuser{} &\xff && \\
2273 \subsection{Location Descriptions}
2274 \label{datarep:locationdescriptions}
2276 A location description is used to compute the
2277 location of a variable or other entity.
2279 \subsection{Location Lists}
2280 \label{datarep:locationlists}
2282 Each entry in a \addtoindex{location list} is either a location list entry,
2283 a base address selection entry, or an
2284 \addtoindexx{end-of-list entry!in location list}
2288 \subsubsection{Location List Entries in Non-Split Objects}
2289 A \addtoindex{location list} entry consists of two address offsets followed
2290 by an unsigned 2-byte length, followed by a block of contiguous bytes
2291 that contains a DWARF location description. The length
2292 specifies the number of bytes in that block. The two offsets
2293 are the same size as an address on the target machine.
2296 A base address selection entry and an
2297 \addtoindexx{end-of-list entry!in location list}
2298 end-of-list entry each
2299 consist of two (constant or relocated) address offsets. The two
2300 offsets are the same size as an address on the target machine.
2302 For a \addtoindex{location list} to be specified, the base address of
2303 \addtoindexx{base address selection entry!in location list}
2304 the corresponding compilation unit must be defined
2305 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2307 \subsubsection{Location List Entries in Split Objects}
2308 \label{datarep:locationlistentriesinsplitobjects}
2309 An alternate form for location list entries is used in split objects.
2310 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2311 that follows. The encodings for these constants are given in
2312 Table \refersec{tab:locationlistentryencodingvalues}.
2316 \setlength{\extrarowheight}{0.1cm}
2317 \begin{longtable}{l|c}
2318 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2319 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2321 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2323 \hline \emph{Continued on next page}
2327 \DWLLEendoflistentry & 0x0 \\
2328 \DWLLEbaseaddressselectionentry & 0x01 \\
2329 \DWLLEstartendentry & 0x02 \\
2330 \DWLLEstartlengthentry & 0x03 \\
2331 \DWLLEoffsetpairentry & 0x04 \\
2335 \section{Base Type Attribute Encodings}
2336 \label{datarep:basetypeattributeencodings}
2338 The encodings of the
2339 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2341 \addtoindexx{encoding attribute}
2344 attribute are given in
2345 Table \refersec{tab:basetypeencodingvalues}
2348 \setlength{\extrarowheight}{0.1cm}
2349 \begin{longtable}{l|c}
2350 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2351 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2353 \bfseries Base type encoding name&\bfseries Value\\ \hline
2355 \hline \emph{Continued on next page}
2358 \ddag \ \textit{New in \DWARFVersionV}
2360 \DWATEaddress&0x01 \\
2361 \DWATEboolean&0x02 \\
2362 \DWATEcomplexfloat&0x03 \\
2364 \DWATEsigned&0x05 \\
2365 \DWATEsignedchar&0x06 \\
2366 \DWATEunsigned&0x07 \\
2367 \DWATEunsignedchar&0x08 \\
2368 \DWATEimaginaryfloat&0x09 \\
2369 \DWATEpackeddecimal&0x0a \\
2370 \DWATEnumericstring&0x0b \\
2371 \DWATEedited&0x0c \\
2372 \DWATEsignedfixed&0x0d \\
2373 \DWATEunsignedfixed&0x0e \\
2374 \DWATEdecimalfloat & 0x0f \\
2375 \DWATEUTF{} & 0x10 \\
2376 \DWATEUCS~\ddag & 0x11 \\
2377 \DWATEASCII~\ddag & 0x12 \\
2378 \DWATElouser{} & 0x80 \\
2379 \DWATEhiuser{} & \xff \\
2384 The encodings of the constants used in the
2385 \DWATdecimalsign{} attribute
2387 Table \refersec{tab:decimalsignencodings}.
2390 \setlength{\extrarowheight}{0.1cm}
2391 \begin{longtable}{l|c}
2392 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2393 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2395 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2397 \hline \emph{Continued on next page}
2402 \DWDSunsigned{} & 0x01 \\
2403 \DWDSleadingoverpunch{} & 0x02 \\
2404 \DWDStrailingoverpunch{} & 0x03 \\
2405 \DWDSleadingseparate{} & 0x04 \\
2406 \DWDStrailingseparate{} & 0x05 \\
2412 The encodings of the constants used in the
2413 \DWATendianity{} attribute are given in
2414 Table \refersec{tab:endianityencodings}.
2417 \setlength{\extrarowheight}{0.1cm}
2418 \begin{longtable}{l|c}
2419 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2420 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2422 \bfseries Endian code name&\bfseries Value\\ \hline
2424 \hline \emph{Continued on next page}
2429 \DWENDdefault{} & 0x00 \\
2430 \DWENDbig{} & 0x01 \\
2431 \DWENDlittle{} & 0x02 \\
2432 \DWENDlouser{} & 0x40 \\
2433 \DWENDhiuser{} & \xff \\
2439 \section{Accessibility Codes}
2440 \label{datarep:accessibilitycodes}
2441 The encodings of the constants used in the
2442 \DWATaccessibility{}
2444 \addtoindexx{accessibility attribute}
2446 Table \refersec{tab:accessibilityencodings}.
2449 \setlength{\extrarowheight}{0.1cm}
2450 \begin{longtable}{l|c}
2451 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2452 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2454 \bfseries Accessibility code name&\bfseries Value\\ \hline
2456 \hline \emph{Continued on next page}
2461 \DWACCESSpublic&0x01 \\
2462 \DWACCESSprotected&0x02 \\
2463 \DWACCESSprivate&0x03 \\
2469 \section{Visibility Codes}
2470 \label{datarep:visibilitycodes}
2471 The encodings of the constants used in the
2472 \DWATvisibility{} attribute are given in
2473 Table \refersec{tab:visibilityencodings}.
2476 \setlength{\extrarowheight}{0.1cm}
2477 \begin{longtable}{l|c}
2478 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2479 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2481 \bfseries Visibility code name&\bfseries Value\\ \hline
2483 \hline \emph{Continued on next page}
2489 \DWVISexported&0x02 \\
2490 \DWVISqualified&0x03 \\
2495 \section{Virtuality Codes}
2496 \label{datarep:vitualitycodes}
2498 The encodings of the constants used in the
2499 \DWATvirtuality{} attribute are given in
2500 Table \refersec{tab:virtualityencodings}.
2503 \setlength{\extrarowheight}{0.1cm}
2504 \begin{longtable}{l|c}
2505 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2506 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2508 \bfseries Virtuality code name&\bfseries Value\\ \hline
2510 \hline \emph{Continued on next page}
2515 \DWVIRTUALITYnone&0x00 \\
2516 \DWVIRTUALITYvirtual&0x01 \\
2517 \DWVIRTUALITYpurevirtual&0x02 \\
2524 \DWVIRTUALITYnone{} is equivalent to the absence of the
2528 \section{Source Languages}
2529 \label{datarep:sourcelanguages}
2531 The encodings of the constants used
2532 \addtoindexx{language attribute, encoding}
2534 \addtoindexx{language name encoding}
2537 attribute are given in
2538 Table \refersec{tab:languageencodings}.
2540 % If we don't force a following space it looks odd
2542 and their associated values are reserved, but the
2543 languages they represent are not well supported.
2544 Table \refersec{tab:languageencodings}
2546 \addtoindexx{lower bound attribute!default}
2547 default lower bound, if any, assumed for
2548 an omitted \DWATlowerbound{} attribute in the context of a
2549 \DWTAGsubrangetype{} debugging information entry for each
2553 \setlength{\extrarowheight}{0.1cm}
2554 \begin{longtable}{l|c|c}
2555 \caption{Language encodings} \label{tab:languageencodings}\\
2556 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2558 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2560 \hline \emph{Continued on next page}
2563 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2565 \addtoindexx{ISO-defined language names}
2567 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2568 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2569 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2570 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2571 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2572 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2573 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2574 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2575 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2576 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2577 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2578 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2579 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2580 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2581 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2582 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2583 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2584 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2585 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2586 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2587 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2588 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2589 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2590 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2591 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2592 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2593 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2594 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2595 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2596 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2597 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2598 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2599 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++:2014 (ISO)} \\
2600 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2601 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2602 \DWLANGlouser{} &0x8000 & \\
2603 \DWLANGhiuser{} &\xffff & \\
2608 \section{Address Class Encodings}
2609 \label{datarep:addressclassencodings}
2611 The value of the common
2612 \addtoindex{address class} encoding
2616 \section{Identifier Case}
2617 \label{datarep:identifiercase}
2619 The encodings of the constants used in the
2620 \DWATidentifiercase{} attribute are given in
2621 Table \refersec{tab:identifiercaseencodings}.
2625 \setlength{\extrarowheight}{0.1cm}
2626 \begin{longtable}{l|c}
2627 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2628 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2630 \bfseries Identifier case name&\bfseries Value\\ \hline
2632 \hline \emph{Continued on next page}
2636 \DWIDcasesensitive&0x00 \\
2638 \DWIDdowncase&0x02 \\
2639 \DWIDcaseinsensitive&0x03 \\
2643 \section{Calling Convention Encodings}
2644 \label{datarep:callingconventionencodings}
2645 The encodings of the constants used in the
2646 \DWATcallingconvention{} attribute are given in
2647 Table \refersec{tab:callingconventionencodings}.
2650 \setlength{\extrarowheight}{0.1cm}
2651 \begin{longtable}{l|c}
2652 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2653 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2655 \bfseries Calling convention name&\bfseries Value\\ \hline
2657 \hline \emph{Continued on next page}
2659 \hline \ddag\ \textit{New in DWARF Version 5}
2662 \DWCCnormal &0x01 \\
2663 \DWCCprogram&0x02 \\
2664 \DWCCnocall &0x03 \\
2665 \DWCCpassbyreference~\ddag &0x04 \\
2666 \DWCCpassbyvalue~\ddag &0x05 \\
2667 \DWCClouser &0x40 \\
2674 \section{Inline Codes}
2675 \label{datarep:inlinecodes}
2677 The encodings of the constants used in
2678 \addtoindexx{inline attribute}
2680 \DWATinline{} attribute are given in
2681 Table \refersec{tab:inlineencodings}.
2685 \setlength{\extrarowheight}{0.1cm}
2686 \begin{longtable}{l|c}
2687 \caption{Inline encodings} \label{tab:inlineencodings}\\
2688 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2690 \bfseries Inline Code name&\bfseries Value\\ \hline
2692 \hline \emph{Continued on next page}
2697 \DWINLnotinlined&0x00 \\
2698 \DWINLinlined&0x01 \\
2699 \DWINLdeclarednotinlined&0x02 \\
2700 \DWINLdeclaredinlined&0x03 \\
2705 % this clearpage is ugly, but the following table came
2706 % out oddly without it.
2708 \section{Array Ordering}
2709 \label{datarep:arrayordering}
2711 The encodings of the constants used in the
2712 \DWATordering{} attribute are given in
2713 Table \refersec{tab:orderingencodings}.
2717 \setlength{\extrarowheight}{0.1cm}
2718 \begin{longtable}{l|c}
2719 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2720 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2722 \bfseries Ordering name&\bfseries Value\\ \hline
2724 \hline \emph{Continued on next page}
2729 \DWORDrowmajor&0x00 \\
2730 \DWORDcolmajor&0x01 \\
2736 \section{Discriminant Lists}
2737 \label{datarep:discriminantlists}
2739 The descriptors used in
2740 \addtoindexx{discriminant list attribute}
2742 \DWATdiscrlist{} attribute are
2743 encoded as 1-byte constants. The
2744 defined values are given in
2745 Table \refersec{tab:discriminantdescriptorencodings}.
2747 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2749 \setlength{\extrarowheight}{0.1cm}
2750 \begin{longtable}{l|c}
2751 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2752 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2754 \bfseries Descriptor name&\bfseries Value\\ \hline
2756 \hline \emph{Continued on next page}
2768 \section{Name Index Table}
2769 \label{datarep:nameindextable}
2770 Each name index table in the \dotdebugnames{} section
2771 begins with a header consisting of:
2772 \begin{enumerate}[1. ]
2773 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2774 \addttindexx{unit\_length}
2775 A 4-byte or 12-byte initial length field that
2776 contains the size in bytes of this contribution to the \dotdebugnames{}
2777 section, not including the length field itself
2778 (see Section \refersec{datarep:initiallengthvalues}).
2780 \item \texttt{version} (\HFTuhalf) \\
2781 A 2-byte version number\addtoindexx{version number!name index table}
2782 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2783 This number is specific to the name index table and is
2784 independent of the DWARF version number.
2786 The value in this field is \versiondotdebugnames.
2788 \item padding (\HFTuhalf) \\
2790 \item \texttt{comp\_unit\_count} (\HFTuword) \\
2791 The number of CUs in the CU list.
2793 \item \texttt{local\_type\_unit\_count} (\HFTuword) \\
2794 The number of TUs in the first TU list.
2796 \item \texttt{foreign\_type\_unit\_count} (\HFTuword) \\
2797 The number of TUs in the second TU list.
2799 \item \texttt{bucket\_count} (\HFTuword) \\
2800 The number of hash buckets in the hash lookup table.
2801 If there is no hash lookup table, this field contains 0.
2803 \item \texttt{name\_count} (\HFTuword) \\
2804 The number of unique names in the index.
2806 \item \texttt{abbrev\_table\_size} (\HFTuword) \\
2807 The size in bytes of the abbreviations table.
2809 \item \texttt{augmentation\_string\_size} (\HFTuword) \\
2810 The size in bytes of the augmentation string. This value should be
2811 rounded up to a multiple of 4.
2813 \item \texttt{augmentation\_string} (\HFTaugstring) \\
2814 A vendor-specific augmentation string, which provides additional
2815 information about the contents of this index. If provided, the string
2816 should begin with a 4-character vendor ID. The remainder of the
2817 string is meant to be read by a cooperating consumer, and its
2818 contents and interpretation are not specified here. The
2819 string should be padded with null characters to a multiple of
2820 four bytes in length.
2824 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
2827 \setlength{\extrarowheight}{0.1cm}
2828 \begin{longtable}{l|c|l}
2829 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
2830 \hline \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2832 \bfseries Attribute name&\bfseries Value &\bfseries Form/Class \\ \hline
2834 \hline \emph{Continued on next page}
2837 \ddag \ \textit{New in \DWARFVersionV}
2839 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
2840 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
2841 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
2842 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
2843 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
2844 \DWIDXlouser~\ddag & 0x2000 & \\
2845 \DWIDXhiuser~\ddag & \xiiifff & \\
2849 The abbreviations table ends with an entry consisting of a single 0
2850 byte for the abbreviation code. The size of the table given by
2851 \texttt{abbrev\_table\_size} may include optional padding following the
2854 \section{Defaulted Member Encodings}
2855 \hypertarget{datarep:defaultedmemberencodings}{}
2857 The encodings of the constants used in the \DWATdefaulted{} attribute
2858 are given in Table \referfol{datarep:defaultedattributeencodings}.
2861 \setlength{\extrarowheight}{0.1cm}
2862 \begin{longtable}{l|c}
2863 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
2864 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
2866 \bfseries Defaulted name &\bfseries Value \\ \hline
2868 \hline \emph{Continued on next page}
2871 \ddag~\textit{New in \DWARFVersionV}
2873 \DWDEFAULTEDno~\ddag & 0x00 \\
2874 \DWDEFAULTEDinclass~\ddag & 0x01 \\
2875 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
2880 \section{Address Range Table}
2881 \label{datarep:addrssrangetable}
2883 Each set of entries in the table of address ranges contained
2884 in the \dotdebugaranges{}
2885 section begins with a header containing:
2886 \begin{enumerate}[1. ]
2887 % FIXME The unit length text is not fully consistent across
2890 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2891 \addttindexx{unit\_length}
2892 A 4-byte or 12-byte length containing the length of the
2893 \addtoindexx{initial length}
2894 set of entries for this compilation unit, not including the
2895 length field itself. In the \thirtytwobitdwarfformat, this is a
2896 4-byte unsigned integer (which must be less than \xfffffffzero);
2897 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2898 \wffffffff followed by an 8-byte unsigned integer that gives
2900 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2902 \item version (\HFTuhalf) \\
2903 A 2-byte version identifier representing the version of the
2904 DWARF information for the address range table
2905 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2907 This value in this field \addtoindexx{version number!address range table} is 2.
2909 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2911 \addtoindexx{section offset!in .debug\_aranges header}
2912 4-byte or 8-byte offset into the
2913 \dotdebuginfo{} section of
2914 the compilation unit header. In the \thirtytwobitdwarfformat,
2915 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2916 this is an 8-byte unsigned offset
2917 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2919 \item \texttt{address\_size} (\HFTubyte) \\
2920 A 1-byte unsigned integer containing the size in bytes of an
2921 \addttindexx{address\_size}
2923 \addtoindexx{size of an address}
2924 (or the offset portion of an address for segmented
2925 \addtoindexx{address space!segmented}
2926 addressing) on the target system.
2928 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
2929 A 1-byte unsigned integer containing the size in bytes of a
2930 segment selector on the target system.
2934 This header is followed by a series of tuples. Each tuple
2935 consists of a segment, an address and a length.
2936 The segment selector
2937 size is given by the \HFNsegmentselectorsize{} field of the header; the
2938 address and length size are each given by the \addttindex{address\_size}
2939 field of the header.
2940 The first tuple following the header in
2941 each set begins at an offset that is a multiple of the size
2942 of a single tuple (that is, the size of a segment selector
2943 plus twice the \addtoindex{size of an address}).
2944 The header is padded, if
2945 necessary, to that boundary. Each set of tuples is terminated
2946 by a 0 for the segment, a 0 for the address and 0 for the
2947 length. If the \HFNsegmentselectorsize{} field in the header is zero,
2948 the segment selectors are omitted from all tuples, including
2949 the terminating tuple.
2952 \section{Line Number Information}
2953 \label{datarep:linenumberinformation}
2955 The \addtoindexi{version number}{version number!line number information}
2956 in the line number program header is \versiondotdebugline{}
2957 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2959 The boolean values \doublequote{true} and \doublequote{false}
2960 used by the line number information program are encoded
2961 as a single byte containing the value 0
2962 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2965 The encodings for the standard opcodes are given in
2966 \addtoindexx{line number opcodes!standard opcode encoding}
2967 Table \refersec{tab:linenumberstandardopcodeencodings}.
2970 \setlength{\extrarowheight}{0.1cm}
2971 \begin{longtable}{l|c}
2972 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2973 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2975 \bfseries Opcode name&\bfseries Value\\ \hline
2977 \hline \emph{Continued on next page}
2983 \DWLNSadvancepc&0x02 \\
2984 \DWLNSadvanceline&0x03 \\
2985 \DWLNSsetfile&0x04 \\
2986 \DWLNSsetcolumn&0x05 \\
2987 \DWLNSnegatestmt&0x06 \\
2988 \DWLNSsetbasicblock&0x07 \\
2989 \DWLNSconstaddpc&0x08 \\
2990 \DWLNSfixedadvancepc&0x09 \\
2991 \DWLNSsetprologueend&0x0a \\*
2992 \DWLNSsetepiloguebegin&0x0b \\*
2993 \DWLNSsetisa&0x0c \\*
2999 The encodings for the extended opcodes are given in
3000 \addtoindexx{line number opcodes!extended opcode encoding}
3001 Table \refersec{tab:linenumberextendedopcodeencodings}.
3004 \setlength{\extrarowheight}{0.1cm}
3005 \begin{longtable}{l|c}
3006 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3007 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3009 \bfseries Opcode name&\bfseries Value\\ \hline
3011 \hline \emph{Continued on next page}
3013 \hline %\ddag~\textit{New in DWARF Version 5}
3016 \DWLNEendsequence &0x01 \\
3017 \DWLNEsetaddress &0x02 \\
3018 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3019 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3021 \DWLNEsetdiscriminator &0x04 \\
3022 \DWLNElouser &0x80 \\
3023 \DWLNEhiuser &\xff \\
3029 The encodings for the line number header entry formats are given in
3030 \addtoindexx{line number opcodes!file entry format encoding}
3031 Table \refersec{tab:linenumberheaderentryformatencodings}.
3034 \setlength{\extrarowheight}{0.1cm}
3035 \begin{longtable}{l|c}
3036 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3037 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3039 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3041 \hline \emph{Continued on next page}
3043 \hline \ddag~\textit{New in DWARF Version 5}
3045 \DWLNCTpath~\ddag & 0x1 \\
3046 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3047 \DWLNCTtimestamp~\ddag & 0x3 \\
3048 \DWLNCTsize~\ddag & 0x4 \\
3049 \DWLNCTMDfive~\ddag & 0x5 \\
3050 \DWLNCTlouser~\ddag & 0x2000 \\
3051 \DWLNCThiuser~\ddag & \xiiifff \\
3056 \section{Macro Information}
3057 \label{datarep:macroinformation}
3058 The \addtoindexi{version number}{version number!macro information}
3059 in the macro information header is \versiondotdebugmacro{}
3060 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3062 The source line numbers and source file indices encoded in the
3063 macro information section are represented as
3064 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3067 The macro information entry type is encoded as a single unsigned byte.
3069 \addtoindexx{macro information entry types!encoding}
3071 Table \refersec{tab:macroinfoentrytypeencodings}.
3075 \setlength{\extrarowheight}{0.1cm}
3076 \begin{longtable}{l|c}
3077 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3078 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3080 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3082 \hline \emph{Continued on next page}
3084 \hline \ddag~\textit{New in DWARF Version 5}
3087 \DWMACROdefine~\ddag &0x01 \\
3088 \DWMACROundef~\ddag &0x02 \\
3089 \DWMACROstartfile~\ddag &0x03 \\
3090 \DWMACROendfile~\ddag &0x04 \\
3091 \DWMACROdefineindirect~\ddag &0x05 \\
3092 \DWMACROundefindirect~\ddag &0x06 \\
3093 \DWMACROtransparentinclude~\ddag &0x07 \\
3094 \DWMACROdefineindirectsup~\ddag &0x08 \\
3095 \DWMACROundefindirectsup~\ddag &0x09 \\
3096 \DWMACROtransparentincludesup~\ddag&0x0a \\
3097 \DWMACROdefineindirectx~\ddag &0x0b \\
3098 \DWMACROundefindirectx~\ddag &0x0c \\
3099 \DWMACROlouser~\ddag &0xe0 \\
3100 \DWMACROhiuser~\ddag &\xff \\
3106 \section{Call Frame Information}
3107 \label{datarep:callframeinformation}
3109 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3110 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3111 value is \xffffffffffffffff.
3113 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3114 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3116 Call frame instructions are encoded in one or more bytes. The
3117 primary opcode is encoded in the high order two bits of
3118 the first byte (that is, opcode = byte $\gg$ 6). An operand
3119 or extended opcode may be encoded in the low order 6
3120 bits. Additional operands are encoded in subsequent bytes.
3121 The instructions and their encodings are presented in
3122 Table \refersec{tab:callframeinstructionencodings}.
3125 \setlength{\extrarowheight}{0.1cm}
3126 \begin{longtable}{l|c|c|l|l}
3127 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3128 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3129 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3131 & \bfseries High 2 &\bfseries Low 6 & &\\
3132 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3134 \hline \emph{Continued on next page}
3139 \DWCFAadvanceloc&0x1&delta & \\
3140 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3141 \DWCFArestore&0x3®ister & & \\
3142 \DWCFAnop&0&0 & & \\
3143 \DWCFAsetloc&0&0x01&address & \\
3144 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3145 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3146 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3147 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3148 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3149 \DWCFAundefined&0&0x07&ULEB128 register & \\
3150 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3151 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3152 \DWCFArememberstate&0&0x0a & & \\
3153 \DWCFArestorestate&0&0x0b & & \\
3154 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3155 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3156 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3157 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3158 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3160 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3161 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3162 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3163 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3164 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3165 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3166 \DWCFAlouser&0&0x1c & & \\
3167 \DWCFAhiuser&0&\xiiif & & \\
3171 \section{Non-contiguous Address Ranges}
3172 \label{datarep:noncontiguousaddressranges}
3174 Each entry in a \addtoindex{range list}
3175 (see Section \refersec{chap:noncontiguousaddressranges})
3177 \addtoindexx{base address selection entry!in range list}
3179 \addtoindexx{range list}
3180 a base address selection entry, or an end-of-list entry.
3182 A \addtoindex{range list} entry consists of two relative addresses. The
3183 addresses are the same size as addresses on the target machine.
3186 A base address selection entry and an
3187 \addtoindexx{end-of-list entry!in range list}
3188 end-of-list entry each
3189 \addtoindexx{base address selection entry!in range list}
3190 consist of two (constant or relocated) addresses. The two
3191 addresses are the same size as addresses on the target machine.
3193 For a \addtoindex{range list} to be specified, the base address of the
3194 \addtoindexx{base address selection entry!in range list}
3195 corresponding compilation unit must be defined
3196 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
3199 \section{String Offsets Table}
3200 \label{chap:stringoffsetstable}
3201 Each set of entries in the string offsets table contained in the
3202 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3203 section begins with a header containing:
3204 \begin{enumerate}[1. ]
3205 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3206 \addttindexx{unit\_length}
3207 A 4-byte or 12-byte length containing the length of
3208 the set of entries for this compilation unit, not
3209 including the length field itself. In the 32-bit
3210 DWARF format, this is a 4-byte unsigned integer
3211 (which must be less than \xfffffffzero); in the 64-bit
3212 DWARF format, this consists of the 4-byte value
3213 \wffffffff followed by an 8-byte unsigned integer
3214 that gives the actual length (see
3215 Section \refersec{datarep:32bitand64bitdwarfformats}).
3218 \item \texttt{version} (\HFTuhalf) \\
3219 A 2-byte version identifier containing the value
3220 \versiondotdebugstroffsets{}
3221 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3223 \item \texttt{padding} (\HFTuhalf) \\
3226 This header is followed by a series of string table offsets
3227 that have the same representation as \DWFORMstrp.
3228 For the 32-bit DWARF format, each offset is 4 bytes long; for
3229 the 64-bit DWARF format, each offset is 8 bytes long.
3231 The \DWATstroffsetsbase{} attribute points to the first
3232 entry following the header. The entries are indexed
3233 sequentially from this base entry, starting from 0.
3235 \section{Address Table}
3236 \label{chap:addresstable}
3237 Each set of entries in the address table contained in the
3238 \dotdebugaddr{} section begins with a header containing:
3239 \begin{enumerate}[1. ]
3240 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3241 \addttindexx{unit\_length}
3242 A 4-byte or 12-byte length containing the length of
3243 the set of entries for this compilation unit, not
3244 including the length field itself. In the 32-bit
3245 DWARF format, this is a 4-byte unsigned integer
3246 (which must be less than \xfffffffzero); in the 64-bit
3247 DWARF format, this consists of the 4-byte value
3248 \wffffffff followed by an 8-byte unsigned integer
3249 that gives the actual length (see
3250 Section \refersec{datarep:32bitand64bitdwarfformats}).
3253 \item \texttt{version} (\HFTuhalf) \\
3254 A 2-byte version identifier containing the value
3255 \versiondotdebugaddr{}
3256 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3259 \item \texttt{address\_size} (\HFTubyte) \\
3260 A 1-byte unsigned integer containing the size in
3261 bytes of an address (or the offset portion of an
3262 address for segmented addressing) on the target
3266 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3267 A 1-byte unsigned integer containing the size in
3268 bytes of a segment selector on the target system.
3271 This header is followed by a series of segment/address pairs.
3272 The segment size is given by the \HFNsegmentselectorsize{} field of the
3273 header, and the address size is given by the \addttindex{address\_size}
3274 field of the header. If the \HFNsegmentselectorsize{} field in the header
3275 is zero, the entries consist only of an addresses.
3277 The \DWATaddrbase{} attribute points to the first entry
3278 following the header. The entries are indexed sequentially
3279 from this base entry, starting from 0.
3282 \section{Range List Table}
3283 \label{app:rangelisttable}
3284 Each set of entries in the range list table contained in the
3285 \dotdebugranges{} section begins with a header containing:
3286 \begin{enumerate}[1. ]
3287 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3288 \addttindexx{unit\_length}
3289 A 4-byte or 12-byte length containing the length of
3290 the set of entries for this compilation unit, not
3291 including the length field itself. In the 32-bit
3292 DWARF format, this is a 4-byte unsigned integer
3293 (which must be less than \xfffffffzero); in the 64-bit
3294 DWARF format, this consists of the 4-byte value
3295 \wffffffff followed by an 8-byte unsigned integer
3296 that gives the actual length (see
3297 Section \refersec{datarep:32bitand64bitdwarfformats}).
3300 \item \texttt{version} (\HFTuhalf) \\
3301 A 2-byte version identifier containing the value
3302 \versiondotdebugranges{}
3303 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3306 \item \texttt{address\_size} (\HFTubyte) \\
3307 A 1-byte unsigned integer containing the size in
3308 bytes of an address (or the offset portion of an
3309 address for segmented addressing) on the target
3313 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3314 A 1-byte unsigned integer containing the size in
3315 bytes of a segment selector on the target system.
3318 This header is followed by a series of range list entries as
3319 described in Section \refersec{chap:noncontiguousaddressranges}.
3320 The segment size is given by the
3321 \HFNsegmentselectorsize{} field of the header, and the address size is
3322 given by the \addttindex{address\_size} field of the header. If the
3323 \HFNsegmentselectorsize{} field in the header is zero, the segment
3324 selector is omitted from the range list entries.
3326 The \DWATrangesbase{} attribute points to the first entry
3327 following the header. The entries are referenced by a byte
3328 offset relative to this base address.
3331 \section{Location List Table}
3332 \label{datarep:locationlisttable}
3333 Each set of entries in the location list table contained in the
3334 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3335 \begin{enumerate}[1. ]
3336 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3337 \addttindexx{unit\_length}
3338 A 4-byte or 12-byte length containing the length of
3339 the set of entries for this compilation unit, not
3340 including the length field itself. In the 32-bit
3341 DWARF format, this is a 4-byte unsigned integer
3342 (which must be less than \xfffffffzero); in the 64-bit
3343 DWARF format, this consists of the 4-byte value
3344 \wffffffff followed by an 8-byte unsigned integer
3345 that gives the actual length (see
3346 Section \refersec{datarep:32bitand64bitdwarfformats}).
3349 \item \texttt{version} (\HFTuhalf) \\
3350 A 2-byte version identifier containing the value
3351 \versiondotdebugloc{}
3352 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3355 \item \texttt{address\_size} (\HFTubyte) \\
3356 A 1-byte unsigned integer containing the size in
3357 bytes of an address (or the offset portion of an
3358 address for segmented addressing) on the target
3362 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3363 A 1-byte unsigned integer containing the size in
3364 bytes of a segment selector on the target system.
3367 This header is followed by a series of location list entries as
3368 described in Section \refersec{chap:locationlists}.
3369 The segment size is given by the
3370 \HFNsegmentselectorsize{} field of the header, and the address size is
3371 given by the \HFNaddresssize{} field of the header. If the
3372 \HFNsegmentselectorsize{} field in the header is zero, the segment
3373 selector is omitted from range list entries.
3375 The entries are referenced by a byte offset relative to the first
3376 location list following this header.
3379 \section{Dependencies and Constraints}
3380 \label{datarep:dependenciesandconstraints}
3381 The debugging information in this format is intended to
3382 exist in sections of an object file, or an equivalent
3383 separate file or database, having names beginning with
3384 the prefix ".debug\_" (see Appendix
3385 \refersec{app:dwarfsectionversionnumbersinformative}
3386 for a complete list of such names).
3387 Except as specifically specified, this information is not
3388 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3391 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3392 32-bit addresses, an assembler or compiler must provide a way
3393 to produce 2-byte and 4-byte quantities without alignment
3394 restrictions, and the linker must be able to relocate a
3396 \addtoindexx{section offset!alignment of}
3397 section offset that occurs at an arbitrary
3400 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3401 64-bit addresses, an assembler or compiler must provide a
3402 way to produce 2-byte, 4-byte and 8-byte quantities without
3403 alignment restrictions, and the linker must be able to relocate
3404 an 8-byte address or 4-byte
3405 \addtoindexx{section offset!alignment of}
3406 section offset that occurs at an
3407 arbitrary alignment.
3409 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3410 32-bit addresses, an assembler or compiler must provide a
3411 way to produce 2-byte, 4-byte and 8-byte quantities without
3412 alignment restrictions, and the linker must be able to relocate
3413 a 4-byte address or 8-byte
3414 \addtoindexx{section offset!alignment of}
3415 section offset that occurs at an
3416 arbitrary alignment.
3418 \textit{It is expected that this will be required only for very large
3419 32-bit programs or by those architectures which support
3420 a mix of 32-bit and 64-bit code and data within the same
3423 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3424 64-bit addresses, an assembler or compiler must provide a
3425 way to produce 2-byte, 4-byte and 8-byte quantities without
3426 alignment restrictions, and the linker must be able to
3427 relocate an 8-byte address or
3428 \addtoindexx{section offset!alignment of}
3429 section offset that occurs at
3430 an arbitrary alignment.
3434 \section{Integer Representation Names}
3435 \label{datarep:integerrepresentationnames}
3436 The sizes of the integers used in the lookup by name, lookup
3437 by address, line number, call frame information and other sections
3439 Table \ref{tab:integerrepresentationnames}.
3443 \setlength{\extrarowheight}{0.1cm}
3444 \begin{longtable}{c|l}
3445 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3446 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3448 \bfseries Representation name&\bfseries Representation\\ \hline
3450 \hline \emph{Continued on next page}
3455 \HFTsbyte& signed, 1-byte integer \\
3456 \HFTubyte&unsigned, 1-byte integer \\
3457 \HFTuhalf&unsigned, 2-byte integer \\
3458 \HFTuword&unsigned, 4-byte integer \\
3464 \section{Type Signature Computation}
3465 \label{datarep:typesignaturecomputation}
3467 A type signature is computed only by the DWARF producer;
3468 \addtoindexx{type signature!computation}
3469 it is used by a DWARF consumer to resolve type references to
3470 the type definitions that are contained in
3471 \addtoindexx{type unit}
3475 The type signature for a type T0 is formed from the
3476 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3477 R.L. Rivest, RFC 1321, April 1992}
3478 hash of a flattened description of the type. The flattened
3479 description of the type is a byte sequence derived from the
3480 DWARF encoding of the type as follows:
3481 \begin{enumerate}[1. ]
3483 \item Start with an empty sequence S and a list V of visited
3484 types, where V is initialized to a list containing the type
3485 T0 as its single element. Elements in V are indexed from 1,
3488 \item If the debugging information entry represents a type that
3489 is nested inside another type or a namespace, append to S
3490 the type\textquoteright s context as follows: For each surrounding type
3491 or namespace, beginning with the outermost such construct,
3492 append the letter 'C', the DWARF tag of the construct, and
3493 the name (taken from
3494 \addtoindexx{name attribute}
3495 the \DWATname{} attribute) of the type
3496 \addtoindexx{name attribute}
3497 or namespace (including its trailing null byte).
3499 \item Append to S the letter 'D', followed by the DWARF tag of
3500 the debugging information entry.
3502 \item For each of the attributes in
3503 Table \refersec{tab:attributesusedintypesignaturecomputation}
3505 the debugging information entry, in the order listed,
3506 append to S a marker letter (see below), the DWARF attribute
3507 code, and the attribute value.
3510 \caption{Attributes used in type signature computation}
3511 \label{tab:attributesusedintypesignaturecomputation}
3512 \simplerule[\textwidth]
3514 \autocols[0pt]{c}{2}{l}{
3530 \DWATcontainingtype,
3534 \DWATdatamemberlocation,
3555 \DWATrvaluereference,
3559 \DWATstringlengthbitsize,
3560 \DWATstringlengthbytesize,
3565 \DWATvariableparameter,
3568 \DWATvtableelemlocation
3571 \simplerule[\textwidth]
3574 Note that except for the initial
3575 \DWATname{} attribute,
3576 \addtoindexx{name attribute}
3577 attributes are appended in order according to the alphabetical
3578 spelling of their identifier.
3580 If an implementation defines any vendor-specific attributes,
3581 any such attributes that are essential to the definition of
3582 the type should also be included at the end of the above list,
3583 in their own alphabetical suborder.
3585 An attribute that refers to another type entry T is processed
3586 as follows: (a) If T is in the list V at some V[x], use the
3587 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3588 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3589 as the marker, process the type T recursively by performing
3590 Steps 2 through 7, and use the result as the attribute value.
3592 Other attribute values use the letter 'A' as the marker, and
3593 the value consists of the form code (encoded as an unsigned
3594 LEB128 value) followed by the encoding of the value according
3595 to the form code. To ensure reproducibility of the signature,
3596 the set of forms used in the signature computation is limited
3605 \item If the tag in Step 3 is one of \DWTAGpointertype,
3606 \DWTAGreferencetype,
3607 \DWTAGrvaluereferencetype,
3608 \DWTAGptrtomembertype,
3609 or \DWTAGfriend, and the referenced
3610 type (via the \DWATtype{} or
3611 \DWATfriend{} attribute) has a
3612 \DWATname{} attribute, append to S the letter 'N', the DWARF
3613 attribute code (\DWATtype{} or
3614 \DWATfriend), the context of
3615 the type (according to the method in Step 2), the letter 'E',
3616 and the name of the type. For \DWTAGfriend, if the referenced
3617 entry is a \DWTAGsubprogram, the context is omitted and the
3618 name to be used is the ABI-specific name of the subprogram
3619 (for example, the mangled linker name).
3622 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3623 \DWTAGreferencetype,
3624 \DWTAGrvaluereferencetype,
3625 \DWTAGptrtomembertype, or
3626 \DWTAGfriend, but has
3627 a \DWATtype{} attribute, or if the referenced type (via
3629 \DWATfriend{} attribute) does not have a
3630 \DWATname{} attribute, the attribute is processed according to
3631 the method in Step 4 for an attribute that refers to another
3635 \item Visit each child C of the debugging information
3636 entry as follows: If C is a nested type entry or a member
3637 function entry, and has
3638 a \DWATname{} attribute, append to
3639 \addtoindexx{name attribute}
3640 S the letter 'S', the tag of C, and its name; otherwise,
3641 process C recursively by performing Steps 3 through 7,
3642 appending the result to S. Following the last child (or if
3643 there are no children), append a zero byte.
3648 For the purposes of this algorithm, if a debugging information
3650 \DWATspecification{}
3651 attribute that refers to
3652 another entry D (which has a
3655 then S inherits the attributes and children of D, and S is
3656 processed as if those attributes and children were present in
3657 the entry S. Exception: if a particular attribute is found in
3658 both S and D, the attribute in S is used and the corresponding
3659 one in D is ignored.
3662 DWARF tag and attribute codes are appended to the sequence
3663 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3664 using the values defined earlier in this chapter.
3666 \textit{A grammar describing this computation may be found in
3667 Appendix \refersec{app:typesignaturecomputationgrammar}.
3670 \textit{An attribute that refers to another type entry should
3671 be recursively processed or replaced with the name of the
3672 referent (in Step 4, 5 or 6). If neither treatment applies to
3673 an attribute that references another type entry, the entry
3674 that contains that attribute should not be considered for a
3675 separate \addtoindex{type unit}.}
3677 \textit{If a debugging information entry contains an attribute from
3678 the list above that would require an unsupported form, that
3679 entry should not be considered for a separate
3680 \addtoindex{type unit}.}
3682 \textit{A type should be considered for a separate
3683 \addtoindex{type unit} only
3684 if all of the type entries that it contains or refers to in
3685 Steps 6 and 7 can themselves each be considered for a separate
3686 \addtoindex{type unit}.}
3689 Where the DWARF producer may reasonably choose two or more
3690 different forms for a given attribute, it should choose
3691 the simplest possible form in computing the signature. (For
3692 example, a constant value should be preferred to a location
3693 expression when possible.)
3695 Once the string S has been formed from the DWARF encoding,
3696 an \MDfive{} hash is computed for the string and the
3697 least significant 64 bits are taken as the type signature.
3699 \textit{The string S is intended to be a flattened representation of
3700 the type that uniquely identifies that type (that is, a different
3701 type is highly unlikely to produce the same string).}
3704 \textit{A debugging information entry should not be placed in a
3705 separate \addtoindex{type unit}
3706 if any of the following apply:}
3710 \item \textit{The entry has an attribute whose value is a location
3711 expression, and the location expression contains a reference to
3712 another debugging information entry (for example, a \DWOPcallref{}
3713 operator), as it is unlikely that the entry will remain
3714 identical across compilation units.}
3716 \item \textit{The entry has an attribute whose value refers
3717 to a code location or a \addtoindex{location list}.}
3719 \item \textit{The entry has an attribute whose value refers
3720 to another debugging information entry that does not represent
3726 \textit{Certain attributes are not included in the type signature:}
3729 \item \textit{The \DWATdeclaration{} attribute is not included because it
3730 indicates that the debugging information entry represents an
3731 incomplete declaration, and incomplete declarations should
3733 \addtoindexx{type unit}
3734 separate type units.}
3736 \item \textit{The \DWATdescription{} attribute is not included because
3737 it does not provide any information unique to the defining
3738 declaration of the type.}
3740 \item \textit{The \DWATdeclfile,
3742 \DWATdeclcolumn{} attributes are not included because they
3743 may vary from one source file to the next, and would prevent
3744 two otherwise identical type declarations from producing the
3745 same \MDfive{} hash.}
3747 \item \textit{The \DWATobjectpointer{} attribute is not included
3748 because the information it provides is not necessary for the
3749 computation of a unique type signature.}
3753 \textit{Nested types and some types referred to by a debugging
3754 information entry are encoded by name rather than by recursively
3755 encoding the type to allow for cases where a complete definition
3756 of the type might not be available in all compilation units.}
3759 \textit{If a type definition contains the definition of a member function,
3760 it cannot be moved as is into a type unit, because the member function
3761 contains attributes that are unique to that compilation unit.
3762 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3763 moving the member function declaration into a separate declaration tree,
3764 and replacing the function definition in the type with a non-defining
3765 declaration of the function (as if the function had been defined out of
3768 An example that illustrates the computation of an \MDfive{} hash may be found in
3769 Appendix \refersec{app:usingtypeunits}.
3771 \section{Name Table Hash Function}
3772 \label{datarep:nametablehashfunction}
3773 The hash function used for hashing name strings in the accelerated
3774 access name index table (see Section \refersec{chap:acceleratedaccess})
3775 is defined in \addtoindex{C} as shown in
3776 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnote{
3777 This hash function is sometimes informally known as the
3778 "\addtoindex{TJB hash function}" or the "\addtoindex{Berstein hash function}"
3780 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
3781 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
3783 \begin{figure}[here]
3786 unsigned long \* must be a 32-bit integer type *\
3787 hash(unsigned char *str)
3789 unsigned long hash = 5381;
3793 hash = hash * 33 + c;
3799 \caption{Name Table Hash Function Definition}
3800 \label{fig:nametablehashfunctiondefinition}