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
22 \hypertarget{chap:DWXXXlohiuser}{reserved value range}
23 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 \DWIDXlouserMARK{}\DWIDXhiuserMARK{}DW\_IDX,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{}DW\_LANG,
32 \DWLNCTlouserMARK{}\DWLNCThiuserMARK{}DW\_LNCT,
33 \DWLNElouserMARK{}\DWLNEhiuserMARK{}DW\_LNE,
34 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
36 \DWOPlouserMARK{}\DWOPhiuserMARK{}DW\_OP,
37 \DWTAGlouserMARK{}\DWTAGhiuserMARK{}DW\_TAG,
38 \DWUTlouserMARK{}\DWUThiuserMARK{}DW\_UT)
40 followed by \_lo\_user or \_hi\_user.
41 Values in the range between \textit{prefix}\_lo\_user
42 and \textit{prefix}\_hi\_user inclusive,
43 are reserved for vendor specific extensions. Vendors may
44 use values in this range without conflicting with current or
45 future system\dash defined values. All other values are reserved
46 for use by the system.
48 \textit{For example, for debugging information entry
49 tags, the special labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
51 \textit{There may also be codes for vendor specific extensions
52 between the number of standard line number opcodes and
53 the first special line number opcode. However, since the
54 number of standard opcodes varies with the DWARF version,
55 the range for extensions is also version dependent. Thus,
56 \DWLNSlouserTARG{} and
57 \DWLNShiuserTARG{} symbols are not defined.}
59 Vendor defined tags, attributes, base type encodings, location
60 atoms, language names, line number actions, calling conventions
61 and call frame instructions, conventionally use the form
62 \text{prefix\_vendor\_id\_name}, where
63 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
64 character sequence chosen so as to avoid conflicts with
67 To ensure that extensions added by one vendor may be safely
68 ignored by consumers that do not understand those extensions,
69 the following rules must be followed:
70 \begin{enumerate}[1. ]
72 \item New attributes are added in such a way that a
73 debugger may recognize the format of a new attribute value
74 without knowing the content of that attribute value.
76 \item The semantics of any new attributes do not alter
77 the semantics of previously existing attributes.
79 \item The semantics of any new tags do not conflict with
80 the semantics of previously existing tags.
82 \item New forms of attribute value are not added.
87 \section{Reserved Values}
88 \label{datarep:reservedvalues}
89 \subsection{Error Values}
90 \label{datarep:errorvalues}
91 \addtoindexx{reserved values!error}
94 \addtoindexx{error value}
95 a convenience for consumers of DWARF information, the value
96 0 is reserved in the encodings for attribute names, attribute
97 forms, base type encodings, location operations, languages,
98 line number program opcodes, macro information entries and tag
99 names to represent an error condition or unknown value. DWARF
100 does not specify names for these reserved values, because they
101 do not represent valid encodings for the given type and do
102 not appear in DWARF debugging information.
105 \subsection{Initial Length Values}
106 \label{datarep:initiallengthvalues}
107 \addtoindexx{reserved values!initial length}
109 An \livetarg{datarep:initiallengthvalues}{initial length} field
110 \addtoindexx{initial length field|see{initial length}}
111 is one of the fields that occur at the beginning
112 of those DWARF sections that have a header
120 that occurs at the beginning of the CIE and FDE structures
121 in the \dotdebugframe{} section.
124 In an \addtoindex{initial length} field, the values \wfffffffzero through
125 \wffffffff are reserved by DWARF to indicate some form of
126 extension relative to \DWARFVersionII; such values must not
127 be interpreted as a length field. The use of one such value,
128 \xffffffff, is defined in
129 Section \refersec{datarep:32bitand64bitdwarfformats});
131 the other values is reserved for possible future extensions.
134 \section{Relocatable, Split, Executable, Shared, Package and Supplementary Object Files}
135 \label{datarep:executableobjectsandsharedobjects}
137 \subsection{Relocatable Object Files}
138 \label{datarep:relocatableobjectfiles}
139 A DWARF producer (for example, a compiler) typically generates its
140 debugging information as part of a relocatable object file.
141 Relocatable object files are then combined by a linker to form an
142 executable file. During the linking process, the linker resolves
143 (binds) symbolic references between the various object files, and
144 relocates the contents of each object file into a combined virtual
147 The DWARF debugging information is placed in several sections (see
148 Appendix \refersec{app:debugsectionrelationshipsinformative}), and
149 requires an object file format capable of
150 representing these separate sections. There are symbolic references
151 between these sections, and also between the debugging information
152 sections and the other sections that contain the text and data of the
153 program itself. Many of these references require relocation, and the
154 producer must emit the relocation information appropriate to the
155 object file format and the target processor architecture. These
156 references include the following:
159 \item The compilation unit header (see Section
160 \refersec{datarep:unitheaders}) in the \dotdebuginfo{}
161 section contains a reference to the \dotdebugabbrev{} table. This
162 reference requires a relocation so that after linking, it refers to
163 that contribution to the combined \dotdebugabbrev{} section in the
166 \item Debugging information entries may have attributes with the form
167 \DWFORMaddr{} (see Section \refersec{datarep:attributeencodings}).
168 These attributes represent locations
169 within the virtual address space of the program, and require
172 \item A DWARF expression may contain a \DWOPaddr{} (see Section
173 \refersec{chap:literalencodings}) which contains a location within
174 the virtual address space of the program, and require relocation.
177 \item Debugging information entries may have attributes with the form
178 \DWFORMsecoffset{} (see Section \refersec{datarep:attributeencodings}).
179 These attributes refer to
180 debugging information in other debugging information sections within
181 the object file, and must be relocated during the linking process.
183 \item Debugging information entries may have attributes with the form
184 \DWFORMrefaddr{} (see Section \refersec{datarep:attributeencodings}).
185 These attributes refer to
186 debugging information entries that may be outside the current
187 compilation unit. These values require both symbolic binding and
190 \item Debugging information entries may have attributes with the form
191 \DWFORMstrp{} (see Section \refersec{datarep:attributeencodings}).
192 These attributes refer to strings in
193 the \dotdebugstr{} section. These values require relocation.
195 \item Entries in the \dotdebugaddr{} and \dotdebugaranges{}
196 sections may contain references to locations within the virtual address
197 space of the program, and thus require relocation.
199 \item Entries in the \dotdebugloclists{} and \dotdebugrnglists{} sections may
200 contain references to locations within the virtual address space of the
201 program depending on whether certain kinds of location or range
202 list entries are used, and thus require relocation.
204 \item In the \dotdebugline{} section, the operand of the \DWLNEsetaddress{}
205 opcode is a reference to a location within the virtual address space
206 of the program, and requires relocation.
208 \item The \dotdebugstroffsets{} section contains a list of string offsets,
209 each of which is an offset of a string in the \dotdebugstr{} section. Each
210 of these offsets requires relocation. Depending on the implementation,
211 these relocations may be implicit (that is, the producer may not need to
212 emit any explicit relocation information for these offsets).
214 \item The \HFNdebuginfooffset{} field in the \dotdebugaranges{} header and
215 the list of compilation units following the \dotdebugnames{} header contain
216 references to the \dotdebuginfo{} section. These references require relocation
217 so that after linking they refer to the correct contribution in the combined
218 \dotdebuginfo{} section in the executable file.
220 \item Frame descriptor entries in the \dotdebugframe{} section
221 (see Section \refersec{chap:structureofcallframeinformation}) contain an
222 \HFNinitiallocation{} field value within the virtual address
223 space of the program and require relocation.
228 \textit{Note that operands of classes
230 \CLASSflag{} do not require relocation. Attribute operands that use
231 forms \DWFORMstring{},
232 \DWFORMrefone, \DWFORMreftwo, \DWFORMreffour, \DWFORMrefeight, or
233 \DWFORMrefudata{} also do not need relocation.}
235 \subsection{Split DWARF Object Files}
236 \label{datarep:splitdwarfobjectfiles}
237 \addtoindexx{split DWARF object file}
238 A DWARF producer may partition the debugging
239 information such that the majority of the debugging
240 information can remain in individual object files without
241 being processed by the linker.
243 \textit{This reduces link time by reducing the amount of information
244 the linker must process.}
247 \subsubsection{First Partition (with Skeleton Unit)}
248 The first partition contains
249 debugging information that must still be processed by the linker,
250 and includes the following:
253 The line number tables, frame tables, and
254 accelerated access tables, in the usual sections:
255 \dotdebugline, \dotdebuglinestr,
256 \dotdebugframe, \dotdebugnames{} and \dotdebugaranges,
260 An address table, in the \dotdebugaddr{} section. This table
261 contains all addresses and constants that require
262 link-time relocation, and items in the table can be
263 referenced indirectly from the debugging information via
264 the \DWFORMaddrxXNand{} forms,
265 by the \DWOPaddrx{} and \DWOPconstx{} operators, and
266 by certain of the \texttt{DW\_LLE\_*} location list
267 and \texttt{DW\_RLE\_*} range list entries.
269 A skeleton compilation unit, as described in Section
270 \refersec{chap:skeletoncompilationunitentries},
271 in the \dotdebuginfo{} section.
273 An abbreviations table for the skeleton compilation unit,
274 in the \dotdebugabbrev{} section
275 used by the \dotdebuginfo{} section.
278 A string table, in the \dotdebugstr{} section. The string
279 table is necessary only if the skeleton compilation unit
281 uses one of the indirect string forms (\DWFORMstrp{},
286 A string offsets table, in the \dotdebugstroffsets{}
287 section for strings in the \dotdebugstr{} section.
288 The string offsets table is necessary only if
289 the skeleton compilation unit uses
291 one of the indexed string forms
295 The attributes contained in the skeleton compilation
296 unit can be used by a DWARF consumer to find the
297 DWARF object file that contains the second partition.
299 \subsubsection{Second Partition (Unlinked or in a \texttt{.dwo} File)}
300 The second partition contains the debugging information that
301 does not need to be processed by the linker. These sections
302 may be left in the object files and ignored by the linker
303 (that is, not combined and copied to the executable object file), or
304 they may be placed by the producer in a separate DWARF object
305 file. This partition includes the following:
308 The full compilation unit, in the \dotdebuginfodwo{} section.
310 Attributes contained in the full compilation unit
311 may refer to machine addresses indirectly using
316 forms, which access the table of addresses specified by the
317 \DWATaddrbase{} attribute in the associated skeleton unit.
318 Location descriptions may similarly do so using the \DWOPaddrx{} and
319 \DWOPconstx{} operations.
321 \item Separate type units, in the \dotdebuginfodwo{} section.
324 Abbreviations table(s) for the compilation unit and type
325 units, in the \dotdebugabbrevdwo{} section
326 used by the \dotdebuginfodwo{} section.
328 \item Location lists, in the
329 \dotdebugloclistsdwo{} section.
331 \item Range lists, in the \dotdebugrnglistsdwo{} section.
334 A \addtoindex{specialized line number table} (for the type units),
335 in the \dotdebuglinedwo{} section.
338 contains only the directory and filename lists needed to
339 interpret \DWATdeclfile{} attributes in the debugging
342 \item Macro information, in the \dotdebugmacrodwo{} section.
344 \item A string table, in the \dotdebugstrdwo{} section.
346 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
348 for the strings in the \dotdebugstrdwo{} section.
351 Except where noted otherwise, all references in this document
352 to a debugging information section (for example, \dotdebuginfo),
353 apply also to the corresponding split DWARF section (for example,
357 Split DWARF object files do not get linked with any other files,
358 therefore references between sections must not make use of
359 normal object file relocation information. As a result, symbolic
360 references within or between sections are not possible.
362 \subsection{Executable Objects}
363 \label{chap:executableobjects}
364 The relocated addresses in the debugging information for an
365 executable object are virtual addresses.
367 The sections containing the debugging information are typically
368 not loaded as part of the memory image of the program (in ELF
369 terminology, the sections are not "allocatable" and are not part
370 of a loadable segment). Therefore, the debugging information
371 sections described in this document are typically linked as if
372 they were each to be loaded at virtual address 0, and references
373 within the debugging information always implicitly indicate which
374 section a particular offset refers to. (For example, a reference
375 of form \DWFORMsecoffset{} may refer to one of several sections,
376 depending on the class allowed by a particular attribute of a
377 debugging information entry, as shown in
378 Table \refersec{tab:attributeencodings}.)
381 \subsection{Shared Object Files}
382 \label{datarep:sharedobjectfiles}
384 addresses in the debugging information for a shared object file
385 are offsets relative to the start of the lowest region of
386 memory loaded from that shared object file.
389 \textit{This requirement makes the debugging information for
390 shared object files position independent. Virtual addresses in a
391 shared object file may be calculated by adding the offset to the
392 base address at which the object file was attached. This offset
393 is available in the run\dash time linker\textquoteright s data structures.}
395 As with executable objects, the sections containing debugging
396 information are typically not loaded as part of the memory image
397 of the shared object, and are typically linked as if they were
398 each to be loaded at virtual address 0.
400 \subsection{DWARF Package Files}
401 \label{datarep:dwarfpackagefiles}
402 \textit{Using \splitDWARFobjectfile{s} allows the developer to compile,
403 link, and debug an application quickly with less link-time overhead,
404 but a more convenient format is needed for saving the debug
405 information for later debugging of a deployed application. A
406 DWARF package file can be used to collect the debugging
407 information from the object (or separate DWARF object) files
408 produced during the compilation of an application.}
410 \textit{The package file is typically placed in the same directory as the
411 application, and is given the same name with a \doublequote{\texttt{.dwp}}
412 extension.\addtoindexx{\texttt{.dwp} file extension}}
415 A DWARF package file is itself an object file, using the
416 \addtoindexx{package files}
417 \addtoindexx{DWARF package files}
418 same object file format (including \byteorder) as the
419 corresponding application binary. It consists only of a file
420 header, a section table, a number of DWARF debug information
421 sections, and two index sections.
424 Each DWARF package file contains no more than one of each of the
425 following sections, copied from a set of object or DWARF object
426 files, and combined, section by section:
433 \dotdebugstroffsetsdwo
438 The string table section in \dotdebugstrdwo{} contains all the
439 strings referenced from DWARF attributes using
443 \DWFORMstrxXNor. Any attribute in a compilation unit or a type
444 unit using this form refers to an entry in that unit's
445 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
446 provides the offset of a string in the \dotdebugstrdwo{}
449 The DWARF package file also contains two index sections that
450 provide a fast way to locate debug information by compilation
451 unit ID for compilation units, or by type
452 signature for type units:
458 \subsubsection{The Compilation Unit (CU) Index Section}
459 The \dotdebugcuindex{} section is a hashed lookup table that maps a
460 compilation unit ID to a set of contributions in the
461 various debug information sections. Each contribution is stored
462 as an offset within its corresponding section and a size.
465 Each \compunitset{} may contain contributions from the
468 \dotdebuginfodwo{} (required)
469 \dotdebugabbrevdwo{} (required)
473 \dotdebugstroffsetsdwo
477 \textit{Note that a \compunitset{} is not able to represent \dotdebugmacinfo{}
478 information from \DWARFVersionIV{} or earlier formats.}
480 \subsubsection{The Type Unit (TU) Index Section}
481 The \dotdebugtuindex{} section is a hashed lookup table that maps a
482 type signature to a set of offsets in the various debug
483 information sections. Each contribution is stored as an offset
484 within its corresponding section and a size.
486 Each \typeunitset{} may contain contributions from the following
489 \dotdebuginfodwo{} (required)
490 \dotdebugabbrevdwo{} (required)
492 \dotdebugstroffsetsdwo
495 \subsubsection{Format of the CU and TU Index Sections}
496 Both index sections have the same format, and serve to map an
497 8-byte signature to a set of contributions to the debug sections.
498 Each index section begins with a header, followed by a hash table of
499 signatures, a parallel table of indexes, a table of offsets, and
500 a table of sizes. The index sections are aligned at 8-byte
501 boundaries in the DWARF package file.
504 The index section header contains the following fields:
505 \begin{enumerate}[1. ]
506 \item \texttt{version} (\HFTuhalf) \\
508 \addtoindexx{version number!CU index information}
509 \addtoindexx{version number!TU index information}
510 This number is specific to the CU and TU index information
511 and is independent of the DWARF version number.
513 The version number is \versiondotdebugcuindex.
515 \item \textit{padding} (\HFTuhalf) \\
516 Reserved to DWARF (must be zero).
519 \item \texttt{section\_count} (\HFTuword) \\
520 The number of entries in the table of section counts that follows.
521 For brevity, the contents of this field is referred to as $N$ below.
523 \item \texttt{unit\_count} (\HFTuword) \\
524 The number of compilation units or type units in the index.
525 For brevity, the contents of this field is referred to as $U$ below.
527 \item \texttt{slot\_count} (\HFTuword) \\
528 The number of slots in the hash table.
529 For brevity, the contents of this field is referred to as $S$ below.
533 \textit{We assume that $U$ and $S$ do not exceed $2^{32}$.}
535 The size of the hash table, $S$, must be $2^k$ such that:
536 \hspace{0.3cm}$2^k\ \ >\ \ 3*U/2$
538 The hash table begins at offset 16 in the section, and consists
539 of an array of $S$ 8-byte slots. Each slot contains a 64-bit
541 % (using the \byteorder{} of the application binary).
543 The parallel table of indices begins immediately after the hash table
544 (at offset \mbox{$16 + 8 * S$} from the beginning of the section), and
545 consists of an array of $S$ 4-byte slots,
546 % (using the byte order of the application binary),
547 corresponding 1-1 with slots in the hash
548 table. Each entry in the parallel table contains a row index into
549 the tables of offsets and sizes.
551 Unused slots in the hash table have 0 in both the hash table
552 entry and the parallel table entry. While 0 is a valid hash
553 value, the row index in a used slot will always be non-zero.
555 Given an 8-byte compilation unit ID or type signature $X$,
556 an entry in the hash table is located as follows:
557 \begin{enumerate}[1. ]
558 \item Define $REP(X)$ to be the value of $X$ interpreted as an
559 unsigned 64-bit integer in the target byte order.
560 \item Calculate a primary hash $H = REP(X)\ \&\ MASK(k)$, where
561 $MASK(k)$ is a mask with the low-order $k$ bits all set to 1.
562 \item Calculate a secondary hash $H' = (((REP(X)>>32)\ \&\ MASK(k))\ |\ 1)$.
563 \item If the hash table entry at index $H$ matches the signature, use
564 that entry. If the hash table entry at index $H$ is unused (all
565 zeroes), terminate the search: the signature is not present
567 \item Let $H = (H + H')\ modulo\ S$. Repeat at Step 4.
570 Because $S > U$, and $H'$ and $S$ are relatively prime, the search is
571 guaranteed to stop at an unused slot or find the match.
574 The table of offsets begins immediately following the parallel
575 table (at offset \mbox{$16 + 12 * S$} from the beginning of the section).
576 This table consists of a single header row containing $N$ fields,
577 each a 4-byte unsigned integer, followed by $U$ data rows, each
578 also containing $N$ fields of 4-byte unsigned integers. The fields
579 in the header row provide a section identifier referring to a
580 debug section; the available section identifiers are shown in
581 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
582 Each data row corresponds to a specific CU
583 or TU in the package file. In the data rows, each field provides
584 an offset to the debug section whose identifier appears in the
585 corresponding field of the header row. The data rows are indexed
588 \textit{Not all sections listed in the table need be included.}
592 \setlength{\extrarowheight}{0.1cm}
593 \begin{longtable}{l|c|l}
594 \caption{DWARF package file section identifier \mbox{encodings}}
595 \label{tab:dwarfpackagefilesectionidentifierencodings}
596 \addtoindexx{DWARF package files!section identifier encodings} \\
597 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
599 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
601 \hline \emph{Continued on next page}
605 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
606 \textit{Reserved} & 2 & \\
607 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
608 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
609 \DWSECTLOCLISTSTARG & 5 & \dotdebugloclistsdwo \\
610 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
611 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
612 \DWSECTRNGLISTSTARG & 8 & \dotdebugrnglistsdwo \\
616 The offsets provided by the CU and TU index sections are the
617 base offsets for the contributions made by each CU or TU to the
618 corresponding section in the package file. Each CU and TU header
619 contains a \HFNdebugabbrevoffset{} field, used to find the abbreviations
620 table for that CU or TU within the contribution to the
621 \dotdebugabbrevdwo{} section for that CU or TU, and are
622 interpreted as relative to the base offset given in the index
623 section. Likewise, offsets into \dotdebuglinedwo{} from
624 \DWATstmtlist{} attributes are interpreted as relative to
625 the base offset for \dotdebuglinedwo{}, and offsets into other debug
626 sections obtained from DWARF attributes are also
627 interpreted as relative to the corresponding base offset.
629 The table of sizes begins immediately following the table of
630 offsets, and provides the sizes of the contributions made by each
631 CU or TU to the corresponding section in the package file.
632 This table consists of U data rows, each with N fields of 4-byte
633 unsigned integers. Each data row corresponds to the same CU or TU
634 as the corresponding data row in the table of offsets described
635 above. Within each data row, the N fields also correspond
636 one-to-one with the fields in the corresponding data row of the
637 table of offsets. Each field provides the size of the
638 contribution made by a CU or TU to the corresponding section in
641 For an example, see Figure \refersec{fig:examplecuindexsection}.
643 \subsection{DWARF Supplementary Object Files}
644 \label{datarep:dwarfsupplemetaryobjectfiles}
645 \textit{A supplementary object file permits a post-link utility to analyze executable and
646 shared object files and collect duplicate debugging information into a single file that
647 can be referenced by each of the original files. This is in contrast to split DWARF
648 object files, which allow the compiler to split the debugging information between
649 multiple files in order to reduce link time and executable size.}
652 A DWARF \addtoindex{supplementary object file} is itself an object file,
653 using the same object
654 file format, \byteorder{}, and size as the corresponding application executables
655 or shared libraries. It consists only of a file header, section table, and
656 a number of DWARF debug information sections. Both the
657 \addtoindex{supplementary object file}
658 and all the executable or shared object files that reference entries or strings in that
659 file must contain a \dotdebugsup{} section that establishes the relationship.
661 The \dotdebugsup{} section contains:
662 \begin{enumerate}[1. ]
663 \item \texttt{version} (\HFTuhalf) \\
664 \addttindexx{version}
665 A 2-byte unsigned integer representing the version of the DWARF
666 information for the compilation unit.
668 The value in this field is \versiondotdebugsup.
670 \item \texttt{is\_supplementary} (\HFTubyte) \\
671 \addttindexx{is\_supplementary}
672 A 1-byte unsigned integer, which contains the value 1 if it is
673 in the \addtoindex{supplementary object file} that other executable or
674 shared object files refer to, or 0 if it is an executable or shared object
675 referring to a \addtoindex{supplementary object file}.
678 \item \texttt{sup\_filename} (null terminated filename string) \\
679 \addttindexx{sup\_filename}
680 If \addttindex{is\_supplementary} is 0, this contains either an absolute
681 filename for the \addtoindex{supplementary object file}, or a filename
682 relative to the object file containing the \dotdebugsup{} section.
683 If \addttindex{is\_supplementary} is 1, then \addttindex{sup\_filename}
684 is not needed and must be an empty string (a single null byte).
687 \item \texttt{sup\_checksum\_len} (unsigned LEB128) \\
688 \addttindexx{sup\_checksum\_len}
689 Length of the following \addttindex{sup\_checksum} field;
690 this value can be 0 if no checksum is provided.
692 \item \texttt{sup\_checksum} (array of \HFTubyte) \\
693 \addttindexx{sup\_checksum}
694 An implementation-defined integer constant value that
695 provides unique identification of the supplementary file.
699 Debug information entries that refer to an executable's or shared
700 object's addresses must \emph{not} be moved to supplementary files
701 (the addesses will likely not be the same). Similarly,
702 entries referenced from within location descriptions or using loclistsptr
703 form attributes must not be moved to a \addtoindex{supplementary object file}.
705 Executable or shared object file compilation units can use
706 \DWTAGimportedunit{} with
708 an \DWATimport{} attribute that uses \DWFORMrefsupfour{} or \DWFORMrefsupeight{}
710 to import entries from the \addtoindex{supplementary object file}, other
712 \DWFORMrefsupfour{} or \DWFORMrefsupeight{}
716 directly to individual entries in the supplementary file,
718 and \DWFORMstrpsup{} form attributes to
719 refer to strings that are used by debug information of multiple
720 executables or shared object files. Within the \addtoindex{supplementary object file}'s
721 debugging sections, forms
723 \DWFORMrefsupfour{}, \DWFORMrefsupeight{}
725 or \DWFORMstrpsup{} are
726 not used, and all reference forms referring to some other sections
727 refer to the local sections in the \addtoindex{supplementary object file}.
729 In macro information, \DWMACROdefinesup{} or
730 \DWMACROundefsup{} opcodes can refer to strings in the
731 \dotdebugstr{} section of the \addtoindex{supplementary object file},
732 or \DWMACROimportsup{}
733 can refer to \dotdebugmacro{} section entries. Within the
734 \dotdebugmacro{} section of a \addtoindex{supplementary object file},
735 \DWMACROdefinestrp{} and \DWMACROundefstrp{}
736 opcodes refer to the local \dotdebugstr{} section in that
737 supplementary file, not the one in
738 the executable or shared object file.
742 \section{32-Bit and 64-Bit DWARF Formats}
743 \label{datarep:32bitand64bitdwarfformats}
744 \hypertarget{datarep:xxbitdwffmt}{}
745 \addtoindexx{32-bit DWARF format}
746 \addtoindexx{64-bit DWARF format}
747 There are two closely-related DWARF
748 formats. In the 32-bit DWARF
749 format, all values that represent lengths of DWARF sections
750 and offsets relative to the beginning of DWARF sections are
751 represented using four bytes. In the 64-bit DWARF format, all
752 values that represent lengths of DWARF sections and offsets
753 relative to the beginning of DWARF sections are represented
754 using eight bytes. A special convention applies to the initial
755 length field of certain DWARF sections, as well as the CIE and
756 FDE structures, so that the 32-bit and 64-bit DWARF formats
757 can coexist and be distinguished within a single linked object.
759 Except where noted otherwise, all references in this document
760 to a debugging information section (for example, \dotdebuginfo),
761 apply also to the corresponding split DWARF section (for example,
764 The differences between the 32- and 64-bit DWARF formats are
765 detailed in the following:
766 \begin{enumerate}[1. ]
768 \item In the 32-bit DWARF format, an
769 \addtoindex{initial length} field (see
770 \addtoindexx{initial length!encoding}
771 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
772 is an unsigned 4-byte integer (which
773 must be less than \xfffffffzero); in the 64-bit DWARF format,
774 an \addtoindex{initial length} field is 12 bytes in size,
777 \item The first four bytes have the value \xffffffff.
779 \item The following eight bytes contain the actual length
780 represented as an unsigned 8-byte integer.
783 \textit{This representation allows a DWARF consumer to dynamically
784 detect that a DWARF section contribution is using the 64-bit
785 format and to adapt its processing accordingly.}
788 \item \hypertarget{datarep:sectionoffsetlength}{}
789 Section offset and section length
790 \addtoindexx{section length!use in headers}
792 \addtoindexx{section offset!use in headers}
793 in the headers of DWARF sections (other than initial length
794 \addtoindexx{initial length}
795 fields) are listed following. In the 32-bit DWARF format these
796 are 4-byte unsigned integer values; in the 64-bit DWARF format,
797 they are 8-byte unsigned integer values.
799 \begin{nolinenumbersenv}
802 Section &Name & Role \\ \hline
803 \dotdebugaranges{} & \addttindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
804 \dotdebugframe{}/CIE & \addttindex{CIE\_id} & CIE distinguished value \\
805 \dotdebugframe{}/FDE & \addttindex{CIE\_pointer} & offset in \dotdebugframe{} \\
806 \dotdebuginfo{} & \addttindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
807 \dotdebugline{} & \addttindex{header\_length} & length of header itself \\
808 \dotdebugnames{} & entry in array of CUs & offset in \dotdebuginfo{} \\
812 \end{nolinenumbersenv}
815 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
816 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
817 union must be accessed to distinguish whether a CIE or FDE is
818 present, consequently, these two fields must exactly overlay
819 each other (both offset and size).
821 \item Within the body of the \dotdebuginfo{}
822 section, certain forms of attribute value depend on the choice
823 of DWARF format as follows. For the 32-bit DWARF format,
824 the value is a 4-byte unsigned integer; for the 64-bit DWARF
825 format, the value is an 8-byte unsigned integer.
828 \begin{nolinenumbersenv}
829 \begin{tabular}{lp{6cm}}
830 Form & Role \\ \hline
831 \DWFORMlinestrp & offset in \dotdebuglinestr \\
832 \DWFORMrefaddr & offset in \dotdebuginfo{} \\
834 \DWFORMsecoffset & offset in a section other than \\
835 & \dotdebuginfo{} or \dotdebugstr{} \\
836 \DWFORMstrp & offset in \dotdebugstr{} \\
837 \DWFORMstrpsup & offset in \dotdebugstr{} section of a \mbox{supplementary} object file \\
838 \DWOPcallref & offset in \dotdebuginfo{} \\
840 \end{nolinenumbersenv}
844 \item Within the body of the \dotdebugline{} section, certain forms of content
845 description depend on the choice of DWARF format as follows: for the
846 32-bit DWARF format, the value is a 4-byte unsigned integer; for the
847 64-bit DWARF format, the value is a 8-byte unsigned integer.
850 \begin{nolinenumbersenv}
851 \begin{tabular}{lp{6cm}}
852 Form & Role \\ \hline
853 \DWFORMlinestrp & offset in \dotdebuglinestr
855 \end{nolinenumbersenv}
858 \item Within the body of the \dotdebugnames{}
859 sections, the representation of each entry in the array of
860 compilation units (CUs) and the array of local type units
861 (TUs), which represents an offset in the
863 section, depends on the DWARF format as follows: in the
864 32-bit DWARF format, each entry is a 4-byte unsigned integer;
865 in the 64-bit DWARF format, it is a 8-byte unsigned integer.
868 \item In the body of the \dotdebugstroffsets{}
869 sections, the size of entries in the body depend on the DWARF
870 format as follows: in the 32-bit DWARF format, entries are 4-byte
871 unsigned integer values; in the 64-bit DWARF format, they are
872 8-byte unsigned integers.
874 %\bbpareb-delete bullet 7
876 \item In the body of the \dotdebugloclists{} and \dotdebugrnglists{}
877 sections, the offsets the follow the header depend on the
878 DWARF format as follows: in the 32-bit DWARF format, offsets are 4-byte
879 unsigned integer values; in the 64-bit DWARF format, they are
880 8-byte unsigned integers.
885 The 32-bit and 64-bit DWARF format conventions must \emph{not} be
886 intermixed within a single compilation unit.
888 \textit{Attribute values and section header fields that represent
889 addresses in the target program are not affected by these
893 A DWARF consumer that supports the 64-bit DWARF format must
894 support executables in which some compilation units use the
895 32-bit format and others use the 64-bit format provided that
896 the combination links correctly (that is, provided that there
897 are no link\dash time errors due to truncation or overflow). (An
898 implementation is not required to guarantee detection and
899 reporting of all such errors.)
901 \textit{It is expected that DWARF producing compilers will \emph{not} use
902 the 64-bit format \emph{by default}. In most cases, the division of
903 even very large applications into a number of executable and
904 shared object files will suffice to assure that the DWARF sections
905 within each individual linked object are less than 4 GBytes
906 in size. However, for those cases where needed, the 64-bit
907 format allows the unusual case to be handled as well. Even
908 in this case, it is expected that only application supplied
909 objects will need to be compiled using the 64-bit format;
910 separate 32-bit format versions of system supplied shared
911 executable libraries can still be used.}
914 \section{Format of Debugging Information}
915 \label{datarep:formatofdebugginginformation}
917 For each compilation unit compiled with a DWARF producer,
918 a contribution is made to the \dotdebuginfo{} section of
919 the object file. Each such contribution consists of a
920 compilation unit header
921 (see Section \refersec{datarep:compilationunitheader})
923 single \DWTAGcompileunit{} or
924 \DWTAGpartialunit{} debugging
925 information entry, together with its children.
927 For each type defined in a compilation unit, a separate
928 contribution may also be made to the
930 section of the object file. Each
931 such contribution consists of a
932 \addtoindex{type unit} header
933 (see Section \refersec{datarep:typeunitheaders})
934 followed by a \DWTAGtypeunit{} entry, together with
937 Each debugging information entry begins with a code that
938 represents an entry in a separate
939 \addtoindex{abbreviations table}. This
940 code is followed directly by a series of attribute values.
942 The appropriate entry in the
943 \addtoindex{abbreviations table} guides the
944 interpretation of the information contained directly in the
945 \dotdebuginfo{} section.
947 Multiple debugging information entries may share the same
948 abbreviation table entry. Each compilation unit is associated
949 with a particular abbreviation table, but multiple compilation
950 units may share the same table.
953 \subsection{Unit Headers}
954 \label{datarep:unitheaders}
955 Unit headers contain a field, \addttindex{unit\_type}, whose value indicates the kind of
958 (see Section \ref{chap:unitentries})
960 that follows. The encodings for the unit type
961 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
965 \setlength{\extrarowheight}{0.1cm}
966 \begin{longtable}{l|c}
967 \caption{Unit header unit type encodings}
968 \label{tab:unitheaderunitkindencodings}
969 \addtoindexx{unit header unit type encodings} \\
970 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
972 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
974 \hline \emph{Continued on next page}
976 \hline \ddag\ \textit{New in DWARF Version 5}
978 \DWUTcompileTARG~\ddag &0x01 \\
979 \DWUTtypeTARG~\ddag &0x02 \\
980 \DWUTpartialTARG~\ddag &0x03 \\
981 \DWUTskeletonTARG~\ddag &0x04 \\
982 \DWUTsplitcompileTARG~\ddag &0x05 \\
983 \DWUTsplittypeTARG~\ddag &0x06 \\
984 \DWUTlouserTARG~\ddag &0x80 \\
985 \DWUThiuserTARG~\ddag &\xff \\
991 All unit headers have the same initial three fields: \HFNinitiallength, \HFNversion{} and \HFNunittype.
996 \subsubsection{Full and Partial Compilation Unit Headers}
998 \label{datarep:compilationunitheader}
999 \begin{enumerate}[1. ]
1001 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1002 \addttindexx{unit\_length}
1004 \addtoindexx{initial length}
1005 unsigned integer representing the length
1006 of the \dotdebuginfo{} contribution for that compilation unit,
1007 not including the length field itself. In the \thirtytwobitdwarfformat,
1008 this is a 4-byte unsigned integer (which must be less
1009 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1010 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1011 integer that gives the actual length
1012 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1014 \item \texttt{version} (\HFTuhalf) \\
1015 \addttindexx{version}
1016 \addtoindexx{version number!compilation unit}
1017 A 2-byte unsigned integer representing the version of the
1018 DWARF information for the compilation unit.
1020 The value in this field is \versiondotdebuginfo.
1022 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1023 for a summary of all version numbers that apply to DWARF sections.}
1026 \item \texttt{unit\_type} (\HFTubyte) \\
1027 \addttindexx{unit\_type}
1028 A 1-byte unsigned integer identifying this unit as a compilation unit.
1029 The value of this field is
1030 \DWUTcompile{} for a
1032 (non-split) full compilation unit or
1033 \DWUTpartial{} for a (non-split) partial compilation unit
1035 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
1039 Section \ref{datarep:skeletonandfullcompilationunitheaders}
1040 regarding a split full compilation unit.
1043 \textit{This field is new in \DWARFVersionV.}
1046 \item \texttt{address\_size} (\HFTubyte) \\
1047 \addttindexx{address\_size}
1048 A 1-byte unsigned integer representing the size in bytes of
1049 an address on the target architecture. If the system uses
1050 \addtoindexx{address space!segmented}
1051 segmented addressing, this value represents the size of the
1052 offset portion of an address.
1054 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1056 \addtoindexx{section offset!in .debug\_info header}
1057 4-byte or 8-byte unsigned offset into the
1059 section. This offset associates the compilation unit with a
1060 particular set of debugging information entry abbreviations. In
1061 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1062 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1063 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1069 \subsubsection{Skeleton and Split Compilation Unit Headers}
1070 \label{datarep:skeletonandfullcompilationunitheaders}
1071 \begin{enumerate}[1. ]
1073 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1074 \addttindexx{unit\_length}
1076 \addtoindexx{initial length}
1077 unsigned integer representing the length
1078 of the \dotdebuginfo{}
1079 contribution for that compilation unit,
1080 not including the length field itself. In the \thirtytwobitdwarfformat,
1081 this is a 4-byte unsigned integer (which must be less
1082 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
1083 of the 4-byte value \wffffffff followed by an 8-byte unsigned
1084 integer that gives the actual length
1085 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1087 \item \texttt{version} (\HFTuhalf) \\
1088 \addttindexx{version}
1089 \addtoindexx{version number!compilation unit}
1090 A 2-byte unsigned integer representing the version of the
1091 DWARF information for the compilation unit.
1093 The value in this field is \versiondotdebuginfo.
1095 \textit{See also Appendix \refersec{app:dwarfsectionversionnumbersinformative}
1096 for a summary of all version numbers that apply to DWARF sections.}
1099 \item \texttt{unit\_type} (\HFTubyte) \\
1100 \addttindexx{unit\_type}
1101 A 1-byte unsigned integer identifying this unit as a compilation unit.
1102 The value of this field is
1103 \DWUTskeleton{} for a skeleton compilation unit or
1104 \DWUTsplitcompile{} for a split
1109 (see Section \refersec{chap:skeletoncompilationunitentries}).
1113 is no split analog to the partial compilation unit.
1116 \textit{This field is new in \DWARFVersionV.}
1119 \item \texttt{address\_size} (\HFTubyte) \\
1120 \addttindexx{address\_size}
1121 A 1-byte unsigned integer representing the size in bytes of
1122 an address on the target architecture. If the system uses
1123 \addtoindexx{address space!segmented}
1124 segmented addressing, this value represents the size of the
1125 offset portion of an address.
1127 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1129 \addtoindexx{section offset!in .debug\_info header}
1130 4-byte or 8-byte unsigned offset into the
1132 section. This offset associates the compilation unit with a
1133 particular set of debugging information entry abbreviations. In
1134 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1135 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1136 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1139 \item \HFNdwoid{} (unit ID) \\
1140 An 8-byte implementation-defined integer constant value,
1141 known as the compilation unit ID, that provides
1142 unique identification of a skeleton compilation
1143 unit and its associated split compilation unit in
1144 the object file named in the \DWATdwoname{} attribute
1145 of the skeleton compilation.
1151 \subsubsection{Type Unit Headers}
1152 \label{datarep:typeunitheaders}
1153 The header for the series of debugging information entries
1154 contributing to the description of a type that has been
1155 placed in its own \addtoindex{type unit}, within the
1156 \dotdebuginfo{} section,
1157 consists of the following information:
1158 \begin{enumerate}[1. ]
1159 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
1160 \addttindexx{unit\_length}
1161 A 4-byte or 12-byte unsigned integer
1162 \addtoindexx{initial length}
1163 representing the length
1164 of the \dotdebuginfo{} contribution for that type unit,
1165 not including the length field itself. In the \thirtytwobitdwarfformat,
1166 this is a 4-byte unsigned integer (which must be
1167 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
1168 consists of the 4-byte value \wffffffff followed by an
1169 8-byte unsigned integer that gives the actual length
1170 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1173 \item \texttt{version} (\HFTuhalf) \\
1174 \addttindexx{version}
1175 \addtoindexx{version number!type unit}
1176 A 2-byte unsigned integer representing the version of the
1177 DWARF information for the type unit.
1179 The value in this field is \versiondotdebuginfo.
1181 \item \texttt{unit\_type} (\HFTubyte) \\
1182 \addttindexx{unit\_type}
1183 A 1-byte unsigned integer identifying this unit as a type unit.
1184 The value of this field is \DWUTtype{} for a non-split type unit
1185 (see Section \refersec{chap:typeunitentries})
1186 or \DWUTsplittype{} for a split type unit.
1188 \textit{This field is new in \DWARFVersionV.}
1191 \item \texttt{address\_size} (\HFTubyte) \\
1192 \addttindexx{address\_size}
1193 A 1-byte unsigned integer representing the size
1194 \addtoindexx{size of an address}
1196 an address on the target architecture. If the system uses
1197 \addtoindexx{address space!segmented}
1198 segmented addressing, this value represents the size of the
1199 offset portion of an address.
1202 \item \HFNdebugabbrevoffset{} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1204 \addtoindexx{section offset!in .debug\_info header}
1205 4-byte or 8-byte unsigned offset into the
1207 section. This offset associates the type unit with a
1208 particular set of debugging information entry abbreviations. In
1209 the \thirtytwobitdwarfformat, this is a 4-byte unsigned length;
1210 in the \sixtyfourbitdwarfformat, this is an 8-byte unsigned length
1211 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1213 \item \texttt{type\_signature} (8-byte unsigned integer) \\
1214 \addttindexx{type\_signature}
1215 \addtoindexx{type signature}
1216 A unique 8-byte signature (see Section
1217 \refersec{datarep:typesignaturecomputation})
1218 of the type described in this type
1221 \textit{An attribute that refers (using
1222 \DWFORMrefsigeight{}) to
1223 the primary type contained in this
1224 \addtoindex{type unit} uses this value.}
1227 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
1228 \addttindexx{type\_offset}
1229 A 4-byte or 8-byte unsigned offset
1230 \addtoindexx{section offset!in .debug\_info header}
1231 relative to the beginning
1232 of the \addtoindex{type unit} header.
1233 This offset refers to the debugging
1234 information entry that describes the type. Because the type
1235 may be nested inside a namespace or other structures, and may
1236 contain references to other types that have not been placed in
1237 separate type units, it is not necessarily either the first or
1238 the only entry in the type unit. In the \thirtytwobitdwarfformat,
1239 this is a 4-byte unsigned length; in the \sixtyfourbitdwarfformat,
1240 this is an 8-byte unsigned length
1241 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1245 \subsection{Debugging Information Entry}
1246 \label{datarep:debugginginformationentry}
1248 Each debugging information entry begins with an
1249 unsigned LEB128\addtoindexx{LEB128!unsigned}
1250 number containing the abbreviation code for the entry. This
1251 code represents an entry within the abbreviations table
1252 associated with the compilation unit containing this entry. The
1253 abbreviation code is followed by a series of attribute values.
1255 On some architectures, there are alignment constraints on
1256 section boundaries. To make it easier to pad debugging
1257 information sections to satisfy such constraints, the
1258 abbreviation code 0 is reserved. Debugging information entries
1259 consisting of only the abbreviation code 0 are considered
1262 \subsection{Abbreviations Tables}
1263 \label{datarep:abbreviationstables}
1264 The abbreviations tables for all compilation units
1265 are contained in a separate object file section called
1267 As mentioned before, multiple compilation
1268 units may share the same abbreviations table.
1270 The abbreviations table for a single compilation unit consists
1271 of a series of abbreviation declarations. Each declaration
1272 specifies the tag and attributes for a particular form of
1273 debugging information entry. Each declaration begins with
1274 an unsigned LEB128\addtoindexx{LEB128!unsigned}
1275 number representing the abbreviation
1276 code itself. It is this code that appears at the beginning
1277 of a debugging information entry in the
1279 section. As described above, the abbreviation
1280 code 0 is reserved for null debugging information entries. The
1281 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
1282 number that encodes the entry\textquoteright s tag. The encodings for the
1283 tag names are given in
1284 Table \refersec{tab:tagencodings}.
1288 \setlength{\extrarowheight}{0.1cm}
1289 \begin{longtable}{l|c}
1290 \caption{Tag encodings} \label{tab:tagencodings} \\
1291 \hline \bfseries Tag name&\bfseries Value\\ \hline
1293 \bfseries Tag name&\bfseries Value \\ \hline
1295 \hline \emph{Continued on next page}
1297 \hline \ddag\ \textit{New in DWARF Version 5}
1299 \DWTAGarraytype{} &0x01 \\
1300 \DWTAGclasstype&0x02 \\
1301 \DWTAGentrypoint&0x03 \\
1302 \DWTAGenumerationtype&0x04 \\
1303 \DWTAGformalparameter&0x05 \\
1304 \bbeb\textit{Reserved}&0x06 \\
1305 \bbeb\textit{Reserved}&0x07 \\
1306 \DWTAGimporteddeclaration&0x08 \\
1307 \bbeb\textit{Reserved}&0x09 \\
1309 \DWTAGlexicalblock&0x0b \\
1310 \bbeb\textit{Reserved}&0x0c \\
1311 \DWTAGmember&0x0d \\
1312 \bbeb\textit{Reserved}&0x0e \\
1313 \DWTAGpointertype&0x0f \\
1314 \DWTAGreferencetype&0x10 \\
1315 \DWTAGcompileunit&0x11 \\
1316 \DWTAGstringtype&0x12 \\
1317 \DWTAGstructuretype&0x13 \\
1318 \bbeb\textit{Reserved}&0x14 \\
1319 \DWTAGsubroutinetype&0x15 \\
1320 \DWTAGtypedef&0x16 \\
1321 \DWTAGuniontype&0x17 \\
1322 \DWTAGunspecifiedparameters&0x18 \\
1323 \DWTAGvariant&0x19 \\
1324 \DWTAGcommonblock&0x1a \\
1325 \DWTAGcommoninclusion&0x1b \\
1326 \DWTAGinheritance&0x1c \\
1327 \DWTAGinlinedsubroutine&0x1d \\
1328 \DWTAGmodule&0x1e \\
1329 \DWTAGptrtomembertype&0x1f \\
1330 \DWTAGsettype&0x20 \\
1331 \DWTAGsubrangetype&0x21 \\
1332 \DWTAGwithstmt&0x22 \\
1333 \DWTAGaccessdeclaration&0x23 \\
1334 \DWTAGbasetype&0x24 \\
1335 \DWTAGcatchblock&0x25 \\
1336 \DWTAGconsttype&0x26 \\
1337 \DWTAGconstant&0x27 \\
1338 \DWTAGenumerator&0x28 \\
1339 \DWTAGfiletype&0x29 \\
1340 \DWTAGfriend&0x2a \\
1341 \DWTAGnamelist&0x2b \\
1342 \DWTAGnamelistitem&0x2c \\
1343 \DWTAGpackedtype&0x2d \\
1344 \DWTAGsubprogram&0x2e \\
1345 \DWTAGtemplatetypeparameter&0x2f \\
1346 \DWTAGtemplatevalueparameter&0x30 \\
1347 \DWTAGthrowntype&0x31 \\
1348 \DWTAGtryblock&0x32 \\
1349 \DWTAGvariantpart&0x33 \\
1350 \DWTAGvariable&0x34 \\
1351 \DWTAGvolatiletype&0x35 \\
1352 \DWTAGdwarfprocedure&0x36 \\
1353 \DWTAGrestricttype&0x37 \\
1354 \DWTAGinterfacetype&0x38 \\
1355 \DWTAGnamespace&0x39 \\
1356 \DWTAGimportedmodule&0x3a \\
1357 \DWTAGunspecifiedtype&0x3b \\
1358 \DWTAGpartialunit&0x3c \\
1359 \DWTAGimportedunit&0x3d \\
1360 \textit{Reserved}&0x3e\footnote{Code 0x3e is reserved to allow backward compatible support of the
1361 DW\_TAG\_mutable\_type DIE that was defined (only) in \DWARFVersionIII.}
1363 \DWTAGcondition&\xiiif \\
1364 \DWTAGsharedtype&0x40 \\
1365 \DWTAGtypeunit & 0x41 \\
1366 \DWTAGrvaluereferencetype & 0x42 \\
1367 \DWTAGtemplatealias & 0x43 \\
1368 \DWTAGcoarraytype~\ddag & 0x44 \\
1369 \DWTAGgenericsubrange~\ddag & 0x45 \\
1370 \DWTAGdynamictype~\ddag & 0x46 \\
1371 \DWTAGatomictype~\ddag & 0x47 \\
1372 \DWTAGcallsite~\ddag & 0x48 \\
1373 \DWTAGcallsiteparameter~\ddag & 0x49 \\
1374 \DWTAGskeletonunit~\ddag & 0x4a \\
1375 \DWTAGimmutabletype~\ddag & 0x4b \\
1376 \DWTAGlouser&0x4080 \\
1377 \DWTAGhiuser&\xffff \\
1382 Following the tag encoding is a 1-byte value that determines
1383 whether a debugging information entry using this abbreviation
1384 has child entries or not. If the value is
1386 the next physically succeeding entry of any debugging
1387 information entry using this abbreviation is the first
1388 child of that entry. If the 1-byte value following the
1389 abbreviation\textquoteright s tag encoding is
1390 \DWCHILDRENnoTARG, the next
1391 physically succeeding entry of any debugging information entry
1392 using this abbreviation is a sibling of that entry. (Either
1393 the first child or sibling entries may be null entries). The
1394 encodings for the child determination byte are given in
1395 Table \refersec{tab:childdeterminationencodings}
1397 Section \refersec{chap:relationshipofdebugginginformationentries},
1398 each chain of sibling entries is terminated by a null entry.)
1402 \setlength{\extrarowheight}{0.1cm}
1403 \begin{longtable}{l|c}
1404 \caption{Child determination encodings}
1405 \label{tab:childdeterminationencodings}
1406 \addtoindexx{Child determination encodings} \\
1407 \hline \bfseries Children determination name&\bfseries Value \\ \hline
1409 \bfseries Children determination name&\bfseries Value \\ \hline
1411 \hline \emph{Continued on next page}
1415 \DWCHILDRENno&0x00 \\
1416 \DWCHILDRENyes&0x01 \\ \hline
1421 Finally, the child encoding is followed by a series of
1422 attribute specifications. Each attribute specification
1423 consists of two parts. The first part is an
1424 unsigned LEB128\addtoindexx{LEB128!unsigned}
1425 number representing the attribute\textquoteright s name.
1426 The second part is an
1427 unsigned LEB128\addtoindexx{LEB128!unsigned}
1428 number representing the attribute\textquoteright s form.
1429 The series of attribute specifications ends with an
1430 entry containing 0 for the name and 0 for the form.
1434 \DWFORMindirectTARG{} is a special case. For
1435 attributes with this form, the attribute value itself in the
1437 section begins with an unsigned
1438 LEB128 number that represents its form. This allows producers
1439 to choose forms for particular attributes
1440 \addtoindexx{abbreviations table!dynamic forms in}
1442 without having to add a new entry to the abbreviations table.
1444 The attribute form \DWFORMimplicitconstTARG{} is another special case.
1445 For attributes with this form, the attribute specification contains
1446 a third part, which is a signed LEB128\addtoindexx{LEB128!signed}
1447 number. The value of this number is used as the value of the
1448 attribute, and no value is stored in the \dotdebuginfo{} section.
1450 The abbreviations for a given compilation unit end with an
1451 entry consisting of a 0 byte for the abbreviation code.
1454 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1455 for a depiction of the organization of the
1456 debugging information.}
1459 \subsection{Attribute Encodings}
1460 \label{datarep:attributeencodings}
1462 The encodings for the attribute names are given in
1463 Table \referfol{tab:attributeencodings}.
1466 \setlength{\extrarowheight}{0.1cm}
1467 \begin{longtable}{l|c|l}
1468 \caption{Attribute encodings}
1469 \label{tab:attributeencodings}
1470 \addtoindexx{attribute encodings} \\
1471 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1473 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1475 \hline \emph{Continued on next page}
1477 \hline \ddag\ \textit{New in DWARF Version 5}
1479 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1480 \addtoindexx{sibling attribute} \\
1481 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1483 \addtoindexx{location attribute} \\
1484 \DWATname&0x03&\livelink{chap:classstring}{string}
1485 \addtoindexx{name attribute} \\
1486 \bbeb\textit{Reserved}&0x04&\textit{not applicable} \\
1487 \bbeb\textit{Reserved}&0x05&\textit{not applicable} \\
1488 \bbeb\textit{Reserved}&0x06&\textit{not applicable} \\
1489 \bbeb\textit{Reserved}&0x07&\textit{not applicable} \\
1490 \bbeb\textit{Reserved}&0x08&\textit{not applicable} \\
1491 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1492 \addtoindexx{ordering attribute} \\
1493 \bbeb\textit{Reserved}&0x0a&\textit{not applicable} \\
1494 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1495 \livelink{chap:classexprloc}{exprloc},
1496 \livelink{chap:classreference}{reference}
1497 \addtoindexx{byte size attribute} \\
1498 \textit{Reserved}&0x0c\footnote{Code 0x0c is reserved to allow backward compatible support of the
1499 DW\_AT\_bit\_offset \mbox{attribute} which was
1500 defined in \DWARFVersionIII{} and earlier.}
1501 &\livelink{chap:classconstant}{constant},
1502 \livelink{chap:classexprloc}{exprloc},
1503 \livelink{chap:classreference}{reference}
1504 \addtoindexx{bit offset attribute (Version 3)}
1505 \addtoindexx{DW\_AT\_bit\_offset (deprecated)} \\
1506 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1507 \livelink{chap:classexprloc}{exprloc},
1508 \livelink{chap:classreference}{reference}
1509 \addtoindexx{bit size attribute} \\
1510 \bbeb\textit{Reserved}&0x0e&\textit{not applicable} \\
1511 \bbeb\textit{Reserved}&0x0f&\textit{not applicable} \\
1512 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1513 \addtoindexx{statement list attribute} \\
1514 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1515 \addtoindexx{low PC attribute} \\
1516 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1517 \livelink{chap:classconstant}{constant}
1518 \addtoindexx{high PC attribute} \\
1519 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1520 \addtoindexx{language attribute} \\
1521 \bbeb\textit{Reserved}&0x14&\textit{not applicable} \\
1522 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1523 \addtoindexx{discriminant attribute} \\
1524 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1525 \addtoindexx{discriminant value attribute} \\
1526 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1527 \addtoindexx{visibility attribute} \\
1528 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1529 \addtoindexx{import attribute} \\
1530 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1532 \bbeb \CLASSreference
1533 \addtoindexx{string length attribute} \\
1534 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1535 \addtoindexx{common reference attribute} \\
1536 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1537 \addtoindexx{compilation directory attribute} \\
1538 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1539 \livelink{chap:classconstant}{constant},
1540 \livelink{chap:classstring}{string}
1541 \addtoindexx{constant value attribute} \\
1542 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1543 \addtoindexx{containing type attribute} \\
1544 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1545 \livelink{chap:classreference}{reference},
1546 \livelink{chap:classflag}{flag}
1547 \addtoindexx{default value attribute} \\
1548 \bbeb\textit{Reserved}&0x1f&\textit{not applicable} \\
1549 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1550 \addtoindexx{inline attribute} \\
1551 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1552 \addtoindexx{is optional attribute} \\
1553 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1554 \livelink{chap:classexprloc}{exprloc},
1555 \livelink{chap:classreference}{reference}
1556 \addtoindexx{lower bound attribute} \\
1557 \bbeb\textit{Reserved}&0x23&\textit{not applicable} \\
1558 \bbeb\textit{Reserved}&0x24&\textit{not applicable} \\
1559 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1560 \addtoindexx{producer attribute} \\
1561 \bbeb\textit{Reserved}&0x26&\textit{not applicable} \\
1562 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1563 \addtoindexx{prototyped attribute} \\
1564 \bbeb\textit{Reserved}&0x28&\textit{not applicable} \\
1565 \bbeb\textit{Reserved}&0x29&\textit{not applicable} \\
1566 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1568 \addtoindexx{return address attribute} \\
1569 \bbeb\textit{Reserved}&0x2b&\textit{not applicable} \\
1570 \DWATstartscope&0x2c&
1571 \livelink{chap:classconstant}{constant},
1573 \addtoindexx{start scope attribute} \\
1574 \bbeb\textit{Reserved}&0x2d&\textit{not applicable} \\
1575 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1576 \livelink{chap:classexprloc}{exprloc},
1577 \livelink{chap:classreference}{reference}
1578 \addtoindexx{bit stride attribute} \\
1579 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1580 \livelink{chap:classexprloc}{exprloc},
1581 \livelink{chap:classreference}{reference}
1582 \addtoindexx{upper bound attribute} \\
1583 \bbeb\textit{Reserved}&0x30&\textit{not applicable} \\
1584 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1585 \addtoindexx{abstract origin attribute} \\
1586 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1587 \addtoindexx{accessibility attribute} \\
1588 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1589 \addtoindexx{address class attribute} \\
1590 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1591 \addtoindexx{artificial attribute} \\
1592 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1593 \addtoindexx{base types attribute} \\
1594 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1595 \addtoindexx{calling convention attribute} \\
1596 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1597 \livelink{chap:classexprloc}{exprloc},
1598 \livelink{chap:classreference}{reference}
1599 \addtoindexx{count attribute} \\
1600 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1601 \livelink{chap:classexprloc}{exprloc},
1603 \addtoindexx{data member attribute} \\
1604 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1605 \addtoindexx{declaration column attribute} \\
1606 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1607 \addtoindexx{declaration file attribute} \\
1608 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1609 \addtoindexx{declaration line attribute} \\
1610 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1611 \addtoindexx{declaration attribute} \\
1612 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1613 \addtoindexx{discriminant list attribute} \\
1614 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1615 \addtoindexx{encoding attribute} \\
1616 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1617 \addtoindexx{external attribute} \\
1618 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1620 \addtoindexx{frame base attribute} \\
1621 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1622 \addtoindexx{friend attribute} \\
1623 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1624 \addtoindexx{identifier case attribute} \\
1625 \textit{Reserved}&0x43\footnote{Code 0x43 is reserved to allow backward compatible support of the
1626 DW\_AT\_macro\_info \mbox{attribute} which was
1627 defined in \DWARFVersionIV{} and earlier.}
1628 &\livelink{chap:classmacptr}{macptr}
1629 \addtoindexx{macro information attribute (legacy)!encoding} \\
1630 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1631 \addtoindexx{name list item attribute} \\
1632 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1633 \addtoindexx{priority attribute} \\
1634 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1636 \addtoindexx{segment attribute} \\
1637 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1638 \addtoindexx{specification attribute} \\
1639 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1641 \addtoindexx{static link attribute} \\
1642 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1643 \addtoindexx{type attribute} \\
1644 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1646 \addtoindexx{location list attribute} \\
1647 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1648 \addtoindexx{variable parameter attribute} \\
1649 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1650 \addtoindexx{virtuality attribute} \\
1651 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1653 \addtoindexx{vtable element location attribute} \\
1654 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1655 \livelink{chap:classexprloc}{exprloc},
1656 \livelink{chap:classreference}{reference}
1657 \addtoindexx{allocated attribute} \\
1658 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1659 \livelink{chap:classexprloc}{exprloc},
1660 \livelink{chap:classreference}{reference}
1661 \addtoindexx{associated attribute} \\
1662 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1663 \addtoindexx{data location attribute} \\
1664 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1665 \livelink{chap:classexprloc}{exprloc},
1666 \livelink{chap:classreference}{reference}
1667 \addtoindexx{byte stride attribute} \\
1668 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1669 \livelink{chap:classconstant}{constant}
1670 \addtoindexx{entry PC attribute} \\
1671 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1672 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} \\
1673 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1674 \addtoindexx{extension attribute} \\
1677 \addtoindexx{ranges attribute} \\
1678 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1679 \livelink{chap:classflag}{flag},
1680 \livelink{chap:classreference}{reference},
1681 \livelink{chap:classstring}{string}
1682 \addtoindexx{trampoline attribute} \\
1683 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1684 \addtoindexx{call column attribute} \\
1685 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1686 \addtoindexx{call file attribute} \\
1687 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1688 \addtoindexx{call line attribute} \\
1689 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1690 \addtoindexx{description attribute} \\
1691 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1692 \addtoindexx{binary scale attribute} \\
1693 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1694 \addtoindexx{decimal scale attribute} \\
1695 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1696 \addtoindexx{small attribute} \\
1697 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1698 \addtoindexx{decimal scale attribute} \\
1699 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1700 \addtoindexx{digit count attribute} \\
1701 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1702 \addtoindexx{picture string attribute} \\
1703 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1704 \addtoindexx{mutable attribute} \\
1705 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1706 \addtoindexx{thread scaled attribute} \\
1707 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1708 \addtoindexx{explicit attribute} \\
1709 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1710 \addtoindexx{object pointer attribute} \\
1711 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1712 \addtoindexx{endianity attribute} \\
1713 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1714 \addtoindexx{elemental attribute} \\
1715 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1716 \addtoindexx{pure attribute} \\
1717 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1718 \addtoindexx{recursive attribute} \\
1719 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1720 \addtoindexx{signature attribute} \\
1721 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1722 \addtoindexx{main subprogram attribute} \\
1723 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1724 \addtoindexx{data bit offset attribute} \\
1725 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1726 \addtoindexx{constant expression attribute} \\
1727 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1728 \addtoindexx{enumeration class attribute} \\
1729 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1730 \addtoindexx{linkage name attribute} \\
1731 \DWATstringlengthbitsize{}~\ddag&0x6f&
1732 \livelink{chap:classconstant}{constant}
1733 \addtoindexx{string length attribute!size of length} \\
1734 \DWATstringlengthbytesize{}~\ddag&0x70&
1735 \livelink{chap:classconstant}{constant}
1736 \addtoindexx{string length attribute!size of length} \\
1737 \DWATrank~\ddag&0x71&
1738 \livelink{chap:classconstant}{constant},
1739 \livelink{chap:classexprloc}{exprloc}
1740 \addtoindexx{rank attribute} \\
1741 \DWATstroffsetsbase~\ddag&0x72&
1742 \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class}
1743 \addtoindexx{string offsets base!encoding} \\
1744 \DWATaddrbase~\ddag &0x73&
1745 \livelinki{chap:classaddrptr}{addrptr}{addrptr class}
1746 \addtoindexx{address table base!encoding} \\
1747 \DWATrnglistsbase~\ddag&0x74&
1749 \addtoindexx{range list base!encoding} \\
1750 \textit{Reserved} &0x75& \textit{Unused} \\
1751 \DWATdwoname~\ddag &0x76&
1752 \livelink{chap:classstring}{string}
1753 \addtoindexx{split DWARF object file name!encoding} \\
1754 \DWATreference~\ddag &0x77&
1755 \livelink{chap:classflag}{flag} \\
1756 \DWATrvaluereference~\ddag &0x78&
1757 \livelink{chap:classflag}{flag} \\
1758 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1759 \addtoindexx{macro information attribute} \\
1760 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1761 \addtoindexx{all calls summary attribute} \\
1762 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1763 \addtoindexx{all source calls summary attribute} \\
1764 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1765 \addtoindexx{all tail calls summary attribute} \\
1766 \DWATcallreturnpc~\ddag &0x7d &\CLASSaddress
1767 \addtoindexx{call return PC attribute} \\
1768 \DWATcallvalue~\ddag &0x7e &\CLASSexprloc
1769 \addtoindexx{call value attribute} \\
1770 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1771 \addtoindexx{call origin attribute} \\
1772 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1773 \addtoindexx{call parameter attribute} \\
1774 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1775 \addtoindexx{call PC attribute} \\
1776 \DWATcalltailcall~\ddag &0x82 &\CLASSflag
1777 \addtoindexx{call tail call attribute} \\
1778 \DWATcalltarget~\ddag &0x83 &\CLASSexprloc
1779 \addtoindexx{call target attribute} \\
1780 \DWATcalltargetclobbered~\ddag &0x84 &\CLASSexprloc
1781 \addtoindexx{call target clobbered attribute} \\
1782 \DWATcalldatalocation~\ddag &0x85 &\CLASSexprloc
1783 \addtoindexx{call data location attribute} \\
1784 \DWATcalldatavalue~\ddag &0x86 &\CLASSexprloc
1785 \addtoindexx{call data value attribute} \\
1786 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1787 \addtoindexx{noreturn attribute} \\
1788 \DWATalignment~\ddag &0x88 &\CLASSconstant
1789 \addtoindexx{alignment attribute} \\
1790 \DWATexportsymbols~\ddag &0x89 &\CLASSflag
1791 \addtoindexx{export symbols attribute} \\
1792 \DWATdeleted~\ddag &0x8a &\CLASSflag \addtoindexx{deleted attribute} \\
1793 \DWATdefaulted~\ddag &0x8b &\CLASSconstant \addtoindexx{defaulted attribute} \\
1794 \DWATloclistsbase~\ddag &0x8c &\CLASSloclistsptr \addtoindexx{location list base attribute} \\
1795 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1796 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1801 \subsection{Classes and Forms}
1802 \label{datarep:classesandforms}
1803 Each class is a set of forms which have related representations
1804 and which are given a common interpretation according to the
1805 attribute in which the form is used.
1806 The attribute form governs how the value of an attribute is
1808 The classes and the forms they include are listed below.
1810 Form \DWFORMsecoffsetTARG{}
1811 is a member of more than one class, namely
1814 \CLASSloclist, \CLASSloclistsptr,
1816 \CLASSrnglist{}, \CLASSrnglistsptr,
1818 \CLASSstroffsetsptr;
1819 as a result, it is not possible for an
1820 attribute to allow more than one of these classes.
1821 The list of classes allowed by the applicable attribute in
1822 Table \refersec{tab:attributeencodings}
1823 determines the class of the form.
1826 In the form descriptions that follow, some forms are said
1827 to depend in part on the value of an attribute of the
1828 \definition{\associatedcompilationunit}:
1831 In the case of a \splitDWARFobjectfile{}, the associated
1832 compilation unit is the skeleton compilation unit corresponding
1833 to the containing unit.
1834 \item Otherwise, the associated compilation unit
1835 is the containing unit.
1839 Each possible form belongs to one or more of the following classes
1840 (see Table \refersec{tab:classesofattributevalue} for a summary of
1841 the purpose and general usage of each class):
1845 \item \CLASSaddress \\
1846 \livetarg{datarep:classaddress}{}
1847 Represented as either:
1849 \item An object of appropriate size to hold an
1850 address on the target machine (\DWFORMaddrTARG).
1851 The size is encoded in the compilation unit header
1852 (see Section \refersec{datarep:compilationunitheader}).
1853 This address is relocatable in a relocatable object file and
1854 is relocated in an executable file or shared object file.
1856 \item An indirect index into a table of addresses (as
1857 described in the previous bullet) in the \dotdebugaddr{} section
1859 (\DWFORMaddrxTARG, \DWFORMaddrxoneTARG, \DWFORMaddrxtwoTARG,
1860 \DWFORMaddrxthreeTARG{} and \DWFORMaddrxfourTARG).
1862 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1863 \addtoindex{LEB128} value, which is interpreted as a zero-based
1864 index into an array of addresses in the \dotdebugaddr{} section.
1866 The representation of a \DWFORMaddrxoneNAME, \DWFORMaddrxtwoNAME,
1867 \DWFORMaddrxthreeNAME{} or \DWFORMaddrxfourNAME{} value is a
1868 1-, 2-, 3- or 4-byte unsigned integer value, respectively,
1869 which is similarly interpreted.
1871 The index is relative to the value of the \DWATaddrbase{} attribute
1872 of the associated compilation unit.
1877 \item \CLASSaddrptr \\
1878 \livetarg{datarep:classaddrptr}{}
1879 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1880 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1881 beginning of the list of machine addresses information for the
1882 referencing entity. It is relocatable in
1883 a relocatable object file, and relocated in an executable or
1884 shared object file. In the \thirtytwobitdwarfformat, this offset
1885 is a 4-byte unsigned value; in the 64-bit DWARF
1886 format, it is an 8-byte unsigned value (see Section
1887 \refersec{datarep:32bitand64bitdwarfformats}).
1889 \textit{This class is new in \DWARFVersionV.}
1892 \item \CLASSblock \\
1893 \livetarg{datarep:classblock}{}
1894 Blocks come in four forms:
1897 A 1-byte length followed by 0 to 255 contiguous information
1898 bytes (\DWFORMblockoneTARG).
1901 A 2-byte length followed by 0 to 65,535 contiguous information
1902 bytes (\DWFORMblocktwoTARG).
1905 A 4-byte length followed by 0 to 4,294,967,295 contiguous
1906 information bytes (\DWFORMblockfourTARG).
1909 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1910 length followed by the number of bytes
1911 specified by the length (\DWFORMblockTARG).
1914 In all forms, the length is the number of information bytes
1915 that follow. The information bytes may contain any mixture
1916 of relocated (or relocatable) addresses, references to other
1917 debugging information entries or data bytes.
1919 \item \CLASSconstant \\
1920 \livetarg{datarep:classconstant}{}
1921 There are eight forms of constants. There are fixed length
1922 constant data forms for one-, two-, four-, eight- and sixteen-byte values
1926 \DWFORMdatafourTARG,
1927 \DWFORMdataeightTARG{} and
1928 \DWFORMdatasixteenTARG).
1929 There are variable length constant
1930 data forms encoded using
1931 signed LEB128 numbers (\DWFORMsdataTARG) and unsigned
1932 LEB128 numbers (\DWFORMudataTARG).
1933 There is also an implicit constant (\DWFORMimplicitconst),
1934 whose value is provided as part of the abbreviation
1938 The data in \DWFORMdataone,
1941 \DWFORMdataeight{} and
1942 \DWFORMdatasixteen{}
1943 can be anything. Depending on context, it may
1944 be a signed integer, an unsigned integer, a floating\dash point
1945 constant, or anything else. A consumer must use context to
1946 know how to interpret the bits, which if they are target
1947 machine data (such as an integer or floating-point constant)
1948 will be in target machine \byteorder.
1950 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1951 forms is used to represent a
1952 signed or unsigned integer, it can be hard for a consumer
1953 to discover the context necessary to determine which
1954 interpretation is intended. Producers are therefore strongly
1955 encouraged to use \DWFORMsdata{} or
1956 \DWFORMudata{} for signed and
1957 unsigned integers respectively, rather than
1958 \DWFORMdata\textless n\textgreater.}
1961 \item \CLASSexprloc \\
1962 \livetarg{datarep:classexprloc}{}
1963 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length
1964 followed by the number of information bytes specified by the
1965 length (\DWFORMexprlocTARG).
1966 The information bytes contain a DWARF expression
1967 (see Section \refersec{chap:dwarfexpressions})
1968 or location description
1969 (see Section \refersec{chap:locationdescriptions}).
1973 \livetarg{datarep:classflag}{}
1974 A flag \addtoindexx{flag class}
1975 is represented explicitly as a single byte of data
1976 (\DWFORMflagTARG) or implicitly (\DWFORMflagpresentTARG). In the
1977 first case, if the \nolink{flag} has value zero, it indicates the
1978 absence of the attribute; if the \nolink{flag} has a non-zero value,
1979 it indicates the presence of the attribute. In the second
1980 case, the attribute is implicitly indicated as present, and
1981 no value is encoded in the debugging information entry itself.
1984 \item \CLASSlineptr \\
1985 \livetarg{datarep:classlineptr}{}
1986 This is an offset into
1987 \addtoindexx{section offset!in class lineptr value}
1989 \dotdebugline{} or \dotdebuglinedwo{} section
1991 It consists of an offset from the beginning of the
1993 section to the first byte of
1994 the data making up the line number list for the compilation
1996 It is relocatable in a relocatable object file, and
1997 relocated in an executable or shared object file. In the
1998 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
1999 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2000 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2003 \item \CLASSloclist \\
2004 \livetarg{datarep:classloclist}{}
2005 This is represented as either:
2008 An index into the \dotdebugloclists{} section (\DWFORMloclistxTARG).
2009 The unsigned ULEB operand identifies an offset location
2010 relative to the base of that section (the location of the first offset
2011 in the section, not the first byte of the section). The contents of
2012 that location is then added to the base to determine the location of
2013 the target list of entries.
2015 An offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2016 The operand consists of a byte
2017 offset\addtoindexx{section offset!in class loclist value}
2018 from the beginning of the \dotdebugloclists{} section.
2019 It is relocatable in a relocatable object file, and
2020 relocated in an executable or shared object file. In the
2021 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2022 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2023 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2026 \textit{This class is new in \DWARFVersionV.}
2028 \item \CLASSloclistsptr \\
2029 \livetarg{datarep:classloclistsptr}{}
2030 This is an offset into the \dotdebugloclists{} section (\DWFORMsecoffset).
2031 The operand consists of a byte
2032 offset\addtoindexx{section offset!in class loclistsptr}
2033 from the beginning of the \dotdebugloclists{} section.
2034 It is relocatable in a relocatable object file, and
2035 relocated in an executable or shared object file. In the
2036 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2037 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2038 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2040 \textit{This class is new in \DWARFVersionV.}
2042 \item \CLASSmacptr \\
2043 \livetarg{datarep:classmacptr}{}
2045 \addtoindexx{section offset!in class macptr value}
2047 \dotdebugmacro{} or \dotdebugmacrodwo{} section
2049 It consists of an offset from the beginning of the
2050 \dotdebugmacro{} or \dotdebugmacrodwo{}
2051 section to the the header making up the
2052 macro information list for the compilation unit.
2053 It is relocatable in a relocatable object file, and
2054 relocated in an executable or shared object file. In the
2055 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2056 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2057 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2060 \item \CLASSrnglist \\
2061 \livetarg{datarep:classrnglist}{}
2062 This is represented as either:
2065 An index into the \dotdebugrnglists{} section (\DWFORMrnglistxTARG).
2066 The unsigned ULEB operand identifies an offset location
2067 relative to the base of that section (the location of the first offset
2068 in the section, not the first byte of the section). The contents of
2069 that location is then added to the base to determine the location of
2070 the target range list of entries.
2073 An offset into the \dotdebugrnglists{} section (\DWFORMsecoffset).
2074 The operand consists of a byte
2075 offset\addtoindexx{section offset!in class rnglist value}
2077 from the beginning of the \dotdebugrnglists{} section.
2078 It is relocatable in a relocatable object file, and
2079 relocated in an executable or shared object file. In the
2080 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2081 in the \sixtyfourbitdwarfformat, it is an 8-byte unsigned value
2082 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2085 \textit{This class is new in \DWARFVersionV.}
2088 \item \CLASSrnglistsptr \\
2089 \livetarg{datarep:classrnglistsptr}{}
2090 This is an offset\addtoindexx{section offset!in class rnglistsptr}
2091 into the \dotdebugrnglists{} section (\DWFORMsecoffset).
2092 It consists of a byte offset from the beginning of the
2093 \dotdebugrnglists{} section.
2094 It is relocatable in a relocatable object file, and relocated
2095 in an executable or shared object file.
2096 In the \thirtytwobitdwarfformat, this offset
2097 is a 4-byte unsigned value; in the 64-bit DWARF
2098 format, it is an 8-byte unsigned value (see Section
2099 \refersec{datarep:32bitand64bitdwarfformats}).
2101 \textit{This class is new in \DWARFVersionV.}
2104 \item \CLASSreference \\
2105 \livetarg{datarep:classreference}{}
2106 There are four types of reference.\addtoindexx{reference class}
2109 The first type of reference can identify any debugging
2110 information entry within the containing unit.
2111 This type of reference is an
2112 offset\addtoindexx{section offset!in class reference value}
2113 from the first byte of the compilation
2114 header for the compilation unit containing the reference. There
2115 are five forms for this type of reference. There are fixed
2116 length forms for one, two, four and eight byte offsets
2122 and \DWFORMrefeightTARG).
2123 There is also an unsigned variable
2124 length offset encoded form that uses
2125 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
2126 (\DWFORMrefudataTARG).
2127 Because this type of reference is within
2128 the containing compilation unit no relocation of the value
2132 The second type of reference can identify any debugging
2133 information entry within a
2134 \dotdebuginfo{} section; in particular,
2135 it may refer to an entry in a different compilation unit
2136 from the unit containing the reference, and may refer to an
2137 entry in a different shared object file. This type of reference
2138 (\DWFORMrefaddrTARG)
2139 is an offset from the beginning of the
2141 section of the target executable or shared object file, or, for
2142 references within a \addtoindex{supplementary object file},
2143 an offset from the beginning of the local \dotdebuginfo{} section;
2144 it is relocatable in a relocatable object file and frequently
2145 relocated in an executable or shared object file. For
2146 references from one shared object or static executable file
2147 to another, the relocation and identification of the target
2148 object must be performed by the consumer. In the
2149 \thirtytwobitdwarfformat, this offset is a 4-byte unsigned value;
2150 in the \sixtyfourbitdwarfformat, it is an 8-byte
2152 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2154 \textit{A debugging information entry that may be referenced by
2155 another compilation unit using
2156 \DWFORMrefaddr{} must have a global symbolic name.}
2158 \textit{For a reference from one executable or shared object file to
2159 another, the reference is resolved by the debugger to identify
2160 the executable or shared object file and the offset into that
2161 file\textquoteright s \dotdebuginfo{}
2162 section in the same fashion as the run
2163 time loader, either when the debug information is first read,
2164 or when the reference is used.}
2167 The third type of reference can identify any debugging
2168 information type entry that has been placed in its own
2169 \addtoindex{type unit}. This type of
2170 reference (\DWFORMrefsigeightTARG) is the
2171 \addtoindexx{type signature}
2172 8-byte type signature
2173 (see Section \refersec{datarep:typesignaturecomputation})
2174 that was computed for the type.
2177 The fourth type of reference is a reference from within the
2178 \dotdebuginfo{} section of the executable or shared object file to
2179 a debugging information entry in the \dotdebuginfo{} section of
2180 a \addtoindex{supplementary object file}.
2181 This type of reference (\DWFORMrefsupfourTARG{}
2183 or \DWFORMrefsupeightTARG{}) is a 4- or 8-byte offset (respectively)
2185 from the beginning of the \dotdebuginfo{} section in the
2186 \addtoindex{supplementary object file}.
2188 \textit{The use of compilation unit relative references will reduce the
2189 number of link\dash time relocations and so speed up linking. The
2190 use of the second, third and fourth type of reference allows for the
2191 sharing of information, such as types, across compilation
2192 units, while the fourth type further allows for sharing of information
2193 across compilation units from different executables or shared object files.}
2195 \textit{A reference to any kind of compilation unit identifies the
2196 debugging information entry for that unit, not the preceding
2201 \item \CLASSstring \\
2202 \livetarg{datarep:classstring}{}
2203 A string is a sequence of contiguous non\dash null bytes followed by
2205 \addtoindexx{string class}
2206 A string may be represented:
2208 \setlength{\itemsep}{0em}
2209 \item Immediately in the debugging information entry itself
2210 (\DWFORMstringTARG),
2213 \addtoindexx{section offset!in class string value}
2214 offset into a string table contained in
2215 the \dotdebugstr{} section of the object file (\DWFORMstrpTARG),
2216 the \dotdebuglinestr{} section of the object file (\DWFORMlinestrpTARG),
2217 or as an offset into a string table contained in the
2218 \dotdebugstr{} section of a \addtoindex{supplementary object file}
2219 (\DWFORMstrpsupTARG). \DWFORMstrpsupNAME{} offsets from the \dotdebuginfo{}
2220 section of a \addtoindex{supplementary object file}
2221 refer to the local \dotdebugstr{} section of that same file.
2222 In the \thirtytwobitdwarfformat, the representation of a
2225 \DWFORMlinestrpNAME{}
2227 or \DWFORMstrpsupNAME{}
2228 value is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
2229 it is an 8-byte unsigned offset
2230 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2233 \item As an indirect offset into the string table using an
2234 index into a table of offsets contained in the
2235 \dotdebugstroffsets{} section of the object file
2237 (\DWFORMstrxTARG, \DWFORMstrxoneTARG, \DWFORMstrxtwoTARG, \DWFORMstrxthreeTARG{} and \DWFORMstrxfourTARG).
2239 The representation of a \DWFORMstrxNAME{} value is an unsigned
2240 \addtoindex{LEB128} value, which is interpreted as a zero-based
2241 index into an array of offsets in the \dotdebugstroffsets{} section.
2243 The representation of a \DWFORMstrxoneNAME, \DWFORMstrxtwoNAME,
2244 \DWFORMstrxthreeNAME{} or \DWFORMstrxfourNAME{} value is a
2245 1-, 2-, 3- or 4-byte unsigned integer value, respectively,
2246 which is similarly interpreted.
2248 The offset entries in the \dotdebugstroffsets{} section have the
2249 same representation as \DWFORMstrp{} values.
2251 Any combination of these three forms may be used within a single compilation.
2253 If the \DWATuseUTFeight{}
2254 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
2255 compilation, partial, skeleton or type unit entry, string values are encoded using the
2256 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
2257 Character Set standard (ISO/IEC 10646\dash 1:1993).
2258 \addtoindexx{ISO 10646 character set standard}
2259 Otherwise, the string representation is unspecified.
2261 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
2262 ISO/IEC 10646\dash 1:1993.
2263 \addtoindexx{ISO 10646 character set standard}
2264 It contains all the same characters
2265 and encoding points as ISO/IEC 10646, as well as additional
2266 information about the characters and their use.}
2269 \textit{Earlier versions of DWARF did not specify the representation
2270 of strings; for compatibility, this version also does
2271 not. However, the UTF\dash 8 representation is strongly recommended.}
2274 \item \CLASSstroffsetsptr \\
2275 \livetarg{datarep:classstroffsetsptr}{}
2276 This is an offset into the \dotdebugstroffsets{} section
2277 (\DWFORMsecoffset). It consists of an offset from the beginning of the
2278 \dotdebugstroffsets{} section to the
2279 beginning of the string offsets information for the
2280 referencing entity. It is relocatable in
2281 a relocatable object file, and relocated in an executable or
2282 shared object file. In the \thirtytwobitdwarfformat, this offset
2283 is a 4-byte unsigned value; in the \sixtyfourbitdwarfformat,
2284 it is an 8-byte unsigned value (see Section
2285 \refersec{datarep:32bitand64bitdwarfformats}).
2287 \textit{This class is new in \DWARFVersionV.}
2291 In no case does an attribute use one of the classes
2296 \CLASSrnglistsptr{} or
2297 \CLASSstroffsetsptr{}
2298 to point into either the
2299 \dotdebuginfo{} or \dotdebugstr{} section.
2301 \subsection{Form Encodings}
2302 \label{datarep:formencodings}
2303 The form encodings are listed in
2304 Table \referfol{tab:attributeformencodings}.
2308 \setlength{\extrarowheight}{0.1cm}
2309 \begin{longtable}{l|c|l}
2310 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
2311 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
2313 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
2315 \hline \emph{Continued on next page}
2317 \hline \ddag\ \textit{New in DWARF Version 5}
2320 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
2321 \textit{Reserved} &0x02& \\
2322 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
2323 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
2324 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
2325 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
2326 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
2327 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
2328 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
2329 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
2330 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
2331 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
2332 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
2333 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
2334 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
2335 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
2336 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
2337 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
2338 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
2339 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
2340 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
2341 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
2342 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclist, \CLASSloclistsptr, \\
2343 & & \CLASSmacptr, \CLASSrnglist, \CLASSrnglistsptr, \CLASSstroffsetsptr \\
2344 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
2345 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
2346 \DWFORMstrx{} \ddag &0x1a &\CLASSstring \\
2347 \DWFORMaddrx{} \ddag &0x1b &\CLASSaddress \\
2348 \DWFORMrefsupfour{}~\ddag &0x1c &\CLASSreference \\
2349 \DWFORMstrpsup{}~\ddag &0x1d &\CLASSstring \\
2350 \DWFORMdatasixteen~\ddag &0x1e &\CLASSconstant \\
2351 \DWFORMlinestrp~\ddag &0x1f &\CLASSstring \\
2352 \DWFORMrefsigeight &0x20 &\CLASSreference \\
2353 \DWFORMimplicitconst~\ddag &0x21 &\CLASSconstant \\
2354 \DWFORMloclistx~\ddag &0x22 &\CLASSloclist \\
2355 \DWFORMrnglistx~\ddag &0x23 &\CLASSrnglist \\
2356 \DWFORMrefsupeight{}~\ddag &0x24 &\CLASSreference \\
2358 \DWFORMstrxone{}~\ddag &0x25 &\CLASSstring \\
2359 \DWFORMstrxtwo{}~\ddag &0x26 &\CLASSstring \\
2360 \DWFORMstrxthree{}~\ddag &0x27 &\CLASSstring \\
2361 \DWFORMstrxfour{}~\ddag &0x28 &\CLASSstring \\
2362 \DWFORMaddrxone{}~\ddag &0x29 &\CLASSaddress \\
2363 \DWFORMaddrxtwo{}~\ddag &0x2a &\CLASSaddress \\
2364 \DWFORMaddrxthree{}~\ddag &0x2b &\CLASSaddress \\
2366 \DWFORMaddrxfour{}~\ddag &0x2c &\CLASSaddress \\
2372 \section{Variable Length Data}
2373 \label{datarep:variablelengthdata}
2374 \addtoindexx{variable length data|see {LEB128}}
2376 \addtoindexx{Little-Endian Base 128|see{LEB128}}
2377 encoded using \doublequote{Little-Endian Base 128}
2378 \addtoindexx{little-endian encoding|see{endian attribute}}
2380 \addtoindexx{LEB128}
2381 LEB128 is a scheme for encoding integers
2382 densely that exploits the assumption that most integers are
2385 \textit{This encoding is equally suitable whether the target machine
2386 architecture represents data in big-endian or little-endian
2387 \byteorder. It is \doublequote{little-endian} only in the sense that it
2388 avoids using space to represent the \doublequote{big} end of an
2389 unsigned integer, when the big end is all zeroes or sign
2392 Unsigned LEB128\addtoindexx{LEB128!unsigned} (\addtoindex{ULEB128})
2393 numbers are encoded as follows:
2394 \addtoindexx{LEB128!unsigned, encoding as}
2395 start at the low order end of an unsigned integer and chop
2396 it into 7-bit chunks. Place each chunk into the low order 7
2397 bits of a byte. Typically, several of the high order bytes
2398 will be zero; discard them. Emit the remaining bytes in a
2399 stream, starting with the low order byte; set the high order
2400 bit on each byte except the last emitted byte. The high bit
2401 of zero on the last byte indicates to the decoder that it
2402 has encountered the last byte.
2404 The integer zero is a special case, consisting of a single
2407 Table \refersec{tab:examplesofunsignedleb128encodings}
2408 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2410 0x80 in each case is the high order bit of the byte, indicating
2411 that an additional byte follows.
2414 The encoding for signed, two\textquoteright{s} complement LEB128
2415 (\addtoindex{SLEB128}) \addtoindexx{LEB128!signed, encoding as}
2416 numbers is similar, except that the criterion for discarding
2417 high order bytes is not whether they are zero, but whether
2418 they consist entirely of sign extension bits. Consider the
2419 4-byte integer -2. The three high level bytes of the number
2420 are sign extension, thus LEB128 would represent it as a single
2421 byte containing the low order 7 bits, with the high order
2422 bit cleared to indicate the end of the byte stream. Note
2423 that there is nothing within the LEB128 representation that
2424 indicates whether an encoded number is signed or unsigned. The
2425 decoder must know what type of number to expect.
2426 Table \refersec{tab:examplesofunsignedleb128encodings}
2427 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
2428 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
2429 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
2432 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
2433 \addtoindexx{LEB128!examples}
2434 gives algorithms for encoding and decoding these forms.}
2438 \setlength{\extrarowheight}{0.1cm}
2439 \begin{longtable}{c|c|c}
2440 \caption{Examples of unsigned LEB128 encodings}
2441 \label{tab:examplesofunsignedleb128encodings}
2442 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
2443 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2445 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2447 \hline \emph{Continued on next page}
2453 128& 0 + 0x80 & 1 \\
2454 129& 1 + 0x80 & 1 \\
2455 %130& 2 + 0x80 & 1 \\
2456 12857& 57 + 0x80 & 100 \\
2463 \setlength{\extrarowheight}{0.1cm}
2464 \begin{longtable}{c|c|c}
2465 \caption{Examples of signed LEB128 encodings}
2466 \label{tab:examplesofsignedleb128encodings}
2467 \addtoindexx{LEB128!signed} \\
2468 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
2470 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
2472 \hline \emph{Continued on next page}
2478 127& 127 + 0x80 & 0 \\
2479 -127& 1 + 0x80 & 0x7f \\
2480 128& 0 + 0x80 & 1 \\
2481 -128& 0 + 0x80 & 0x7f \\
2482 129& 1 + 0x80 & 1 \\
2483 -129& 0x7f + 0x80 & 0x7e \\
2490 \section{DWARF Expressions and Location Descriptions}
2491 \label{datarep:dwarfexpressionsandlocationdescriptions}
2492 \subsection{DWARF Expressions}
2493 \label{datarep:dwarfexpressions}
2496 \addtoindexx{DWARF expression!operator encoding}
2497 DWARF expression is stored in a \nolink{block} of contiguous
2498 bytes. The bytes form a sequence of operations. Each operation
2499 is a 1-byte code that identifies that operation, followed by
2500 zero or more bytes of additional data. The encodings for the
2501 operations are described in
2502 Table \refersec{tab:dwarfoperationencodings}.
2505 \setlength{\extrarowheight}{0.1cm}
2506 \begin{longtable}{l|c|c|l}
2507 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
2508 \hline & &\bfseries No. of &\\
2509 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2511 & &\bfseries No. of &\\
2512 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
2514 \hline \emph{Continued on next page}
2516 \hline \ddag\ \textit{New in DWARF Version 5}
2519 \bbeb\textit{Reserved}&0x01&-& \\
2520 \bbeb\textit{Reserved}&0x02&-& \\
2521 \DWOPaddr&0x03&1 & constant address \\
2522 & & &(size is target specific) \\
2523 \bbeb\textit{Reserved}&0x04&-& \\
2524 \bbeb\textit{Reserved}&0x05&-& \\
2525 \DWOPderef&0x06&0 & \\
2526 \bbeb\textit{Reserved}&0x07&-& \\
2527 \DWOPconstoneu&0x08&1&1-byte constant \\
2528 \DWOPconstones&0x09&1&1-byte constant \\
2529 \DWOPconsttwou&0x0a&1&2-byte constant \\
2530 \DWOPconsttwos&0x0b&1&2-byte constant \\
2531 \DWOPconstfouru&0x0c&1&4-byte constant \\
2532 \DWOPconstfours&0x0d&1&4-byte constant \\
2533 \DWOPconsteightu&0x0e&1&8-byte constant \\
2534 \DWOPconsteights&0x0f&1&8-byte constant \\
2535 \DWOPconstu&0x10&1&ULEB128 constant \\
2536 \DWOPconsts&0x11&1&SLEB128 constant \\
2537 \DWOPdup&0x12&0 & \\
2538 \DWOPdrop&0x13&0 & \\
2539 \DWOPover&0x14&0 & \\
2540 \DWOPpick&0x15&1&1-byte stack index \\
2541 \DWOPswap&0x16&0 & \\
2542 \DWOProt&0x17&0 & \\
2543 \DWOPxderef&0x18&0 & \\
2544 \DWOPabs&0x19&0 & \\
2545 \DWOPand&0x1a&0 & \\
2546 \DWOPdiv&0x1b&0 & \\
2547 \DWOPminus&0x1c&0 & \\
2548 \DWOPmod&0x1d&0 & \\
2549 \DWOPmul&0x1e&0 & \\
2550 \DWOPneg&0x1f&0 & \\
2551 \DWOPnot&0x20&0 & \\
2553 \DWOPplus&0x22&0 & \\
2554 \DWOPplusuconst&0x23&1&ULEB128 addend \\
2555 \DWOPshl&0x24&0 & \\
2556 \DWOPshr&0x25&0 & \\
2557 \DWOPshra&0x26&0 & \\
2558 \DWOPxor&0x27&0 & \\
2560 \DWOPbra&0x28&1 & signed 2-byte constant \\
2567 \DWOPskip&0x2f&1&signed 2-byte constant \\ \hline
2569 \DWOPlitzero & 0x30 & 0 & \\
2570 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
2571 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
2572 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
2574 \DWOPregzero & 0x50 & 0 & \\*
2575 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
2576 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
2577 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
2579 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
2580 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
2581 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
2582 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
2584 \DWOPregx{} & 0x90 &1&ULEB128 register \\
2585 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
2586 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
2587 & & &SLEB128 offset \\
2588 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
2589 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
2590 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
2591 \DWOPnop{} & 0x96 &0& \\
2593 \DWOPpushobjectaddress&0x97&0 & \\
2594 \DWOPcalltwo&0x98&1& 2-byte offset of DIE \\
2595 \DWOPcallfour&0x99&1& 4-byte offset of DIE \\
2596 \DWOPcallref&0x9a&1& 4\dash\ or 8-byte offset of DIE \\
2597 \DWOPformtlsaddress&0x9b &0& \\
2598 \DWOPcallframecfa{} &0x9c &0& \\
2599 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2601 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2602 &&&\nolink{block} of that size\\
2603 \DWOPstackvalue{} &0x9f &0& \\
2604 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2605 &&&SLEB128 constant offset \\
2606 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2607 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2608 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2609 &&&\nolink{block} of that size\\
2610 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2611 & & & 1-byte size, \\*
2612 & & & constant value \\
2613 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2614 &&& ULEB128 constant offset \\
2615 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2616 &&& ULEB128 type entry offset \\
2617 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2618 &&& ULEB128 type entry offset \\
2619 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2620 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2621 \DWOPlouser{} &0xe0 && \\
2622 \DWOPhiuser{} &\xff && \\
2628 \subsection{Location Descriptions}
2629 \label{datarep:locationdescriptions}
2631 A location description is used to compute the
2632 location of a variable or other entity.
2634 \subsection{Location Lists}
2635 \label{datarep:locationlists}
2636 Each entry in a \addtoindex{location list} is either a location list entry,
2637 a base address entry, a default location entry or an
2638 \addtoindexx{end-of-list entry!in location list}
2641 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2642 that follows. The encodings for these constants are given in
2643 Table \ref{tab:locationlistentryencodingvalues}.
2647 \setlength{\extrarowheight}{0.1cm}
2648 \begin{longtable}{l|c}
2649 \caption{Location list entry encoding values}
2650 \label{tab:locationlistentryencodingvalues} \\
2651 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2653 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2655 \hline \emph{Continued on next page}
2658 \ddag New in \DWARFVersionV
2660 \DWLLEendoflist~\ddag & 0x00 \\
2661 \DWLLEbaseaddressx~\ddag & 0x01 \\
2662 \DWLLEstartxendx~\ddag & 0x02 \\
2663 \DWLLEstartxlength~\ddag & 0x03 \\
2664 \DWLLEoffsetpair~\ddag & 0x04 \\
2665 \DWLLEdefaultlocation~\ddag & 0x05 \\
2666 \DWLLEbaseaddress~\ddag & 0x06 \\
2667 \DWLLEstartend~\ddag & 0x07 \\
2668 \DWLLEstartlength~\ddag & 0x08 \\
2672 \section{Base Type Attribute Encodings}
2673 \label{datarep:basetypeattributeencodings}
2675 The\hypertarget{chap:DWATencodingencodingofbasetype}{}
2676 encodings of the constants used in the
2677 \DWATencodingDEFN{} attribute\addtoindexx{encoding attribute}
2679 Table \refersec{tab:basetypeencodingvalues}
2682 \setlength{\extrarowheight}{0.1cm}
2683 \begin{longtable}{l|c}
2684 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2685 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2687 \bfseries Base type encoding name&\bfseries Value\\ \hline
2689 \hline \emph{Continued on next page}
2692 \ddag \ \textit{New in \DWARFVersionV}
2694 \DWATEaddress&0x01 \\
2695 \DWATEboolean&0x02 \\
2696 \DWATEcomplexfloat&0x03 \\
2698 \DWATEsigned&0x05 \\
2699 \DWATEsignedchar&0x06 \\
2700 \DWATEunsigned&0x07 \\
2701 \DWATEunsignedchar&0x08 \\
2702 \DWATEimaginaryfloat&0x09 \\
2703 \DWATEpackeddecimal&0x0a \\
2704 \DWATEnumericstring&0x0b \\
2705 \DWATEedited&0x0c \\
2706 \DWATEsignedfixed&0x0d \\
2707 \DWATEunsignedfixed&0x0e \\
2708 \DWATEdecimalfloat & 0x0f \\
2709 \DWATEUTF{} & 0x10 \\
2710 \DWATEUCS~\ddag & 0x11 \\
2711 \DWATEASCII~\ddag & 0x12 \\
2712 \DWATElouser{} & 0x80 \\
2713 \DWATEhiuser{} & \xff \\
2718 The encodings of the constants used in the
2719 \DWATdecimalsign{} attribute
2721 Table \refersec{tab:decimalsignencodings}.
2724 \setlength{\extrarowheight}{0.1cm}
2725 \begin{longtable}{l|c}
2726 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2727 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2729 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2731 % \hline \emph{Continued on next page}
2735 \DWDSunsigned{} & 0x01 \\
2736 \DWDSleadingoverpunch{} & 0x02 \\
2737 \DWDStrailingoverpunch{} & 0x03 \\
2738 \DWDSleadingseparate{} & 0x04 \\
2739 \DWDStrailingseparate{} & 0x05 \\
2744 The encodings of the constants used in the
2745 \DWATendianity{} attribute are given in
2746 Table \refersec{tab:endianityencodings}.
2749 \setlength{\extrarowheight}{0.1cm}
2750 \begin{longtable}{l|c}
2751 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2752 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2754 \bfseries Endian code name&\bfseries Value\\ \hline
2756 \hline \emph{Continued on next page}
2761 \DWENDdefault{} & 0x00 \\
2762 \DWENDbig{} & 0x01 \\
2763 \DWENDlittle{} & 0x02 \\
2764 \DWENDlouser{} & 0x40 \\
2765 \DWENDhiuser{} & \xff \\
2771 \section{Accessibility Codes}
2772 \label{datarep:accessibilitycodes}
2773 The encodings of the constants used in the
2774 \DWATaccessibility{}
2776 \addtoindexx{accessibility attribute}
2778 Table \refersec{tab:accessibilityencodings}.
2781 \setlength{\extrarowheight}{0.1cm}
2782 \begin{longtable}{l|c}
2783 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2784 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2786 \bfseries Accessibility code name&\bfseries Value\\ \hline
2788 \hline \emph{Continued on next page}
2793 \DWACCESSpublic&0x01 \\
2794 \DWACCESSprotected&0x02 \\
2795 \DWACCESSprivate&0x03 \\
2801 \section{Visibility Codes}
2802 \label{datarep:visibilitycodes}
2803 The encodings of the constants used in the
2804 \DWATvisibility{} attribute are given in
2805 Table \refersec{tab:visibilityencodings}.
2808 \setlength{\extrarowheight}{0.1cm}
2809 \begin{longtable}{l|c}
2810 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2811 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2813 \bfseries Visibility code name&\bfseries Value\\ \hline
2815 \hline \emph{Continued on next page}
2821 \DWVISexported&0x02 \\
2822 \DWVISqualified&0x03 \\
2827 \section{Virtuality Codes}
2828 \label{datarep:vitualitycodes}
2830 The encodings of the constants used in the
2831 \DWATvirtuality{} attribute are given in
2832 Table \refersec{tab:virtualityencodings}.
2835 \setlength{\extrarowheight}{0.1cm}
2836 \begin{longtable}{l|c}
2837 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2838 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2840 \bfseries Virtuality code name&\bfseries Value\\ \hline
2842 \hline \emph{Continued on next page}
2847 \DWVIRTUALITYnone&0x00 \\
2848 \DWVIRTUALITYvirtual&0x01 \\
2849 \DWVIRTUALITYpurevirtual&0x02 \\
2856 \DWVIRTUALITYnone{} is equivalent to the absence of the
2860 \section{Source Languages}
2861 \label{datarep:sourcelanguages}
2863 The encodings of the constants used
2864 \addtoindexx{language attribute, encoding}
2866 \addtoindexx{language name encoding}
2869 attribute are given in
2870 Table \refersec{tab:languageencodings}.
2872 % If we don't force a following space it looks odd
2874 and their associated values are reserved, but the
2875 languages they represent are not well supported.
2876 Table \refersec{tab:languageencodings}
2878 \addtoindexx{lower bound attribute!default}
2879 default lower bound, if any, assumed for
2880 an omitted \DWATlowerbound{} attribute in the context of a
2881 \DWTAGsubrangetype{} debugging information entry for each
2885 \setlength{\extrarowheight}{0.1cm}
2886 \begin{longtable}{l|c|c}
2887 \caption{Language encodings} \label{tab:languageencodings}\\
2888 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2890 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2892 \hline \emph{Continued on next page}
2895 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2897 \addtoindexx{ISO-defined language names}
2899 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2900 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2901 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2902 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++98 (ISO)} \\
2903 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2904 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2905 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2906 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2907 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2908 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2909 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2910 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2911 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2912 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2913 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2914 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2915 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2916 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2917 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2918 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2919 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2920 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2921 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2922 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2923 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++03 (ISO)}\\
2924 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++11 (ISO)} \\
2925 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2926 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2927 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2928 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2929 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2930 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2931 \DWLANGCplusplusfourteen{}~\ddag &0x0021 &0 \addtoindexx{C++14 (ISO)} \\
2932 \DWLANGFortranzerothree{}~\ddag &0x0022 &1 \addtoindexx{Fortran:2004 (ISO)} \\
2933 \DWLANGFortranzeroeight{}~\ddag &0x0023 &1 \addtoindexx{Fortran:2010 (ISO)} \\
2934 \DWLANGRenderScript{}~\ddag &0x0024 &0 \addtoindexx{RenderScript Kernel Language} \\
2936 \DWLANGBLISS{} \ddag &0x0025 &0 \addtoindexx{BLISS}
2939 \DWLANGlouser{} &0x8000 & \\
2940 \DWLANGhiuser{} &\xffff & \\
2945 \section{Address Class Encodings}
2946 \label{datarep:addressclassencodings}
2948 The value of the common
2949 \addtoindex{address class} encoding
2953 \section{Identifier Case}
2954 \label{datarep:identifiercase}
2956 The encodings of the constants used in the
2957 \DWATidentifiercase{} attribute are given in
2958 Table \refersec{tab:identifiercaseencodings}.
2962 \setlength{\extrarowheight}{0.1cm}
2963 \begin{longtable}{l|c}
2964 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2965 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2967 \bfseries Identifier case name&\bfseries Value\\ \hline
2969 \hline \emph{Continued on next page}
2973 \DWIDcasesensitive&0x00 \\
2975 \DWIDdowncase&0x02 \\
2976 \DWIDcaseinsensitive&0x03 \\
2981 \section{Calling Convention Encodings}
2982 \label{datarep:callingconventionencodings}
2983 The encodings of the constants used in the
2984 \DWATcallingconvention{} attribute are given in
2985 Table \refersec{tab:callingconventionencodings}.
2988 \setlength{\extrarowheight}{0.1cm}
2989 \begin{longtable}{l|c}
2990 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2991 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2993 \bfseries Calling convention name&\bfseries Value\\ \hline
2995 \hline \emph{Continued on next page}
2997 \hline \ddag\ \textit{New in DWARF Version 5}
3000 \DWCCnormal &0x01 \\
3001 \DWCCprogram&0x02 \\
3002 \DWCCnocall &0x03 \\
3003 \DWCCpassbyreference~\ddag &0x04 \\
3004 \DWCCpassbyvalue~\ddag &0x05 \\
3005 \DWCClouser &0x40 \\
3012 \section{Inline Codes}
3013 \label{datarep:inlinecodes}
3015 The encodings of the constants used in
3016 \addtoindexx{inline attribute}
3018 \DWATinline{} attribute are given in
3019 Table \refersec{tab:inlineencodings}.
3023 \setlength{\extrarowheight}{0.1cm}
3024 \begin{longtable}{l|c}
3025 \caption{Inline encodings} \label{tab:inlineencodings}\\
3026 \hline \bfseries Inline code name&\bfseries Value \\ \hline
3028 \bfseries Inline Code name&\bfseries Value\\ \hline
3030 \hline \emph{Continued on next page}
3035 \DWINLnotinlined&0x00 \\
3036 \DWINLinlined&0x01 \\
3037 \DWINLdeclarednotinlined&0x02 \\
3038 \DWINLdeclaredinlined&0x03 \\
3043 % this clearpage is ugly, but the following table came
3044 % out oddly without it.
3047 \section{Array Ordering}
3048 \label{datarep:arrayordering}
3050 The encodings of the constants used in the
3051 \DWATordering{} attribute are given in
3052 Table \refersec{tab:orderingencodings}.
3056 \setlength{\extrarowheight}{0.1cm}
3057 \begin{longtable}{l|c}
3058 \caption{Ordering encodings} \label{tab:orderingencodings}\\
3059 \hline \bfseries Ordering name&\bfseries Value \\ \hline
3061 \bfseries Ordering name&\bfseries Value\\ \hline
3063 \hline \emph{Continued on next page}
3068 \DWORDrowmajor&0x00 \\
3069 \DWORDcolmajor&0x01 \\
3075 \section{Discriminant Lists}
3076 \label{datarep:discriminantlists}
3078 The descriptors used in
3079 \addtoindexx{discriminant list attribute}
3081 \DWATdiscrlist{} attribute are
3082 encoded as 1-byte constants. The
3083 defined values are given in
3084 Table \refersec{tab:discriminantdescriptorencodings}.
3086 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
3088 \setlength{\extrarowheight}{0.1cm}
3089 \begin{longtable}{l|c}
3090 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
3091 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
3093 \bfseries Descriptor name&\bfseries Value\\ \hline
3095 \hline \emph{Continued on next page}
3107 \section{Name Index Table}
3108 \label{datarep:nameindextable}
3109 The \addtoindexi{version number}{version number!name index table}
3110 in the name index table header is \versiondotdebugnames{}.
3112 The name index attributes and their encodings are listed in Table \refersec{datarep:indexattributeencodings}.
3116 \setlength{\extrarowheight}{0.1cm}
3117 \begin{longtable}{l|c|l}
3118 \caption{Name index attribute encodings} \label{datarep:indexattributeencodings}\\
3119 \hline \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3121 \bfseries Attribute name &\bfseries Value &\bfseries Form/Class \\ \hline
3123 \hline \emph{Continued on next page}
3126 \ddag~\textit{New in \DWARFVersionV}
3128 \DWIDXcompileunit~\ddag & 1 & \CLASSconstant \\
3129 \DWIDXtypeunit~\ddag & 2 & \CLASSconstant \\
3130 \DWIDXdieoffset~\ddag & 3 & \CLASSreference \\
3131 \DWIDXparent~\ddag & 4 & \CLASSconstant \\
3132 \DWIDXtypehash~\ddag & 5 & \DWFORMdataeight \\
3133 \DWIDXlouser~\ddag & 0x2000 & \\
3134 \DWIDXhiuser~\ddag & \xiiifff & \\
3138 The abbreviations table ends with an entry consisting of a single 0
3139 byte for the abbreviation code. The size of the table given by
3140 \texttt{abbrev\_table\_size} may include optional padding following the
3143 \section{Defaulted Member Encodings}
3144 \hypertarget{datarep:defaultedmemberencodings}{}
3146 The encodings of the constants used in the \DWATdefaulted{} attribute
3147 are given in Table \referfol{datarep:defaultedattributeencodings}.
3150 \setlength{\extrarowheight}{0.1cm}
3151 \begin{longtable}{l|c}
3152 \caption{Defaulted attribute encodings} \label{datarep:defaultedattributeencodings} \\
3153 \hline \bfseries Defaulted name &\bfseries Value \\ \hline
3155 \bfseries Defaulted name &\bfseries Value \\ \hline
3157 \hline \emph{Continued on next page}
3160 \ddag~\textit{New in \DWARFVersionV}
3162 \DWDEFAULTEDno~\ddag & 0x00 \\
3163 \DWDEFAULTEDinclass~\ddag & 0x01 \\
3164 \DWDEFAULTEDoutofclass~\ddag & 0x02 \\
3169 \section{Address Range Table}
3170 \label{datarep:addrssrangetable}
3172 Each set of entries in the table of address ranges contained
3173 in the \dotdebugaranges{}
3174 section begins with a header containing:
3175 \begin{enumerate}[1. ]
3176 % FIXME The unit length text is not fully consistent across
3179 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3180 \addttindexx{unit\_length}
3181 A 4-byte or 12-byte length containing the length of the
3182 \addtoindexx{initial length}
3183 set of entries for this compilation unit, not including the
3184 length field itself. In the \thirtytwobitdwarfformat, this is a
3185 4-byte unsigned integer (which must be less than \xfffffffzero);
3186 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
3187 \wffffffff followed by an 8-byte unsigned integer that gives
3189 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3191 \item version (\HFTuhalf) \\
3192 A 2-byte version identifier representing the version of the
3193 DWARF information for the address range table.
3195 This value in this field \addtoindexx{version number!address range table} is 2.
3197 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
3199 \addtoindexx{section offset!in .debug\_aranges header}
3200 4-byte or 8-byte offset into the
3201 \dotdebuginfo{} section of
3202 the compilation unit header. In the \thirtytwobitdwarfformat,
3203 this is a 4-byte unsigned offset; in the \sixtyfourbitdwarfformat,
3204 this is an 8-byte unsigned offset
3205 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3207 \item \texttt{address\_size} (\HFTubyte) \\
3208 A 1-byte unsigned integer containing the size in bytes of an
3209 \addttindexx{address\_size}
3211 \addtoindexx{size of an address}
3212 (or the offset portion of an address for segmented
3213 \addtoindexx{address space!segmented}
3214 addressing) on the target system.
3216 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3217 A 1-byte unsigned integer containing the size in bytes of a
3218 segment selector on the target system.
3222 This header is followed by a series of tuples. Each tuple
3223 consists of a segment, an address and a length.
3224 The segment selector
3225 size is given by the \HFNsegmentselectorsize{} field of the header; the
3226 address and length size are each given by the \addttindex{address\_size}
3227 field of the header.
3228 The first tuple following the header in
3229 each set begins at an offset that is a multiple of the size
3230 of a single tuple (that is, the size of a segment selector
3231 plus twice the \addtoindex{size of an address}).
3232 The header is padded, if
3233 necessary, to that boundary. Each set of tuples is terminated
3234 by a 0 for the segment, a 0 for the address and 0 for the
3235 length. If the \HFNsegmentselectorsize{} field in the header is zero,
3236 the segment selectors are omitted from all tuples, including
3237 the terminating tuple.
3240 \section{Line Number Information}
3241 \label{datarep:linenumberinformation}
3243 The \addtoindexi{version number}{version number!line number information}
3244 in the line number program header is \versiondotdebugline{}.
3246 The boolean values \doublequote{true} and \doublequote{false}
3247 used by the line number information program are encoded
3248 as a single byte containing the value 0
3249 for \doublequote{false,} and a non-zero value for \doublequote{true.}
3252 The encodings for the standard opcodes are given in
3253 \addtoindexx{line number opcodes!standard opcode encoding}
3254 Table \refersec{tab:linenumberstandardopcodeencodings}.
3257 \setlength{\extrarowheight}{0.1cm}
3258 \begin{longtable}{l|c}
3259 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
3260 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3262 \bfseries Opcode name&\bfseries Value\\ \hline
3264 \hline \emph{Continued on next page}
3270 \DWLNSadvancepc&0x02 \\
3271 \DWLNSadvanceline&0x03 \\
3272 \DWLNSsetfile&0x04 \\
3273 \DWLNSsetcolumn&0x05 \\
3274 \DWLNSnegatestmt&0x06 \\
3275 \DWLNSsetbasicblock&0x07 \\
3276 \DWLNSconstaddpc&0x08 \\
3277 \DWLNSfixedadvancepc&0x09 \\
3278 \DWLNSsetprologueend&0x0a \\*
3279 \DWLNSsetepiloguebegin&0x0b \\*
3280 \DWLNSsetisa&0x0c \\*
3286 The encodings for the extended opcodes are given in
3287 \addtoindexx{line number opcodes!extended opcode encoding}
3288 Table \refersec{tab:linenumberextendedopcodeencodings}.
3291 \setlength{\extrarowheight}{0.1cm}
3292 \begin{longtable}{l|c}
3293 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
3294 \hline \bfseries Opcode name&\bfseries Value \\ \hline
3296 \bfseries Opcode name&\bfseries Value\\ \hline
3298 \hline \emph{Continued on next page}
3300 \hline %\ddag~\textit{New in DWARF Version 5}
3303 \DWLNEendsequence &0x01 \\
3304 \DWLNEsetaddress &0x02 \\
3305 \textit{Reserved} &0x03\footnote{Code 0x03 is reserved to allow backward compatible support of the
3306 DW\_LNE\_define\_file operation which was defined in \DWARFVersionIV{}
3308 \DWLNEsetdiscriminator &0x04 \\
3309 \DWLNElouser &0x80 \\
3310 \DWLNEhiuser &\xff \\
3316 The encodings for the line number header entry formats are given in
3317 \addtoindexx{line number opcodes!file entry format encoding}
3318 Table \refersec{tab:linenumberheaderentryformatencodings}.
3321 \setlength{\extrarowheight}{0.1cm}
3322 \begin{longtable}{l|c}
3323 \caption{Line number header entry format \mbox{encodings}} \label{tab:linenumberheaderentryformatencodings}\\
3324 \hline \bfseries Line number header entry format name&\bfseries Value \\ \hline
3326 \bfseries Line number header entry format name&\bfseries Value\\ \hline
3328 \hline \emph{Continued on next page}
3330 \hline \ddag~\textit{New in DWARF Version 5}
3332 \DWLNCTpath~\ddag & 0x1 \\
3333 \DWLNCTdirectoryindex~\ddag & 0x2 \\
3334 \DWLNCTtimestamp~\ddag & 0x3 \\
3335 \DWLNCTsize~\ddag & 0x4 \\
3336 \DWLNCTMDfive~\ddag & 0x5 \\
3337 \DWLNCTlouser~\ddag & 0x2000 \\
3338 \DWLNCThiuser~\ddag & \xiiifff \\
3343 \section{Macro Information}
3344 \label{datarep:macroinformation}
3345 The \addtoindexi{version number}{version number!macro information}
3346 in the macro information header is \versiondotdebugmacro{}.
3348 The source line numbers and source file indices encoded in the
3349 macro information section are represented as
3350 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
3353 The macro information entry type is encoded as a single unsigned byte.
3355 \addtoindexx{macro information entry types!encoding}
3357 Table \refersec{tab:macroinfoentrytypeencodings}.
3361 \setlength{\extrarowheight}{0.1cm}
3362 \begin{longtable}{l|c}
3363 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
3364 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
3366 \bfseries Macro information entry type name&\bfseries Value\\ \hline
3368 \hline \emph{Continued on next page}
3370 \hline \ddag~\textit{New in DWARF Version 5}
3373 \DWMACROdefine~\ddag &0x01 \\
3374 \DWMACROundef~\ddag &0x02 \\
3375 \DWMACROstartfile~\ddag &0x03 \\
3376 \DWMACROendfile~\ddag &0x04 \\
3377 \DWMACROdefinestrp~\ddag &0x05 \\
3378 \DWMACROundefstrp~\ddag &0x06 \\
3379 \DWMACROimport~\ddag &0x07 \\
3380 \DWMACROdefinesup~\ddag &0x08 \\
3381 \DWMACROundefsup~\ddag &0x09 \\
3382 \DWMACROimportsup~\ddag &0x0a \\
3383 \DWMACROdefinestrx~\ddag &0x0b \\
3384 \DWMACROundefstrx~\ddag &0x0c \\
3385 \DWMACROlouser~\ddag &0xe0 \\
3386 \DWMACROhiuser~\ddag &\xff \\
3392 \section{Call Frame Information}
3393 \label{datarep:callframeinformation}
3395 In the \thirtytwobitdwarfformat, the value of the CIE id in the
3396 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
3397 value is \xffffffffffffffff.
3399 The value of the CIE \addtoindexi{version number}{version number!call frame information}
3400 is \versiondotdebugframe.
3402 Call frame instructions are encoded in one or more bytes. The
3403 primary opcode is encoded in the high order two bits of
3404 the first byte (that is, opcode = byte $\gg$ 6). An operand
3405 or extended opcode may be encoded in the low order 6
3406 bits. Additional operands are encoded in subsequent bytes.
3407 The instructions and their encodings are presented in
3408 Table \refersec{tab:callframeinstructionencodings}.
3411 \setlength{\extrarowheight}{0.1cm}
3412 \begin{longtable}{l|c|c|l|l}
3413 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
3414 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
3415 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3417 & \bfseries High 2 &\bfseries Low 6 & &\\
3418 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
3420 \hline \emph{Continued on next page}
3425 \DWCFAadvanceloc&0x1&delta & \\
3426 \DWCFAoffset&0x2®ister&ULEB128 offset \\
3427 \DWCFArestore&0x3®ister & & \\
3428 \DWCFAnop&0&0 & & \\
3429 \DWCFAsetloc&0&0x01&address & \\
3430 \DWCFAadvancelocone&0&0x02&1-byte delta & \\
3431 \DWCFAadvanceloctwo&0&0x03&2-byte delta & \\
3432 \DWCFAadvancelocfour&0&0x04&4-byte delta & \\
3433 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
3434 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
3435 \DWCFAundefined&0&0x07&ULEB128 register & \\
3436 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
3437 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
3438 \DWCFArememberstate&0&0x0a & & \\
3439 \DWCFArestorestate&0&0x0b & & \\
3440 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
3441 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
3442 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
3443 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
3444 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
3446 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
3447 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
3448 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
3449 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
3450 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
3451 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
3452 \DWCFAlouser&0&0x1c & & \\
3453 \DWCFAhiuser&0&\xiiif & & \\
3457 \section{Range List Entries for Non-contiguous Address Ranges}
3458 \label{datarep:noncontiguousaddressranges}
3459 Each entry in a \addtoindex{range list}
3460 (see Section \refersec{chap:noncontiguousaddressranges})
3462 \addtoindexx{base address selection entry!in range list}
3464 \addtoindexx{range list}
3465 a base address selection entry, or an end-of-list entry.
3467 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
3468 that follows. The encodings for these constants are given in
3469 Table \refersec{tab:rnglistsentryencodingvalues}.
3473 \setlength{\extrarowheight}{0.1cm}
3474 \begin{longtable}{l|c}
3475 \caption{Range list entry encoding values}
3476 \label{tab:rnglistsentryencodingvalues} \\
3477 \hline \bfseries Range list entry encoding name&\bfseries Value \\ \hline
3479 \bfseries Range list entry encoding name&\bfseries Value\\ \hline
3481 \hline \emph{Continued on next page}
3484 \ddag New in \DWARFVersionV
3486 \DWRLEendoflist~\ddag & 0x00 \\
3487 \DWRLEbaseaddressx~\ddag & 0x01 \\
3488 \DWRLEstartxendx~\ddag & 0x02 \\
3489 \DWRLEstartxlength~\ddag & 0x03 \\
3490 \DWRLEoffsetpair~\ddag & 0x04 \\
3491 \DWRLEbaseaddress~\ddag & 0x05 \\
3492 \DWRLEstartend~\ddag & 0x06 \\
3493 \DWRLEstartlength~\ddag & 0x07 \\
3497 For a \addtoindex{range list} to be specified, the base address of the
3498 \addtoindexx{base address selection entry!in range list}
3499 corresponding compilation unit must be defined
3500 (see Section \refersec{chap:fullandpartialcompilationunitentries}).
3503 \section{String Offsets Table}
3504 \label{chap:stringoffsetstable}
3505 Each set of entries in the string offsets table contained in the
3506 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
3507 section begins with a header containing:
3508 \begin{enumerate}[1. ]
3509 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3510 \addttindexx{unit\_length}
3511 A 4-byte or 12-byte length containing the length of
3512 the set of entries for this compilation unit, not
3513 including the length field itself. In the 32-bit
3514 DWARF format, this is a 4-byte unsigned integer
3515 (which must be less than \xfffffffzero); in the 64-bit
3516 DWARF format, this consists of the 4-byte value
3517 \wffffffff followed by an 8-byte unsigned integer
3518 that gives the actual length (see
3519 Section \refersec{datarep:32bitand64bitdwarfformats}).
3522 \item \texttt{version} (\HFTuhalf) \\
3523 \addtoindexx{version number!string offsets table}
3524 A 2-byte version identifier containing the value
3525 \versiondotdebugstroffsets{}.
3527 \item \textit{padding} (\HFTuhalf) \\
3528 Reserved to DWARF (must be zero).
3531 This header is followed by a series of string table offsets
3532 that have the same representation as \DWFORMstrp.
3533 For the 32-bit DWARF format, each offset is 4 bytes long; for
3534 the 64-bit DWARF format, each offset is 8 bytes long.
3536 The \DWATstroffsetsbase{} attribute points to the first
3537 entry following the header. The entries are indexed
3538 sequentially from this base entry, starting from 0.
3540 \section{Address Table}
3541 \label{chap:addresstable}
3542 Each set of entries in the address table contained in the
3543 \dotdebugaddr{} section begins with a header containing:
3544 \begin{enumerate}[1. ]
3545 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3546 \addttindexx{unit\_length}
3547 A 4-byte or 12-byte length containing the length of
3548 the set of entries for this compilation unit, not
3549 including the length field itself. In the 32-bit
3550 DWARF format, this is a 4-byte unsigned integer
3551 (which must be less than \xfffffffzero); in the 64-bit
3552 DWARF format, this consists of the 4-byte value
3553 \wffffffff followed by an 8-byte unsigned integer
3554 that gives the actual length (see
3555 Section \refersec{datarep:32bitand64bitdwarfformats}).
3558 \item \texttt{version} (\HFTuhalf) \\
3559 \addtoindexx{version number!address table}
3560 A 2-byte version identifier containing the value
3561 \versiondotdebugaddr{}.
3564 \item \texttt{address\_size} (\HFTubyte) \\
3565 A 1-byte unsigned integer containing the size in
3566 bytes of an address (or the offset portion of an
3567 address for segmented addressing) on the target
3571 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3572 A 1-byte unsigned integer containing the size in
3573 bytes of a segment selector on the target system.
3576 This header is followed by a series of segment/address pairs.
3577 The segment size is given by the \HFNsegmentselectorsize{} field of the
3578 header, and the address size is given by the \addttindex{address\_size}
3579 field of the header. If the \HFNsegmentselectorsize{} field in the header
3580 is zero, the entries consist only of an addresses.
3582 The \DWATaddrbase{} attribute points to the first entry
3583 following the header. The entries are indexed sequentially
3584 from this base entry, starting from 0.
3587 \section{Range List Table}
3588 \label{app:ranglisttable}
3589 Each \dotdebugrnglists{} and \dotdebugrnglistsdwo{} section
3590 begins with a header containing:
3591 \begin{enumerate}[1. ]
3592 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3593 \addttindexx{unit\_length}
3594 A 4-byte or 12-byte length containing the length of
3595 the set of entries for this compilation unit, not
3596 including the length field itself. In the 32-bit
3597 DWARF format, this is a 4-byte unsigned integer
3598 (which must be less than \xfffffffzero); in the 64-bit
3599 DWARF format, this consists of the 4-byte value
3600 \wffffffff followed by an 8-byte unsigned integer
3601 that gives the actual length (see
3602 Section \refersec{datarep:32bitand64bitdwarfformats}).
3605 \item \texttt{version} (\HFTuhalf) \\
3606 \addtoindexx{version number!range list table}
3607 A 2-byte version identifier containing the value
3608 \versiondotdebugrnglists{}.
3611 \item \texttt{address\_size} (\HFTubyte) \\
3612 A 1-byte unsigned integer containing the size in
3613 bytes of an address (or the offset portion of an
3614 address for segmented addressing) on the target
3618 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3619 A 1-byte unsigned integer containing the size in
3620 bytes of a segment selector on the target system.
3622 \item \HFNoffsetentrycount{} (\HFTuword) \\
3623 A 4-byte count of the number of offsets
3624 that follow the header.
3626 This count may be zero.
3630 Immediately following the header is an array of offsets.
3631 This array is followed by a series of range lists.
3634 If the \HFNoffsetentrycount{} is non-zero, there
3636 is one offset for each range list.
3638 of the $i$\textsuperscript{th} offset is the offset
3640 (an unsigned integer)
3643 beginning of the offset array to the location of the
3644 $i$\textsuperscript{th} range list.
3646 In the 32-bit DWARF format, each offset is 4-bytes in size;
3647 in the 64-bit DWARF format, each offset is 8-bytes in size
3648 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3652 If the \HFNoffsetentrycount{} is zero, then \DWFORMrnglistx{} cannot
3653 be used to access a range list; \DWFORMsecoffset{} must be used
3654 instead. If the \HFNoffsetentrycount{} is non-zero, then \DWFORMrnglistx{}
3655 may be used to access a range list; this is necessary in split units and
3656 may be more compact than using \DWFORMsecoffset in non-split units.
3661 described in Section \refersec{chap:noncontiguousaddressranges}.
3664 The segment size is given by the
3665 \HFNsegmentselectorsize{} field of the header, and the address size is
3666 given by the \addttindex{address\_size} field of the header. If the
3667 \HFNsegmentselectorsize{} field in the header is zero, the segment
3668 selector is omitted from the range list entries.
3670 The \DWATrnglistsbase{} attribute points to the first offset
3671 following the header. The range lists are referenced
3672 by the index of the position of their corresponding offset in the
3673 array of offsets, which indirectly specifies the offset to the
3677 \section{Location List Table}
3678 \label{datarep:locationlisttable}
3679 Each \dotdebugloclists{} or \dotdebugloclistsdwo{} section
3680 begins with a header containing:
3681 \begin{enumerate}[1. ]
3682 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3683 \addttindexx{unit\_length}
3684 A 4-byte or 12-byte length containing the length of
3685 the set of entries for this compilation unit, not
3686 including the length field itself. In the 32-bit
3687 DWARF format, this is a 4-byte unsigned integer
3688 (which must be less than \xfffffffzero); in the 64-bit
3689 DWARF format, this consists of the 4-byte value
3690 \wffffffff followed by an 8-byte unsigned integer
3691 that gives the actual length (see
3692 Section \refersec{datarep:32bitand64bitdwarfformats}).
3695 \item \texttt{version} (\HFTuhalf) \\
3696 \addtoindexx{version number!location list table}
3697 A 2-byte version identifier containing the value
3698 \versiondotdebugloclists{}.
3701 \item \texttt{address\_size} (\HFTubyte) \\
3702 A 1-byte unsigned integer containing the size in
3703 bytes of an address (or the offset portion of an
3704 address for segmented addressing) on the target
3708 \item \HFNsegmentselectorsize{} (\HFTubyte) \\
3709 A 1-byte unsigned integer containing the size in
3710 bytes of a segment selector on the target system.
3712 \item \HFNoffsetentrycount{} (\HFTuword) \\
3713 A 4-byte count of the number of offsets
3714 that follow the header.
3716 This count may be zero.
3720 Immediately following the header is an array of offsets.
3721 This array is followed by a series of location lists.
3724 If the \HFNoffsetentrycount{} is non-zero, there
3726 is one offset for each location list. The contents
3727 of the $i$\textsuperscript{th} offset is the offset
3729 (an unsigned integer)
3732 beginning of the offset array to the location of the
3733 $i$\textsuperscript{th} location list.
3735 In the 32-bit DWARF format, each offset is 4-bytes in size;
3736 in the 64-bit DWARF format, each offset is 8-bytes in size
3737 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
3741 If the \HFNoffsetentrycount{} is zero, then \DWFORMloclistx{} cannot
3742 be used to access a location list; \DWFORMsecoffset{} must be used
3743 instead. If the \HFNoffsetentrycount{} is non-zero, then \DWFORMloclistx{}
3744 may be used to access a location list; this is necessary in split units and
3745 may be more compact than using \DWFORMsecoffset in non-split units.
3750 described in Section \refersec{chap:locationlists}.
3752 The segment size is given by the
3753 \HFNsegmentselectorsize{} field of the header, and the address size is
3754 given by the \HFNaddresssize{} field of the header. If the
3755 \HFNsegmentselectorsize{} field in the header is zero, the segment
3756 selector is omitted from location list entries.
3758 The \DWATloclistsbase{} attribute points to the first offset
3759 following the header. The location lists are referenced
3760 by the index of the position of their corresponding offset in the
3761 array of offsets, which indirectly specifies the offset to the
3765 \section{Dependencies and Constraints}
3766 \label{datarep:dependenciesandconstraints}
3767 The debugging information in this format is intended to
3768 exist in sections of an object file, or an equivalent
3769 separate file or database, having names beginning with
3770 the prefix ".debug\_" (see Appendix
3771 \refersec{app:dwarfsectionversionnumbersinformative}
3772 for a complete list of such names).
3773 Except as specifically specified, this information is not
3774 aligned on 2-, 4- or 8-byte boundaries. Consequently:
3777 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3778 32-bit addresses, an assembler or compiler must provide a way
3779 to produce 2-byte and 4-byte quantities without alignment
3780 restrictions, and the linker must be able to relocate a
3782 \addtoindexx{section offset!alignment of}
3783 section offset that occurs at an arbitrary
3786 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3787 64-bit addresses, an assembler or compiler must provide a
3788 way to produce 2-byte, 4-byte and 8-byte quantities without
3789 alignment restrictions, and the linker must be able to relocate
3790 an 8-byte address or 4-byte
3791 \addtoindexx{section offset!alignment of}
3792 section offset that occurs at an
3793 arbitrary alignment.
3795 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3796 32-bit addresses, an assembler or compiler must provide a
3797 way to produce 2-byte, 4-byte and 8-byte quantities without
3798 alignment restrictions, and the linker must be able to relocate
3799 a 4-byte address or 8-byte
3800 \addtoindexx{section offset!alignment of}
3801 section offset that occurs at an
3802 arbitrary alignment.
3804 \textit{It is expected that this will be required only for very large
3805 32-bit programs or by those architectures which support
3806 a mix of 32-bit and 64-bit code and data within the same
3809 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3810 64-bit addresses, an assembler or compiler must provide a
3811 way to produce 2-byte, 4-byte and 8-byte quantities without
3812 alignment restrictions, and the linker must be able to
3813 relocate an 8-byte address or
3814 \addtoindexx{section offset!alignment of}
3815 section offset that occurs at
3816 an arbitrary alignment.
3820 \section{Integer Representation Names}
3821 \label{datarep:integerrepresentationnames}
3822 The sizes of the integers used in the lookup by name, lookup
3823 by address, line number, call frame information and other sections
3825 Table \ref{tab:integerrepresentationnames}.
3829 \setlength{\extrarowheight}{0.1cm}
3830 \begin{longtable}{c|l}
3831 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3832 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3834 \bfseries Representation name&\bfseries Representation\\ \hline
3836 \hline \emph{Continued on next page}
3841 \HFTsbyte& signed, 1-byte integer \\
3842 \HFTubyte&unsigned, 1-byte integer \\
3843 \HFTuhalf&unsigned, 2-byte integer \\
3844 \HFTuword&unsigned, 4-byte integer \\
3850 \section{Type Signature Computation}
3851 \label{datarep:typesignaturecomputation}
3853 A \addtoindex{type signature} is used by a DWARF consumer
3854 to resolve type references to the type definitions that
3855 are contained in \addtoindex{type unit}s (see Section
3856 \refersec{chap:typeunitentries}).
3858 \textit{A type signature is computed only by a DWARF producer;
3859 \addtoindexx{type signature!computation} a consumer need
3860 only compare two type signatures to check for equality.}
3863 The type signature for a type T0 is formed from the
3864 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3865 R.L. Rivest, RFC 1321, April 1992}
3866 digest of a flattened description of the type. The flattened
3867 description of the type is a byte sequence derived from the
3868 DWARF encoding of the type as follows:
3869 \begin{enumerate}[1. ]
3871 \item Start with an empty sequence S and a list V of visited
3872 types, where V is initialized to a list containing the type
3873 T0 as its single element. Elements in V are indexed from 1,
3876 \item If the debugging information entry represents a type that
3877 is nested inside another type or a namespace, append to S
3878 the type\textquoteright s context as follows: For each surrounding type
3879 or namespace, beginning with the outermost such construct,
3880 append the letter 'C', the DWARF tag of the construct, and
3881 the name (taken from
3882 \addtoindexx{name attribute}
3883 the \DWATname{} attribute) of the type
3884 \addtoindexx{name attribute}
3885 or namespace (including its trailing null byte).
3887 \item Append to S the letter 'D', followed by the DWARF tag of
3888 the debugging information entry.
3890 \item For each of the attributes in
3891 Table \refersec{tab:attributesusedintypesignaturecomputation}
3893 the debugging information entry, in the order listed,
3894 append to S a marker letter (see below), the DWARF attribute
3895 code, and the attribute value.
3898 \caption{Attributes used in type signature computation}
3899 \label{tab:attributesusedintypesignaturecomputation}
3900 \simplerule[\textwidth]
3902 \autocols[0pt]{c}{2}{l}{
3918 \DWATcontainingtype,
3922 \DWATdatamemberlocation,
3943 \DWATrvaluereference,
3947 \DWATstringlengthbitsize,
3948 \DWATstringlengthbytesize,
3953 \DWATvariableparameter,
3956 \DWATvtableelemlocation
3959 \simplerule[\textwidth]
3962 Note that except for the initial
3963 \DWATname{} attribute,
3964 \addtoindexx{name attribute}
3965 attributes are appended in order according to the alphabetical
3966 spelling of their identifier.
3969 If an implementation defines any vendor-specific attributes,
3970 any such attributes that are essential to the definition of
3971 the type are also included at the end of the above list,
3972 in their own alphabetical suborder.
3974 An attribute that refers to another type entry T is processed
3976 \begin{enumerate}[ a)]
3978 If T is in the list V at some V[x], use the
3979 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3980 encoding of x as the attribute value.
3983 Otherwise, append type T to the list V, then
3985 as the marker, process the type T recursively by performing
3986 Steps 2 through 7, and use the result as the attribute value.
3990 Other attribute values use the letter 'A' as the marker, and
3991 the value consists of the form code (encoded as an unsigned
3992 LEB128 value) followed by the encoding of the value according
3993 to the form code. To ensure reproducibility of the signature,
3994 the set of forms used in the signature computation is limited
4002 \item If the tag in Step 3 is one of \DWTAGpointertype,
4003 \DWTAGreferencetype,
4004 \DWTAGrvaluereferencetype,
4005 \DWTAGptrtomembertype,
4006 or \DWTAGfriend, and the referenced
4007 type (via the \DWATtype{} or
4008 \DWATfriend{} attribute) has a
4009 \DWATname{} attribute, append to S the letter 'N', the DWARF
4010 attribute code (\DWATtype{} or
4011 \DWATfriend), the context of
4012 the type (according to the method in Step 2), the letter 'E',
4013 and the name of the type. For \DWTAGfriend, if the referenced
4014 entry is a \DWTAGsubprogram, the context is omitted and the
4015 name to be used is the ABI-specific name of the subprogram
4016 (for example, the mangled linker name).
4019 \item If the tag in Step 3 is not one of \DWTAGpointertype,
4020 \DWTAGreferencetype,
4021 \DWTAGrvaluereferencetype,
4022 \DWTAGptrtomembertype, or
4023 \DWTAGfriend, but has
4024 a \DWATtype{} attribute, or if the referenced type (via
4026 \DWATfriend{} attribute) does not have a
4027 \DWATname{} attribute, the attribute is processed according to
4028 the method in Step 4 for an attribute that refers to another
4032 \item Visit each child C of the debugging information
4033 entry as follows: If C is a nested type entry or a member
4034 function entry, and has
4035 a \DWATname{} attribute, append to
4036 \addtoindexx{name attribute}
4037 S the letter 'S', the tag of C, and its name; otherwise,
4038 process C recursively by performing Steps 3 through 7,
4039 appending the result to S. Following the last child (or if
4040 there are no children), append a zero byte.
4045 For the purposes of this algorithm, if a debugging information
4047 \DWATspecification{}
4048 attribute that refers to
4049 another entry D (which has a
4052 then S inherits the attributes and children of D, and S is
4053 processed as if those attributes and children were present in
4054 the entry S. Exception: if a particular attribute is found in
4055 both S and D, the attribute in S is used and the corresponding
4056 one in D is ignored.
4059 DWARF tag and attribute codes are appended to the sequence
4060 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
4061 using the values defined earlier in this chapter.
4063 \textit{A grammar describing this computation may be found in
4064 Appendix \refersec{app:typesignaturecomputationgrammar}.
4067 \textit{An attribute that refers to another type entry is
4068 recursively processed or replaced with the name of the
4069 referent (in Step 4, 5 or 6). If neither treatment applies to
4070 an attribute that references another type entry, the entry
4071 that contains that attribute is not suitable for a
4072 separate \addtoindex{type unit}.}
4074 \textit{If a debugging information entry contains an attribute from
4075 the list above that would require an unsupported form, that
4076 entry is not suitable for a separate
4077 \addtoindex{type unit}.}
4079 \textit{A type is suitable for a separate
4080 \addtoindex{type unit} only
4081 if all of the type entries that it contains or refers to in
4082 Steps 6 and 7 are themselves suitable for a separate
4083 \addtoindex{type unit}.}
4086 \textit{Where the DWARF producer may reasonably choose two or
4087 more different forms for a given attribute, it should choose
4088 the simplest possible form in computing the signature. (For
4089 example, a constant value should be preferred to a location
4090 expression when possible.)}
4092 Once the string S has been formed from the DWARF encoding,
4093 an 16-byte \MDfive{} digest is computed for the string and the
4094 last eight bytes are taken as the type signature.
4096 \textit{The string S is intended to be a flattened representation of
4097 the type that uniquely identifies that type (that is, a different
4098 type is highly unlikely to produce the same string).}
4101 \textit{A debugging information entry is not be placed in a
4102 separate \addtoindex{type unit}
4103 if any of the following apply:}
4107 \item \textit{The entry has an attribute whose value is a location
4108 description, and the location description
4109 contains a reference to
4110 another debugging information entry (for example, a \DWOPcallref{}
4111 operator), as it is unlikely that the entry will remain
4112 identical across compilation units.}
4114 \item \textit{The entry has an attribute whose value refers
4115 to a code location or a \addtoindex{location list}.}
4117 \item \textit{The entry has an attribute whose value refers
4118 to another debugging information entry that does not represent
4124 \textit{Certain attributes are not included in the type signature:}
4127 \item \textit{The \DWATdeclaration{} attribute is not included because it
4128 indicates that the debugging information entry represents an
4129 incomplete declaration, and incomplete declarations should
4131 \addtoindexx{type unit}
4132 separate type units.}
4134 \item \textit{The \DWATdescription{} attribute is not included because
4135 it does not provide any information unique to the defining
4136 declaration of the type.}
4138 \item \textit{The \DWATdeclfile,
4140 \DWATdeclcolumn{} attributes are not included because they
4141 may vary from one source file to the next, and would prevent
4142 two otherwise identical type declarations from producing the
4143 same \MDfive{} digest.}
4145 \item \textit{The \DWATobjectpointer{} attribute is not included
4146 because the information it provides is not necessary for the
4147 computation of a unique type signature.}
4151 \textit{Nested types and some types referred to by a debugging
4152 information entry are encoded by name rather than by recursively
4153 encoding the type to allow for cases where a complete definition
4154 of the type might not be available in all compilation units.}