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.
8 \section{Vendor Extensibility}
9 \label{datarep:vendorextensibility}
10 \addtoindexx{vendor extensibility}
11 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
14 \addtoindexx{extensibility|see{vendor extensibility}}
15 reserve a portion of the DWARF name space and ranges of
16 enumeration values for use for vendor specific extensions,
17 special labels are reserved for tag names, attribute names,
18 base type encodings, location operations, language names,
19 calling conventions and call frame instructions.
21 The labels denoting the beginning and end of the reserved
22 \hypertarget{chap:DWXXXlohiuser}{}
23 value range for vendor specific extensions consist of the
25 (\DWATlouserMARK{}\DWAThiuserMARK{} DW\_AT,
26 \DWATElouserMARK{}\DWATEhiuserMARK{} DW\_ATE,
27 \DWCClouserMARK{}\DWCChiuserMARK{} DW\_CC,
28 \DWCFAlouserMARK{}\DWCFAhiuserMARK{} DW\_CFA
29 \DWENDlouserMARK{}\DWENDhiuserMARK{} DW\_END,
30 \DWLANGlouserMARK{}\DWLANGhiuserMARK{} DW\_LANG,
31 \DWLNElouserMARK{}\DWLNEhiuserMARK{} DW\_LNE,
32 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
33 \DWOPlouserMARK{}\DWOPhiuserMARK{} DW\_OP or
34 \DWTAGlouserMARK{}\DWTAGhiuserMARK{} DW\_TAG,
35 respectively) followed by
36 \_lo\_user or \_hi\_user.
37 Values in the range between \textit{prefix}\_lo\_user
38 and \textit{prefix}\_hi\_user inclusive,
39 are reserved for vendor specific extensions. Vendors may
40 use values in this range without conflicting with current or
41 future system\dash defined values. All other values are reserved
42 for use by the system.
44 \textit{For example, for DIE tags, the special
45 labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
47 \textit{There may also be codes for vendor specific extensions
48 between the number of standard line number opcodes and
49 the first special line number opcode. However, since the
50 number of standard opcodes varies with the DWARF version,
51 the range for extensions is also version dependent. Thus,
52 \DWLNSlouserTARG{} and
53 \DWLNShiuserTARG{} symbols are not defined.
56 Vendor defined tags, attributes, base type encodings, location
57 atoms, language names, line number actions, calling conventions
58 and call frame instructions, conventionally use the form
59 \text{prefix\_vendor\_id\_name}, where
60 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
61 character sequence chosen so as to avoid conflicts with
64 To ensure that extensions added by one vendor may be safely
65 ignored by consumers that do not understand those extensions,
66 the following rules must be followed:
67 \begin{enumerate}[1. ]
69 \item New attributes are added in such a way that a
70 debugger may recognize the format of a new attribute value
71 without knowing the content of that attribute value.
73 \item The semantics of any new attributes do not alter
74 the semantics of previously existing attributes.
76 \item The semantics of any new tags do not conflict with
77 the semantics of previously existing tags.
79 \item New forms of attribute value are not added.
84 \section{Reserved Values}
85 \label{datarep:reservedvalues}
86 \subsection{Error Values}
87 \label{datarep:errorvalues}
88 \addtoindexx{reserved values!error}
91 \addtoindexx{error value}
92 a convenience for consumers of DWARF information, the value
93 0 is reserved in the encodings for attribute names, attribute
94 forms, base type encodings, location operations, languages,
95 line number program opcodes, macro information entries and tag
96 names to represent an error condition or unknown value. DWARF
97 does not specify names for these reserved values, because they
98 do not represent valid encodings for the given type and do
99 not appear in DWARF debugging information.
102 \subsection{Initial Length Values}
103 \label{datarep:initiallengthvalues}
104 \addtoindexx{reserved values!initial length}
106 An \livetarg{datarep:initiallengthvalues}{initial length} field
107 \addtoindexx{initial length field|see{initial length}}
108 is one of the fields that occur at the beginning
109 of those DWARF sections that have a header
113 \dotdebugnames{}) or the length field
114 that occurs at the beginning of the CIE and FDE structures
115 in the \dotdebugframe{} section.
118 In an \addtoindex{initial length} field, the values \wfffffffzero through
119 \wffffffff are reserved by DWARF to indicate some form of
120 extension relative to \DWARFVersionII; such values must not
121 be interpreted as a length field. The use of one such value,
122 \xffffffff, is defined below
123 (see Section \refersec{datarep:32bitand64bitdwarfformats});
125 the other values is reserved for possible future extensions.
129 \section{Relocatable, Split, Executable, Shared and Package Object Files}
130 \label{datarep:executableobjectsandsharedobjects}
132 \subsection{Relocatable Object Files}
133 \label{datarep:relocatableobjectfiles}
134 A DWARF producer (for example, a compiler) typically generates its
135 debugging information as part of a relocatable object file.
136 Relocatable object files are then combined by a linker to form an
137 executable file. During the linking process, the linker resolves
138 (binds) symbolic references between the various object files, and
139 relocates the contents of each object file into a combined virtual
142 The DWARF debugging information is placed in several sections (see
143 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
144 requires an object file format capable of
145 representing these separate sections. There are symbolic references
146 between these sections, and also between the debugging information
147 sections and the other sections that contain the text and data of the
148 program itself. Many of these references require relocation, and the
149 producer must emit the relocation information appropriate to the
150 object file format and the target processor architecture. These
151 references include the following:
154 \item The compilation unit header (see Section
155 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
156 section contains a reference to the \dotdebugabbrev{} table. This
157 reference requires a relocation so that after linking, it refers to
158 that contribution to the combined \dotdebugabbrev{} section in the
161 \item Debugging information entries may have attributes with the form
162 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
163 These attributes represent locations
164 within the virtual address space of the program, and require
167 \item A DWARF expression may contain a \DWOPaddr{} (see Section
168 \refersec{chap:literalencodings}) which contains a location within
169 the virtual address space of the program, and require relocation.
172 \item Debugging information entries may have attributes with the form
173 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
174 These attributes refer to
175 debugging information in other debugging information sections within
176 the object file, and must be relocated during the linking process.
178 However, if a \DWATrangesbase{} attribute is present, the offset in
179 a \DWATranges{} attribute (which uses form \DWFORMsecoffset) is
180 relative to the given base offset--no relocation is involved.
182 \item Debugging information entries may have attributes with the form
183 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
184 These attributes refer to
185 debugging information entries that may be outside the current
186 compilation unit. These values require both symbolic binding and
189 \item Debugging information entries may have attributes with the form
190 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
191 These attributes refer to strings in
192 the \dotdebugstr{} section. These values require relocation.
194 \item Entries in the \dotdebugaddr, \dotdebugloc{}, \dotdebugranges{}
195 and \dotdebugaranges{}
196 sections contain references to locations within the virtual address
197 space of the program, and require relocation.
199 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
200 opcode is a reference to a location within the virtual address space
201 of the program, and requires relocation.
203 \item The \dotdebugstroffsets{} section contains a list of string offsets,
204 each of which is an offset of a string in the \dotdebugstr{} section. Each
205 of these offsets requires relocation. Depending on the implementation,
206 these relocations may be implicit (that is, the producer may not need to
207 emit any explicit relocation information for these offsets).
209 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges{} header and
210 the list of compilation units following the \dotdebugnames{} header contain
211 references to the \dotdebuginfo{} section. These references require relocation
212 so that after linking they refer to the correct contribution in the combined
213 \dotdebuginfo{} section in the executable file.
215 \item Frame descriptor entries in the \dotdebugframe{} section
216 (see Section \refersec{chap:structureofcallframeinformation}) contain an
217 \HFNinitiallocation{} field value within the virtual address
218 space of the program and require relocation.
223 \textit{Note that operands of classes \CLASSblock, \CLASSconstant{} and
224 \CLASSflag{} do not require relocation. Attribute operands that use
225 form \DWFORMstring{} also do not require relocation. Further,
226 attribute operands that use form
227 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
228 \DWFORMrefudata{} do not need relocation.}
230 \subsection{Split DWARF Object Files}
231 \label{datarep:splitdwarfobjectfiles}
232 \addtoindexx{split DWARF object file}
233 A DWARF producer may partition the debugging
234 information such that the majority of the debugging
235 information can remain in individual object files without
236 being processed by the linker.
239 \subsubsection{First Partition (with Skeleton Unit)}
240 The first partition contains
241 debugging information that must still be processed by the linker,
242 and includes the following:
245 The line number tables, range tables, frame tables, and
246 accelerated access tables, in the usual sections:
247 \dotdebugline, \dotdebuglinestr, \dotdebugranges, \dotdebugframe,
248 \dotdebugnames{} and \dotdebugaranges,
252 An address table, in the \dotdebugaddr{} section. This table
253 contains all addresses and constants that require
254 link-time relocation, and items in the table can be
255 referenced indirectly from the debugging information via
256 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
257 \DWOPconstx{} operators.
259 A skeleton compilation unit, as described in Section
260 \refersec{chap:skeletoncompilationunitentries},
261 in the \dotdebuginfo{} section.
263 An abbreviations table for the skeleton compilation unit,
264 in the \dotdebugabbrev{} section.
266 A string table, in the \dotdebugstr{} section. The string
267 table is necessary only if the skeleton compilation unit
268 uses either indirect string form, \DWFORMstrp{} or
271 A string offsets table, in the \dotdebugstroffsets{}
272 section. The string offsets table is necessary only if
273 the skeleton compilation unit uses the \DWFORMstrx{} form.
275 The attributes contained in the skeleton compilation
276 unit can be used by a DWARF consumer to find the split or
277 hybrid DWARF object file that contains the second partition.
279 \subsubsection{Second Partition (Unlinked or In \texttt{.dwo} File)}
280 The second partition contains the debugging information that
281 does not need to be processed by the linker. These sections
282 may be left in the object files and ignored by the linker
283 (that is, not combined and copied to the executable object file), or
284 they may be placed by the producer in a separate DWARF object
285 file. This partition includes the following:
288 The full compilation unit, in the \dotdebuginfodwo{} section.
291 The full compilation unit entry includes a \DWATdwoid{}
292 attribute whose form and value is the same as that of the \DWATdwoid{}
293 attribute of the associated skeleton unit.
296 Attributes contained in the full compilation unit
297 may refer to machine addresses indirectly using the \DWFORMaddrx{}
298 form, which accesses the table of addresses specified by the
299 \DWATaddrbase{} attribute in the associated skeleton unit.
300 Location expressions may similarly do so using the \DWOPaddrx{} and
301 \DWOPconstx{} operations.
303 \DWATranges{} attributes contained in the full compilation unit
304 may refer to range table entries with a \DWFORMsecoffset{} offset
305 relative to the base offset specified by the \DWATrangesbase{}
306 attribute in the associated skeleton unit.
308 \item Separate type units, in the \dotdebuginfodwo{} section.
311 Abbreviations table(s) for the compilation unit and type
312 units, in the \dotdebugabbrevdwo{} section.
314 \item Location lists, in the \dotdebuglocdwo{} section.
317 A \addtoindex{specialized line number table} (for the type units),
318 in the \dotdebuglinedwo{} section. This table
319 contains only the directory and filename lists needed to
320 interpret \DWATdeclfile{} attributes in the debugging
323 \item Macro information, in the \dotdebugmacrodwo{} section.
325 \item A string table, in the \dotdebugstrdwo{} section.
327 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
331 Except where noted otherwise, all references in this document
332 to a debugging information section (for example, \dotdebuginfo),
333 applies also to the corresponding split DWARF section (for example,
337 Split DWARF object files do not get linked with any other files,
338 therefore references between sections must not make use of
339 normal object file relocation information. As a result, symbolic
340 references within or between sections are not possible.
342 \subsection{Executable Objects}
343 \label{chap:executableobjects}
344 The relocated addresses in the debugging information for an
345 executable object are virtual addresses.
348 \subsection{Shared Object Files}
349 \label{datarep:sharedobjectfiles}
351 addresses in the debugging information for a shared object file
352 are offsets relative to the start of the lowest region of
353 memory loaded from that shared object file.
356 \textit{This requirement makes the debugging information for
357 shared object files position independent. Virtual addresses in a
358 shared object file may be calculated by adding the offset to the
359 base address at which the object file was attached. This offset
360 is available in the run\dash time linker\textquoteright s data structures.}
362 \subsection{DWARF Package Files}
363 \label{datarep:dwarfpackagefiles}
364 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
365 link, and debug an application quickly with less link-time overhead,
366 but a more convenient format is needed for saving the debug
367 information for later debugging of a deployed application. A
368 DWARF package file can be used to collect the debugging
369 information from the object (or separate DWARF object) files
370 produced during the compilation of an application.}
372 \textit{The package file is typically placed in the same directory as the
373 application, and is given the same name with a \doublequote{\texttt{.dwp}}
374 extension.\addtoindexx{\texttt{.dwp} file extension}}
376 A DWARF package file is itself an object file, using the
377 \addtoindexx{package files}
378 \addtoindexx{DWARF package files}
379 same object file format (including \byteorder) as the
380 corresponding application binary. It consists only of a file
381 header, a section table, a number of DWARF debug information
382 sections, and two index sections.
385 Each DWARF package file contains no more than one of each of the
386 following sections, copied from a set of object or DWARF object
387 files, and combined, section by section:
393 \dotdebugstroffsetsdwo
398 The string table section in \dotdebugstrdwo{} contains all the
399 strings referenced from DWARF attributes using the form
400 \DWFORMstrx. Any attribute in a compilation unit or a type
401 unit using this form refers to an entry in that unit's
402 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
403 provides the offset of a string in the \dotdebugstrdwo{}
406 The DWARF package file also contains two index sections that
407 provide a fast way to locate debug information by compilation
408 unit ID (\DWATdwoid) for compilation units, or by type
409 signature for type units:
415 \subsubsection{The Compilation Unit (CU) Index Section}
416 The \dotdebugcuindex{} section is a hashed lookup table that maps a
417 compilation unit ID to a set of contributions in the
418 various debug information sections. Each contribution is stored
419 as an offset within its corresponding section and a size.
421 Each \compunitset{} may contain contributions from the
424 \dotdebuginfodwo{} (required)
425 \dotdebugabbrevdwo{} (required)
428 \dotdebugstroffsetsdwo
432 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
433 information from \DWARFVersionIV{} or earlier formats.}
435 \subsubsection{The Type Unit (TU) Index Section}
436 The \dotdebugtuindex{} section is a hashed lookup table that maps a
437 type signature to a set of offsets into the various debug
438 information sections. Each contribution is stored as an offset
439 within its corresponding section and a size.
441 Each \typeunitset{} may contain contributions from the following
444 \dotdebuginfodwo{} (required)
445 \dotdebugabbrevdwo{} (required)
447 \dotdebugstroffsetsdwo
450 \subsubsection{Format of the CU and TU Index Sections}
451 Both index sections have the same format, and serve to map an
452 8-byte signature to a set of contributions to the debug sections.
453 Each index section begins with a header, followed by a hash table of
454 signatures, a parallel table of indexes, a table of offsets, and
455 a table of sizes. The index sections are aligned at 8-byte
456 boundaries in the DWARF package file.
459 The index section header contains the following fields:
460 \begin{enumerate}[1. ]
461 \item \texttt{version} (\HFTuhalf) \\
463 \addtoindexx{version number!CU index information}
464 \addtoindexx{version number!TU index information}
465 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
466 This number is specific to the CU and TU index information
467 and is independent of the DWARF version number.
469 The version number is \versiondotdebugcuindex.
471 \item \textit{padding} (\HFTuhalf) \\
472 Reserved to DWARF (must be zero).
474 \item \texttt{column\_count} (\HFTuword) \\
475 The number of columns in the table of section counts that follows.
476 For brevity, the contents of this field is referred to as $C$ below.
478 \item \texttt{unit\_count} (\HFTuword) \\
479 The number of compilation units or type units in the index.
480 For brevity, the contents of this field is referred to as $U$ below.
482 \item \texttt{slot\_count} (\HFTuword) \\
483 The number of slots in the hash table.
484 For brevity, the contents of this field is referred to as $S$ below.
488 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
490 The size of the hash table, $S$, must be $2^k$ such that:
491 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
493 The hash table begins at offset 16 in the section, and consists
494 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
496 % (using the \byteorder{} of the application binary).
498 The parallel table of indices begins immediately after the hash table
499 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
500 consists of an array of $S$ 4-byte slots,
501 % (using the byte order of the application binary),
502 corresponding 1-1 with slots in the hash
503 table. Each entry in the parallel table contains a row index into
504 the tables of offsets and sizes.
506 Unused slots in the hash table have 0 in both the hash table
507 entry and the parallel table entry. While 0 is a valid hash
508 value, the row index in a used slot will always be non-zero.
510 Given an 8-byte compilation unit ID or type signature $X$,
511 an entry in the hash table is located as follows:
512 \begin{enumerate}[1. ]
513 \item Define $REP(X)$ to be the value of $X$ interpreted as an
514 unsigned 64-bit integer in the target byte order.
515 \item Calculate a primary hash $H = REP(X)\ \&\ MASK(k)$, where
516 $MASK(k)$ is a mask with the low-order $k$ bits all set to 1.
517 \item Calculate a secondary hash $H' = (((REP(X)>>32)\ \&\ MASK(k))\ |\ 1)$.
518 \item If the hash table entry at index $H$ matches the signature, use
519 that entry. If the hash table entry at index $H$ is unused (all
520 zeroes), terminate the search: the signature is not present
522 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 4.
525 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
526 guaranteed to stop at an unused slot or find the match.
529 The table of offsets begins immediately following the parallel
530 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
531 The table is a two-dimensional array of 4-byte words,
532 %(using the byte order of the application binary),
533 with $C$ columns and $U + 1$
534 rows, in row-major order. Each row in the array is indexed
535 starting from 0. The first row provides a key to the columns:
536 each column in this row provides a section identifier for a debug
537 section, and the offsets in the same column of subsequent rows
538 refer to that section. The section identifiers are shown in
539 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
543 \setlength{\extrarowheight}{0.1cm}
544 \begin{longtable}{l|c|l}
545 \caption{DWARF package file section identifier \mbox{encodings}}
546 \label{tab:dwarfpackagefilesectionidentifierencodings}
547 \addtoindexx{DWARF package files!section identifier encodings} \\
548 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
550 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
552 \hline \emph{Continued on next page}
556 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
557 \textit{Reserved} & 2 & \\
558 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
559 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
560 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
561 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
562 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
563 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
567 The offsets provided by the CU and TU index sections are the
568 base offsets for the contributions made by each CU or TU to the
569 corresponding section in the package file. Each CU and TU header
570 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
571 table for that CU or TU within the contribution to the
572 \dotdebugabbrevdwo{} section for that CU or TU, and are
573 interpreted as relative to the base offset given in the index
574 section. Likewise, offsets into \dotdebuglinedwo{} from
575 \DWATstmtlist{} attributes are interpreted as relative to
576 the base offset for \dotdebuglinedwo{}, and offsets into other debug
577 sections obtained from DWARF attributes are also
578 interpreted as relative to the corresponding base offset.
580 The table of sizes begins immediately following the table of
581 offsets, and provides the sizes of the contributions made by each
582 CU or TU to the corresponding section in the package file. Like
583 the table of offsets, it is a two-dimensional array of 4-byte
584 words, with $C$ columns and $U$ rows, in row-major order. Each row in
585 the array is indexed starting from 1 (row 0 of the table of
586 offsets also serves as the key for the table of sizes).
588 \subsection{DWARF Supplementary Object Files}
589 \label{datarep:dwarfsupplemetaryobjectfiles}
590 In order to minimize the size of debugging information, it is possible
591 to move duplicate debug information entries, strings and macro entries from
592 several executables or shared object files into a separate
593 \addtoindexi{\textit{supplementary object file}}{supplementary object file} by some
594 post-linking utility; the moved entries and strings can be then referenced
595 from the debugging information of each of those executable or shared object files.
598 A DWARF \addtoindex{supplementary object file} is itself an object file,
599 using the same object
600 file format, \byteorder{}, and size as the corresponding application executables
601 or shared libraries. It consists only of a file header, section table, and
602 a number of DWARF debug information sections. Both the
603 \addtoindex{supplementary object file}
604 and all the executable or shared object files that reference entries or strings in that
605 file must contain a \dotdebugsup{} section that establishes the relationship.
607 The \dotdebugsup{} section contains:
608 \begin{enumerate}[1. ]
609 \item \texttt{version} (\HFTuhalf) \\
610 \addttindexx{version}
611 A 2-byte unsigned integer representing the version of the DWARF
612 information for the compilation unit (see Appendix G). The
613 value in this field is \versiondotdebugsup.
615 \item \texttt{is\_supplementary} (\HFTubyte) \\
616 \addttindexx{is\_supplementary}
617 A 1-byte unsigned integer, which contains the value 1 if it is
618 in the \addtoindex{supplementary object file} that other executable or
619 shared object files refer to, or 0 if it is an executable or shared object
620 referring to a \addtoindex{supplementary object file}.
623 \item \texttt{sup\_filename} (null terminated filename string) \\
624 \addttindexx{sup\_filename}
625 If \addttindex{is\_supplementary} is 0, this contains either an absolute
626 filename for the \addtoindex{supplementary object file}, or a filename
627 relative to the object file containing the \dotdebugsup{} section.
628 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
629 is not needed and must be an empty string (a single null byte).
632 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
633 \addttindexx{sup\_checksum\_len}
634 Length of the following \addttindex{sup\_checksum} field;
635 his value can be 0 if no checksum is provided.
638 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
639 \addttindexx{sup\_checksum}
640 Some checksum or cryptographic hash function of the \dotdebuginfo{},
641 \dotdebugstr{} and \dotdebugmacro{} sections of the
642 \addtoindex{supplementary object file}, or some unique identifier
643 which the implementation can choose to verify that the supplementary
644 section object file matches what the debug information in the executable
645 or shared object file expects.
648 Debug information entries that refer to an executable's or shared
649 object's addresses must \emph{not} be moved to supplementary files (the
650 addesses will likely not be the same). Similarly,
651 entries referenced from within location expressions or using loclistptr
652 form attributes must not be moved to a \addtoindex{supplementary object file}.
654 Executable or shared object file compilation units can use
655 \DWTAGimportedunit{} with \DWFORMrefsup{} form \DWATimport{} attribute
656 to import entries from the \addtoindex{supplementary object file}, other \DWFORMrefsup{}
657 attributes to refer to them and \DWFORMstrpsup{} form attributes to
658 refer to strings that are used by debug information of multiple
659 executables or shared object files. Within the \addtoindex{supplementary object file}'s
660 debugging sections, form \DWFORMrefsup{} or \DWFORMstrpsup{} are
661 not used, and all reference forms referring to some other sections
662 refer to the local sections in the \addtoindex{supplementary object file}.
664 In macro information, \DWMACROdefinesup{} or
665 \DWMACROundefsup{} opcodes can refer to strings in the
666 \dotdebugstr{} section of the \addtoindex{supplementary object file},
667 or \DWMACROimportsup{}
668 can refer to \dotdebugmacro{} section entries. Within the
669 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
670 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
671 opcodes refer to the local \dotdebugstr{} section in that
672 supplementary file, not the one in
673 the executable or shared object file.
677 \section{32-Bit and 64-Bit DWARF Formats}
678 \label{datarep:32bitand64bitdwarfformats}
679 \hypertarget{datarep:xxbitdwffmt}{}
680 \addtoindexx{32-bit DWARF format}
681 \addtoindexx{64-bit DWARF format}
682 There are two closely related file formats. In the 32-bit DWARF
683 format, all values that represent lengths of DWARF sections
684 and offsets relative to the beginning of DWARF sections are
685 represented using four bytes. In the 64-bit DWARF format, all
686 values that represent lengths of DWARF sections and offsets
687 relative to the beginning of DWARF sections are represented
688 using eight bytes. A special convention applies to the initial
689 length field of certain DWARF sections, as well as the CIE and
690 FDE structures, so that the 32-bit and 64-bit DWARF formats
691 can coexist and be distinguished within a single linked object.
693 The differences between the 32- and 64-bit DWARF formats are
694 detailed in the following:
695 \begin{enumerate}[1. ]
697 \item In the 32-bit DWARF format, an
698 \addtoindex{initial length} field (see
699 \addtoindexx{initial length!encoding}
700 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
701 is an unsigned 4-byte integer (which
702 must be less than \xfffffffzero); in the 64-bit DWARF format,
703 an \addtoindex{initial length} field is 12 bytes in size,
706 \item The first four bytes have the value \xffffffff.
708 \item The following eight bytes contain the actual length
709 represented as an unsigned 8-byte integer.
712 \textit{This representation allows a DWARF consumer to dynamically
713 detect that a DWARF section contribution is using the 64-bit
714 format and to adapt its processing accordingly.}
717 \item Section offset and section length
718 \hypertarget{datarep:sectionoffsetlength}{}
719 \addtoindexx{section length!use in headers}
721 \addtoindexx{section offset!use in headers}
722 in the headers of DWARF sections (other than initial length
723 \addtoindexx{initial length}
724 fields) are listed following. In the 32-bit DWARF format these
725 are 4-byte unsigned integer values; in the 64-bit DWARF format,
726 they are 8-byte unsigned integer values.
730 Section &Name & Role \\ \hline
731 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
732 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
733 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
734 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
735 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
736 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
742 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
743 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
744 union must be accessed to distinguish whether a CIE or FDE is
745 present, consequently, these two fields must exactly overlay
746 each other (both offset and size).
748 \item Within the body of the \dotdebuginfo{}
749 section, certain forms of attribute value depend on the choice
750 of DWARF format as follows. For the 32-bit DWARF format,
751 the value is a 4-byte unsigned integer; for the 64-bit DWARF
752 format, the value is an 8-byte unsigned integer.
754 \begin{tabular}{lp{6cm}}
755 Form & Role \\ \hline
756 \DWFORMlinestrp & offset in \dotdebuglinestr \\
757 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
758 \DWFORMrefsup & offset in \dotdebuginfo{} section of a \mbox{supplementary} object file \\
759 \addtoindexx{supplementary object file}
760 \DWFORMsecoffset & offset in a section other than \\
761 & \dotdebuginfo{} or \dotdebugstr{} \\
762 \DWFORMstrp & offset in \dotdebugstr{} \\
763 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
764 \DWOPcallref & offset in \dotdebuginfo{} \\
769 \item Within the body of the \dotdebugline{} section, certain forms of content
770 description depend on the choice of DWARF format as follows: for the
771 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
772 64-bit DWARF format, the value is a 8-byte unsigned integer.
774 \begin{tabular}{lp{6cm}}
775 Form & Role \\ \hline
776 \DWFORMlinestrp & offset in \dotdebuglinestr
780 \item Within the body of the \dotdebugnames{}
781 sections, the representation of each entry in the array of
782 compilation units (CUs) and the array of local type units
783 (TUs), which represents an offset in the
785 section, depends on the DWARF format as follows: in the
786 32-bit DWARF format, each entry is a 4-byte unsigned integer;
787 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
790 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
791 sections, the size of entries in the body depend on the DWARF
792 format as follows: in the 32-bit DWARF format, entries are 4-byte
793 unsigned integer values; in the 64-bit DWARF format, they are
794 8-byte unsigned integers.
796 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
797 sections, the contents of the address size fields depends on the
798 DWARF format as follows: in the 32-bit DWARF format, these fields
799 contain 4; in the 64-bit DWARF format these fields contain 8.
803 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
804 intermixed within a single compilation unit.
806 \textit{Attribute values and section header fields that represent
807 addresses in the target program are not affected by these
810 A DWARF consumer that supports the 64-bit DWARF format must
811 support executables in which some compilation units use the
812 32-bit format and others use the 64-bit format provided that
813 the combination links correctly (that is, provided that there
814 are no link\dash time errors due to truncation or overflow). (An
815 implementation is not required to guarantee detection and
816 reporting of all such errors.)
818 \textit{It is expected that DWARF producing compilers will \emph{not} use
819 the 64-bit format \emph{by default}. In most cases, the division of
820 even very large applications into a number of executable and
821 shared object files will suffice to assure that the DWARF sections
822 within each individual linked object are less than 4 GBytes
823 in size. However, for those cases where needed, the 64-bit
824 format allows the unusual case to be handled as well. Even
825 in this case, it is expected that only application supplied
826 objects will need to be compiled using the 64-bit format;
827 separate 32-bit format versions of system supplied shared
828 executable libraries can still be used.}
832 \section{Format of Debugging Information}
833 \label{datarep:formatofdebugginginformation}
835 For each compilation unit compiled with a DWARF producer,
836 a contribution is made to the \dotdebuginfo{} section of
837 the object file. Each such contribution consists of a
838 compilation unit header
839 (see Section \refersec{datarep:compilationunitheader})
841 single \DWTAGcompileunit{} or
842 \DWTAGpartialunit{} debugging
843 information entry, together with its children.
845 For each type defined in a compilation unit, a separate
846 contribution may also be made to the
848 section of the object file. Each
849 such contribution consists of a
850 \addtoindex{type unit} header
851 (see Section \refersec{datarep:typeunitheader})
852 followed by a \DWTAGtypeunit{} entry, together with
855 Each debugging information entry begins with a code that
856 represents an entry in a separate
857 \addtoindex{abbreviations table}. This
858 code is followed directly by a series of attribute values.
860 The appropriate entry in the
861 \addtoindex{abbreviations table} guides the
862 interpretation of the information contained directly in the
863 \dotdebuginfo{} section.
866 Multiple debugging information entries may share the same
867 abbreviation table entry. Each compilation unit is associated
868 with a particular abbreviation table, but multiple compilation
869 units may share the same table.
871 \subsection{Unit Headers}
872 \label{datarep:unitheaders}
873 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
874 compilation unit that follows. The encodings for the unit type
875 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
879 \setlength{\extrarowheight}{0.1cm}
880 \begin{longtable}{l|c}
881 \caption{Unit header unit type encodings}
882 \label{tab:unitheaderunitkindencodings}
883 \addtoindexx{unit header unit type encodings} \\
884 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
886 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
888 \hline \emph{Continued on next page}
890 \hline \ddag\ \textit{New in DWARF Version 5}
892 \DWUTcompileTARG~\ddag &0x01 \\
893 \DWUTtypeTARG~\ddag &0x02 \\
894 \DWUTpartialTARG~\ddag &0x03 \\ \hline
899 \subsubsection{Compilation Unit Header}
900 \label{datarep:compilationunitheader}
901 \begin{enumerate}[1. ]
903 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
904 \addttindexx{unit\_length}
906 \addtoindexx{initial length}
907 unsigned integer representing the length
908 of the \dotdebuginfo{}
909 contribution for that compilation unit,
910 not including the length field itself. In the \thirtytwobitdwarfformat,
911 this is a 4-byte unsigned integer (which must be less
912 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
913 of the 4-byte value \wffffffff followed by an 8-byte unsigned
914 integer that gives the actual length
915 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
917 \item \texttt{version} (\HFTuhalf) \\
918 \addttindexx{version}
919 A 2-byte unsigned integer representing the version of the
920 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
921 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
922 The value in this field is \versiondotdebuginfo.
925 \item \texttt{unit\_type} (\HFTubyte) \\
926 \addttindexx{unit\_type}
927 A 1-byte unsigned integer identifying this unit as a compilation unit.
928 The value of this field is
929 \DWUTcompile{} for a full compilation unit or
930 \DWUTpartial{} for a partial compilation unit
931 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
933 \textit{This field is new in \DWARFVersionV.}
936 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
938 \addtoindexx{section offset!in .debug\_info header}
939 4-byte or 8-byte unsigned offset into the
941 section. This offset associates the compilation unit with a
942 particular set of debugging information entry abbreviations. In
943 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
944 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
945 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
947 \item \texttt{address\_size} (\HFTubyte) \\
948 \addttindexx{address\_size}
949 A 1-byte unsigned integer representing the size in bytes of
950 an address on the target architecture. If the system uses
951 \addtoindexx{address space!segmented}
952 segmented addressing, this value represents the size of the
953 offset portion of an address.
957 \subsubsection{Type Unit Header}
958 \label{datarep:typeunitheader}
960 The header for the series of debugging information entries
961 contributing to the description of a type that has been
962 placed in its own \addtoindex{type unit}, within the
963 \dotdebuginfo{} section,
964 consists of the following information:
965 \begin{enumerate}[1. ]
967 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
968 \addttindexx{unit\_length}
969 A 4-byte or 12-byte unsigned integer
970 \addtoindexx{initial length}
971 representing the length
972 of the \dotdebuginfo{} contribution for that type unit,
973 not including the length field itself. In the \thirtytwobitdwarfformat,
974 this is a 4-byte unsigned integer (which must be
975 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
976 consists of the 4-byte value \wffffffff followed by an
977 8-byte unsigned integer that gives the actual length
978 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
981 \item \texttt{version} (\HFTuhalf) \\
982 \addttindexx{version}
983 A 2-byte unsigned integer representing the version of the
984 DWARF information for the
985 type unit\addtoindexx{version number!type unit}
986 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
987 The value in this field is \versiondotdebuginfo.
989 \item \texttt{unit\_type} (\HFTubyte) \\
990 \addttindexx{unit\_type}
991 A 1-byte unsigned integer identifying this unit as a type unit.
992 The value of this field is \DWUTtype{} for a type unit
993 (see Section \refersec{chap:typeunitentries}).
995 \textit{This field is new in \DWARFVersionV.}
998 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1000 \addtoindexx{section offset!in .debug\_info header}
1001 4-byte or 8-byte unsigned offset into the
1003 section. This offset associates the type unit with a
1004 particular set of debugging information entry abbreviations. In
1005 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1006 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1007 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1010 \item \texttt{address\_size} (\HFTubyte) \\
1011 \addttindexx{address\_size}
1012 A 1-byte unsigned integer representing the size
1013 \addtoindexx{size of an address}
1015 an address on the target architecture. If the system uses
1016 \addtoindexx{address space!segmented}
1017 segmented addressing, this value represents the size of the
1018 offset portion of an address.
1020 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1021 \addttindexx{type\_signature}
1022 \addtoindexx{type signature}
1023 A unique 8-byte signature (see Section
1024 \refersec{datarep:typesignaturecomputation})
1025 of the type described in this type
1028 \textit{An attribute that refers (using
1029 \DWFORMrefsigeight{}) to
1030 the primary type contained in this
1031 \addtoindex{type unit} uses this value.}
1033 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1034 \addttindexx{type\_offset}
1035 A 4-byte or 8-byte unsigned offset
1036 \addtoindexx{section offset!in .debug\_info header}
1037 relative to the beginning
1038 of the \addtoindex{type unit} header.
1039 This offset refers to the debugging
1040 information entry that describes the type. Because the type
1041 may be nested inside a namespace or other structures, and may
1042 contain references to other types that have not been placed in
1043 separate type units, it is not necessarily either the first or
1044 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1045 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1046 this is an 8-byte unsigned length
1047 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1051 \subsection{Debugging Information Entry}
1052 \label{datarep:debugginginformationentry}
1054 Each debugging information entry begins with an
1055 unsigned LEB128\addtoindexx{LEB128!unsigned}
1056 number containing the abbreviation code for the entry. This
1057 code represents an entry within the abbreviations table
1058 associated with the compilation unit containing this entry. The
1059 abbreviation code is followed by a series of attribute values.
1061 On some architectures, there are alignment constraints on
1062 section boundaries. To make it easier to pad debugging
1063 information sections to satisfy such constraints, the
1064 abbreviation code 0 is reserved. Debugging information entries
1065 consisting of only the abbreviation code 0 are considered
1068 \subsection{Abbreviations Tables}
1069 \label{datarep:abbreviationstables}
1071 The abbreviations tables for all compilation units
1072 are contained in a separate object file section called
1074 As mentioned before, multiple compilation
1075 units may share the same abbreviations table.
1077 The abbreviations table for a single compilation unit consists
1078 of a series of abbreviation declarations. Each declaration
1079 specifies the tag and attributes for a particular form of
1080 debugging information entry. Each declaration begins with
1081 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1082 number representing the abbreviation
1083 code itself. It is this code that appears at the beginning
1084 of a debugging information entry in the
1086 section. As described above, the abbreviation
1087 code 0 is reserved for null debugging information entries. The
1088 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1089 number that encodes the entry\textquoteright s tag. The encodings for the
1090 tag names are given in
1091 Table \referfol{tab:tagencodings}.
1094 \setlength{\extrarowheight}{0.1cm}
1095 \begin{longtable}{l|c}
1096 \caption{Tag encodings} \label{tab:tagencodings} \\
1097 \hline \bfseries Tag name&\bfseries Value\\ \hline
1099 \bfseries Tag name&\bfseries Value \\ \hline
1101 \hline \emph{Continued on next page}
1103 \hline \ddag\ \textit{New in DWARF Version 5}
1105 \DWTAGarraytype{} &0x01 \\
1106 \DWTAGclasstype&0x02 \\
1107 \DWTAGentrypoint&0x03 \\
1108 \DWTAGenumerationtype&0x04 \\
1109 \DWTAGformalparameter&0x05 \\
1110 \DWTAGimporteddeclaration&0x08 \\
1112 \DWTAGlexicalblock&0x0b \\
1113 \DWTAGmember&0x0d \\
1114 \DWTAGpointertype&0x0f \\
1115 \DWTAGreferencetype&0x10 \\
1116 \DWTAGcompileunit&0x11 \\
1117 \DWTAGstringtype&0x12 \\
1118 \DWTAGstructuretype&0x13 \\
1119 \DWTAGsubroutinetype&0x15 \\
1120 \DWTAGtypedef&0x16 \\
1121 \DWTAGuniontype&0x17 \\
1122 \DWTAGunspecifiedparameters&0x18 \\
1123 \DWTAGvariant&0x19 \\
1124 \DWTAGcommonblock&0x1a \\
1125 \DWTAGcommoninclusion&0x1b \\
1126 \DWTAGinheritance&0x1c \\
1127 \DWTAGinlinedsubroutine&0x1d \\
1128 \DWTAGmodule&0x1e \\
1129 \DWTAGptrtomembertype&0x1f \\
1130 \DWTAGsettype&0x20 \\
1131 \DWTAGsubrangetype&0x21 \\
1132 \DWTAGwithstmt&0x22 \\
1133 \DWTAGaccessdeclaration&0x23 \\
1134 \DWTAGbasetype&0x24 \\
1135 \DWTAGcatchblock&0x25 \\
1136 \DWTAGconsttype&0x26 \\
1137 \DWTAGconstant&0x27 \\
1138 \DWTAGenumerator&0x28 \\
1139 \DWTAGfiletype&0x29 \\
1140 \DWTAGfriend&0x2a \\
1141 \DWTAGnamelist&0x2b \\
1142 \DWTAGnamelistitem&0x2c \\
1143 \DWTAGpackedtype&0x2d \\
1144 \DWTAGsubprogram&0x2e \\
1145 \DWTAGtemplatetypeparameter&0x2f \\
1146 \DWTAGtemplatevalueparameter&0x30 \\
1147 \DWTAGthrowntype&0x31 \\
1148 \DWTAGtryblock&0x32 \\
1149 \DWTAGvariantpart&0x33 \\
1150 \DWTAGvariable&0x34 \\
1151 \DWTAGvolatiletype&0x35 \\
1152 \DWTAGdwarfprocedure&0x36 \\
1153 \DWTAGrestricttype&0x37 \\
1154 \DWTAGinterfacetype&0x38 \\
1155 \DWTAGnamespace&0x39 \\
1156 \DWTAGimportedmodule&0x3a \\
1157 \DWTAGunspecifiedtype&0x3b \\
1158 \DWTAGpartialunit&0x3c \\
1159 \DWTAGimportedunit&0x3d \\
1160 \DWTAGcondition&\xiiif \\
1161 \DWTAGsharedtype&0x40 \\
1162 \DWTAGtypeunit & 0x41 \\
1163 \DWTAGrvaluereferencetype & 0x42 \\
1164 \DWTAGtemplatealias & 0x43 \\
1165 \DWTAGcoarraytype~\ddag & 0x44 \\
1166 \DWTAGgenericsubrange~\ddag & 0x45 \\
1167 \DWTAGdynamictype~\ddag & 0x46 \\
1168 \DWTAGatomictype~\ddag & 0x47 \\
1169 \DWTAGcallsite~\ddag & 0x48 \\
1170 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1171 \DWTAGlouser&0x4080 \\
1172 \DWTAGhiuser&\xffff \\
1177 Following the tag encoding is a 1-byte value that determines
1178 whether a debugging information entry using this abbreviation
1179 has child entries or not. If the value is
1181 the next physically succeeding entry of any debugging
1182 information entry using this abbreviation is the first
1183 child of that entry. If the 1-byte value following the
1184 abbreviation\textquoteright s tag encoding is
1185 \DWCHILDRENnoTARG, the next
1186 physically succeeding entry of any debugging information entry
1187 using this abbreviation is a sibling of that entry. (Either
1188 the first child or sibling entries may be null entries). The
1189 encodings for the child determination byte are given in
1190 Table \refersec{tab:childdeterminationencodings}
1192 Section \refersec{chap:relationshipofdebugginginformationentries},
1193 each chain of sibling entries is terminated by a null entry.)
1197 \setlength{\extrarowheight}{0.1cm}
1198 \begin{longtable}{l|c}
1199 \caption{Child determination encodings}
1200 \label{tab:childdeterminationencodings}
1201 \addtoindexx{Child determination encodings} \\
1202 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1204 \bfseries Children determination name&\bfseries Value \\ \hline
1206 \hline \emph{Continued on next page}
1210 \DWCHILDRENno&0x00 \\
1211 \DWCHILDRENyes&0x01 \\ \hline
1216 Finally, the child encoding is followed by a series of
1217 attribute specifications. Each attribute specification
1218 consists of two parts. The first part is an
1219 unsigned LEB128\addtoindexx{LEB128!unsigned}
1220 number representing the attribute\textquoteright s name.
1221 The second part is an
1222 unsigned LEB128\addtoindexx{LEB128!unsigned}
1223 number representing the attribute\textquoteright s form.
1224 The series of attribute specifications ends with an
1225 entry containing 0 for the name and 0 for the form.
1228 \DWFORMindirectTARG{} is a special case. For
1229 attributes with this form, the attribute value itself in the
1231 section begins with an unsigned
1232 LEB128 number that represents its form. This allows producers
1233 to choose forms for particular attributes
1234 \addtoindexx{abbreviations table!dynamic forms in}
1236 without having to add a new entry to the abbreviations table.
1238 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1239 For attributes with this form, the attribute specification contains
1240 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1241 number. The value of this number is used as the value of the
1242 attribute, and no value is stored in the \dotdebuginfo{} section.
1244 The abbreviations for a given compilation unit end with an
1245 entry consisting of a 0 byte for the abbreviation code.
1248 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1249 for a depiction of the organization of the
1250 debugging information.}
1253 \subsection{Attribute Encodings}
1254 \label{datarep:attributeencodings}
1256 The encodings for the attribute names are given in
1257 Table \referfol{tab:attributeencodings}.
1260 \setlength{\extrarowheight}{0.1cm}
1261 \begin{longtable}{l|c|l}
1262 \caption{Attribute encodings}
1263 \label{tab:attributeencodings}
1264 \addtoindexx{attribute encodings} \\
1265 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1267 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1269 \hline \emph{Continued on next page}
1271 \hline \ddag\ \textit{New in DWARF Version 5}
1273 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1274 \addtoindexx{sibling attribute} \\
1275 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1276 \livelink{chap:classloclistptr}{loclistptr}
1277 \addtoindexx{location attribute} \\
1278 \DWATname&0x03&\livelink{chap:classstring}{string}
1279 \addtoindexx{name attribute} \\
1280 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1281 \addtoindexx{ordering attribute} \\
1282 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1283 \livelink{chap:classexprloc}{exprloc},
1284 \livelink{chap:classreference}{reference}
1285 \addtoindexx{byte size attribute} \\
1286 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1287 DW\_AT\_bit\_offset \mbox{attribute} which was
1288 defined in \DWARFVersionIII{} and earlier.}
1289 &\livelink{chap:classconstant}{constant},
1290 \livelink{chap:classexprloc}{exprloc},
1291 \livelink{chap:classreference}{reference}
1292 \addtoindexx{bit offset attribute (Version 3)}
1293 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1294 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1295 \livelink{chap:classexprloc}{exprloc},
1296 \livelink{chap:classreference}{reference}
1297 \addtoindexx{bit size attribute} \\
1298 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1299 \addtoindexx{statement list attribute} \\
1300 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1301 \addtoindexx{low PC attribute} \\
1302 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1303 \livelink{chap:classconstant}{constant}
1304 \addtoindexx{high PC attribute} \\
1305 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1306 \addtoindexx{language attribute} \\
1307 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1308 \addtoindexx{discriminant attribute} \\
1309 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1310 \addtoindexx{discriminant value attribute} \\
1311 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1312 \addtoindexx{visibility attribute} \\
1313 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1314 \addtoindexx{import attribute} \\
1315 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1316 \livelink{chap:classloclistptr}{loclistptr}
1317 \addtoindexx{string length attribute} \\
1318 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1319 \addtoindexx{common reference attribute} \\
1320 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1321 \addtoindexx{compilation directory attribute} \\
1322 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1323 \livelink{chap:classconstant}{constant},
1324 \livelink{chap:classstring}{string}
1325 \addtoindexx{constant value attribute} \\
1326 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1327 \addtoindexx{containing type attribute} \\
1328 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1329 \livelink{chap:classreference}{reference},
1330 \livelink{chap:classflag}{flag}
1331 \addtoindexx{default value attribute} \\
1332 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1333 \addtoindexx{inline attribute} \\
1334 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1335 \addtoindexx{is optional attribute} \\
1336 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1337 \livelink{chap:classexprloc}{exprloc},
1338 \livelink{chap:classreference}{reference}
1339 \addtoindexx{lower bound attribute} \\
1340 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1341 \addtoindexx{producer attribute} \\
1342 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1343 \addtoindexx{prototyped attribute} \\
1344 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1345 \livelink{chap:classloclistptr}{loclistptr}
1346 \addtoindexx{return address attribute} \\
1347 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1348 \livelink{chap:classrangelistptr}{rangelistptr}
1349 \addtoindexx{start scope attribute} \\
1350 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1351 \livelink{chap:classexprloc}{exprloc},
1352 \livelink{chap:classreference}{reference}
1353 \addtoindexx{bit stride attribute} \\
1354 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1355 \livelink{chap:classexprloc}{exprloc},
1356 \livelink{chap:classreference}{reference}
1357 \addtoindexx{upper bound attribute} \\
1358 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1359 \addtoindexx{abstract origin attribute} \\
1360 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1361 \addtoindexx{accessibility attribute} \\
1362 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1363 \addtoindexx{address class attribute} \\
1364 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1365 \addtoindexx{artificial attribute} \\
1366 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1367 \addtoindexx{base types attribute} \\
1368 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1369 \addtoindexx{calling convention attribute} \\
1370 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1371 \livelink{chap:classexprloc}{exprloc},
1372 \livelink{chap:classreference}{reference}
1373 \addtoindexx{count attribute} \\
1374 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1375 \livelink{chap:classexprloc}{exprloc},
1376 \livelink{chap:classloclistptr}{loclistptr}
1377 \addtoindexx{data member attribute} \\
1378 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1379 \addtoindexx{declaration column attribute} \\
1380 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1381 \addtoindexx{declaration file attribute} \\
1382 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1383 \addtoindexx{declaration line attribute} \\
1384 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1385 \addtoindexx{declaration attribute} \\
1386 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1387 \addtoindexx{discriminant list attribute} \\
1388 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1389 \addtoindexx{encoding attribute} \\
1390 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1391 \addtoindexx{external attribute} \\
1392 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1393 \livelink{chap:classloclistptr}{loclistptr}
1394 \addtoindexx{frame base attribute} \\
1395 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1396 \addtoindexx{friend attribute} \\
1397 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1398 \addtoindexx{identifier case attribute} \\
1399 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1400 Reserved for compatibility and coexistence
1401 with prior DWARF versions.}
1402 &0x43&\livelink{chap:classmacptr}{macptr}
1403 \addtoindexx{macro information attribute (legacy)!encoding} \\
1404 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1405 \addtoindexx{name list item attribute} \\
1406 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1407 \addtoindexx{priority attribute} \\
1408 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1409 \livelink{chap:classloclistptr}{loclistptr}
1410 \addtoindexx{segment attribute} \\
1411 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1412 \addtoindexx{specification attribute} \\
1413 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1414 \livelink{chap:classloclistptr}{loclistptr}
1415 \addtoindexx{static link attribute} \\
1416 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1417 \addtoindexx{type attribute} \\
1418 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1419 \livelink{chap:classloclistptr}{loclistptr}
1420 \addtoindexx{location list attribute} \\
1421 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1422 \addtoindexx{variable parameter attribute} \\
1423 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1424 \addtoindexx{virtuality attribute} \\
1425 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1426 \livelink{chap:classloclistptr}{loclistptr}
1427 \addtoindexx{vtable element location attribute} \\
1428 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1429 \livelink{chap:classexprloc}{exprloc},
1430 \livelink{chap:classreference}{reference}
1431 \addtoindexx{allocated attribute} \\
1432 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1433 \livelink{chap:classexprloc}{exprloc},
1434 \livelink{chap:classreference}{reference}
1435 \addtoindexx{associated attribute} \\
1436 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1437 \addtoindexx{data location attribute} \\
1438 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1439 \livelink{chap:classexprloc}{exprloc},
1440 \livelink{chap:classreference}{reference}
1441 \addtoindexx{byte stride attribute} \\
1442 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1443 \livelink{chap:classconstant}{constant}
1444 \addtoindexx{entry PC attribute} \\
1445 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1446 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1447 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1448 \addtoindexx{extension attribute} \\
1449 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1450 \addtoindexx{ranges attribute} \\
1451 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1452 \livelink{chap:classflag}{flag},
1453 \livelink{chap:classreference}{reference},
1454 \livelink{chap:classstring}{string}
1455 \addtoindexx{trampoline attribute} \\
1456 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1457 \addtoindexx{call column attribute} \\
1458 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1459 \addtoindexx{call file attribute} \\
1460 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1461 \addtoindexx{call line attribute} \\
1462 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1463 \addtoindexx{description attribute} \\
1464 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1465 \addtoindexx{binary scale attribute} \\
1466 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1467 \addtoindexx{decimal scale attribute} \\
1468 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1469 \addtoindexx{small attribute} \\
1470 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1471 \addtoindexx{decimal scale attribute} \\
1472 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1473 \addtoindexx{digit count attribute} \\
1474 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1475 \addtoindexx{picture string attribute} \\
1476 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1477 \addtoindexx{mutable attribute} \\
1478 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1479 \addtoindexx{thread scaled attribute} \\
1480 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1481 \addtoindexx{explicit attribute} \\
1482 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1483 \addtoindexx{object pointer attribute} \\
1484 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1485 \addtoindexx{endianity attribute} \\
1486 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1487 \addtoindexx{elemental attribute} \\
1488 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1489 \addtoindexx{pure attribute} \\
1490 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1491 \addtoindexx{recursive attribute} \\
1492 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1493 \addtoindexx{signature attribute} \\
1494 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1495 \addtoindexx{main subprogram attribute} \\
1496 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1497 \addtoindexx{data bit offset attribute} \\
1498 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1499 \addtoindexx{constant expression attribute} \\
1500 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1501 \addtoindexx{enumeration class attribute} \\
1502 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1503 \addtoindexx{linkage name attribute} \\
1504 \DWATstringlengthbitsize{}~\ddag&0x6f&
1505 \livelink{chap:classconstant}{constant}
1506 \addtoindexx{string length attribute!size of length} \\
1507 \DWATstringlengthbytesize{}~\ddag&0x70&
1508 \livelink{chap:classconstant}{constant}
1509 \addtoindexx{string length attribute!size of length} \\
1510 \DWATrank~\ddag&0x71&
1511 \livelink{chap:classconstant}{constant},
1512 \livelink{chap:classexprloc}{exprloc}
1513 \addtoindexx{rank attribute} \\
1514 \DWATstroffsetsbase~\ddag&0x72&
1515 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1516 \addtoindexx{string offsets base!encoding} \\
1517 \DWATaddrbase~\ddag &0x73&
1518 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1519 \addtoindexx{address table base!encoding} \\
1520 \DWATrangesbase~\ddag&0x74&
1521 \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class}
1522 \addtoindexx{ranges base!encoding} \\
1523 \DWATdwoid~\ddag &0x75&
1524 \livelink{chap:classconstant}{constant}
1525 \addtoindexx{split DWARF object file id!encoding} \\
1526 \DWATdwoname~\ddag &0x76&
1527 \livelink{chap:classstring}{string}
1528 \addtoindexx{split DWARF object file name!encoding} \\
1529 \DWATreference~\ddag &0x77&
1530 \livelink{chap:classflag}{flag} \\
1531 \DWATrvaluereference~\ddag &0x78&
1532 \livelink{chap:classflag}{flag} \\
1533 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1534 \addtoindexx{macro information attribute} \\
1535 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1536 \addtoindexx{all calls summary attribute} \\
1537 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1538 \addtoindexx{all source calls summary attribute} \\
1539 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1540 \addtoindexx{all tail calls summary attribute} \\
1541 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1542 \addtoindexx{call return PC attribute} \\
1543 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1544 \addtoindexx{call value attribute} \\
1545 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1546 \addtoindexx{call origin attribute} \\
1547 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1548 \addtoindexx{call parameter attribute} \\
1549 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1550 \addtoindexx{call PC attribute} \\
1551 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1552 \addtoindexx{call tail call attribute} \\
1553 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1554 \addtoindexx{call target attribute} \\
1555 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1556 \addtoindexx{call target clobbered attribute} \\
1557 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1558 \addtoindexx{call data location attribute} \\
1559 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1560 \addtoindexx{call data value attribute} \\
1561 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1562 \addtoindexx{noreturn attribute} \\
1563 \DWATalignment~\ddag &0x88 &\CLASSconstant
1564 \addtoindexx{alignment attribute} \\
1565 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1566 \addtoindexx{export symbols attribute} \\
1567 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1568 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1569 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1570 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1575 The attribute form governs how the value of the attribute is
1576 encoded. There are nine classes of form, listed below. Each
1577 class is a set of forms which have related representations
1578 and which are given a common interpretation according to the
1579 attribute in which the form is used.
1581 Form \DWFORMsecoffsetTARG{}
1583 \addtoindexx{rangelistptr class}
1585 \addtoindexx{macptr class}
1587 \addtoindexx{loclistptr class}
1589 \addtoindexx{lineptr class}
1595 \CLASSrangelistptr{} or
1596 \CLASSstroffsetsptr;
1597 the list of classes allowed by the applicable attribute in
1598 Table \refersec{tab:attributeencodings}
1599 determines the class of the form.
1602 In the form descriptions that follow, some forms are said
1603 to depend in part on the value of an attribute of the
1604 \definition{\associatedcompilationunit}:
1607 In the case of a \splitDWARFobjectfile{}, the associated
1608 compilation unit is the skeleton compilation unit corresponding
1609 to the containing unit.
1610 \item Otherwise, the associated compilation unit
1611 is the containing unit.
1615 Each possible form belongs to one or more of the following classes
1616 (see Table \refersec{tab:classesofattributevalue} for a summary of
1617 the purpose and general usage of each class):
1620 \item \livelinki{chap:classaddress}{address}{address class} \\
1621 \livetarg{datarep:classaddress}{}
1622 Represented as either:
1624 \item An object of appropriate size to hold an
1625 address on the target machine
1627 The size is encoded in the compilation unit header
1628 (see Section \refersec{datarep:compilationunitheader}).
1629 This address is relocatable in a relocatable object file and
1630 is relocated in an executable file or shared object file.
1632 \item An indirect index into a table of addresses (as
1633 described in the previous bullet) in the
1634 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1635 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1636 \addtoindex{LEB128} value, which is interpreted as a zero-based
1637 index into an array of addresses in the \dotdebugaddr{} section.
1638 The index is relative to the value of the \DWATaddrbase{} attribute
1639 of the associated compilation unit.
1644 \item \livelink{chap:classaddrptr}{addrptr} \\
1645 \livetarg{datarep:classaddrptr}{}
1646 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1647 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1648 beginning of the list of machine addresses information for the
1649 referencing entity. It is relocatable in
1650 a relocatable object file, and relocated in an executable or
1651 shared object file. In the \thirtytwobitdwarfformat, this offset
1652 is a 4-byte unsigned value; in the 64-bit DWARF
1653 format, it is an 8-byte unsigned value (see Section
1654 \refersec{datarep:32bitand64bitdwarfformats}).
1656 \textit{This class is new in \DWARFVersionV.}
1659 \item \livelink{chap:classblock}{block} \\
1660 \livetarg{datarep:classblock}{}
1661 Blocks come in four forms:
1664 A 1-byte length followed by 0 to 255 contiguous information
1665 bytes (\DWFORMblockoneTARG).
1668 A 2-byte length followed by 0 to 65,535 contiguous information
1669 bytes (\DWFORMblocktwoTARG).
1672 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1673 information bytes (\DWFORMblockfourTARG).
1676 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1677 length followed by the number of bytes
1678 specified by the length (\DWFORMblockTARG).
1681 In all forms, the length is the number of information bytes
1682 that follow. The information bytes may contain any mixture
1683 of relocated (or relocatable) addresses, references to other
1684 debugging information entries or data bytes.
1686 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1687 \livetarg{datarep:classconstant}{}
1688 There are eight forms of constants. There are fixed length
1689 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1693 \DWFORMdatafourTARG,
1694 \DWFORMdataeightTARG{} and
1695 \DWFORMdatasixteenTARG).
1696 There are also variable length constant
1697 data forms encoded using LEB128 numbers (see below).
1698 Both signed (\DWFORMsdataTARG) and unsigned
1699 (\DWFORMudataTARG) variable length constants are available.
1700 There is also an implicit constant (\DWFORMimplicitconst),
1701 whose value is provided as part of the abbreviation
1705 The data in \DWFORMdataone,
1708 \DWFORMdataeight{} and
1709 \DWFORMdatasixteen{}
1710 can be anything. Depending on context, it may
1711 be a signed integer, an unsigned integer, a floating\dash point
1712 constant, or anything else. A consumer must use context to
1713 know how to interpret the bits, which if they are target
1714 machine data (such as an integer or floating-point constant)
1715 will be in target machine \byteorder.
1717 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1718 forms is used to represent a
1719 signed or unsigned integer, it can be hard for a consumer
1720 to discover the context necessary to determine which
1721 interpretation is intended. Producers are therefore strongly
1722 encouraged to use \DWFORMsdata{} or
1723 \DWFORMudata{} for signed and
1724 unsigned integers respectively, rather than
1725 \DWFORMdata\textless n\textgreater.}
1728 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1729 \livetarg{datarep:classexprloc}{}
1730 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1731 number of information bytes specified by the length
1732 (\DWFORMexprlocTARG).
1733 The information bytes contain a DWARF expression
1734 (see Section \refersec{chap:dwarfexpressions})
1735 or location description
1736 (see Section \refersec{chap:locationdescriptions}).
1739 \item \livelinki{chap:classflag}{flag}{flag class} \\
1740 \livetarg{datarep:classflag}{}
1741 A flag \addtoindexx{flag class}
1742 is represented explicitly as a single byte of data
1743 (\DWFORMflagTARG) or
1744 implicitly (\DWFORMflagpresentTARG).
1746 first case, if the \nolink{flag} has value zero, it indicates the
1747 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1748 it indicates the presence of the attribute. In the second
1749 case, the attribute is implicitly indicated as present, and
1750 no value is encoded in the debugging information entry itself.
1752 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1753 \livetarg{datarep:classlineptr}{}
1754 This is an offset into
1755 \addtoindexx{section offset!in class lineptr value}
1757 \dotdebugline{} or \dotdebuglinedwo{} section
1759 It consists of an offset from the beginning of the
1761 section to the first byte of
1762 the data making up the line number list for the compilation
1764 It is relocatable in a relocatable object file, and
1765 relocated in an executable or shared object file. In the
1766 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1767 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1768 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1771 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1772 \livetarg{datarep:classloclistptr}{}
1773 This is an offset into the
1777 It consists of an offset from the
1778 \addtoindexx{section offset!in class loclistptr value}
1781 section to the first byte of
1782 the data making up the
1783 \addtoindex{location list} for the compilation unit.
1784 It is relocatable in a relocatable object file, and
1785 relocated in an executable or shared object file. In the
1786 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1787 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1788 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1791 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1792 \livetarg{datarep:classmacptr}{}
1794 \addtoindexx{section offset!in class macptr value}
1796 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1798 It consists of an offset from the beginning of the
1799 \dotdebugmacro{} or \dotdebugmacrodwo{}
1800 section to the the header making up the
1801 macro information list for the compilation unit.
1802 It is relocatable in a relocatable object file, and
1803 relocated in an executable or shared object file. In the
1804 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1805 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
1806 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1809 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1810 \livetarg{datarep:classrangelistptr}{}
1812 \addtoindexx{section offset!in class rangelistptr value}
1813 offset into the \dotdebugranges{} section
1816 offset from the beginning of the
1817 \dotdebugranges{} section
1818 to the beginning of the non\dash contiguous address ranges
1819 information for the referencing entity.
1820 It is relocatable in
1821 a relocatable object file, and relocated in an executable or
1823 However, if a \DWATrangesbase{} attribute applies, the offset
1824 is relative to the base offset given by \DWATrangesbase.
1825 In the \thirtytwobitdwarfformat, this offset
1826 is a 4-byte unsigned value; in the 64-bit DWARF
1827 format, it is an 8-byte unsigned value (see Section
1828 \refersec{datarep:32bitand64bitdwarfformats}).
1831 \textit{Because classes
1836 \CLASSrangelistptr{} and
1837 \CLASSstroffsetsptr{}
1838 share a common representation, it is not possible for an
1839 attribute to allow more than one of these classes}
1843 \item \livelinki{chap:classreference}{reference}{reference class} \\
1844 \livetarg{datarep:classreference}{}
1845 There are four types of reference.
1848 \addtoindexx{reference class}
1849 first type of reference can identify any debugging
1850 information entry within the containing unit.
1853 \addtoindexx{section offset!in class reference value}
1854 offset from the first byte of the compilation
1855 header for the compilation unit containing the reference. There
1856 are five forms for this type of reference. There are fixed
1857 length forms for one, two, four and eight byte offsets
1863 and \DWFORMrefeightTARG).
1864 There is also an unsigned variable
1865 length offset encoded form that uses
1866 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1867 (\DWFORMrefudataTARG).
1868 Because this type of reference is within
1869 the containing compilation unit no relocation of the value
1872 The second type of reference can identify any debugging
1873 information entry within a
1874 \dotdebuginfo{} section; in particular,
1875 it may refer to an entry in a different compilation unit
1876 from the unit containing the reference, and may refer to an
1877 entry in a different shared object file. This type of reference
1878 (\DWFORMrefaddrTARG)
1879 is an offset from the beginning of the
1881 section of the target executable or shared object file, or, for
1882 references within a \addtoindex{supplementary object file},
1883 an offset from the beginning of the local \dotdebuginfo{} section;
1884 it is relocatable in a relocatable object file and frequently
1885 relocated in an executable or shared object file. For
1886 references from one shared object or static executable file
1887 to another, the relocation and identification of the target
1888 object must be performed by the consumer. In the
1889 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1890 in the \sixtyfourbitdwarfformat, it is an 8-byte
1892 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1894 \textit{A debugging information entry that may be referenced by
1895 another compilation unit using
1896 \DWFORMrefaddr{} must have a global symbolic name.}
1898 \textit{For a reference from one executable or shared object file to
1899 another, the reference is resolved by the debugger to identify
1900 the executable or shared object file and the offset into that
1901 file\textquoteright s \dotdebuginfo{}
1902 section in the same fashion as the run
1903 time loader, either when the debug information is first read,
1904 or when the reference is used.}
1906 The third type of reference can identify any debugging
1907 information type entry that has been placed in its own
1908 \addtoindex{type unit}. This type of
1909 reference (\DWFORMrefsigeightTARG) is the
1910 \addtoindexx{type signature}
1911 8-byte type signature
1912 (see Section \refersec{datarep:typesignaturecomputation})
1913 that was computed for the type.
1915 The fourth type of reference is a reference from within the
1916 \dotdebuginfo{} section of the executable or shared object file to
1917 a debugging information entry in the \dotdebuginfo{} section of
1918 a \addtoindex{supplementary object file}.
1919 This type of reference (\DWFORMrefsupTARG) is an offset from the
1920 beginning of the \dotdebuginfo{} section in the
1921 \addtoindex{supplementary object file}.
1923 \textit{The use of compilation unit relative references will reduce the
1924 number of link\dash time relocations and so speed up linking. The
1925 use of the second, third and fourth type of reference allows for the
1926 sharing of information, such as types, across compilation
1927 units, while the fourth type further allows for sharing of information
1928 across compilation units from different executables or shared object files.}
1930 \textit{A reference to any kind of compilation unit identifies the
1931 debugging information entry for that unit, not the preceding
1935 \item \livelinki{chap:classstring}{string}{string class} \\
1936 \livetarg{datarep:classstring}{}
1937 A string is a sequence of contiguous non\dash null bytes followed by
1939 \addtoindexx{string class}
1940 A string may be represented:
1942 \setlength{\itemsep}{0em}
1943 \item immediately in the debugging information entry itself
1944 (\DWFORMstringTARG),
1947 \addtoindexx{section offset!in class string value}
1948 offset into a string table contained in
1949 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
1950 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
1951 or as an offset into a string table contained in the
1952 \dotdebugstr{} section of a \addtoindex{supplementary object file}
1953 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
1954 section of a \addtoindex{supplementary object file}
1955 refer to the local \dotdebugstr{} section of that same file.
1956 In the \thirtytwobitdwarfformat, the representation of a
1957 \DWFORMstrpNAME{}, \DWFORMstrpNAME{} or \DWFORMstrpsupNAME{}
1958 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
1959 it is an 8-byte unsigned offset
1960 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1963 \item as an indirect offset into the string table using an
1964 index into a table of offsets contained in the
1965 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1966 The representation of a \DWFORMstrxNAME{} value is an unsigned
1967 \addtoindex{LEB128} value, which is interpreted as a zero-based
1968 index into an array of offsets in the \dotdebugstroffsets{} section.
1969 The offset entries in the \dotdebugstroffsets{} section have the
1970 same representation as \DWFORMstrp{} values.
1972 Any combination of these three forms may be used within a single compilation.
1974 If the \DWATuseUTFeight{}
1975 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1976 compilation, partial, skeleton or type unit entry, string values are encoded using the
1977 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1978 Character Set standard (ISO/IEC 10646\dash 1:1993).
1979 \addtoindexx{ISO 10646 character set standard}
1980 Otherwise, the string representation is unspecified.
1982 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1983 ISO/IEC 10646\dash 1:1993.
1984 \addtoindexx{ISO 10646 character set standard}
1985 It contains all the same characters
1986 and encoding points as ISO/IEC 10646, as well as additional
1987 information about the characters and their use.}
1989 \textit{Earlier versions of DWARF did not specify the representation
1990 of strings; for compatibility, this version also does
1991 not. However, the UTF\dash 8 representation is strongly recommended.}
1994 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1995 \livetarg{datarep:classstroffsetsptr}{}
1996 This is an offset into the \dotdebugstroffsets{} section
1997 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1998 \dotdebugstroffsets{} section to the
1999 beginning of the string offsets information for the
2000 referencing entity. It is relocatable in
2001 a relocatable object file, and relocated in an executable or
2002 shared object file. In the \thirtytwobitdwarfformat, this offset
2003 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2004 it is an 8-byte unsigned value (see Section
2005 \refersec{datarep:32bitand64bitdwarfformats}).
2007 \textit{This class is new in \DWARFVersionV.}
2011 In no case does an attribute use one of the classes
2016 \CLASSrangelistptr{} or
2017 \CLASSstroffsetsptr{}
2018 to point into either the
2019 \dotdebuginfo{} or \dotdebugstr{} section.
2021 The form encodings are listed in
2022 Table \referfol{tab:attributeformencodings}.
2026 \setlength{\extrarowheight}{0.1cm}
2027 \begin{longtable}{l|c|l}
2028 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2029 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2031 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2033 \hline \emph{Continued on next page}
2035 \hline \ddag\ \textit{New in DWARF Version 5}
2038 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2039 \textit{Reserved} &0x02& \\
2040 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2041 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2042 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2043 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2044 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2045 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2046 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2047 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2048 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2049 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2050 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2051 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2052 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2053 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2054 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2055 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2056 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2057 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2058 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2059 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2060 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
2061 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
2062 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2063 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2064 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
2065 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
2066 \DWFORMrefsup{}~\ddag &0x1c &\livelink{chap:classreference}{reference} \\
2067 \DWFORMstrpsup{}~\ddag &0x1d &\livelink{chap:classstring}{string} \\
2068 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2069 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2070 \DWFORMrefsigeight &0x20 &\livelink{chap:classreference}{reference} \\
2071 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2077 \section{Variable Length Data}
2078 \label{datarep:variablelengthdata}
2079 \addtoindexx{variable length data|see {LEB128}}
2081 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2082 encoded using \doublequote{Little-Endian Base 128}
2083 \addtoindexx{little-endian encoding|see{endian attribute}}
2085 \addtoindexx{LEB128}
2086 LEB128 is a scheme for encoding integers
2087 densely that exploits the assumption that most integers are
2090 \textit{This encoding is equally suitable whether the target machine
2091 architecture represents data in big-endian or little-endian
2092 \byteorder. It is \doublequote{little-endian} only in the sense that it
2093 avoids using space to represent the \doublequote{big} end of an
2094 unsigned integer, when the big end is all zeroes or sign
2097 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2098 numbers are encoded as follows:
2099 \addtoindexx{LEB128!unsigned, encoding as}
2100 start at the low order end of an unsigned integer and chop
2101 it into 7-bit chunks. Place each chunk into the low order 7
2102 bits of a byte. Typically, several of the high order bytes
2103 will be zero; discard them. Emit the remaining bytes in a
2104 stream, starting with the low order byte; set the high order
2105 bit on each byte except the last emitted byte. The high bit
2106 of zero on the last byte indicates to the decoder that it
2107 has encountered the last byte.
2109 The integer zero is a special case, consisting of a single
2112 Table \refersec{tab:examplesofunsignedleb128encodings}
2113 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2115 0x80 in each case is the high order bit of the byte, indicating
2116 that an additional byte follows.
2119 The encoding for signed, two\textquoteright{s} complement LEB128
2120 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2121 numbers is similar, except that the criterion for discarding
2122 high order bytes is not whether they are zero, but whether
2123 they consist entirely of sign extension bits. Consider the
2124 4-byte integer -2. The three high level bytes of the number
2125 are sign extension, thus LEB128 would represent it as a single
2126 byte containing the low order 7 bits, with the high order
2127 bit cleared to indicate the end of the byte stream. Note
2128 that there is nothing within the LEB128 representation that
2129 indicates whether an encoded number is signed or unsigned. The
2130 decoder must know what type of number to expect.
2131 Table \refersec{tab:examplesofunsignedleb128encodings}
2132 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2133 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2134 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2137 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2138 \addtoindexx{LEB128!examples}
2139 gives algorithms for encoding and decoding these forms.}
2143 \setlength{\extrarowheight}{0.1cm}
2144 \begin{longtable}{c|c|c}
2145 \caption{Examples of unsigned LEB128 encodings}
2146 \label{tab:examplesofunsignedleb128encodings}
2147 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2148 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2150 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2152 \hline \emph{Continued on next page}
2158 128& 0 + 0x80 & 1 \\
2159 129& 1 + 0x80 & 1 \\
2160 %130& 2 + 0x80 & 1 \\
2161 12857& 57 + 0x80 & 100 \\
2168 \setlength{\extrarowheight}{0.1cm}
2169 \begin{longtable}{c|c|c}
2170 \caption{Examples of signed LEB128 encodings}
2171 \label{tab:examplesofsignedleb128encodings}
2172 \addtoindexx{LEB128!signed} \\
2173 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2175 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2177 \hline \emph{Continued on next page}
2183 127& 127 + 0x80 & 0 \\
2184 -127& 1 + 0x80 & 0x7f \\
2185 128& 0 + 0x80 & 1 \\
2186 -128& 0 + 0x80 & 0x7f \\
2187 129& 1 + 0x80 & 1 \\
2188 -129& 0x7f + 0x80 & 0x7e \\
2195 \section{DWARF Expressions and Location Descriptions}
2196 \label{datarep:dwarfexpressionsandlocationdescriptions}
2197 \subsection{DWARF Expressions}
2198 \label{datarep:dwarfexpressions}
2201 \addtoindexx{DWARF expression!operator encoding}
2202 DWARF expression is stored in a \nolink{block} of contiguous
2203 bytes. The bytes form a sequence of operations. Each operation
2204 is a 1-byte code that identifies that operation, followed by
2205 zero or more bytes of additional data. The encodings for the
2206 operations are described in
2207 Table \refersec{tab:dwarfoperationencodings}.
2210 \setlength{\extrarowheight}{0.1cm}
2211 \begin{longtable}{l|c|c|l}
2212 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2213 \hline & &\bfseries No. of &\\
2214 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2216 & &\bfseries No. of &\\
2217 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2219 \hline \emph{Continued on next page}
2221 \hline \ddag\ \textit{New in DWARF Version 5}
2224 \DWOPaddr&0x03&1 & constant address \\
2225 & & &(size is target specific) \\
2227 \DWOPderef&0x06&0 & \\
2229 \DWOPconstoneu&0x08&1&1-byte constant \\
2230 \DWOPconstones&0x09&1&1-byte constant \\
2231 \DWOPconsttwou&0x0a&1&2-byte constant \\
2232 \DWOPconsttwos&0x0b&1&2-byte constant \\
2233 \DWOPconstfouru&0x0c&1&4-byte constant \\
2234 \DWOPconstfours&0x0d&1&4-byte constant \\
2235 \DWOPconsteightu&0x0e&1&8-byte constant \\
2236 \DWOPconsteights&0x0f&1&8-byte constant \\
2237 \DWOPconstu&0x10&1&ULEB128 constant \\
2238 \DWOPconsts&0x11&1&SLEB128 constant \\
2239 \DWOPdup&0x12&0 & \\
2240 \DWOPdrop&0x13&0 & \\
2241 \DWOPover&0x14&0 & \\
2242 \DWOPpick&0x15&1&1-byte stack index \\
2243 \DWOPswap&0x16&0 & \\
2244 \DWOProt&0x17&0 & \\
2245 \DWOPxderef&0x18&0 & \\
2246 \DWOPabs&0x19&0 & \\
2247 \DWOPand&0x1a&0 & \\
2248 \DWOPdiv&0x1b&0 & \\
2249 \DWOPminus&0x1c&0 & \\
2250 \DWOPmod&0x1d&0 & \\
2251 \DWOPmul&0x1e&0 & \\
2252 \DWOPneg&0x1f&0 & \\
2253 \DWOPnot&0x20&0 & \\
2255 \DWOPplus&0x22&0 & \\
2256 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2257 \DWOPshl&0x24&0 & \\
2258 \DWOPshr&0x25&0 & \\
2259 \DWOPshra&0x26&0 & \\
2260 \DWOPxor&0x27&0 & \\
2262 \DWOPbra&0x28&1 & signed 2-byte constant \\
2269 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2271 \DWOPlitzero & 0x30 & 0 & \\
2272 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2273 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2274 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2276 \DWOPregzero & 0x50 & 0 & \\*
2277 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2278 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2279 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2281 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2282 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2283 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2284 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2286 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2287 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2288 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2289 & & &SLEB128 offset \\
2290 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2291 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2292 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2293 \DWOPnop{} & 0x96 &0& \\
2295 \DWOPpushobjectaddress&0x97&0 & \\
2296 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2297 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2298 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2299 \DWOPformtlsaddress&0x9b &0& \\
2300 \DWOPcallframecfa{} &0x9c &0& \\
2301 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2303 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2304 &&&\nolink{block} of that size\\
2305 \DWOPstackvalue{} &0x9f &0& \\
2306 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2307 &&&SLEB128 constant offset \\
2308 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2309 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2310 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2311 &&&\nolink{block} of that size\\
2312 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2313 & & & 1-byte size, \\*
2314 & & & constant value \\
2315 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2316 &&& ULEB128 constant offset \\
2317 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2318 &&& ULEB128 type entry offset \\
2319 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2320 &&& ULEB128 type entry offset \\
2321 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2322 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2323 \DWOPlouser{} &0xe0 && \\
2324 \DWOPhiuser{} &\xff && \\
2330 \subsection{Location Descriptions}
2331 \label{datarep:locationdescriptions}
2333 A location description is used to compute the
2334 location of a variable or other entity.
2336 \subsection{Location Lists}
2337 \label{datarep:locationlists}
2339 Each entry in a \addtoindex{location list} is either a location list entry,
2340 a base address selection entry, or an
2341 \addtoindexx{end-of-list entry!in location list}
2345 \subsubsection{Location List Entries in Non-Split Objects}
2346 A \addtoindex{location list} entry consists of two address offsets followed
2347 by an unsigned 2-byte length, followed by a block of contiguous bytes
2348 that contains a DWARF location description. The length
2349 specifies the number of bytes in that block. The two offsets
2350 are the same size as an address on the target machine.
2353 A base address selection entry and an
2354 \addtoindexx{end-of-list entry!in location list}
2355 end-of-list entry each
2356 consist of two (constant or relocated) address offsets. The two
2357 offsets are the same size as an address on the target machine.
2359 For a \addtoindex{location list} to be specified, the base address of
2360 \addtoindexx{base address selection entry!in location list}
2361 the corresponding compilation unit must be defined
2362 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
2364 \subsubsection{Location List Entries in Split Objects}
2365 \label{datarep:locationlistentriesinsplitobjects}
2366 An alternate form for location list entries is used in split objects.
2367 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2368 that follows. The encodings for these constants are given in
2369 Table \refersec{tab:locationlistentryencodingvalues}.
2373 \setlength{\extrarowheight}{0.1cm}
2374 \begin{longtable}{l|c}
2375 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2376 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2378 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2380 \hline \emph{Continued on next page}
2384 \DWLLEendoflistentry & 0x0 \\
2385 \DWLLEbaseaddressselectionentry & 0x01 \\
2386 \DWLLEstartendentry & 0x02 \\
2387 \DWLLEstartlengthentry & 0x03 \\
2388 \DWLLEoffsetpairentry & 0x04 \\
2392 \section{Base Type Attribute Encodings}
2393 \label{datarep:basetypeattributeencodings}
2395 The encodings of the
2396 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2397 constants used in the
2398 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2400 Table \refersec{tab:basetypeencodingvalues}
2403 \setlength{\extrarowheight}{0.1cm}
2404 \begin{longtable}{l|c}
2405 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2406 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2408 \bfseries Base type encoding name&\bfseries Value\\ \hline
2410 \hline \emph{Continued on next page}
2413 \ddag \ \textit{New in \DWARFVersionV}
2415 \DWATEaddress&0x01 \\
2416 \DWATEboolean&0x02 \\
2417 \DWATEcomplexfloat&0x03 \\
2419 \DWATEsigned&0x05 \\
2420 \DWATEsignedchar&0x06 \\
2421 \DWATEunsigned&0x07 \\
2422 \DWATEunsignedchar&0x08 \\
2423 \DWATEimaginaryfloat&0x09 \\
2424 \DWATEpackeddecimal&0x0a \\
2425 \DWATEnumericstring&0x0b \\
2426 \DWATEedited&0x0c \\
2427 \DWATEsignedfixed&0x0d \\
2428 \DWATEunsignedfixed&0x0e \\
2429 \DWATEdecimalfloat & 0x0f \\
2430 \DWATEUTF{} & 0x10 \\
2431 \DWATEUCS~\ddag & 0x11 \\
2432 \DWATEASCII~\ddag & 0x12 \\
2433 \DWATElouser{} & 0x80 \\
2434 \DWATEhiuser{} & \xff \\
2439 The encodings of the constants used in the
2440 \DWATdecimalsign{} attribute
2442 Table \refersec{tab:decimalsignencodings}.
2445 \setlength{\extrarowheight}{0.1cm}
2446 \begin{longtable}{l|c}
2447 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2448 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2450 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2452 % \hline \emph{Continued on next page}
2456 \DWDSunsigned{} & 0x01 \\
2457 \DWDSleadingoverpunch{} & 0x02 \\
2458 \DWDStrailingoverpunch{} & 0x03 \\
2459 \DWDSleadingseparate{} & 0x04 \\
2460 \DWDStrailingseparate{} & 0x05 \\
2465 The encodings of the constants used in the
2466 \DWATendianity{} attribute are given in
2467 Table \refersec{tab:endianityencodings}.
2470 \setlength{\extrarowheight}{0.1cm}
2471 \begin{longtable}{l|c}
2472 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2473 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2475 \bfseries Endian code name&\bfseries Value\\ \hline
2477 \hline \emph{Continued on next page}
2482 \DWENDdefault{} & 0x00 \\
2483 \DWENDbig{} & 0x01 \\
2484 \DWENDlittle{} & 0x02 \\
2485 \DWENDlouser{} & 0x40 \\
2486 \DWENDhiuser{} & \xff \\
2492 \section{Accessibility Codes}
2493 \label{datarep:accessibilitycodes}
2494 The encodings of the constants used in the
2495 \DWATaccessibility{}
2497 \addtoindexx{accessibility attribute}
2499 Table \refersec{tab:accessibilityencodings}.
2502 \setlength{\extrarowheight}{0.1cm}
2503 \begin{longtable}{l|c}
2504 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2505 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2507 \bfseries Accessibility code name&\bfseries Value\\ \hline
2509 \hline \emph{Continued on next page}
2514 \DWACCESSpublic&0x01 \\
2515 \DWACCESSprotected&0x02 \\
2516 \DWACCESSprivate&0x03 \\
2522 \section{Visibility Codes}
2523 \label{datarep:visibilitycodes}
2524 The encodings of the constants used in the
2525 \DWATvisibility{} attribute are given in
2526 Table \refersec{tab:visibilityencodings}.
2529 \setlength{\extrarowheight}{0.1cm}
2530 \begin{longtable}{l|c}
2531 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2532 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2534 \bfseries Visibility code name&\bfseries Value\\ \hline
2536 \hline \emph{Continued on next page}
2542 \DWVISexported&0x02 \\
2543 \DWVISqualified&0x03 \\
2548 \section{Virtuality Codes}
2549 \label{datarep:vitualitycodes}
2551 The encodings of the constants used in the
2552 \DWATvirtuality{} attribute are given in
2553 Table \refersec{tab:virtualityencodings}.
2556 \setlength{\extrarowheight}{0.1cm}
2557 \begin{longtable}{l|c}
2558 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2559 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2561 \bfseries Virtuality code name&\bfseries Value\\ \hline
2563 \hline \emph{Continued on next page}
2568 \DWVIRTUALITYnone&0x00 \\
2569 \DWVIRTUALITYvirtual&0x01 \\
2570 \DWVIRTUALITYpurevirtual&0x02 \\
2577 \DWVIRTUALITYnone{} is equivalent to the absence of the
2581 \section{Source Languages}
2582 \label{datarep:sourcelanguages}
2584 The encodings of the constants used
2585 \addtoindexx{language attribute, encoding}
2587 \addtoindexx{language name encoding}
2590 attribute are given in
2591 Table \refersec{tab:languageencodings}.
2593 % If we don't force a following space it looks odd
2595 and their associated values are reserved, but the
2596 languages they represent are not well supported.
2597 Table \refersec{tab:languageencodings}
2599 \addtoindexx{lower bound attribute!default}
2600 default lower bound, if any, assumed for
2601 an omitted \DWATlowerbound{} attribute in the context of a
2602 \DWTAGsubrangetype{} debugging information entry for each
2606 \setlength{\extrarowheight}{0.1cm}
2607 \begin{longtable}{l|c|c}
2608 \caption{Language encodings} \label{tab:languageencodings}\\
2609 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2611 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2613 \hline \emph{Continued on next page}
2616 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2618 \addtoindexx{ISO-defined language names}
2620 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2621 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2622 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2623 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2624 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2625 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2626 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2627 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2628 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2629 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2630 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2631 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2632 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2633 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2634 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2635 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2636 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2637 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2638 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2639 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2640 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2641 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2642 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2643 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2644 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2645 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2646 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2647 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2648 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2649 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2650 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2651 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2652 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++:2014 (ISO)} \\
2653 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2654 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2655 \DWLANGlouser{} &0x8000 & \\
2656 \DWLANGhiuser{} &\xffff & \\
2661 \section{Address Class Encodings}
2662 \label{datarep:addressclassencodings}
2664 The value of the common
2665 \addtoindex{address class} encoding
2669 \section{Identifier Case}
2670 \label{datarep:identifiercase}
2672 The encodings of the constants used in the
2673 \DWATidentifiercase{} attribute are given in
2674 Table \refersec{tab:identifiercaseencodings}.
2678 \setlength{\extrarowheight}{0.1cm}
2679 \begin{longtable}{l|c}
2680 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2681 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2683 \bfseries Identifier case name&\bfseries Value\\ \hline
2685 \hline \emph{Continued on next page}
2689 \DWIDcasesensitive&0x00 \\
2691 \DWIDdowncase&0x02 \\
2692 \DWIDcaseinsensitive&0x03 \\
2696 \section{Calling Convention Encodings}
2697 \label{datarep:callingconventionencodings}
2698 The encodings of the constants used in the
2699 \DWATcallingconvention{} attribute are given in
2700 Table \refersec{tab:callingconventionencodings}.
2703 \setlength{\extrarowheight}{0.1cm}
2704 \begin{longtable}{l|c}
2705 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2706 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2708 \bfseries Calling convention name&\bfseries Value\\ \hline
2710 \hline \emph{Continued on next page}
2712 \hline \ddag\ \textit{New in DWARF Version 5}
2715 \DWCCnormal &0x01 \\
2716 \DWCCprogram&0x02 \\
2717 \DWCCnocall &0x03 \\
2718 \DWCCpassbyreference~\ddag &0x04 \\
2719 \DWCCpassbyvalue~\ddag &0x05 \\
2720 \DWCClouser &0x40 \\
2727 \section{Inline Codes}
2728 \label{datarep:inlinecodes}
2730 The encodings of the constants used in
2731 \addtoindexx{inline attribute}
2733 \DWATinline{} attribute are given in
2734 Table \refersec{tab:inlineencodings}.
2738 \setlength{\extrarowheight}{0.1cm}
2739 \begin{longtable}{l|c}
2740 \caption{Inline encodings} \label{tab:inlineencodings}\\
2741 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2743 \bfseries Inline Code name&\bfseries Value\\ \hline
2745 \hline \emph{Continued on next page}
2750 \DWINLnotinlined&0x00 \\
2751 \DWINLinlined&0x01 \\
2752 \DWINLdeclarednotinlined&0x02 \\
2753 \DWINLdeclaredinlined&0x03 \\
2758 % this clearpage is ugly, but the following table came
2759 % out oddly without it.
2761 \section{Array Ordering}
2762 \label{datarep:arrayordering}
2764 The encodings of the constants used in the
2765 \DWATordering{} attribute are given in
2766 Table \refersec{tab:orderingencodings}.
2770 \setlength{\extrarowheight}{0.1cm}
2771 \begin{longtable}{l|c}
2772 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2773 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2775 \bfseries Ordering name&\bfseries Value\\ \hline
2777 \hline \emph{Continued on next page}
2782 \DWORDrowmajor&0x00 \\
2783 \DWORDcolmajor&0x01 \\
2789 \section{Discriminant Lists}
2790 \label{datarep:discriminantlists}
2792 The descriptors used in
2793 \addtoindexx{discriminant list attribute}
2795 \DWATdiscrlist{} attribute are
2796 encoded as 1-byte constants. The
2797 defined values are given in
2798 Table \refersec{tab:discriminantdescriptorencodings}.
2800 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2802 \setlength{\extrarowheight}{0.1cm}
2803 \begin{longtable}{l|c}
2804 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2805 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2807 \bfseries Descriptor name&\bfseries Value\\ \hline
2809 \hline \emph{Continued on next page}
2821 \section{Name Index Table}
2822 \label{datarep:nameindextable}
2823 The \addtoindexi{version number}{version number!name index table}
2824 in the name index table header is \versiondotdebugnames{}
2825 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2827 The name index attributes and their encodings are listed in Table \referfol{datarep:indexattributeencodings}.
2830 \setlength{\extrarowheight}{0.1cm}
2831 \begin{longtable}{l|c|l}
2832 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
2833 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
2835 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
2837 \hline \emph{Continued on next page}
2840 \ddag~\textit{New in \DWARFVersionV}
2842 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
2843 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
2844 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
2845 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
2846 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
2847 \DWIDXlouser~\ddag & 0x2000 & \\
2848 \DWIDXhiuser~\ddag & \xiiifff & \\
2852 The abbreviations table ends with an entry consisting of a single 0
2853 byte for the abbreviation code. The size of the table given by
2854 \texttt{abbrev\_table\_size} may include optional padding following the
2857 \section{Defaulted Member Encodings}
2858 \hypertarget{datarep:defaultedmemberencodings}{}
2860 The encodings of the constants used in the \DWATdefaulted{} attribute
2861 are given in Table \referfol{datarep:defaultedattributeencodings}.
2864 \setlength{\extrarowheight}{0.1cm}
2865 \begin{longtable}{l|c}
2866 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
2867 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
2869 \bfseries Defaulted name &\bfseries Value \\ \hline
2871 \hline \emph{Continued on next page}
2874 \ddag~\textit{New in \DWARFVersionV}
2876 \DWDEFAULTEDno~\ddag & 0x00 \\
2877 \DWDEFAULTEDinclass~\ddag & 0x01 \\
2878 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
2883 \section{Address Range Table}
2884 \label{datarep:addrssrangetable}
2886 Each set of entries in the table of address ranges contained
2887 in the \dotdebugaranges{}
2888 section begins with a header containing:
2889 \begin{enumerate}[1. ]
2890 % FIXME The unit length text is not fully consistent across
2893 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2894 \addttindexx{unit\_length}
2895 A 4-byte or 12-byte length containing the length of the
2896 \addtoindexx{initial length}
2897 set of entries for this compilation unit, not including the
2898 length field itself. In the \thirtytwobitdwarfformat, this is a
2899 4-byte unsigned integer (which must be less than \xfffffffzero);
2900 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2901 \wffffffff followed by an 8-byte unsigned integer that gives
2903 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2905 \item version (\HFTuhalf) \\
2906 A 2-byte version identifier representing the version of the
2907 DWARF information for the address range table
2908 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2910 This value in this field \addtoindexx{version number!address range table} is 2.
2912 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2914 \addtoindexx{section offset!in .debug\_aranges header}
2915 4-byte or 8-byte offset into the
2916 \dotdebuginfo{} section of
2917 the compilation unit header. In the \thirtytwobitdwarfformat,
2918 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2919 this is an 8-byte unsigned offset
2920 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2922 \item \texttt{address\_size} (\HFTubyte) \\
2923 A 1-byte unsigned integer containing the size in bytes of an
2924 \addttindexx{address\_size}
2926 \addtoindexx{size of an address}
2927 (or the offset portion of an address for segmented
2928 \addtoindexx{address space!segmented}
2929 addressing) on the target system.
2931 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
2932 A 1-byte unsigned integer containing the size in bytes of a
2933 segment selector on the target system.
2937 This header is followed by a series of tuples. Each tuple
2938 consists of a segment, an address and a length.
2939 The segment selector
2940 size is given by the \HFNsegmentselectorsize{} field of the header; the
2941 address and length size are each given by the \addttindex{address\_size}
2942 field of the header.
2943 The first tuple following the header in
2944 each set begins at an offset that is a multiple of the size
2945 of a single tuple (that is, the size of a segment selector
2946 plus twice the \addtoindex{size of an address}).
2947 The header is padded, if
2948 necessary, to that boundary. Each set of tuples is terminated
2949 by a 0 for the segment, a 0 for the address and 0 for the
2950 length. If the \HFNsegmentselectorsize{} field in the header is zero,
2951 the segment selectors are omitted from all tuples, including
2952 the terminating tuple.
2955 \section{Line Number Information}
2956 \label{datarep:linenumberinformation}
2958 The \addtoindexi{version number}{version number!line number information}
2959 in the line number program header is \versiondotdebugline{}
2960 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2962 The boolean values \doublequote{true} and \doublequote{false}
2963 used by the line number information program are encoded
2964 as a single byte containing the value 0
2965 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2968 The encodings for the standard opcodes are given in
2969 \addtoindexx{line number opcodes!standard opcode encoding}
2970 Table \refersec{tab:linenumberstandardopcodeencodings}.
2973 \setlength{\extrarowheight}{0.1cm}
2974 \begin{longtable}{l|c}
2975 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2976 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2978 \bfseries Opcode name&\bfseries Value\\ \hline
2980 \hline \emph{Continued on next page}
2986 \DWLNSadvancepc&0x02 \\
2987 \DWLNSadvanceline&0x03 \\
2988 \DWLNSsetfile&0x04 \\
2989 \DWLNSsetcolumn&0x05 \\
2990 \DWLNSnegatestmt&0x06 \\
2991 \DWLNSsetbasicblock&0x07 \\
2992 \DWLNSconstaddpc&0x08 \\
2993 \DWLNSfixedadvancepc&0x09 \\
2994 \DWLNSsetprologueend&0x0a \\*
2995 \DWLNSsetepiloguebegin&0x0b \\*
2996 \DWLNSsetisa&0x0c \\*
3002 The encodings for the extended opcodes are given in
3003 \addtoindexx{line number opcodes!extended opcode encoding}
3004 Table \refersec{tab:linenumberextendedopcodeencodings}.
3007 \setlength{\extrarowheight}{0.1cm}
3008 \begin{longtable}{l|c}
3009 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3010 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3012 \bfseries Opcode name&\bfseries Value\\ \hline
3014 \hline \emph{Continued on next page}
3016 \hline %\ddag~\textit{New in DWARF Version 5}
3019 \DWLNEendsequence &0x01 \\
3020 \DWLNEsetaddress &0x02 \\
3021 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3022 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3024 \DWLNEsetdiscriminator &0x04 \\
3025 \DWLNElouser &0x80 \\
3026 \DWLNEhiuser &\xff \\
3032 The encodings for the line number header entry formats are given in
3033 \addtoindexx{line number opcodes!file entry format encoding}
3034 Table \refersec{tab:linenumberheaderentryformatencodings}.
3037 \setlength{\extrarowheight}{0.1cm}
3038 \begin{longtable}{l|c}
3039 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3040 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3042 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3044 \hline \emph{Continued on next page}
3046 \hline \ddag~\textit{New in DWARF Version 5}
3048 \DWLNCTpath~\ddag & 0x1 \\
3049 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3050 \DWLNCTtimestamp~\ddag & 0x3 \\
3051 \DWLNCTsize~\ddag & 0x4 \\
3052 \DWLNCTMDfive~\ddag & 0x5 \\
3053 \DWLNCTlouser~\ddag & 0x2000 \\
3054 \DWLNCThiuser~\ddag & \xiiifff \\
3059 \section{Macro Information}
3060 \label{datarep:macroinformation}
3061 The \addtoindexi{version number}{version number!macro information}
3062 in the macro information header is \versiondotdebugmacro{}
3063 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3065 The source line numbers and source file indices encoded in the
3066 macro information section are represented as
3067 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3070 The macro information entry type is encoded as a single unsigned byte.
3072 \addtoindexx{macro information entry types!encoding}
3074 Table \refersec{tab:macroinfoentrytypeencodings}.
3078 \setlength{\extrarowheight}{0.1cm}
3079 \begin{longtable}{l|c}
3080 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3081 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3083 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3085 \hline \emph{Continued on next page}
3087 \hline \ddag~\textit{New in DWARF Version 5}
3090 \DWMACROdefine~\ddag &0x01 \\
3091 \DWMACROundef~\ddag &0x02 \\
3092 \DWMACROstartfile~\ddag &0x03 \\
3093 \DWMACROendfile~\ddag &0x04 \\
3094 \DWMACROdefinestrp~\ddag &0x05 \\
3095 \DWMACROundefstrp~\ddag &0x06 \\
3096 \DWMACROimport~\ddag &0x07 \\
3097 \DWMACROdefinesup~\ddag &0x08 \\
3098 \DWMACROundefsup~\ddag &0x09 \\
3099 \DWMACROimportsup~\ddag &0x0a \\
3100 \DWMACROdefinestrx~\ddag &0x0b \\
3101 \DWMACROundefstrx~\ddag &0x0c \\
3102 \DWMACROlouser~\ddag &0xe0 \\
3103 \DWMACROhiuser~\ddag &\xff \\
3109 \section{Call Frame Information}
3110 \label{datarep:callframeinformation}
3112 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3113 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3114 value is \xffffffffffffffff.
3116 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3117 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3119 Call frame instructions are encoded in one or more bytes. The
3120 primary opcode is encoded in the high order two bits of
3121 the first byte (that is, opcode = byte $\gg$ 6). An operand
3122 or extended opcode may be encoded in the low order 6
3123 bits. Additional operands are encoded in subsequent bytes.
3124 The instructions and their encodings are presented in
3125 Table \refersec{tab:callframeinstructionencodings}.
3128 \setlength{\extrarowheight}{0.1cm}
3129 \begin{longtable}{l|c|c|l|l}
3130 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3131 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3132 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3134 & \bfseries High 2 &\bfseries Low 6 & &\\
3135 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3137 \hline \emph{Continued on next page}
3142 \DWCFAadvanceloc&0x1&delta & \\
3143 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3144 \DWCFArestore&0x3®ister & & \\
3145 \DWCFAnop&0&0 & & \\
3146 \DWCFAsetloc&0&0x01&address & \\
3147 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3148 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3149 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3150 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3151 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3152 \DWCFAundefined&0&0x07&ULEB128 register & \\
3153 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3154 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3155 \DWCFArememberstate&0&0x0a & & \\
3156 \DWCFArestorestate&0&0x0b & & \\
3157 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3158 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3159 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3160 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3161 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3163 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3164 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3165 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3166 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3167 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3168 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3169 \DWCFAlouser&0&0x1c & & \\
3170 \DWCFAhiuser&0&\xiiif & & \\
3174 \section{Non-contiguous Address Ranges}
3175 \label{datarep:noncontiguousaddressranges}
3177 Each entry in a \addtoindex{range list}
3178 (see Section \refersec{chap:noncontiguousaddressranges})
3180 \addtoindexx{base address selection entry!in range list}
3182 \addtoindexx{range list}
3183 a base address selection entry, or an end-of-list entry.
3185 A \addtoindex{range list} entry consists of two relative addresses. The
3186 addresses are the same size as addresses on the target machine.
3189 A base address selection entry and an
3190 \addtoindexx{end-of-list entry!in range list}
3191 end-of-list entry each
3192 \addtoindexx{base address selection entry!in range list}
3193 consist of two (constant or relocated) addresses. The two
3194 addresses are the same size as addresses on the target machine.
3196 For a \addtoindex{range list} to be specified, the base address of the
3197 \addtoindexx{base address selection entry!in range list}
3198 corresponding compilation unit must be defined
3199 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3202 \section{String Offsets Table}
3203 \label{chap:stringoffsetstable}
3204 Each set of entries in the string offsets table contained in the
3205 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3206 section begins with a header containing:
3207 \begin{enumerate}[1. ]
3208 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3209 \addttindexx{unit\_length}
3210 A 4-byte or 12-byte length containing the length of
3211 the set of entries for this compilation unit, not
3212 including the length field itself. In the 32-bit
3213 DWARF format, this is a 4-byte unsigned integer
3214 (which must be less than \xfffffffzero); in the 64-bit
3215 DWARF format, this consists of the 4-byte value
3216 \wffffffff followed by an 8-byte unsigned integer
3217 that gives the actual length (see
3218 Section \refersec{datarep:32bitand64bitdwarfformats}).
3221 \item \texttt{version} (\HFTuhalf) \\
3222 A 2-byte version identifier containing the value
3223 \versiondotdebugstroffsets{}
3224 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3226 \item \texttt{padding} (\HFTuhalf) \\
3229 This header is followed by a series of string table offsets
3230 that have the same representation as \DWFORMstrp.
3231 For the 32-bit DWARF format, each offset is 4 bytes long; for
3232 the 64-bit DWARF format, each offset is 8 bytes long.
3234 The \DWATstroffsetsbase{} attribute points to the first
3235 entry following the header. The entries are indexed
3236 sequentially from this base entry, starting from 0.
3238 \section{Address Table}
3239 \label{chap:addresstable}
3240 Each set of entries in the address table contained in the
3241 \dotdebugaddr{} section begins with a header containing:
3242 \begin{enumerate}[1. ]
3243 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3244 \addttindexx{unit\_length}
3245 A 4-byte or 12-byte length containing the length of
3246 the set of entries for this compilation unit, not
3247 including the length field itself. In the 32-bit
3248 DWARF format, this is a 4-byte unsigned integer
3249 (which must be less than \xfffffffzero); in the 64-bit
3250 DWARF format, this consists of the 4-byte value
3251 \wffffffff followed by an 8-byte unsigned integer
3252 that gives the actual length (see
3253 Section \refersec{datarep:32bitand64bitdwarfformats}).
3256 \item \texttt{version} (\HFTuhalf) \\
3257 A 2-byte version identifier containing the value
3258 \versiondotdebugaddr{}
3259 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3262 \item \texttt{address\_size} (\HFTubyte) \\
3263 A 1-byte unsigned integer containing the size in
3264 bytes of an address (or the offset portion of an
3265 address for segmented addressing) on the target
3269 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3270 A 1-byte unsigned integer containing the size in
3271 bytes of a segment selector on the target system.
3274 This header is followed by a series of segment/address pairs.
3275 The segment size is given by the \HFNsegmentselectorsize{} field of the
3276 header, and the address size is given by the \addttindex{address\_size}
3277 field of the header. If the \HFNsegmentselectorsize{} field in the header
3278 is zero, the entries consist only of an addresses.
3280 The \DWATaddrbase{} attribute points to the first entry
3281 following the header. The entries are indexed sequentially
3282 from this base entry, starting from 0.
3285 \section{Range List Table}
3286 \label{app:rangelisttable}
3287 Each set of entries in the range list table contained in the
3288 \dotdebugranges{} section begins with a header containing:
3289 \begin{enumerate}[1. ]
3290 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3291 \addttindexx{unit\_length}
3292 A 4-byte or 12-byte length containing the length of
3293 the set of entries for this compilation unit, not
3294 including the length field itself. In the 32-bit
3295 DWARF format, this is a 4-byte unsigned integer
3296 (which must be less than \xfffffffzero); in the 64-bit
3297 DWARF format, this consists of the 4-byte value
3298 \wffffffff followed by an 8-byte unsigned integer
3299 that gives the actual length (see
3300 Section \refersec{datarep:32bitand64bitdwarfformats}).
3303 \item \texttt{version} (\HFTuhalf) \\
3304 A 2-byte version identifier containing the value
3305 \versiondotdebugranges{}
3306 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3309 \item \texttt{address\_size} (\HFTubyte) \\
3310 A 1-byte unsigned integer containing the size in
3311 bytes of an address (or the offset portion of an
3312 address for segmented addressing) on the target
3316 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3317 A 1-byte unsigned integer containing the size in
3318 bytes of a segment selector on the target system.
3321 This header is followed by a series of range list entries as
3322 described in Section \refersec{chap:noncontiguousaddressranges}.
3323 The segment size is given by the
3324 \HFNsegmentselectorsize{} field of the header, and the address size is
3325 given by the \addttindex{address\_size} field of the header. If the
3326 \HFNsegmentselectorsize{} field in the header is zero, the segment
3327 selector is omitted from the range list entries.
3329 The \DWATrangesbase{} attribute points to the first entry
3330 following the header. The entries are referenced by a byte
3331 offset relative to this base address.
3334 \section{Location List Table}
3335 \label{datarep:locationlisttable}
3336 Each set of entries in the location list table contained in the
3337 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3338 \begin{enumerate}[1. ]
3339 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3340 \addttindexx{unit\_length}
3341 A 4-byte or 12-byte length containing the length of
3342 the set of entries for this compilation unit, not
3343 including the length field itself. In the 32-bit
3344 DWARF format, this is a 4-byte unsigned integer
3345 (which must be less than \xfffffffzero); in the 64-bit
3346 DWARF format, this consists of the 4-byte value
3347 \wffffffff followed by an 8-byte unsigned integer
3348 that gives the actual length (see
3349 Section \refersec{datarep:32bitand64bitdwarfformats}).
3352 \item \texttt{version} (\HFTuhalf) \\
3353 A 2-byte version identifier containing the value
3354 \versiondotdebugloc{}
3355 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3358 \item \texttt{address\_size} (\HFTubyte) \\
3359 A 1-byte unsigned integer containing the size in
3360 bytes of an address (or the offset portion of an
3361 address for segmented addressing) on the target
3365 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3366 A 1-byte unsigned integer containing the size in
3367 bytes of a segment selector on the target system.
3370 This header is followed by a series of location list entries as
3371 described in Section \refersec{chap:locationlists}.
3372 The segment size is given by the
3373 \HFNsegmentselectorsize{} field of the header, and the address size is
3374 given by the \HFNaddresssize{} field of the header. If the
3375 \HFNsegmentselectorsize{} field in the header is zero, the segment
3376 selector is omitted from range list entries.
3378 The entries are referenced by a byte offset relative to the first
3379 location list following this header.
3382 \section{Dependencies and Constraints}
3383 \label{datarep:dependenciesandconstraints}
3384 The debugging information in this format is intended to
3385 exist in sections of an object file, or an equivalent
3386 separate file or database, having names beginning with
3387 the prefix ".debug\_" (see Appendix
3388 \refersec{app:dwarfsectionversionnumbersinformative}
3389 for a complete list of such names).
3390 Except as specifically specified, this information is not
3391 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3394 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3395 32-bit addresses, an assembler or compiler must provide a way
3396 to produce 2-byte and 4-byte quantities without alignment
3397 restrictions, and the linker must be able to relocate a
3399 \addtoindexx{section offset!alignment of}
3400 section offset that occurs at an arbitrary
3403 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3404 64-bit addresses, an assembler or compiler must provide a
3405 way to produce 2-byte, 4-byte and 8-byte quantities without
3406 alignment restrictions, and the linker must be able to relocate
3407 an 8-byte address or 4-byte
3408 \addtoindexx{section offset!alignment of}
3409 section offset that occurs at an
3410 arbitrary alignment.
3412 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3413 32-bit addresses, an assembler or compiler must provide a
3414 way to produce 2-byte, 4-byte and 8-byte quantities without
3415 alignment restrictions, and the linker must be able to relocate
3416 a 4-byte address or 8-byte
3417 \addtoindexx{section offset!alignment of}
3418 section offset that occurs at an
3419 arbitrary alignment.
3421 \textit{It is expected that this will be required only for very large
3422 32-bit programs or by those architectures which support
3423 a mix of 32-bit and 64-bit code and data within the same
3426 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3427 64-bit addresses, an assembler or compiler must provide a
3428 way to produce 2-byte, 4-byte and 8-byte quantities without
3429 alignment restrictions, and the linker must be able to
3430 relocate an 8-byte address or
3431 \addtoindexx{section offset!alignment of}
3432 section offset that occurs at
3433 an arbitrary alignment.
3437 \section{Integer Representation Names}
3438 \label{datarep:integerrepresentationnames}
3439 The sizes of the integers used in the lookup by name, lookup
3440 by address, line number, call frame information and other sections
3442 Table \ref{tab:integerrepresentationnames}.
3446 \setlength{\extrarowheight}{0.1cm}
3447 \begin{longtable}{c|l}
3448 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3449 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3451 \bfseries Representation name&\bfseries Representation\\ \hline
3453 \hline \emph{Continued on next page}
3458 \HFTsbyte& signed, 1-byte integer \\
3459 \HFTubyte&unsigned, 1-byte integer \\
3460 \HFTuhalf&unsigned, 2-byte integer \\
3461 \HFTuword&unsigned, 4-byte integer \\
3467 \section{Type Signature Computation}
3468 \label{datarep:typesignaturecomputation}
3470 A \addtoindex{type signature} is used by a DWARF consumer
3471 to resolve type references to the type definitions that
3472 are contained in \addtoindex{type unit}s (see Section
3473 \refersec{chap:typeunitentries}).
3475 \textit{A type signature is computed only by a DWARF producer;
3476 \addtoindexx{type signature!computation} a consumer need
3477 compare two type signatures to check for equality.}
3480 The type signature for a type T0 is formed from the
3481 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3482 R.L. Rivest, RFC 1321, April 1992}
3483 digest of a flattened description of the type. The flattened
3484 description of the type is a byte sequence derived from the
3485 DWARF encoding of the type as follows:
3486 \begin{enumerate}[1. ]
3488 \item Start with an empty sequence S and a list V of visited
3489 types, where V is initialized to a list containing the type
3490 T0 as its single element. Elements in V are indexed from 1,
3493 \item If the debugging information entry represents a type that
3494 is nested inside another type or a namespace, append to S
3495 the type\textquoteright s context as follows: For each surrounding type
3496 or namespace, beginning with the outermost such construct,
3497 append the letter 'C', the DWARF tag of the construct, and
3498 the name (taken from
3499 \addtoindexx{name attribute}
3500 the \DWATname{} attribute) of the type
3501 \addtoindexx{name attribute}
3502 or namespace (including its trailing null byte).
3504 \item Append to S the letter 'D', followed by the DWARF tag of
3505 the debugging information entry.
3507 \item For each of the attributes in
3508 Table \refersec{tab:attributesusedintypesignaturecomputation}
3510 the debugging information entry, in the order listed,
3511 append to S a marker letter (see below), the DWARF attribute
3512 code, and the attribute value.
3515 \caption{Attributes used in type signature computation}
3516 \label{tab:attributesusedintypesignaturecomputation}
3517 \simplerule[\textwidth]
3519 \autocols[0pt]{c}{2}{l}{
3535 \DWATcontainingtype,
3539 \DWATdatamemberlocation,
3560 \DWATrvaluereference,
3564 \DWATstringlengthbitsize,
3565 \DWATstringlengthbytesize,
3570 \DWATvariableparameter,
3573 \DWATvtableelemlocation
3576 \simplerule[\textwidth]
3579 Note that except for the initial
3580 \DWATname{} attribute,
3581 \addtoindexx{name attribute}
3582 attributes are appended in order according to the alphabetical
3583 spelling of their identifier.
3585 If an implementation defines any vendor-specific attributes,
3586 any such attributes that are essential to the definition of
3587 the type are also included at the end of the above list,
3588 in their own alphabetical suborder.
3590 An attribute that refers to another type entry T is processed
3591 as follows: (a) If T is in the list V at some V[x], use the
3592 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3593 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3594 as the marker, process the type T recursively by performing
3595 Steps 2 through 7, and use the result as the attribute value.
3598 Other attribute values use the letter 'A' as the marker, and
3599 the value consists of the form code (encoded as an unsigned
3600 LEB128 value) followed by the encoding of the value according
3601 to the form code. To ensure reproducibility of the signature,
3602 the set of forms used in the signature computation is limited
3611 \item If the tag in Step 3 is one of \DWTAGpointertype,
3612 \DWTAGreferencetype,
3613 \DWTAGrvaluereferencetype,
3614 \DWTAGptrtomembertype,
3615 or \DWTAGfriend, and the referenced
3616 type (via the \DWATtype{} or
3617 \DWATfriend{} attribute) has a
3618 \DWATname{} attribute, append to S the letter 'N', the DWARF
3619 attribute code (\DWATtype{} or
3620 \DWATfriend), the context of
3621 the type (according to the method in Step 2), the letter 'E',
3622 and the name of the type. For \DWTAGfriend, if the referenced
3623 entry is a \DWTAGsubprogram, the context is omitted and the
3624 name to be used is the ABI-specific name of the subprogram
3625 (for example, the mangled linker name).
3628 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3629 \DWTAGreferencetype,
3630 \DWTAGrvaluereferencetype,
3631 \DWTAGptrtomembertype, or
3632 \DWTAGfriend, but has
3633 a \DWATtype{} attribute, or if the referenced type (via
3635 \DWATfriend{} attribute) does not have a
3636 \DWATname{} attribute, the attribute is processed according to
3637 the method in Step 4 for an attribute that refers to another
3641 \item Visit each child C of the debugging information
3642 entry as follows: If C is a nested type entry or a member
3643 function entry, and has
3644 a \DWATname{} attribute, append to
3645 \addtoindexx{name attribute}
3646 S the letter 'S', the tag of C, and its name; otherwise,
3647 process C recursively by performing Steps 3 through 7,
3648 appending the result to S. Following the last child (or if
3649 there are no children), append a zero byte.
3654 For the purposes of this algorithm, if a debugging information
3656 \DWATspecification{}
3657 attribute that refers to
3658 another entry D (which has a
3661 then S inherits the attributes and children of D, and S is
3662 processed as if those attributes and children were present in
3663 the entry S. Exception: if a particular attribute is found in
3664 both S and D, the attribute in S is used and the corresponding
3665 one in D is ignored.
3668 DWARF tag and attribute codes are appended to the sequence
3669 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3670 using the values defined earlier in this chapter.
3672 \textit{A grammar describing this computation may be found in
3673 Appendix \refersec{app:typesignaturecomputationgrammar}.
3676 \textit{An attribute that refers to another type entry is
3677 recursively processed or replaced with the name of the
3678 referent (in Step 4, 5 or 6). If neither treatment applies to
3679 an attribute that references another type entry, the entry
3680 that contains that attribute is not suitable for a
3681 separate \addtoindex{type unit}.}
3683 \textit{If a debugging information entry contains an attribute from
3684 the list above that would require an unsupported form, that
3685 entry is not suitable for a separate
3686 \addtoindex{type unit}.}
3688 \textit{A type is suitable for a separate
3689 \addtoindex{type unit} only
3690 if all of the type entries that it contains or refers to in
3691 Steps 6 and 7 are themselves suitable for a separate
3692 \addtoindex{type unit}.}
3695 Where the DWARF producer may reasonably choose two or more
3696 different forms for a given attribute, it should choose
3697 the simplest possible form in computing the signature. (For
3698 example, a constant value should be preferred to a location
3699 expression when possible.)
3701 Once the string S has been formed from the DWARF encoding,
3702 an 16-byte \MDfive{} digest is computed for the string and the
3703 last eight bytes are taken as the type signature.
3705 \textit{The string S is intended to be a flattened representation of
3706 the type that uniquely identifies that type (that is, a different
3707 type is highly unlikely to produce the same string).}
3710 \textit{A debugging information entry is not be placed in a
3711 separate \addtoindex{type unit}
3712 if any of the following apply:}
3716 \item \textit{The entry has an attribute whose value is a location
3717 expression, and the location expression contains a reference to
3718 another debugging information entry (for example, a \DWOPcallref{}
3719 operator), as it is unlikely that the entry will remain
3720 identical across compilation units.}
3722 \item \textit{The entry has an attribute whose value refers
3723 to a code location or a \addtoindex{location list}.}
3725 \item \textit{The entry has an attribute whose value refers
3726 to another debugging information entry that does not represent
3732 \textit{Certain attributes are not included in the type signature:}
3735 \item \textit{The \DWATdeclaration{} attribute is not included because it
3736 indicates that the debugging information entry represents an
3737 incomplete declaration, and incomplete declarations should
3739 \addtoindexx{type unit}
3740 separate type units.}
3742 \item \textit{The \DWATdescription{} attribute is not included because
3743 it does not provide any information unique to the defining
3744 declaration of the type.}
3746 \item \textit{The \DWATdeclfile,
3748 \DWATdeclcolumn{} attributes are not included because they
3749 may vary from one source file to the next, and would prevent
3750 two otherwise identical type declarations from producing the
3751 same \MDfive{} digest.}
3753 \item \textit{The \DWATobjectpointer{} attribute is not included
3754 because the information it provides is not necessary for the
3755 computation of a unique type signature.}
3759 \textit{Nested types and some types referred to by a debugging
3760 information entry are encoded by name rather than by recursively
3761 encoding the type to allow for cases where a complete definition
3762 of the type might not be available in all compilation units.}
3765 \textit{If a type definition contains the definition of a member function,
3766 it cannot be moved as is into a type unit, because the member function
3767 contains attributes that are unique to that compilation unit.
3768 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3769 moving the member function declaration into a separate declaration tree,
3770 and replacing the function definition in the type with a non-defining
3771 declaration of the function (as if the function had been defined out of
3774 An example that illustrates the computation of an \MDfive{} digest may be found in
3775 Appendix \refersec{app:usingtypeunits}.
3777 \section{Name Table Hash Function}
3778 \label{datarep:nametablehashfunction}
3779 The hash function used for hashing name strings in the accelerated
3780 access name index table (see Section \refersec{chap:acceleratedaccess})
3781 is defined in \addtoindex{C} as shown in
3782 Figure \referfol{fig:nametablehashfunctiondefinition}.\footnote{
3783 This hash function is sometimes informally known as the
3784 "\addtoindex{DJB hash function}" or the "\addtoindex{Berstein hash function}"
3786 \hrefself{http://en.wikipedia.org/wiki/List\_of\_hash\_functions} or
3787 \hrefself{http://stackoverflow.com/questions/10696223/reason-for-5381-number-in-djb-hash-function)}.}
3792 unsigned long \* must be a 32-bit integer type *\
3793 hash(unsigned char *str)
3795 unsigned long hash = 5381;
3799 hash = hash * 33 + c;
3805 \caption{Name Table Hash Function Definition}
3806 \label{fig:nametablehashfunctiondefinition}