1 \chapter{Data Representation}
2 \label{datarep:datarepresentation}
4 This section describes the binary representation of the
5 debugging information entry itself, of the attribute types
6 and of other fundamental elements described above.
9 \section{Vendor Extensibility}
10 \label{datarep:vendorextensibility}
11 \addtoindexx{vendor extensibility}
12 \addtoindexx{vendor specific extensions|see{vendor extensibility}}
15 \addtoindexx{extensibility|see{vendor extensibility}}
16 reserve a portion of the DWARF name space and ranges of
17 enumeration values for use for vendor specific extensions,
18 special labels are reserved for tag names, attribute names,
19 base type encodings, location operations, language names,
20 calling conventions and call frame instructions.
22 The labels denoting the beginning and end of the reserved
23 \hypertarget{chap:DWXXXlohiuser}{}
24 value range for vendor specific extensions consist of the
26 (\DWATlouserMARK{}\DWAThiuserMARK{} DW\_AT,
27 \DWATElouserMARK{}\DWATEhiuserMARK{} DW\_ATE,
28 \DWCClouserMARK{}\DWCChiuserMARK{} DW\_CC,
29 \DWCFAlouserMARK{}\DWCFAhiuserMARK{} DW\_CFA
30 \DWENDlouserMARK{}\DWENDhiuserMARK{} DW\_END,
31 \DWLANGlouserMARK{}\DWLANGhiuserMARK{} DW\_LANG,
32 \DWLNElouserMARK{}\DWLNEhiuserMARK{} DW\_LNE,
33 \DWMACROlouserMARK{}\DWMACROhiuserMARK{}DW\_MACRO,
34 \DWOPlouserMARK{}\DWOPhiuserMARK{} DW\_OP or
35 \DWTAGlouserMARK{}\DWTAGhiuserMARK{} DW\_TAG,
36 respectively) followed by
37 \_lo\_user or \_hi\_user.
38 Values in the range between \textit{prefix}\_lo\_user
39 and \textit{prefix}\_hi\_user inclusive,
40 are reserved for vendor specific extensions. Vendors may
41 use values in this range without conflicting with current or
42 future system\dash defined values. All other values are reserved
43 for use by the system.
45 \textit{For example, for DIE tags, the special
46 labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
48 \textit{There may also be codes for vendor specific extensions
49 between the number of standard line number opcodes and
50 the first special line number opcode. However, since the
51 number of standard opcodes varies with the DWARF version,
52 the range for extensions is also version dependent. Thus,
53 \DWLNSlouserTARG{} and
54 \DWLNShiuserTARG{} symbols are not defined.
57 Vendor defined tags, attributes, base type encodings, location
58 atoms, language names, line number actions, calling conventions
59 and call frame instructions, conventionally use the form
60 \text{prefix\_vendor\_id\_name}, where
61 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
62 character sequence chosen so as to avoid conflicts with
65 To ensure that extensions added by one vendor may be safely
66 ignored by consumers that do not understand those extensions,
67 the following rules should be followed:
68 \begin{enumerate}[1. ]
70 \item New attributes should be added in such a way that a
71 debugger may recognize the format of a new attribute value
72 without knowing the content of that attribute value.
74 \item The semantics of any new attributes should not alter
75 the semantics of previously existing attributes.
77 \item The semantics of any new tags should not conflict with
78 the semantics of previously existing tags.
80 \item Do not add any new forms of attribute value.
85 \section{Reserved Values}
86 \label{datarep:reservedvalues}
87 \subsection{Error Values}
88 \label{datarep:errorvalues}
89 \addtoindexx{reserved values!error}
92 \addtoindexx{error value}
93 a convenience for consumers of DWARF information, the value
94 0 is reserved in the encodings for attribute names, attribute
95 forms, base type encodings, location operations, languages,
96 line number program opcodes, macro information entries and tag
97 names to represent an error condition or unknown value. DWARF
98 does not specify names for these reserved values, since they
99 do not represent valid encodings for the given type and should
100 not appear in DWARF debugging information.
103 \subsection{Initial Length Values}
104 \label{datarep:initiallengthvalues}
105 \addtoindexx{reserved values!initial length}
107 An \livetarg{datarep:initiallengthvalues}{initial length field} is one of the length fields that occur
109 of those DWARF sections that
114 \dotdebugpubnames{}, and
115 \dotdebugpubtypes{}) or the length field
116 that occurs at the beginning of the CIE and FDE structures
117 in the \dotdebugframe{} section.
120 In an \addtoindex{initial length field}, the values \wfffffffzero through
121 \wffffffff are reserved by DWARF to indicate some form of
122 extension relative to \addtoindex{DWARF Version 2}; such values must not
123 be interpreted as a length field. The use of one such value,
124 \xffffffff, is defined below
125 (see Section \refersec{datarep:32bitand64bitdwarfformats});
127 the other values is reserved for possible future extensions.
131 \section{Relocatable, Split, Executable, Shared and Package Object Files}
132 \label{datarep:executableobjectsandsharedobjects}
134 \subsection{Relocatable Objects}
136 \subsection{Split DWARF Objects}
137 \label{datarep:splitdwarfobjects}
138 A DWARF producer may partition the debugging
139 information such that the majority of the debugging
140 information can remain in individual object files without
141 being processed by the linker. The first partition contains
142 debugging information that must still be processed by the linker,
143 and includes the following:
146 The line number tables, range tables, frame tables, and
147 accelerated access tables, in the usual sections:
148 \dotdebugline, \dotdebugranges, \dotdebugframe,
149 \dotdebugpubnames, \dotdebugpubtypes{} and \dotdebugaranges,
152 An address table, in the \dotdebugaddr{} section. This table
153 contains all addresses and constants that require
154 link-time relocation, and items in the table can be
155 referenced indirectly from the debugging information via
156 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
157 \DWOPconstx{} operators.
159 A skeleton compilation unit, as described in Section
160 \refersec{chap:skeletoncompilationunitentries},
161 in the \dotdebuginfo{} section.
163 An abbreviations table for the skeleton compilation unit,
164 in the \dotdebugabbrev{} section.
166 A string table, in the \dotdebugstr{} section. The string
167 table is necessary only if the skeleton compilation unit
168 uses either indirect string form, \DWFORMstrp{} or
171 A string offsets table, in the \dotdebugstroffsets{}
172 section. The string offsets table is necessary only if
173 the skeleton compilation unit uses the \DWFORMstrx{} form.
175 The attributes contained in the skeleton compilation
176 unit can be used by a DWARF consumer to find the object file
177 or DWARF object file that contains the second partition.
179 The second partition contains the debugging information that
180 does not need to be processed by the linker. These sections
181 may be left in the object files and ignored by the linker
182 (that is, not combined and copied to the executable object), or
183 they may be placed by the producer in a separate DWARF object
184 file. This partition includes the following:
187 The full compilation unit, in the \dotdebuginfodwo{} section.
188 Attributes in debugging information entries may refer to
189 machine addresses indirectly using the \DWFORMaddrx{} form,
190 and location expressions may do so using the \DWOPaddrx{} and
191 \DWOPconstx{} forms. Attributes may refer to range table
192 entries with an offset relative to a base offset in the
193 range table for the compilation unit.
195 \item Separate type units, in the \dotdebuginfodwo{} section.
198 Abbreviations table(s) for the compilation unit and type
199 units, in the \dotdebugabbrevdwo{} section.
201 \item Location lists, in the \dotdebuglocdwo{} section.
204 A skeleton line table (for the type units), in the
205 \dotdebuglinedwo{} section (see
206 Section \refersec{chap:skeletoncompilationunitentries}).
208 \item Macro information, in the \dotdebugmacrodwo{} section.
210 \item A string table, in the \dotdebugstrdwo{} section.
212 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
216 Except where noted otherwise, all references in this document
217 to a debugging information section (for example, \dotdebuginfo),
218 applies also to the corresponding split DWARF section (for example,
221 \subsection{Executable Objects}
222 \label{chap:executableobjects}
223 The relocated addresses in the debugging information for an
224 executable object are virtual addresses.
226 \subsection{Shared Objects}
227 \label{datarep:sharedobjects}
229 addresses in the debugging information for a shared object
230 are offsets relative to the start of the lowest region of
231 memory loaded from that shared object.
234 \textit{This requirement makes the debugging information for
235 shared objects position independent. Virtual addresses in a
236 shared object may be calculated by adding the offset to the
237 base address at which the object was attached. This offset
238 is available in the run\dash time linker\textquoteright s data structures.}
240 \subsection{DWARF Package Files}
241 \label{datarep:dwarfpackagefiles}
242 \textit{Using split DWARF objects allows the developer to compile,
243 link, and debug an application quickly with less link-time overhead,
244 but a more convenient format is needed for saving the debug
245 information for later debugging of a deployed application. A
246 DWARF package file can be used to collect the debugging
247 information from the object (or separate DWARF object) files
248 produced during the compilation of an application.}
250 \textit{The package file is typically placed in the same directory as the
251 application, and is given the same name with a \doublequote{\texttt{.dwp}}
252 extension.\addtoindexx{\texttt{.dap} file extension}}
254 A DWARF package file is itself an object file, using the
255 \addtoindexx{package files}
256 \addtoindexx{DWARF package files}
257 same object file format, byte order, and size as the
258 corresponding application binary. It consists only of a file
259 header, section table, a number of DWARF debug information
260 sections, and two index sections.
262 Each DWARF package file contains no more than one of each of the
263 following sections, copied from a set of object or DWARF object
264 files, and combined, section by section:
270 \dotdebugstroffsetsdwo
275 The string table section in \dotdebugstrdwo{} contains all the
276 strings referenced from DWARF attributes using the form
277 \DWFORMstrx. Any attribute in a compilation unit or a type
278 unit using this form will refer to an entry in that unit's
279 contribution to the \dotdebugstroffsetsdwo{} section, which in turn
280 will provide the offset of a string in the \dotdebugstrdwo{}
283 The DWARF package file also contains two index sections that
284 provide a fast way to locate debug information by compilation
285 unit signature (\DWATdwoid) for compilation units, or by type
286 signature for type units:
292 \subsubsection{The Compilation Unit (CU) Index Section}
293 The \dotdebugcuindex{} section is a hashed lookup table that maps a
294 compilation unit signature to a set of contributions in the
295 various debug information sections. Each contribution is stored
296 as an offset within its corresponding section and a size.
298 Each compilation unit set may contain contributions from the
301 \dotdebuginfodwo{} (required)
302 \dotdebugabbrevdwo{} (required)
305 \dotdebugstroffsetsdwo
309 \textit{Note that a set is not able to represent \dotdebugmacinfo{}
310 information from \DWARFVersionIV{} or earlier formats.}
312 \subsubsection{The Type Unit (TU) Index Section}
313 The \dotdebugtuindex{} section is a hashed lookup table that maps a
314 type signature to a set of offsets into the various debug
315 information sections. Each contribution is stored as an offset
316 within its corresponding section and a size.
318 Each type unit set may contain contributions from the following
321 \dotdebuginfodwo{} (required)
322 \dotdebugabbrevdwo{} (required)
324 \dotdebugstroffsetsdwo
327 \subsubsection{Format of the CU and TU Index Sections}
328 Both index sections have the same format, and serve to map a
329 64-bit signature to a set of contributions to the debug sections.
330 Each section begins with a header, followed by a hash table of
331 signatures, a parallel table of indexes, a table of offsets, and
332 a table of sizes. The index sections are aligned at 8-byte
333 boundaries in the file.
336 The index section header contains four unsigned 32-bit values
337 (using the byte order of the application binary):
339 \item The \addtoindexi{version number}{version number!package index tables}
340 of the format of this index (currently 5)
341 \item L, the number of columns in the table of section offsets
342 \item N, the number of compilation units or type units in the index
343 \item M, the number of slots in the hash table
346 \textit{We assume that N and M will not exceed $2^{32}$.}
348 The size of the hash table, M, must be $2^k$ such that:
349 \hspace{0.3cm}$2^k\ \ >\ \ 3*N/2$
351 The hash table begins at offset 16 in the section, and consists
352 of an array of M 64-bit slots. Each slot contains a 64-bit
353 signature (using the byte order of the application binary).
355 The parallel table begins immediately after the hash table (at
356 offset \mbox{16 + 8 * M} from the beginning of the section), and
357 consists of an array of M 32-bit slots (using the byte order of
358 the application binary), corresponding 1-1 with slots in the hash
359 table. Each entry in the parallel table contains a row index into
360 the tables of offsets and sizes.
362 Unused slots in the hash table have 0 in both the hash table
363 entry and the parallel table entry. While 0 is a valid hash
364 value, the row index in a used slot will always be non-zero.
366 Given a 64-bit compilation unit signature or a type signature S,
367 an entry in the hash table is located as follows:
368 \begin{enumerate}[1. ]
369 \item Calculate a primary hash $H = S\ \&\ MASK(k)$, where $MASK(k)$ is a
370 mask with the low-order k bits all set to 1.
372 \item Calculate a secondary hash $H' = (((S>>32)\ \&\ MASK(k))\ |\ 1)$.
374 \item If the hash table entry at index H matches the signature, use
375 that entry. If the hash table entry at index H is unused (all
376 zeroes), terminate the search: the signature is not present
379 \item Let $H = (H + H')\ modulo\ M$. Repeat at Step 3.
382 Because $M > N$, and H' and M are relatively prime, the search is
383 guaranteed to stop at an unused slot or find the match.
386 The table of offsets begins immediately following the parallel
387 table (at offset \mbox{16 + 12 * M} from the beginning of the section).
388 The table is a two-dimensional array of 32-bit words (using the
389 byte order of the application binary), with L columns and N+1
390 rows, in row-major order. Each row in the array is indexed
391 starting from 0. The first row provides a key to the columns:
392 each column in this row provides an identifier for a debug
393 section, and the offsets in the same column of subsequent rows
394 refer to that section. The section identifiers are shown in
395 Table \referfol{tab:dwarfpackagefilesectionidentifierencodings}.
398 \setlength{\extrarowheight}{0.1cm}
399 \begin{longtable}{l|c|l}
400 \caption{DWARF package file section identifier \mbox{encodings}}
401 \label{tab:dwarfpackagefilesectionidentifierencodings}
402 \addtoindexx{DWARF package files!section identifier encodings} \\
403 \hline \bfseries Section identifier &\bfseries Value &\bfseries Section \\ \hline
405 \bfseries Section identifier &\bfseries Value &\bfseries Section\\ \hline
407 \hline \emph{Continued on next page}
411 \DWSECTINFOTARG & 1 & \dotdebuginfodwo \\
412 \textit(reserved) & 2 & \\
413 \DWSECTABBREVTARG & 3 & \dotdebugabbrevdwo \\
414 \DWSECTLINETARG & 4 & \dotdebuglinedwo \\
415 \DWSECTLOCTARG & 5 & \dotdebuglocdwo \\
416 \DWSECTSTROFFSETSTARG & 6 & \dotdebugstroffsetsdwo \\
417 %DWSECTMACINFO & & \dotdebugmacinfodwo \\
418 \DWSECTMACROTARG & 7 & \dotdebugmacrodwo \\
422 The offsets provided by the CU and TU index sections are the base
423 offsets for the contributions made by each CU or TU to the
424 corresponding section in the package file. Each CU and TU header
425 contains an \texttt{abbrev\_offset} field, used to find the abbreviations
426 table for that CU or TU within the contribution to the
427 \dotdebugabbrevdwo{} section for that CU or TU, and should be
428 interpreted as relative to the base offset given in the index
429 section. Likewise, offsets into \dotdebuglinedwo{} from
430 \DWATstmtlist{} attributes should be interpreted as relative to
431 the base offset for \dotdebuglinedwo{}, and offsets into other debug
432 sections obtained from DWARF attributes should also be
433 interpreted as relative to the corresponding base offset.
435 The table of sizes begins immediately following the table of
436 offsets, and provides the sizes of the contributions made by each
437 CU or TU to the corresponding section in the package file. Like
438 the table of offsets, it is a two-dimensional array of 32-bit
439 words, with L columns and N rows, in row-major order. Each row in
440 the array is indexed starting from 1 (row 0 of the table of
441 offsets also serves as the key for the table of sizes).
444 \section{32-Bit and 64-Bit DWARF Formats}
445 \label{datarep:32bitand64bitdwarfformats}
446 \hypertarget{datarep:xxbitdwffmt}{}
447 \addtoindexx{32-bit DWARF format}
448 \addtoindexx{64-bit DWARF format}
449 There are two closely related file formats. In the 32\dash bit DWARF
450 format, all values that represent lengths of DWARF sections
451 and offsets relative to the beginning of DWARF sections are
452 represented using 32\dash bits. In the 64\dash bit DWARF format, all
453 values that represent lengths of DWARF sections and offsets
454 relative to the beginning of DWARF sections are represented
455 using 64\dash bits. A special convention applies to the initial
456 length field of certain DWARF sections, as well as the CIE and
457 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
458 can coexist and be distinguished within a single linked object.
460 The differences between the 32\dash\ and 64\dash bit
462 detailed in the following:
463 \begin{enumerate}[1. ]
465 \item In the 32\dash bit DWARF format, an
466 \addtoindex{initial length field}
468 \addtoindexx{initial length field!encoding}
469 Section \ref{datarep:initiallengthvalues} on page \pageref{datarep:initiallengthvalues})
470 is an unsigned 32\dash bit integer (which
471 must be less than \xfffffffzero); in the 64\dash bit DWARF format,
472 an \addtoindex{initial length field} is 96 bits in size,
475 \item The first 32\dash bits have the value \xffffffff.
477 \item The following 64\dash bits contain the actual length
478 represented as an unsigned 64\dash bit integer.
481 \textit{This representation allows a DWARF consumer to dynamically
482 detect that a DWARF section contribution is using the 64\dash bit
483 format and to adapt its processing accordingly.}
485 \item Section offset and section length
486 \hypertarget{datarep:sectionoffsetlength}{}
487 \addtoindexx{section length!use in headers}
489 \addtoindexx{section offset!use in headers}
490 in the headers of DWARF sections (other
491 \addtoindexx{initial length field}
493 \addtoindex{initial length}
494 fields) are listed following. In the 32\dash bit DWARF format these
495 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
497 \addtoindexx{section length!in .debug\_aranges header}
499 \addtoindexx{section length!in .debug\_pubnames header}
501 \addtoindexx{section length!in .debug\_pubtypes header}
502 unsigned integer values.
506 Section &Name & Role \\ \hline
507 \dotdebugaranges{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
508 \dotdebugframe{}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
509 \dotdebugframe{}/FDE & \addtoindex{CIE\_pointer} & offset in \dotdebugframe{} \\
510 \dotdebuginfo{} & \addtoindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
511 \dotdebugline{} & \addtoindex{header\_length} & length of header itself \\
512 \dotdebugpubnames{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
513 & \addtoindex{debug\_info\_length} & length of \dotdebuginfo{} \\
515 \dotdebugpubtypes{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
516 & \addtoindex{debug\_info\_length} & length of \dotdebuginfo{} \\
521 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
522 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
523 union must be accessed to distinguish whether a CIE or FDE is
524 present, consequently, these two fields must exactly overlay
525 each other (both offset and size).
527 \item Within the body of the \dotdebuginfo{}
528 section, certain forms of attribute value depend on the choice
529 of DWARF format as follows. For the 32\dash bit DWARF format,
530 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
531 format, the value is a 64\dash bit unsigned integer.
534 Form & Role \\ \hline
535 \DWFORMrefaddr& offset in \dotdebuginfo{} \\
536 \DWFORMsecoffset& offset in a section other than \\
537 &\dotdebuginfo{} or \dotdebugstr{} \\
538 \DWFORMstrp&offset in \dotdebugstr{} \\
539 \DWOPcallref&offset in \dotdebuginfo{} \\
543 \item Within the body of the \dotdebugpubnames{} and
545 sections, the representation of the first field
546 of each tuple (which represents an offset in the
548 section) depends on the DWARF format as follows: in the
549 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
550 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
553 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
554 sections, the size of entries in the body depend on the DWARF
555 format as follows: in the 32-bit DWARF format, entries are 32-bit
556 unsigned integer values; in the 64-bit DWARF format, they are
557 64-bit unsigned integers.
559 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
560 sections, the contents of the address size fields depends on the
561 DWARF format as follows: in the 32-bit DWARF format, these fields
562 contain 4; in the 64-bit DWARF format these fields contain 8.
566 The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
567 intermixed within a single compilation unit.
569 \textit{Attribute values and section header fields that represent
570 addresses in the target program are not affected by these
573 A DWARF consumer that supports the 64\dash bit DWARF format must
574 support executables in which some compilation units use the
575 32\dash bit format and others use the 64\dash bit format provided that
576 the combination links correctly (that is, provided that there
577 are no link\dash time errors due to truncation or overflow). (An
578 implementation is not required to guarantee detection and
579 reporting of all such errors.)
581 \textit{It is expected that DWARF producing compilers will \emph{not} use
582 the 64\dash bit format \emph{by default}. In most cases, the division of
583 even very large applications into a number of executable and
584 shared objects will suffice to assure that the DWARF sections
585 within each individual linked object are less than 4 GBytes
586 in size. However, for those cases where needed, the 64\dash bit
587 format allows the unusual case to be handled as well. Even
588 in this case, it is expected that only application supplied
589 objects will need to be compiled using the 64\dash bit format;
590 separate 32\dash bit format versions of system supplied shared
591 executable libraries can still be used.}
595 \section{Format of Debugging Information}
596 \label{datarep:formatofdebugginginformation}
598 For each compilation unit compiled with a DWARF producer,
599 a contribution is made to the \dotdebuginfo{} section of
600 the object file. Each such contribution consists of a
601 compilation unit header
602 (see Section \refersec{datarep:compilationunitheader})
604 single \DWTAGcompileunit{} or
605 \DWTAGpartialunit{} debugging
606 information entry, together with its children.
608 For each type defined in a compilation unit, a separate
609 contribution may also be made to the
611 section of the object file. Each
612 such contribution consists of a
613 \addtoindex{type unit} header
614 (see Section \refersec{datarep:typeunitheader})
615 followed by a \DWTAGtypeunit{} entry, together with
618 Each debugging information entry begins with a code that
619 represents an entry in a separate
620 \addtoindex{abbreviations table}. This
621 code is followed directly by a series of attribute values.
623 The appropriate entry in the
624 \addtoindex{abbreviations table} guides the
625 interpretation of the information contained directly in the
626 \dotdebuginfo{} section.
629 Multiple debugging information entries may share the same
630 abbreviation table entry. Each compilation unit is associated
631 with a particular abbreviation table, but multiple compilation
632 units may share the same table.
634 \subsection{Unit Headers}
635 \label{datarep:unitheaders}
636 Unit headers contain a field, \texttt{unit\_type}, whose value indicates the kind of
637 compilation unit that follows. The encodings for the unit type
638 enumeration are shown in Table \refersec{tab:unitheaderunitkindencodings}.
642 \setlength{\extrarowheight}{0.1cm}
643 \begin{longtable}{l|c}
644 \caption{Unit header unit type encodings}
645 \label{tab:unitheaderunitkindencodings}
646 \addtoindexx{Unit header unit type encodings} \\
647 \hline \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
649 \bfseries Unit header unit type encodings&\bfseries Value \\ \hline
651 \hline \emph{Continued on next page}
653 \hline \ddag\ \textit{New in DWARF Version 5}
655 \DWUTcompileTARG~\ddag &0x01 \\
656 \DWUTtypeTARG~\ddag &0x02 \\
657 \DWUTpartialTARG~\ddag &0x03 \\ \hline
661 \subsubsection{Compilation Unit Header}
662 \label{datarep:compilationunitheader}
663 \begin{enumerate}[1. ]
665 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
666 \addttindexx{unit\_length}
667 A 4\dash byte or 12\dash byte
668 \addtoindexx{initial length}
669 unsigned integer representing the length
670 of the \dotdebuginfo{}
671 contribution for that compilation unit,
672 not including the length field itself. In the \thirtytwobitdwarfformat,
673 this is a 4\dash byte unsigned integer (which must be less
674 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
675 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
676 integer that gives the actual length
677 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
679 \item \texttt{version} (\addtoindex{uhalf}) \\
680 A 2\dash byte unsigned integer representing the version of the
681 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
682 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
683 The value in this field is \versiondotdebuginfo.
686 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
687 A 1-byte unsigned integer identifying this unit as a compilation unit.
688 The value of this field is
689 \DWUTcompile{} for a {normal compilation} unit or
690 \DWUTpartial{} for a {partial compilation} unit
691 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
693 \textit{This field is new in \DWARFVersionV.}
696 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
698 \addtoindexx{section offset!in .debug\_info header}
699 4\dash byte or 8\dash byte unsigned offset into the
701 section. This offset associates the compilation unit with a
702 particular set of debugging information entry abbreviations. In
703 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
704 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
705 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
707 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
708 A 1\dash byte unsigned integer representing the size in bytes of
709 \addttindexx{address\_size}
710 an address on the target architecture. If the system uses
711 \addtoindexx{address space!segmented}
712 segmented addressing, this value represents the size of the
713 offset portion of an address.
718 \subsubsection{Type Unit Header}
719 \label{datarep:typeunitheader}
721 The header for the series of debugging information entries
722 contributing to the description of a type that has been
723 placed in its own \addtoindex{type unit}, within the
724 \dotdebuginfo{} section,
725 consists of the following information:
726 \begin{enumerate}[1. ]
728 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
729 \addttindexx{unit\_length}
730 A 4\dash byte or 12\dash byte unsigned integer
731 \addtoindexx{initial length}
732 representing the length
733 of the \dotdebuginfo{} contribution for that type unit,
734 not including the length field itself. In the \thirtytwobitdwarfformat,
735 this is a 4\dash byte unsigned integer (which must be
736 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
737 consists of the 4\dash byte value \wffffffff followed by an
738 8\dash byte unsigned integer that gives the actual length
739 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
742 \item \texttt{version} (\addtoindex{uhalf}) \\
743 A 2\dash byte unsigned integer representing the version of the
744 DWARF information for the
745 type unit\addtoindexx{version number!type unit}
746 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
747 The value in this field is \versiondotdebuginfo.
749 \item \texttt{unit\_type} (\addtoindex{ubyte}) \\
750 A 1-byte unsigned integer identifying this unit as a type unit.
751 The value of this field is \DWUTtype{} for a type unit
752 (see Section \refersec{chap:separatetypeunitentries}).
754 \textit{This field is new in \DWARFVersionV.}
757 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
759 \addtoindexx{section offset!in .debug\_info header}
760 4\dash byte or 8\dash byte unsigned offset into the
762 section. This offset associates the type unit with a
763 particular set of debugging information entry abbreviations. In
764 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
765 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
766 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
769 \item \texttt{address\_size} (ubyte) \\
770 A 1\dash byte unsigned integer representing the size
771 \addtoindexx{size of an address}
773 \addttindexx{address\_size}
774 an address on the target architecture. If the system uses
775 \addtoindexx{address space!segmented}
776 segmented addressing, this value represents the size of the
777 offset portion of an address.
779 \item \texttt{type\_signature} (8\dash byte unsigned integer) \\
780 \addtoindexx{type signature}
782 \addttindexx{type\_signature}
783 64\dash bit unique signature (see Section
784 \refersec{datarep:typesignaturecomputation})
785 of the type described in this type
788 \textit{An attribute that refers (using
789 \DWFORMrefsigeight{}) to
790 the primary type contained in this
791 \addtoindex{type unit} uses this value.}
793 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
794 \addttindexx{type\_offset}
795 A 4\dash byte or 8\dash byte unsigned offset
796 \addtoindexx{section offset!in .debug\_info header}
797 relative to the beginning
798 of the \addtoindex{type unit} header.
799 This offset refers to the debugging
800 information entry that describes the type. Because the type
801 may be nested inside a namespace or other structures, and may
802 contain references to other types that have not been placed in
803 separate type units, it is not necessarily either the first or
804 the only entry in the type unit. In the \thirtytwobitdwarfformat,
805 this is a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat,
806 this is an 8\dash byte unsigned length
807 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
811 \subsection{Debugging Information Entry}
812 \label{datarep:debugginginformationentry}
814 Each debugging information entry begins with an
815 unsigned LEB128\addtoindexx{LEB128!unsigned}
816 number containing the abbreviation code for the entry. This
817 code represents an entry within the abbreviations table
818 associated with the compilation unit containing this entry. The
819 abbreviation code is followed by a series of attribute values.
821 On some architectures, there are alignment constraints on
822 section boundaries. To make it easier to pad debugging
823 information sections to satisfy such constraints, the
824 abbreviation code 0 is reserved. Debugging information entries
825 consisting of only the abbreviation code 0 are considered
828 \subsection{Abbreviations Tables}
829 \label{datarep:abbreviationstables}
831 The abbreviations tables for all compilation units
832 are contained in a separate object file section called
834 As mentioned before, multiple compilation
835 units may share the same abbreviations table.
837 The abbreviations table for a single compilation unit consists
838 of a series of abbreviation declarations. Each declaration
839 specifies the tag and attributes for a particular form of
840 debugging information entry. Each declaration begins with
841 an unsigned LEB128\addtoindexx{LEB128!unsigned}
842 number representing the abbreviation
843 code itself. It is this code that appears at the beginning
844 of a debugging information entry in the
846 section. As described above, the abbreviation
847 code 0 is reserved for null debugging information entries. The
848 abbreviation code is followed by another unsigned LEB128\addtoindexx{LEB128!unsigned}
849 number that encodes the entry\textquoteright s tag. The encodings for the
850 tag names are given in
851 Table \refersec{tab:tagencodings}.
854 \setlength{\extrarowheight}{0.1cm}
855 \begin{longtable}{l|c}
857 \caption{Tag encodings} \label{tab:tagencodings} \\
858 \hline \bfseries Tag name&\bfseries Value\\ \hline
860 \bfseries Tag name&\bfseries Value \\ \hline
862 \hline \emph{Continued on next page}
864 \hline \ddag\ \textit{New in DWARF Version 5}
866 \DWTAGarraytype{} &0x01 \\
867 \DWTAGclasstype&0x02 \\
868 \DWTAGentrypoint&0x03 \\
869 \DWTAGenumerationtype&0x04 \\
870 \DWTAGformalparameter&0x05 \\
871 \DWTAGimporteddeclaration&0x08 \\
873 \DWTAGlexicalblock&0x0b \\
875 \DWTAGpointertype&0x0f \\
876 \DWTAGreferencetype&0x10 \\
877 \DWTAGcompileunit&0x11 \\
878 \DWTAGstringtype&0x12 \\
879 \DWTAGstructuretype&0x13 \\
880 \DWTAGsubroutinetype&0x15 \\
881 \DWTAGtypedef&0x16 \\
882 \DWTAGuniontype&0x17 \\
883 \DWTAGunspecifiedparameters&0x18 \\
884 \DWTAGvariant&0x19 \\
885 \DWTAGcommonblock&0x1a \\
886 \DWTAGcommoninclusion&0x1b \\
887 \DWTAGinheritance&0x1c \\
888 \DWTAGinlinedsubroutine&0x1d \\
890 \DWTAGptrtomembertype&0x1f \\
891 \DWTAGsettype&0x20 \\
892 \DWTAGsubrangetype&0x21 \\
893 \DWTAGwithstmt&0x22 \\
894 \DWTAGaccessdeclaration&0x23 \\
895 \DWTAGbasetype&0x24 \\
896 \DWTAGcatchblock&0x25 \\
897 \DWTAGconsttype&0x26 \\
898 \DWTAGconstant&0x27 \\
899 \DWTAGenumerator&0x28 \\
900 \DWTAGfiletype&0x29 \\
902 \DWTAGnamelist&0x2b \\
903 \DWTAGnamelistitem&0x2c \\
904 \DWTAGpackedtype&0x2d \\
905 \DWTAGsubprogram&0x2e \\
906 \DWTAGtemplatetypeparameter&0x2f \\
907 \DWTAGtemplatevalueparameter&0x30 \\
908 \DWTAGthrowntype&0x31 \\
909 \DWTAGtryblock&0x32 \\
910 \DWTAGvariantpart&0x33 \\
911 \DWTAGvariable&0x34 \\
912 \DWTAGvolatiletype&0x35 \\
913 \DWTAGdwarfprocedure&0x36 \\
914 \DWTAGrestricttype&0x37 \\
915 \DWTAGinterfacetype&0x38 \\
916 \DWTAGnamespace&0x39 \\
917 \DWTAGimportedmodule&0x3a \\
918 \DWTAGunspecifiedtype&0x3b \\
919 \DWTAGpartialunit&0x3c \\
920 \DWTAGimportedunit&0x3d \\
921 \DWTAGcondition&\xiiif \\
922 \DWTAGsharedtype&0x40 \\
923 \DWTAGtypeunit & 0x41 \\
924 \DWTAGrvaluereferencetype & 0x42 \\
925 \DWTAGtemplatealias & 0x43 \\
926 \DWTAGcoarraytype~\ddag & 0x44 \\
927 \DWTAGgenericsubrange~\ddag & 0x45 \\
928 \DWTAGdynamictype~\ddag & 0x46 \\
929 \DWTAGatomictype~\ddag & 0x47 \\
930 \DWTAGcallsite~\ddag & 0x48 \\
931 \DWTAGcallsiteparameter~\ddag & 0x49 \\
932 \DWTAGlouser&0x4080 \\
933 \DWTAGhiuser&\xffff \\
937 Following the tag encoding is a 1\dash byte value that determines
938 whether a debugging information entry using this abbreviation
939 has child entries or not. If the value is
941 the next physically succeeding entry of any debugging
942 information entry using this abbreviation is the first
943 child of that entry. If the 1\dash byte value following the
944 abbreviation\textquoteright s tag encoding is
945 \DWCHILDRENnoTARG, the next
946 physically succeeding entry of any debugging information entry
947 using this abbreviation is a sibling of that entry. (Either
948 the first child or sibling entries may be null entries). The
949 encodings for the child determination byte are given in
950 Table \refersec{tab:childdeterminationencodings}
952 Section \refersec{chap:relationshipofdebugginginformationentries},
953 each chain of sibling entries is terminated by a null entry.)
957 \setlength{\extrarowheight}{0.1cm}
958 \begin{longtable}{l|c}
959 \caption{Child determination encodings}
960 \label{tab:childdeterminationencodings}
961 \addtoindexx{Child determination encodings} \\
962 \hline \bfseries Children determination name&\bfseries Value \\ \hline
964 \bfseries Children determination name&\bfseries Value \\ \hline
966 \hline \emph{Continued on next page}
970 \DWCHILDRENno&0x00 \\
971 \DWCHILDRENyes&0x01 \\ \hline
976 Finally, the child encoding is followed by a series of
977 attribute specifications. Each attribute specification
978 consists of two parts. The first part is an
979 unsigned LEB128\addtoindexx{LEB128!unsigned}
980 number representing the attribute\textquoteright s name.
981 The second part is an
982 unsigned LEB128\addtoindexx{LEB128!unsigned}
983 number representing the attribute\textquoteright s form.
984 The series of attribute specifications ends with an
985 entry containing 0 for the name and 0 for the form.
988 \DWFORMindirectTARG{} is a special case. For
989 attributes with this form, the attribute value itself in the
991 section begins with an unsigned
992 LEB128 number that represents its form. This allows producers
993 to choose forms for particular attributes
994 \addtoindexx{abbreviations table!dynamic forms in}
996 without having to add a new entry to the abbreviations table.
998 The abbreviations for a given compilation unit end with an
999 entry consisting of a 0 byte for the abbreviation code.
1002 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
1003 for a depiction of the organization of the
1004 debugging information.}
1007 \subsection{Attribute Encodings}
1008 \label{datarep:attributeencodings}
1010 The encodings for the attribute names are given in
1011 Table \refersec{tab:attributeencodings}.
1013 The attribute form governs how the value of the attribute is
1014 encoded. There are nine classes of form, listed below. Each
1015 class is a set of forms which have related representations
1016 and which are given a common interpretation according to the
1017 attribute in which the form is used.
1019 Form \DWFORMsecoffsetTARG{}
1021 \addtoindexx{rangelistptr class}
1023 \addtoindexx{macptr class}
1025 \addtoindexx{loclistptr class}
1027 \addtoindexx{lineptr class}
1033 \CLASSrangelistptr{} or
1034 \CLASSstroffsetsptr;
1035 the list of classes allowed by the applicable attribute in
1036 Table \refersec{tab:attributeencodings}
1037 determines the class of the form.
1041 Each possible form belongs to one or more of the following classes:
1044 \item \livelinki{chap:classaddress}{address}{address class} \\
1045 \livetarg{datarep:classaddress}{}
1046 Represented as either:
1048 \item An object of appropriate size to hold an
1049 address on the target machine
1051 The size is encoded in the compilation unit header
1052 (see Section \refersec{datarep:compilationunitheader}).
1053 This address is relocatable in a relocatable object file and
1054 is relocated in an executable file or shared object.
1056 \item An indirect index into a table of addresses (as
1057 described in the previous bullet) in the
1058 \dotdebugaddr{} section (\DWFORMaddrxTARG).
1059 The representation of a \DWFORMaddrxNAME{} value is an unsigned
1060 \addtoindex{LEB128} value, which is interpreted as a zero-based
1061 index into an array of addresses in the \dotdebugaddr{} section.
1062 The index is relative to the value of the \DWATaddrbase{} attribute
1063 of the associated compilation unit.
1067 \item \livelink{chap:classaddrptr}{addrptr} \\
1068 \livetarg{datarep:classaddrptr}{}
1069 This is an offset into the \dotdebugaddr{} section (\DWFORMsecoffset). It
1070 consists of an offset from the beginning of the \dotdebugaddr{} section to the
1071 beginning of the list of machine addresses information for the
1072 referencing entity. It is relocatable in
1073 a relocatable object file, and relocated in an executable or
1074 shared object. In the \thirtytwobitdwarfformat, this offset
1075 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1076 format, it is an 8\dash byte unsigned value (see Section
1077 \refersec{datarep:32bitand64bitdwarfformats}).
1079 \textit{This class is new in \DWARFVersionV.}
1082 \item \livelink{chap:classblock}{block} \\
1083 \livetarg{datarep:classblock}{}
1084 Blocks come in four forms:
1086 \begin{myindentpara}{1cm}
1087 A 1\dash byte length followed by 0 to 255 contiguous information
1088 bytes (\DWFORMblockoneTARG).
1091 \begin{myindentpara}{1cm}
1092 A 2\dash byte length followed by 0 to 65,535 contiguous information
1093 bytes (\DWFORMblocktwoTARG).
1096 \begin{myindentpara}{1cm}
1097 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
1098 information bytes (\DWFORMblockfourTARG).
1101 \begin{myindentpara}{1cm}
1102 An unsigned LEB128\addtoindexx{LEB128!unsigned}
1103 length followed by the number of bytes
1104 specified by the length (\DWFORMblockTARG).
1107 In all forms, the length is the number of information bytes
1108 that follow. The information bytes may contain any mixture
1109 of relocated (or relocatable) addresses, references to other
1110 debugging information entries or data bytes.
1112 \item \livelinki{chap:classconstant}{constant}{constant class} \\
1113 \livetarg{datarep:classconstant}{}
1114 There are six forms of constants. There are fixed length
1115 constant data forms for one, two, four and eight byte values
1119 \DWFORMdatafourTARG,
1120 and \DWFORMdataeightTARG).
1121 There are also variable length constant
1122 data forms encoded using LEB128 numbers (see below). Both
1123 signed (\DWFORMsdataTARG) and unsigned
1124 (\DWFORMudataTARG) variable
1125 length constants are available
1128 The data in \DWFORMdataone,
1130 \DWFORMdatafour{} and
1132 can be anything. Depending on context, it may
1133 be a signed integer, an unsigned integer, a floating\dash point
1134 constant, or anything else. A consumer must use context to
1135 know how to interpret the bits, which if they are target
1136 machine data (such as an integer or floating point constant)
1137 will be in target machine byte\dash order.
1139 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
1140 forms is used to represent a
1141 signed or unsigned integer, it can be hard for a consumer
1142 to discover the context necessary to determine which
1143 interpretation is intended. Producers are therefore strongly
1144 encouraged to use \DWFORMsdata{} or
1145 \DWFORMudata{} for signed and
1146 unsigned integers respectively, rather than
1147 \DWFORMdata\textless n\textgreater.}
1150 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
1151 \livetarg{datarep:classexprloc}{}
1152 This is an unsigned LEB128\addtoindexx{LEB128!unsigned} length followed by the
1153 number of information bytes specified by the length
1154 (\DWFORMexprlocTARG).
1155 The information bytes contain a DWARF expression
1156 (see Section \refersec{chap:dwarfexpressions})
1157 or location description
1158 (see Section \refersec{chap:locationdescriptions}).
1160 \item \livelinki{chap:classflag}{flag}{flag class} \\
1161 \livetarg{datarep:classflag}{}
1162 A flag \addtoindexx{flag class}
1163 is represented explicitly as a single byte of data
1164 (\DWFORMflagTARG) or
1165 implicitly (\DWFORMflagpresentTARG).
1167 first case, if the \nolink{flag} has value zero, it indicates the
1168 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
1169 it indicates the presence of the attribute. In the second
1170 case, the attribute is implicitly indicated as present, and
1171 no value is encoded in the debugging information entry itself.
1173 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
1174 \livetarg{datarep:classlineptr}{}
1175 This is an offset into
1176 \addtoindexx{section offset!in class lineptr value}
1178 \dotdebugline{} or \dotdebuglinedwo{} section
1180 It consists of an offset from the beginning of the
1182 section to the first byte of
1183 the data making up the line number list for the compilation
1185 It is relocatable in a relocatable object file, and
1186 relocated in an executable or shared object. In the
1187 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1188 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1189 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1192 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
1193 \livetarg{datarep:classloclistptr}{}
1194 This is an offset into the
1198 It consists of an offset from the
1199 \addtoindexx{section offset!in class loclistptr value}
1202 section to the first byte of
1203 the data making up the
1204 \addtoindex{location list} for the compilation unit.
1205 It is relocatable in a relocatable object file, and
1206 relocated in an executable or shared object. In the
1207 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1208 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1209 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1212 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
1213 \livetarg{datarep:classmacptr}{}
1215 \addtoindexx{section offset!in class macptr value}
1217 \dotdebugmacro{} or \dotdebugmacrodwo{} section
1219 It consists of an offset from the beginning of the
1220 \dotdebugmacro{} or \dotdebugmacrodwo{}
1221 section to the the header making up the
1222 macro information list for the compilation unit.
1223 It is relocatable in a relocatable object file, and
1224 relocated in an executable or shared object. In the
1225 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1226 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
1227 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1230 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
1231 \livetarg{datarep:classrangelistptr}{}
1233 \addtoindexx{section offset!in class rangelistptr value}
1234 offset into the \dotdebugranges{} section
1237 offset from the beginning of the
1238 \dotdebugranges{} section
1239 to the beginning of the non\dash contiguous address ranges
1240 information for the referencing entity.
1241 It is relocatable in
1242 a relocatable object file, and relocated in an executable or
1243 shared object. In the \thirtytwobitdwarfformat, this offset
1244 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1245 format, it is an 8\dash byte unsigned value (see Section
1246 \refersec{datarep:32bitand64bitdwarfformats}).
1249 \textit{Because classes
1254 \CLASSrangelistptr{} and
1255 \CLASSstroffsetsptr{}
1256 share a common representation, it is not possible for an
1257 attribute to allow more than one of these classes}
1261 \item \livelinki{chap:classreference}{reference}{reference class} \\
1262 \livetarg{datarep:classreference}{}
1263 There are three types of reference.
1266 \addtoindexx{reference class}
1267 first type of reference can identify any debugging
1268 information entry within the containing unit.
1271 \addtoindexx{section offset!in class reference value}
1272 offset from the first byte of the compilation
1273 header for the compilation unit containing the reference. There
1274 are five forms for this type of reference. There are fixed
1275 length forms for one, two, four and eight byte offsets
1281 and \DWFORMrefeightTARG).
1282 There is also an unsigned variable
1283 length offset encoded form that uses
1284 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers
1285 (\DWFORMrefudataTARG).
1286 Because this type of reference is within
1287 the containing compilation unit no relocation of the value
1290 The second type of reference can identify any debugging
1291 information entry within a
1292 \dotdebuginfo{} section; in particular,
1293 it may refer to an entry in a different compilation unit
1294 from the unit containing the reference, and may refer to an
1295 entry in a different shared object. This type of reference
1296 (\DWFORMrefaddrTARG)
1297 is an offset from the beginning of the
1299 section of the target executable or shared object;
1300 it is relocatable in a relocatable object file and frequently
1301 relocated in an executable file or shared object. For
1302 references from one shared object or static executable file
1303 to another, the relocation and identification of the target
1304 object must be performed by the consumer. In the
1305 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1306 in the \sixtyfourbitdwarfformat, it is an 8\dash byte
1308 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1310 \textit{A debugging information entry that may be referenced by
1311 another compilation unit using
1312 \DWFORMrefaddr{} must have a
1313 global symbolic name.}
1315 \textit{For a reference from one executable or shared object to
1316 another, the reference is resolved by the debugger to identify
1317 the shared object or executable and the offset into that
1318 object\textquoteright s \dotdebuginfo{}
1319 section in the same fashion as the run
1320 time loader, either when the debug information is first read,
1321 or when the reference is used.}
1323 The third type of reference can identify any debugging
1324 information type entry that has been placed in its own
1325 \addtoindex{type unit}. This type of
1326 reference (\DWFORMrefsigeightTARG) is the
1327 \addtoindexx{type signature}
1328 64\dash bit type signature
1329 (see Section \refersec{datarep:typesignaturecomputation})
1333 \textit{The use of compilation unit relative references will reduce the
1334 number of link\dash time relocations and so speed up linking. The
1335 use of the second and third type of reference allows for the
1336 sharing of information, such as types, across compilation
1339 \textit{A reference to any kind of compilation unit identifies the
1340 debugging information entry for that unit, not the preceding
1343 \item \livelinki{chap:classstring}{string}{string class} \\
1344 \livetarg{datarep:classstring}{}
1345 A string is a sequence of contiguous non\dash null bytes followed by
1347 \addtoindexx{string class}
1348 A string may be represented:
1350 \item immediately in the debugging information entry itself
1351 (\DWFORMstringTARG),
1353 \addtoindexx{section offset!in class string value}
1354 offset into a string table contained in
1355 the \dotdebugstr{} section of the object file
1357 In the \thirtytwobitdwarfformat, the representation of a
1359 value is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
1360 it is an 8\dash byte unsigned offset
1361 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1362 \item as an indirect offset into the string table using an
1363 index into a table of offsets contained in the
1364 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1365 The representation of a \DWFORMstrxNAME{} value is an unsigned
1366 \addtoindex{LEB128} value, which is interpreted as a zero-based
1367 index into an array of offsets in the \dotdebugstroffsets{} section.
1368 The offset entries in the \dotdebugstroffsets{} section have the
1369 same representation as \DWFORMstrp{} values.
1371 Any combination of these three forms may be used within a single compilation.
1373 If the \DWATuseUTFeight{}
1374 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1375 compilation, partial, skeleton or type unit entry, string values are encoded using the
1376 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1377 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
1378 the string representation is unspecified.
1380 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1381 ISO/IEC 10646\dash 1:1993. It contains all the same characters
1382 and encoding points as ISO/IEC 10646, as well as additional
1383 information about the characters and their use.}
1385 \textit{Earlier versions of DWARF did not specify the representation
1386 of strings; for compatibility, this version also does
1387 not. However, the UTF\dash 8 representation is strongly recommended.}
1389 \item \livelinki{chap:classstroffsetsptr}{stroffsetsptr}{stroffsetsptr class} \\
1390 \livetarg{datarep:classstroffsetsptr}{}
1391 This is an offset into the \dotdebugstroffsets{} section
1392 (\DWFORMsecoffset). It consists of an offset from the beginning of the
1393 \dotdebugstroffsets{} section to the
1394 beginning of the string offsets information for the
1395 referencing entity. It is relocatable in
1396 a relocatable object file, and relocated in an executable or
1397 shared object. In the \thirtytwobitdwarfformat, this offset
1398 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
1399 format, it is an 8\dash byte unsigned value (see Section
1400 \refersec{datarep:32bitand64bitdwarfformats}).
1402 \textit{This class is new in \DWARFVersionV.}
1406 In no case does an attribute use one of the classes
1411 \CLASSrangelistptr{} or
1412 \CLASSstroffsetsptr{}
1413 to point into either the
1414 \dotdebuginfo{} or \dotdebugstr{} section.
1416 The form encodings are listed in
1417 Table \refersec{tab:attributeformencodings}.
1421 \setlength{\extrarowheight}{0.1cm}
1422 \begin{longtable}{l|c|l}
1423 \caption{Attribute encodings}
1424 \label{tab:attributeencodings}
1425 \addtoindexx{attribute encodings} \\
1426 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1428 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1430 \hline \emph{Continued on next page}
1432 \hline \ddag\ \textit{New in DWARF Version 5}
1434 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1435 \addtoindexx{sibling attribute!encoding} \\
1436 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1437 \livelink{chap:classloclistptr}{loclistptr}
1438 \addtoindexx{location attribute!encoding} \\
1439 \DWATname&0x03&\livelink{chap:classstring}{string}
1440 \addtoindexx{name attribute!encoding} \\
1441 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1442 \addtoindexx{ordering attribute!encoding} \\
1443 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant},
1444 \livelink{chap:classexprloc}{exprloc},
1445 \livelink{chap:classreference}{reference}
1446 \addtoindexx{byte size attribute!encoding} \\
1447 \DWATbitoffset&0x0c&\livelink{chap:classconstant}{constant},
1448 \livelink{chap:classexprloc}{exprloc},
1449 \livelink{chap:classreference}{reference}
1450 \addtoindexx{bit offset attribute!encoding} \\
1451 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1452 \livelink{chap:classexprloc}{exprloc},
1453 \livelink{chap:classreference}{reference}
1454 \addtoindexx{bit size attribute!encoding} \\
1455 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1456 \addtoindexx{statement list attribute!encoding} \\
1457 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1458 \addtoindexx{low PC attribute!encoding} \\
1459 \DWAThighpc&0x12&\livelink{chap:classaddress}{address},
1460 \livelink{chap:classconstant}{constant}
1461 \addtoindexx{high PC attribute!encoding} \\
1462 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1463 \addtoindexx{language attribute!encoding} \\
1464 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1465 \addtoindexx{discriminant attribute!encoding} \\
1466 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1467 \addtoindexx{discriminant value attribute!encoding} \\
1468 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1469 \addtoindexx{visibility attribute!encoding} \\
1470 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1471 \addtoindexx{import attribute!encoding} \\
1472 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1473 \livelink{chap:classloclistptr}{loclistptr}
1474 \addtoindexx{string length attribute!encoding} \\
1475 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1476 \addtoindexx{common reference attribute!encoding} \\
1477 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1478 \addtoindexx{compilation directory attribute!encoding} \\
1479 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block},
1480 \livelink{chap:classconstant}{constant},
1481 \livelink{chap:classstring}{string}
1482 \addtoindexx{constant value attribute!encoding} \\
1483 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1484 \addtoindexx{containing type attribute!encoding} \\
1485 \DWATdefaultvalue&0x1e&\livelink{chap:classconstant}{constant},
1486 \livelink{chap:classreference}{reference},
1487 \livelink{chap:classflag}{flag}
1488 \addtoindexx{default value attribute!encoding} \\
1489 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1490 \addtoindexx{inline attribute!encoding} \\
1491 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1492 \addtoindexx{is optional attribute!encoding} \\
1493 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1494 \livelink{chap:classexprloc}{exprloc},
1495 \livelink{chap:classreference}{reference}
1496 \addtoindexx{lower bound attribute!encoding} \\
1497 \DWATproducer&0x25&\livelink{chap:classstring}{string}
1498 \addtoindexx{producer attribute!encoding} \\
1499 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1500 \addtoindexx{prototyped attribute!encoding} \\
1501 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1502 \livelink{chap:classloclistptr}{loclistptr}
1503 \addtoindexx{return address attribute!encoding} \\
1504 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1505 \livelink{chap:classrangelistptr}{rangelistptr}
1506 \addtoindexx{start scope attribute!encoding} \\
1507 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1508 \livelink{chap:classexprloc}{exprloc},
1509 \livelink{chap:classreference}{reference}
1510 \addtoindexx{bit stride attribute!encoding} \\
1511 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1512 \livelink{chap:classexprloc}{exprloc},
1513 \livelink{chap:classreference}{reference}
1514 \addtoindexx{upper bound attribute!encoding} \\
1515 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1516 \addtoindexx{abstract origin attribute!encoding} \\
1517 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1518 \addtoindexx{accessibility attribute!encoding} \\
1519 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1520 \addtoindexx{address class attribute!encoding} \\
1521 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1522 \addtoindexx{artificial attribute!encoding} \\
1523 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1524 \addtoindexx{base types attribute!encoding} \\
1525 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1526 \addtoindexx{calling convention attribute!encoding} \\
1527 \DWATcount&0x37&\livelink{chap:classconstant}{constant},
1528 \livelink{chap:classexprloc}{exprloc},
1529 \livelink{chap:classreference}{reference}
1530 \addtoindexx{count attribute!encoding} \\
1531 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1532 \livelink{chap:classexprloc}{exprloc},
1533 \livelink{chap:classloclistptr}{loclistptr}
1534 \addtoindexx{data member attribute!encoding} \\
1535 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1536 \addtoindexx{declaration column attribute!encoding} \\
1537 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1538 \addtoindexx{declaration file attribute!encoding} \\
1539 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1540 \addtoindexx{declaration line attribute!encoding} \\
1541 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1542 \addtoindexx{declaration attribute!encoding} \\
1543 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1544 \addtoindexx{discriminant list attribute!encoding} \\
1545 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1546 \addtoindexx{encoding attribute!encoding} \\
1547 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1548 \addtoindexx{external attribute!encoding} \\
1549 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1550 \livelink{chap:classloclistptr}{loclistptr}
1551 \addtoindexx{frame base attribute!encoding} \\
1552 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1553 \addtoindexx{friend attribute!encoding} \\
1554 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1555 \addtoindexx{identifier case attribute!encoding} \\
1556 \DWATmacroinfo\footnote{\raggedright Not used in \DWARFVersionV.
1557 Reserved for compatibility and coexistence
1558 with prior DWARF versions.}
1559 &0x43&\livelink{chap:classmacptr}{macptr}
1560 \addtoindexx{macro information attribute (legacy)!encoding} \\
1561 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1562 \addtoindexx{name list item attribute!encoding} \\
1563 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1564 \addtoindexx{priority attribute!encoding} \\
1565 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1566 \livelink{chap:classloclistptr}{loclistptr}
1567 \addtoindexx{segment attribute!encoding} \\
1568 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1569 \addtoindexx{specification attribute!encoding} \\
1570 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1571 \livelink{chap:classloclistptr}{loclistptr}
1572 \addtoindexx{static link attribute!encoding} \\
1573 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1574 \addtoindexx{type attribute!encoding} \\
1575 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1576 \livelink{chap:classloclistptr}{loclistptr}
1577 \addtoindexx{location list attribute!encoding} \\
1578 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1579 \addtoindexx{variable parameter attribute!encoding} \\
1580 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1581 \addtoindexx{virtuality attribute!encoding} \\
1582 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1583 \livelink{chap:classloclistptr}{loclistptr}
1584 \addtoindexx{vtable element location attribute!encoding} \\
1585 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant},
1586 \livelink{chap:classexprloc}{exprloc},
1587 \livelink{chap:classreference}{reference}
1588 \addtoindexx{allocated attribute!encoding} \\
1589 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant},
1590 \livelink{chap:classexprloc}{exprloc},
1591 \livelink{chap:classreference}{reference}
1592 \addtoindexx{associated attribute!encoding} \\
1593 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1594 \addtoindexx{data location attribute!encoding} \\
1595 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant},
1596 \livelink{chap:classexprloc}{exprloc},
1597 \livelink{chap:classreference}{reference}
1598 \addtoindexx{byte stride attribute!encoding} \\
1599 \DWATentrypc&0x52&\livelink{chap:classaddress}{address},
1600 \livelink{chap:classconstant}{constant}
1601 \addtoindexx{entry pc attribute!encoding} \\
1602 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1603 \addtoindexx{use UTF8 attribute!encoding}\addtoindexx{UTF-8} \\
1604 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1605 \addtoindexx{extension attribute!encoding} \\
1606 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1607 \addtoindexx{ranges attribute!encoding} \\
1608 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address},
1609 \livelink{chap:classflag}{flag},
1610 \livelink{chap:classreference}{reference},
1611 \livelink{chap:classstring}{string}
1612 \addtoindexx{trampoline attribute!encoding} \\
1613 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1614 \addtoindexx{call column attribute!encoding} \\
1615 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1616 \addtoindexx{call file attribute!encoding} \\
1617 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1618 \addtoindexx{call line attribute!encoding} \\
1619 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1620 \addtoindexx{description attribute!encoding} \\
1621 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1622 \addtoindexx{binary scale attribute!encoding} \\
1623 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1624 \addtoindexx{decimal scale attribute!encoding} \\
1625 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1626 \addtoindexx{small attribute!encoding} \\
1627 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1628 \addtoindexx{decimal scale attribute!encoding} \\
1629 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1630 \addtoindexx{digit count attribute!encoding} \\
1631 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1632 \addtoindexx{picture string attribute!encoding} \\
1633 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1634 \addtoindexx{mutable attribute!encoding} \\
1635 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1636 \addtoindexx{thread scaled attribute!encoding} \\
1637 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1638 \addtoindexx{explicit attribute!encoding} \\
1639 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1640 \addtoindexx{object pointer attribute!encoding} \\
1641 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1642 \addtoindexx{endianity attribute!encoding} \\
1643 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1644 \addtoindexx{elemental attribute!encoding} \\
1645 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1646 \addtoindexx{pure attribute!encoding} \\
1647 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1648 \addtoindexx{recursive attribute!encoding} \\
1649 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1650 \addtoindexx{signature attribute!encoding} \\
1651 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1652 \addtoindexx{main subprogram attribute!encoding} \\
1653 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1654 \addtoindexx{data bit offset attribute!encoding} \\
1655 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1656 \addtoindexx{constant expression attribute!encoding} \\
1657 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1658 \addtoindexx{enumeration class attribute!encoding} \\
1659 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1660 \addtoindexx{linkage name attribute!encoding} \\
1661 \DWATstringlengthbitsize{}~\ddag&0x6f&
1662 \livelink{chap:classconstant}{constant}
1663 \addtoindexx{string length attribute!size of length} \\
1664 \DWATstringlengthbytesize{}~\ddag&0x70&
1665 \livelink{chap:classconstant}{constant}
1666 \addtoindexx{string length attribute!size of length} \\
1667 \DWATrank~\ddag&0x71&
1668 \livelink{chap:classconstant}{constant},
1669 \livelink{chap:classexprloc}{exprloc}
1670 \addtoindexx{rank attribute!encoding} \\
1671 \DWATstroffsetsbase~\ddag&0x72&
1672 \livelinki{chap:classstring}{stroffsetsptr}{stroffsetsptr class}
1673 \addtoindexx{string offsets base!encoding} \\
1674 \DWATaddrbase~\ddag &0x73&
1675 \livelinki{chap:DWATaddrbase}{addrptr}{addrptr class}
1676 \addtoindexx{address table base!encoding} \\
1677 \DWATrangesbase~\ddag&0x74&
1678 \livelinki{chap:DWATrangesbase}{rangelistptr}{rangelistptr class}
1679 \addtoindexx{ranges base!encoding} \\
1680 \DWATdwoid~\ddag &0x75&
1681 \livelink{chap:DWATdwoid}{constant}
1682 \addtoindexx{split DWARF object id!encoding} \\
1683 \DWATdwoname~\ddag &0x76&
1684 \livelink{chap:DWATdwoname}{string}
1685 \addtoindexx{split DWARF object file name!encoding} \\
1686 \DWATreference~\ddag &0x77&
1687 \livelink{chap:DWATreference}{flag} \\
1688 \DWATrvaluereference~\ddag &0x78&
1689 \livelink{chap:DWATrvaluereference}{flag} \\
1690 \DWATmacros~\ddag &0x79&\livelink{chap:classmacptr}{macptr}
1691 \addtoindexx{macro information attribute!encoding} \\
1692 \DWATcallallcalls~\ddag &0x7a&\CLASSflag
1693 \addtoindexx{all calls summary attribute!encoding} \\
1694 \DWATcallallsourcecalls~\ddag &0x7b &\CLASSflag
1695 \addtoindexx{all source calls summary attribute!encoding} \\
1696 \DWATcallalltailcalls~\ddag &0x7c&\CLASSflag
1697 \addtoindexx{all tail calls summary attribute!encoding} \\
1698 \DWATcalldatalocation~\ddag &0x7d &\CLASSexprloc
1699 \addtoindexx{call data location attribute!encoding} \\
1700 \DWATcalldatavalue~\ddag &0x7e &\CLASSexprloc
1701 \addtoindexx{call data value attribute!encoding} \\
1702 \DWATcallorigin~\ddag &0x7f &\CLASSexprloc
1703 \addtoindexx{call origin attribute!encoding} \\
1704 \DWATcallparameter~\ddag &0x80 &\CLASSreference
1705 \addtoindexx{call parameter attribute!encoding} \\
1706 \DWATcallpc~\ddag &0x81 &\CLASSaddress
1707 \addtoindexx{call pc attribute!encoding} \\
1708 \DWATcallreturnpc~\ddag &0x82 &\CLASSaddress
1709 \addtoindexx{call return pc attribute!encoding} \\
1710 \DWATcalltailcall~\ddag &0x83 &\CLASSflag
1711 \addtoindexx{call tail call attribute!encoding} \\
1712 \DWATcalltarget~\ddag &0x84 &\CLASSexprloc
1713 \addtoindexx{call target attribute!encoding} \\
1714 \DWATcalltargetclobbered~\ddag &0x85 &\CLASSexprloc
1715 \addtoindexx{call target clobbered attribute!encoding} \\
1716 \DWATcallvalue~\ddag &0x86 &\CLASSexprloc
1717 \addtoindexx{call value attribute!encoding} \\
1718 \DWATnoreturn~\ddag &0x87 &\CLASSflag
1719 \addtoindexx{noreturn attribute!encoding} \\
1720 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1721 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1728 \setlength{\extrarowheight}{0.1cm}
1729 \begin{longtable}{l|c|l}
1730 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1731 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1733 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1735 \hline \emph{Continued on next page}
1737 \hline \ddag\ \textit{New in DWARF Version 5}
1740 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1741 \textit{Reserved} &0x02& \\
1742 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1743 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1744 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1745 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1746 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1747 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1748 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1749 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1750 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1751 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1752 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1753 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1754 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1755 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1756 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1757 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1758 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1759 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
1760 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
1761 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1762 \DWFORMsecoffset{} &0x17& \CLASSaddrptr, \CLASSlineptr, \CLASSloclistptr, \\
1763 & & \CLASSmacptr, \CLASSrangelistptr, \CLASSstroffsetsptr \\
1764 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
1765 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
1766 \DWFORMstrx{} \ddag &0x1a&\livelink{chap:classstring}{string} \\
1767 \DWFORMaddrx{} \ddag &0x1b&\livelink{chap:classaddress}{address} \\
1768 \DWFORMrefsigeight &0x20&\livelink{chap:classreference}{reference} \\
1775 \section{Variable Length Data}
1776 \label{datarep:variablelengthdata}
1777 \addtoindexx{variable length data|see {LEB128}}
1779 \addtoindexx{Little Endian Base 128|see{LEB128}}
1780 encoded using \doublequote{Little Endian Base 128}
1781 \addtoindexx{little-endian encoding|see{endian attribute}}
1783 \addtoindexx{LEB128}
1784 LEB128 is a scheme for encoding integers
1785 densely that exploits the assumption that most integers are
1788 \textit{This encoding is equally suitable whether the target machine
1789 architecture represents data in big\dash\ endian or little\dash endian
1790 order. It is \doublequote{little\dash endian} only in the sense that it
1791 avoids using space to represent the \doublequote{big} end of an
1792 unsigned integer, when the big end is all zeroes or sign
1795 Unsigned LEB128\addtoindexx{LEB128!unsigned} (ULEB128) numbers are encoded as follows:
1796 \addtoindexx{LEB128!unsigned, encoding as}
1797 start at the low order end of an unsigned integer and chop
1798 it into 7\dash bit chunks. Place each chunk into the low order 7
1799 bits of a byte. Typically, several of the high order bytes
1800 will be zero; discard them. Emit the remaining bytes in a
1801 stream, starting with the low order byte; set the high order
1802 bit on each byte except the last emitted byte. The high bit
1803 of zero on the last byte indicates to the decoder that it
1804 has encountered the last byte.
1806 The integer zero is a special case, consisting of a single
1809 Table \refersec{tab:examplesofunsignedleb128encodings}
1810 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
1812 0x80 in each case is the high order bit of the byte, indicating
1813 that an additional byte follows.
1816 The encoding for signed, two\textquoteright s complement LEB128 (SLEB128)
1817 \addtoindexx{LEB128!signed, encoding as}
1818 numbers is similar, except that the criterion for discarding
1819 high order bytes is not whether they are zero, but whether
1820 they consist entirely of sign extension bits. Consider the
1821 32\dash bit integer -2. The three high level bytes of the number
1822 are sign extension, thus LEB128 would represent it as a single
1823 byte containing the low order 7 bits, with the high order
1824 bit cleared to indicate the end of the byte stream. Note
1825 that there is nothing within the LEB128 representation that
1826 indicates whether an encoded number is signed or unsigned. The
1827 decoder must know what type of number to expect.
1828 Table \refersec{tab:examplesofunsignedleb128encodings}
1829 gives some examples of unsigned LEB128\addtoindexx{LEB128!unsigned}
1830 numbers and Table \refersec{tab:examplesofsignedleb128encodings}
1831 gives some examples of signed LEB128\addtoindexx{LEB128!signed}
1834 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1835 \addtoindexx{LEB128!examples}
1836 gives algorithms for encoding and decoding these forms.}
1840 \setlength{\extrarowheight}{0.1cm}
1841 \begin{longtable}{c|c|c}
1842 \caption{Examples of unsigned LEB128 encodings}
1843 \label{tab:examplesofunsignedleb128encodings}
1844 \addtoindexx{LEB128 encoding!examples}\addtoindexx{LEB128!unsigned} \\
1845 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1847 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1849 \hline \emph{Continued on next page}
1855 128& 0 + 0x80 & 1 \\
1856 129& 1 + 0x80 & 1 \\
1857 130& 2 + 0x80 & 1 \\
1858 12857& 57 + 0x80 & 100 \\
1865 \setlength{\extrarowheight}{0.1cm}
1866 \begin{longtable}{c|c|c}
1867 \caption{Examples of signed LEB128 encodings}
1868 \label{tab:examplesofsignedleb128encodings}
1869 \addtoindexx{LEB128!signed} \\
1870 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1872 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1874 \hline \emph{Continued on next page}
1880 127& 127 + 0x80 & 0 \\
1881 -127& 1 + 0x80 & 0x7f \\
1882 128& 0 + 0x80 & 1 \\
1883 -128& 0 + 0x80 & 0x7f \\
1884 129& 1 + 0x80 & 1 \\
1885 -129& 0x7f + 0x80 & 0x7e \\
1892 \section{DWARF Expressions and Location Descriptions}
1893 \label{datarep:dwarfexpressionsandlocationdescriptions}
1894 \subsection{DWARF Expressions}
1895 \label{datarep:dwarfexpressions}
1898 \addtoindexx{DWARF Expression!operator encoding}
1899 DWARF expression is stored in a \nolink{block} of contiguous
1900 bytes. The bytes form a sequence of operations. Each operation
1901 is a 1\dash byte code that identifies that operation, followed by
1902 zero or more bytes of additional data. The encodings for the
1903 operations are described in
1904 Table \refersec{tab:dwarfoperationencodings}.
1907 \setlength{\extrarowheight}{0.1cm}
1908 \begin{longtable}{l|c|c|l}
1909 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1910 \hline & &\bfseries No. of &\\
1911 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1913 & &\bfseries No. of &\\
1914 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1916 \hline \emph{Continued on next page}
1918 \hline \ddag\ \textit{New in DWARF Version 5}
1921 \DWOPaddr&0x03&1 & constant address \\
1922 & & &(size is target specific) \\
1924 \DWOPderef&0x06&0 & \\
1926 \DWOPconstoneu&0x08&1&1\dash byte constant \\
1927 \DWOPconstones&0x09&1&1\dash byte constant \\
1928 \DWOPconsttwou&0x0a&1&2\dash byte constant \\
1929 \DWOPconsttwos&0x0b&1&2\dash byte constant \\
1930 \DWOPconstfouru&0x0c&1&4\dash byte constant \\
1931 \DWOPconstfours&0x0d&1&4\dash byte constant \\
1932 \DWOPconsteightu&0x0e&1&8\dash byte constant \\
1933 \DWOPconsteights&0x0f&1&8\dash byte constant \\
1934 \DWOPconstu&0x10&1&ULEB128 constant \\
1935 \DWOPconsts&0x11&1&SLEB128 constant \\
1936 \DWOPdup&0x12&0 & \\
1937 \DWOPdrop&0x13&0 & \\
1938 \DWOPover&0x14&0 & \\
1939 \DWOPpick&0x15&1&1\dash byte stack index \\
1940 \DWOPswap&0x16&0 & \\
1941 \DWOProt&0x17&0 & \\
1942 \DWOPxderef&0x18&0 & \\
1943 \DWOPabs&0x19&0 & \\
1944 \DWOPand&0x1a&0 & \\
1945 \DWOPdiv&0x1b&0 & \\
1946 \DWOPminus&0x1c&0 & \\
1947 \DWOPmod&0x1d&0 & \\
1948 \DWOPmul&0x1e&0 & \\
1949 \DWOPneg&0x1f&0 & \\
1950 \DWOPnot&0x20&0 & \\
1952 \DWOPplus&0x22&0 & \\
1953 \DWOPplusuconst&0x23&1&ULEB128 addend \\
1954 \DWOPshl&0x24&0 & \\
1955 \DWOPshr&0x25&0 & \\
1956 \DWOPshra&0x26&0 & \\
1957 \DWOPxor&0x27&0 & \\
1959 \DWOPbra&0x28&1 & signed 2\dash byte constant \\
1966 \DWOPskip&0x2f&1&signed 2\dash byte constant \\ \hline
1968 \DWOPlitzero & 0x30 & 0 & \\
1969 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
1970 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
1971 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
1973 \DWOPregzero & 0x50 & 0 & \\*
1974 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
1975 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
1976 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
1978 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
1979 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
1980 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
1981 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
1983 \DWOPregx{} & 0x90 &1&ULEB128 register \\
1984 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
1985 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
1986 & & &SLEB128 offset \\
1987 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
1988 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
1989 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
1990 \DWOPnop{} & 0x96 &0& \\
1992 \DWOPpushobjectaddress&0x97&0 & \\
1993 \DWOPcalltwo&0x98&1& 2\dash byte offset of DIE \\
1994 \DWOPcallfour&0x99&1& 4\dash byte offset of DIE \\
1995 \DWOPcallref&0x9a&1& 4\dash\ or 8\dash byte offset of DIE \\
1996 \DWOPformtlsaddress&0x9b &0& \\
1997 \DWOPcallframecfa{} &0x9c &0& \\
1998 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
2000 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
2001 &&&\nolink{block} of that size\\
2002 \DWOPstackvalue{} &0x9f &0& \\
2003 \DWOPimplicitpointer{}~\ddag &0xa0& 2 &4- or 8-byte offset of DIE, \\*
2004 &&&SLEB128 constant offset \\
2005 \DWOPaddrx~\ddag&0xa1&1&ULEB128 indirect address \\
2006 \DWOPconstx~\ddag&0xa2&1&ULEB128 indirect constant \\
2007 \DWOPentryvalue~\ddag&0xa3&2&ULEB128 size, \\*
2008 &&&\nolink{block} of that size\\
2009 \DWOPconsttype~\ddag & 0xa4 & 3 & ULEB128 type entry offset,\\*
2010 & & & 1-byte size, \\*
2011 & & & constant value \\
2012 \DWOPregvaltype~\ddag & 0xa5 & 2 & ULEB128 register number, \\*
2013 &&& ULEB128 constant offset \\
2014 \DWOPdereftype~\ddag & 0xa6 & 2 & 1-byte size, \\*
2015 &&& ULEB128 type entry offset \\
2016 \DWOPxdereftype~\ddag & 0xa7 & 2 & 1-byte size, \\*
2017 &&& ULEB128 type entry offset \\
2018 \DWOPconvert~\ddag & 0xa8 & 1 & ULEB128 type entry offset \\
2019 \DWOPreinterpret~\ddag & 0xa9 & 1 & ULEB128 type entry offset \\
2020 \DWOPlouser{} &0xe0 && \\
2021 \DWOPhiuser{} &\xff && \\
2027 \subsection{Location Descriptions}
2028 \label{datarep:locationdescriptions}
2030 A location description is used to compute the
2031 location of a variable or other entity.
2033 \subsection{Location Lists}
2034 \label{datarep:locationlists}
2036 Each entry in a \addtoindex{location list} is either a location list entry,
2037 a base address selection entry, or an
2038 \addtoindexx{end of list entry!in location list}
2042 \subsubsection{Location List Entries in Non-Split Objects}
2043 A \addtoindex{location list} entry consists of two address offsets followed
2044 by an unsigned 2\dash byte length, followed by a block of contiguous bytes
2045 that contains a DWARF location description. The length
2046 specifies the number of bytes in that block. The two offsets
2047 are the same size as an address on the target machine.
2050 A base address selection entry and an
2051 \addtoindexx{end of list entry!in location list}
2052 end of list entry each
2053 consist of two (constant or relocated) address offsets. The two
2054 offsets are the same size as an address on the target machine.
2056 For a \addtoindex{location list} to be specified, the base address of
2057 \addtoindexx{base address selection entry!in location list}
2058 the corresponding compilation unit must be defined
2059 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2061 \subsubsection{Location List Entries in Split Objects}
2062 An alternate form for location list entries is used in split objects.
2063 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2064 that follows. The encodings for these constants are given in
2065 Table \refersec{tab:locationlistentryencodingvalues}.
2068 \setlength{\extrarowheight}{0.1cm}
2069 \begin{longtable}{l|c}
2070 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2071 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2073 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2075 \hline \emph{Continued on next page}
2079 \DWLLEendoflistentry & 0x0 \\
2080 \DWLLEbaseaddressselectionentry & 0x01 \\
2081 \DWLLEstartendentry & 0x02 \\
2082 \DWLLEstartlengthentry & 0x03 \\
2083 \DWLLEoffsetpairentry & 0x04 \\
2087 \section{Base Type Attribute Encodings}
2088 \label{datarep:basetypeattributeencodings}
2090 The encodings of the
2091 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2093 \addtoindexx{encoding attribute!encoding}
2096 attribute are given in
2097 Table \refersec{tab:basetypeencodingvalues}
2100 \setlength{\extrarowheight}{0.1cm}
2101 \begin{longtable}{l|c}
2102 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2103 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2105 \bfseries Base type encoding name&\bfseries Value\\ \hline
2107 \hline \emph{Continued on next page}
2110 \ddag \ \textit{New in \DWARFVersionV}
2112 \DWATEaddress&0x01 \\
2113 \DWATEboolean&0x02 \\
2114 \DWATEcomplexfloat&0x03 \\
2116 \DWATEsigned&0x05 \\
2117 \DWATEsignedchar&0x06 \\
2118 \DWATEunsigned&0x07 \\
2119 \DWATEunsignedchar&0x08 \\
2120 \DWATEimaginaryfloat&0x09 \\
2121 \DWATEpackeddecimal&0x0a \\
2122 \DWATEnumericstring&0x0b \\
2123 \DWATEedited&0x0c \\
2124 \DWATEsignedfixed&0x0d \\
2125 \DWATEunsignedfixed&0x0e \\
2126 \DWATEdecimalfloat & 0x0f \\
2127 \DWATEUTF{} & 0x10 \\
2128 \DWATEUCS~\ddag & 0x11 \\
2129 \DWATEASCII~\ddag & 0x12 \\
2130 \DWATElouser{} & 0x80 \\
2131 \DWATEhiuser{} & \xff \\
2136 The encodings of the constants used in the
2137 \DWATdecimalsign{} attribute
2139 Table \refersec{tab:decimalsignencodings}.
2142 \setlength{\extrarowheight}{0.1cm}
2143 \begin{longtable}{l|c}
2144 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2145 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2147 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2149 \hline \emph{Continued on next page}
2154 \DWDSunsigned{} & 0x01 \\
2155 \DWDSleadingoverpunch{} & 0x02 \\
2156 \DWDStrailingoverpunch{} & 0x03 \\
2157 \DWDSleadingseparate{} & 0x04 \\
2158 \DWDStrailingseparate{} & 0x05 \\
2164 The encodings of the constants used in the
2165 \DWATendianity{} attribute are given in
2166 Table \refersec{tab:endianityencodings}.
2169 \setlength{\extrarowheight}{0.1cm}
2170 \begin{longtable}{l|c}
2171 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2172 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2174 \bfseries Endian code name&\bfseries Value\\ \hline
2176 \hline \emph{Continued on next page}
2181 \DWENDdefault{} & 0x00 \\
2182 \DWENDbig{} & 0x01 \\
2183 \DWENDlittle{} & 0x02 \\
2184 \DWENDlouser{} & 0x40 \\
2185 \DWENDhiuser{} & \xff \\
2190 \section{Accessibility Codes}
2191 \label{datarep:accessibilitycodes}
2192 The encodings of the constants used in the
2193 \DWATaccessibility{}
2195 \addtoindexx{accessibility attribute!encoding}
2197 Table \refersec{tab:accessibilityencodings}.
2200 \setlength{\extrarowheight}{0.1cm}
2201 \begin{longtable}{l|c}
2202 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2203 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2205 \bfseries Accessibility code name&\bfseries Value\\ \hline
2207 \hline \emph{Continued on next page}
2212 \DWACCESSpublic&0x01 \\
2213 \DWACCESSprotected&0x02 \\
2214 \DWACCESSprivate&0x03 \\
2220 \section{Visibility Codes}
2221 \label{datarep:visibilitycodes}
2222 The encodings of the constants used in the
2223 \DWATvisibility{} attribute are given in
2224 Table \refersec{tab:visibilityencodings}.
2227 \setlength{\extrarowheight}{0.1cm}
2228 \begin{longtable}{l|c}
2229 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2230 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2232 \bfseries Visibility code name&\bfseries Value\\ \hline
2234 \hline \emph{Continued on next page}
2240 \DWVISexported&0x02 \\
2241 \DWVISqualified&0x03 \\
2246 \section{Virtuality Codes}
2247 \label{datarep:vitualitycodes}
2249 The encodings of the constants used in the
2250 \DWATvirtuality{} attribute are given in
2251 Table \refersec{tab:virtualityencodings}.
2254 \setlength{\extrarowheight}{0.1cm}
2255 \begin{longtable}{l|c}
2256 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2257 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2259 \bfseries Virtuality code name&\bfseries Value\\ \hline
2261 \hline \emph{Continued on next page}
2266 \DWVIRTUALITYnone&0x00 \\
2267 \DWVIRTUALITYvirtual&0x01 \\
2268 \DWVIRTUALITYpurevirtual&0x02 \\
2276 \DWVIRTUALITYnone{} is equivalent to the absence of the
2280 \section{Source Languages}
2281 \label{datarep:sourcelanguages}
2283 The encodings of the constants used
2284 \addtoindexx{language attribute, encoding}
2286 \addtoindexx{language name encoding}
2289 attribute are given in
2290 Table \refersec{tab:languageencodings}.
2292 % If we don't force a following space it looks odd
2294 and their associated values are reserved, but the
2295 languages they represent are not well supported.
2296 Table \refersec{tab:languageencodings}
2298 \addtoindexx{lower bound attribute!default}
2299 default lower bound, if any, assumed for
2300 an omitted \DWATlowerbound{} attribute in the context of a
2301 \DWTAGsubrangetype{} debugging information entry for each
2305 \setlength{\extrarowheight}{0.1cm}
2306 \begin{longtable}{l|c|c}
2307 \caption{Language encodings} \label{tab:languageencodings}\\
2308 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2310 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2312 \hline \emph{Continued on next page}
2315 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2317 \addtoindexx{ISO-defined language names}
2319 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2320 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2321 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2322 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2323 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2324 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2325 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2326 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2327 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2328 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2329 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2330 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2331 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2332 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2333 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2334 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2335 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2336 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2337 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2338 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2339 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2340 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2341 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2342 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2343 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2344 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2345 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2346 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2347 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2348 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2349 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2350 \DWLANGDylan{} \ddag &0x0020 &0 \addtoindexx{Dylan} \\
2351 \DWLANGlouser{} &0x8000 & \\
2352 \DWLANGhiuser{} &\xffff & \\
2357 \section{Address Class Encodings}
2358 \label{datarep:addressclassencodings}
2360 The value of the common
2361 \addtoindexi{address}{address class!attribute encoding}
2366 \section{Identifier Case}
2367 \label{datarep:identifiercase}
2369 The encodings of the constants used in the
2370 \DWATidentifiercase{} attribute are given in
2371 Table \refersec{tab:identifiercaseencodings}.
2374 \setlength{\extrarowheight}{0.1cm}
2375 \begin{longtable}{l|c}
2376 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2377 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2379 \bfseries Identifier case name&\bfseries Value\\ \hline
2381 \hline \emph{Continued on next page}
2385 \DWIDcasesensitive&0x00 \\
2387 \DWIDdowncase&0x02 \\
2388 \DWIDcaseinsensitive&0x03 \\
2392 \section{Calling Convention Encodings}
2393 \label{datarep:callingconventionencodings}
2394 The encodings of the constants used in the
2395 \DWATcallingconvention{} attribute are given in
2396 Table \refersec{tab:callingconventionencodings}.
2399 \setlength{\extrarowheight}{0.1cm}
2400 \begin{longtable}{l|c}
2401 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2402 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2404 \bfseries Calling convention name&\bfseries Value\\ \hline
2406 \hline \emph{Continued on next page}
2412 \DWCCprogram&0x02 \\
2421 \section{Inline Codes}
2422 \label{datarep:inlinecodes}
2424 The encodings of the constants used in
2425 \addtoindexx{inline attribute!encoding}
2427 \DWATinline{} attribute are given in
2428 Table \refersec{tab:inlineencodings}.
2432 \setlength{\extrarowheight}{0.1cm}
2433 \begin{longtable}{l|c}
2434 \caption{Inline encodings} \label{tab:inlineencodings}\\
2435 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2437 \bfseries Inline Code name&\bfseries Value\\ \hline
2439 \hline \emph{Continued on next page}
2444 \DWINLnotinlined&0x00 \\
2445 \DWINLinlined&0x01 \\
2446 \DWINLdeclarednotinlined&0x02 \\
2447 \DWINLdeclaredinlined&0x03 \\
2452 % this clearpage is ugly, but the following table came
2453 % out oddly without it.
2455 \section{Array Ordering}
2456 \label{datarep:arrayordering}
2458 The encodings of the constants used in the
2459 \DWATordering{} attribute are given in
2460 Table \refersec{tab:orderingencodings}.
2464 \setlength{\extrarowheight}{0.1cm}
2465 \begin{longtable}{l|c}
2466 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2467 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2469 \bfseries Ordering name&\bfseries Value\\ \hline
2471 \hline \emph{Continued on next page}
2476 \DWORDrowmajor&0x00 \\
2477 \DWORDcolmajor&0x01 \\
2483 \section{Discriminant Lists}
2484 \label{datarep:discriminantlists}
2486 The descriptors used in
2487 \addtoindexx{discriminant list attribute!encoding}
2489 \DWATdiscrlist{} attribute are
2490 encoded as 1\dash byte constants. The
2491 defined values are given in
2492 Table \refersec{tab:discriminantdescriptorencodings}.
2494 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2496 \setlength{\extrarowheight}{0.1cm}
2497 \begin{longtable}{l|c}
2498 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2499 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2501 \bfseries Descriptor name&\bfseries Value\\ \hline
2503 \hline \emph{Continued on next page}
2515 \section{Name Lookup Tables}
2516 \label{datarep:namelookuptables}
2518 Each set of entries in the table of global names contained
2519 in the \dotdebugpubnames{} and
2520 \dotdebugpubtypes{} sections begins
2521 with a header consisting of:
2522 \begin{enumerate}[1. ]
2524 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2525 \addttindexx{unit\_length}
2526 A 4\dash byte or 12\dash byte unsigned integer
2527 \addtoindexx{initial length}
2528 representing the length
2529 of the \dotdebuginfo{}
2530 contribution for that compilation unit,
2531 not including the length field itself. In the
2532 \thirtytwobitdwarfformat, this is a 4\dash byte unsigned integer (which must be less
2533 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
2534 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
2535 integer that gives the actual length
2536 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2538 \item version (\addtoindex{uhalf}) \\
2539 A 2\dash byte unsigned integer representing the version of the
2540 DWARF information for the name lookup table
2541 \addtoindexx{version number!name lookup table}
2542 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2543 The value in this field is 2.
2546 \item \addtoindex{debug\_info\_offset} (section offset) \\
2548 \addtoindexx{section offset!in name lookup table set of entries}
2549 4\dash byte or 8\dash byte
2551 \dotdebuginfo{} or \dotdebuginfodwo{}
2552 section of the compilation unit header.
2553 In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned offset;
2554 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned offsets
2555 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2557 \item \addtoindex{debug\_info\_length} (\livelink{datarep:sectionoffsetlength}{section length}) \\
2558 \addtoindexx{section length!in .debug\_pubnames header}
2560 \addtoindexx{section length!in .debug\_pubtypes header}
2561 4\dash byte or 8\dash byte length containing the size in bytes of the
2562 contents of the \dotdebuginfo{}
2563 section generated to represent
2564 this compilation unit. In the \thirtytwobitdwarfformat, this is
2565 a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat, this
2566 is an 8-byte unsigned length
2567 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2572 This header is followed by a series of tuples. Each tuple
2573 consists of a 4\dash byte or 8\dash byte offset followed by a string
2574 of non\dash null bytes terminated by one null byte.
2576 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2577 format, it is an 8\dash byte offset.
2578 Each set is terminated by an
2579 offset containing the value 0.
2583 \section{Address Range Table}
2584 \label{datarep:addrssrangetable}
2586 Each set of entries in the table of address ranges contained
2587 in the \dotdebugaranges{}
2588 section begins with a header containing:
2589 \begin{enumerate}[1. ]
2590 % FIXME The unit length text is not fully consistent across
2593 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2594 \addttindexx{unit\_length}
2595 A 4-byte or 12-byte length containing the length of the
2596 \addtoindexx{initial length}
2597 set of entries for this compilation unit, not including the
2598 length field itself. In the \thirtytwobitdwarfformat, this is a
2599 4-byte unsigned integer (which must be less than \xfffffffzero);
2600 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2601 \wffffffff followed by an 8-byte unsigned integer that gives
2603 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2605 \item version (\addtoindex{uhalf}) \\
2606 A 2\dash byte version identifier representing the version of the
2607 DWARF information for the address range table
2608 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2609 This value in this field \addtoindexx{version number!address range table} is 2.
2612 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2614 \addtoindexx{section offset!in .debug\_aranges header}
2615 4\dash byte or 8\dash byte offset into the
2616 \dotdebuginfo{} section of
2617 the compilation unit header. In the \thirtytwobitdwarfformat,
2618 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2619 this is an 8\dash byte unsigned offset
2620 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2622 \item address\_size (ubyte) \\
2623 A 1\dash byte unsigned integer containing the size in bytes of an
2624 \addtoindexx{address\_size}
2626 \addtoindexx{size of an address}
2627 (or the offset portion of an address for segmented
2628 \addtoindexx{address space!segmented}
2629 addressing) on the target system.
2631 \item segment\_size (ubyte) \\
2633 \addtoindexx{segment\_size}
2634 1\dash byte unsigned integer containing the size in bytes of a
2635 segment selector on the target system.
2639 This header is followed by a series of tuples. Each tuple
2640 consists of a segment, an address and a length.
2642 size is given by the \addtoindex{segment\_size} field of the header; the
2643 address and length size are each given by the address\_size
2644 field of the header.
2645 The first tuple following the header in
2646 each set begins at an offset that is a multiple of the size
2647 of a single tuple (that is, the size of a segment selector
2648 plus twice the \addtoindex{size of an address}).
2649 The header is padded, if
2650 necessary, to that boundary. Each set of tuples is terminated
2651 by a 0 for the segment, a 0 for the address and 0 for the
2652 length. If the \addtoindex{segment\_size} field in the header is zero,
2653 the segment selectors are omitted from all tuples, including
2654 the terminating tuple.
2657 \section{Line Number Information}
2658 \label{datarep:linenumberinformation}
2660 The \addtoindexi{version number}{version number!line number information}
2661 in the line number program header is \versiondotdebugline{}
2662 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2664 The boolean values \doublequote{true} and \doublequote{false}
2665 used by the line number information program are encoded
2666 as a single byte containing the value 0
2667 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2669 The encodings for the standard opcodes are given in
2670 \addtoindexx{line number opcodes!standard opcode encoding}
2671 Table \refersec{tab:linenumberstandardopcodeencodings}.
2673 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2675 \setlength{\extrarowheight}{0.1cm}
2676 \begin{longtable}{l|c}
2677 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2678 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2680 \bfseries Opcode name&\bfseries Value\\ \hline
2682 \hline \emph{Continued on next page}
2688 \DWLNSadvancepc&0x02 \\
2689 \DWLNSadvanceline&0x03 \\
2690 \DWLNSsetfile&0x04 \\
2691 \DWLNSsetcolumn&0x05 \\
2692 \DWLNSnegatestmt&0x06 \\
2693 \DWLNSsetbasicblock&0x07 \\
2694 \DWLNSconstaddpc&0x08 \\
2695 \DWLNSfixedadvancepc&0x09 \\
2696 \DWLNSsetprologueend&0x0a \\*
2697 \DWLNSsetepiloguebegin&0x0b \\*
2698 \DWLNSsetisa&0x0c \\*
2705 The encodings for the extended opcodes are given in
2706 \addtoindexx{line number opcodes!extended opcode encoding}
2707 Table \refersec{tab:linenumberextendedopcodeencodings}.
2710 \setlength{\extrarowheight}{0.1cm}
2711 \begin{longtable}{l|c}
2712 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2713 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2715 \bfseries Opcode name&\bfseries Value\\ \hline
2717 \hline \emph{Continued on next page}
2719 \hline \ddag~\textit{New in DWARF Version 5}
2722 \DWLNEendsequence &0x01 \\
2723 \DWLNEsetaddress &0x02 \\
2724 \DWLNEdefinefile &0x03 \\
2725 \DWLNEsetdiscriminator &0x04 \\
2726 \DWLNEdefinefileMDfive~\ddag &0x05 \\
2727 \DWLNElouser &0x80 \\
2728 \DWLNEhiuser &\xff \\
2734 The encodings for the file entry format are given in
2735 \addtoindexx{line number opcodes!file entry format encoding}
2736 Table \refersec{tab:linenumberfileentryformatencodings}.
2739 \setlength{\extrarowheight}{0.1cm}
2740 \begin{longtable}{l|c}
2741 \caption{Line number file entry format \mbox{encodings}} \label{tab:linenumberfileentryformatencodings}\\
2742 \hline \bfseries File entry format name&\bfseries Value \\ \hline
2744 \bfseries File entry format name&\bfseries Value\\ \hline
2746 \hline \emph{Continued on next page}
2751 \DWLNFtimestampsize & 0x01 \\
2752 \DWLNFMDfive & 0x02 \\
2757 \section{Macro Information}
2758 \label{datarep:macroinformation}
2759 The \addtoindexi{version number}{version number!macro information}
2760 in the macro information header is \versiondotdebugmacro{}
2761 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2763 The source line numbers and source file indices encoded in the
2764 macro information section are represented as
2765 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
2767 The macro information entry type is encoded as a single unsigned byte.
2769 \addtoindexx{macro information entry types!encoding}
2771 Table \refersec{tab:macroinfoentrytypeencodings}.
2775 \setlength{\extrarowheight}{0.1cm}
2776 \begin{longtable}{l|c}
2777 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
2778 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
2780 \bfseries Macro information entry type name&\bfseries Value\\ \hline
2782 \hline \emph{Continued on next page}
2784 \hline \ddag~\textit{New in DWARF Version 5}
2787 \DWMACROdefine~\ddag &0x01 \\
2788 \DWMACROundef~\ddag &0x02 \\
2789 \DWMACROstartfile~\ddag &0x03 \\
2790 \DWMACROendfile~\ddag &0x04 \\
2791 \DWMACROdefineindirect~\ddag &0x05 \\
2792 \DWMACROundefindirect~\ddag &0x06 \\
2793 \DWMACROtransparentinclude~\ddag &0x07 \\
2794 \textit{Reserved} &0x08-0x0a \\
2795 \DWMACROdefineindirectx~\ddag &0x0b \\
2796 \DWMACROundefindirectx~\ddag &0x0c \\
2797 \DWMACROlouser~\ddag &0xe0 \\
2798 \DWMACROhiuser~\ddag &\xff \\
2804 \section{Call Frame Information}
2805 \label{datarep:callframeinformation}
2807 In the \thirtytwobitdwarfformat, the value of the CIE id in the
2808 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
2809 value is \xffffffffffffffff.
2811 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2812 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2814 Call frame instructions are encoded in one or more bytes. The
2815 primary opcode is encoded in the high order two bits of
2816 the first byte (that is, opcode = byte $\gg$ 6). An operand
2817 or extended opcode may be encoded in the low order 6
2818 bits. Additional operands are encoded in subsequent bytes.
2819 The instructions and their encodings are presented in
2820 Table \refersec{tab:callframeinstructionencodings}.
2823 \setlength{\extrarowheight}{0.1cm}
2824 \begin{longtable}{l|c|c|l|l}
2825 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2826 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
2827 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2829 & \bfseries High 2 &\bfseries Low 6 & &\\
2830 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2832 \hline \emph{Continued on next page}
2837 \DWCFAadvanceloc&0x1&delta & \\
2838 \DWCFAoffset&0x2®ister&ULEB128 offset \\
2839 \DWCFArestore&0x3®ister & & \\
2840 \DWCFAnop&0&0 & & \\
2841 \DWCFAsetloc&0&0x01&address & \\
2842 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
2843 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
2844 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
2845 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
2846 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
2847 \DWCFAundefined&0&0x07&ULEB128 register & \\
2848 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
2849 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
2850 \DWCFArememberstate&0&0x0a & & \\
2851 \DWCFArestorestate&0&0x0b & & \\
2852 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
2853 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
2854 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
2855 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
2856 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
2858 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
2859 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
2860 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
2861 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
2862 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
2863 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
2864 \DWCFAlouser&0&0x1c & & \\
2865 \DWCFAhiuser&0&\xiiif & & \\
2869 \section{Non-contiguous Address Ranges}
2870 \label{datarep:noncontiguousaddressranges}
2872 Each entry in a \addtoindex{range list}
2873 (see Section \refersec{chap:noncontiguousaddressranges})
2875 \addtoindexx{base address selection entry!in range list}
2877 \addtoindexx{range list}
2878 a base address selection entry, or an end
2881 A \addtoindex{range list} entry consists of two relative addresses. The
2882 addresses are the same size as addresses on the target machine.
2885 A base address selection entry and an
2886 \addtoindexx{end of list entry!in range list}
2887 end of list entry each
2888 \addtoindexx{base address selection entry!in range list}
2889 consist of two (constant or relocated) addresses. The two
2890 addresses are the same size as addresses on the target machine.
2892 For a \addtoindex{range list} to be specified, the base address of the
2893 \addtoindexx{base address selection entry!in range list}
2894 corresponding compilation unit must be defined
2895 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2898 \section{String Offsets Table}
2899 \label{chap:stringoffsetstable}
2900 Each set of entries in the string offsets table contained in the
2901 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
2902 section begins with a header containing:
2903 \begin{enumerate}[1. ]
2904 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2905 A 4-byte or 12-byte length containing the length of
2906 the set of entries for this compilation unit, not
2907 including the length field itself. In the 32-bit
2908 DWARF format, this is a 4-byte unsigned integer
2909 (which must be less than \xfffffffzero); in the 64-bit
2910 DWARF format, this consists of the 4-byte value
2911 \wffffffff followed by an 8-byte unsigned integer
2912 that gives the actual length (see
2913 Section \refersec{datarep:32bitand64bitdwarfformats}).
2916 \item \texttt{version} (\addtoindex{uhalf}) \\
2917 A 2-byte version identifier containing the value
2918 \versiondotdebugstroffsets{}
2919 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2920 \item \texttt{padding} (\addtoindex{uhalf}) \\
2923 This header is followed by a series of string table offsets
2924 that have the same representation as \DWFORMstrp.
2925 For the 32-bit DWARF format, each offset is 4 bytes long; for
2926 the 64-bit DWARF format, each offset is 8 bytes long.
2928 The \DWATstroffsetsbase{} attribute points to the first
2929 entry following the header. The entries are indexed
2930 sequentially from this base entry, starting from 0.
2932 \section{Address Table}
2933 \label{chap:addresstable}
2934 Each set of entries in the address table contained in the
2935 \dotdebugaddr{} section begins with a header containing:
2936 \begin{enumerate}[1. ]
2937 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2938 A 4-byte or 12-byte length containing the length of
2939 the set of entries for this compilation unit, not
2940 including the length field itself. In the 32-bit
2941 DWARF format, this is a 4-byte unsigned integer
2942 (which must be less than \xfffffffzero); in the 64-bit
2943 DWARF format, this consists of the 4-byte value
2944 \wffffffff followed by an 8-byte unsigned integer
2945 that gives the actual length (see
2946 Section \refersec{datarep:32bitand64bitdwarfformats}).
2949 \item \texttt{version} (\addtoindex{uhalf}) \\
2950 A 2-byte version identifier containing the value
2951 \versiondotdebugaddr{}
2952 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2955 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2956 A 1-byte unsigned integer containing the size in
2957 bytes of an address (or the offset portion of an
2958 address for segmented addressing) on the target
2962 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2963 A 1-byte unsigned integer containing the size in
2964 bytes of a segment selector on the target system.
2967 This header is followed by a series of segment/address pairs.
2968 The segment size is given by the \texttt{segment\_size} field of the
2969 header, and the address size is given by the \texttt{address\_size}
2970 field of the header. If the \texttt{segment\_size} field in the header
2971 is zero, the entries consist only of an addresses.
2973 The \DWATaddrbase{} attribute points to the first entry
2974 following the header. The entries are indexed sequentially
2975 from this base entry, starting from 0.
2977 \section{Range List Table}
2978 \label{app:rangelisttable}
2979 Each set of entries in the range list table contained in the
2980 \dotdebugranges{} section begins with a header containing:
2981 \begin{enumerate}[1. ]
2982 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2983 A 4-byte or 12-byte length containing the length of
2984 the set of entries for this compilation unit, not
2985 including the length field itself. In the 32-bit
2986 DWARF format, this is a 4-byte unsigned integer
2987 (which must be less than \xfffffffzero); in the 64-bit
2988 DWARF format, this consists of the 4-byte value
2989 \wffffffff followed by an 8-byte unsigned integer
2990 that gives the actual length (see
2991 Section \refersec{datarep:32bitand64bitdwarfformats}).
2994 \item \texttt{version} (\addtoindex{uhalf}) \\
2995 A 2-byte version identifier containing the value
2996 \versiondotdebugranges{}
2997 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3000 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3001 A 1-byte unsigned integer containing the size in
3002 bytes of an address (or the offset portion of an
3003 address for segmented addressing) on the target
3007 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3008 A 1-byte unsigned integer containing the size in
3009 bytes of a segment selector on the target system.
3012 This header is followed by a series of range list entries as
3013 described in Section \refersec{chap:locationlists}.
3014 The segment size is given by the
3015 \texttt{segment\_size} field of the header, and the address size is
3016 given by the \texttt{address\_size} field of the header. If the
3017 \texttt{segment\_size} field in the header is zero, the segment
3018 selector is omitted from the range list entries.
3020 The \DWATrangesbase{} attribute points to the first entry
3021 following the header. The entries are referenced by a byte
3022 offset relative to this base address.
3025 \section{Location List Table}
3026 \label{datarep:locationlisttable}
3027 Each set of entries in the location list table contained in the
3028 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3029 \begin{enumerate}[1. ]
3030 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3031 A 4-byte or 12-byte length containing the length of
3032 the set of entries for this compilation unit, not
3033 including the length field itself. In the 32-bit
3034 DWARF format, this is a 4-byte unsigned integer
3035 (which must be less than \xfffffffzero); in the 64-bit
3036 DWARF format, this consists of the 4-byte value
3037 \wffffffff followed by an 8-byte unsigned integer
3038 that gives the actual length (see
3039 Section \refersec{datarep:32bitand64bitdwarfformats}).
3042 \item \texttt{version} (\addtoindex{uhalf}) \\
3043 A 2-byte version identifier containing the value
3044 \versiondotdebugloc{}
3045 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3048 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3049 A 1-byte unsigned integer containing the size in
3050 bytes of an address (or the offset portion of an
3051 address for segmented addressing) on the target
3055 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3056 A 1-byte unsigned integer containing the size in
3057 bytes of a segment selector on the target system.
3060 This header is followed by a series of location list entries as
3061 described in Section \refersec{chap:locationlists}.
3062 The segment size is given by the
3063 \texttt{segment\_size} field of the header, and the address size is
3064 given by the \texttt{address\_size} field of the header. If the
3065 \texttt{segment\_size} field in the header is zero, the segment
3066 selector is omitted from the range list entries.
3068 The entries are referenced by a byte offset relative to the first
3069 location list following this header.
3072 \section{Dependencies and Constraints}
3073 \label{datarep:dependenciesandconstraints}
3074 The debugging information in this format is intended to
3076 \addtoindexx{DWARF section names!list of}
3086 \dotdebugpubnames{},
3087 \dotdebugpubtypes{},
3091 \dotdebugstroffsets{}
3092 sections of an object file, or equivalent
3093 separate file or database. The information is not
3094 word\dash aligned. Consequently:
3097 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3098 32\dash bit addresses, an assembler or compiler must provide a way
3099 to produce 2\dash byte and 4\dash byte quantities without alignment
3100 restrictions, and the linker must be able to relocate a
3101 4\dash byte address or
3102 \addtoindexx{section offset!alignment of}
3103 section offset that occurs at an arbitrary
3106 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3107 64\dash bit addresses, an assembler or compiler must provide a
3108 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3109 alignment restrictions, and the linker must be able to relocate
3110 an 8\dash byte address or 4\dash byte
3111 \addtoindexx{section offset!alignment of}
3112 section offset that occurs at an
3113 arbitrary alignment.
3115 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3116 32\dash bit addresses, an assembler or compiler must provide a
3117 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3118 alignment restrictions, and the linker must be able to relocate
3119 a 4\dash byte address or 8\dash byte
3120 \addtoindexx{section offset!alignment of}
3121 section offset that occurs at an
3122 arbitrary alignment.
3124 \textit{It is expected that this will be required only for very large
3125 32\dash bit programs or by those architectures which support
3126 a mix of 32\dash bit and 64\dash bit code and data within the same
3129 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3130 64\dash bit addresses, an assembler or compiler must provide a
3131 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3132 alignment restrictions, and the linker must be able to
3133 relocate an 8\dash byte address or
3134 \addtoindexx{section offset!alignment of}
3135 section offset that occurs at
3136 an arbitrary alignment.
3140 \section{Integer Representation Names}
3141 \label{datarep:integerrepresentationnames}
3142 The sizes of the integers used in the lookup by name, lookup
3143 by address, line number and call frame information sections
3145 Table \ref{tab:integerrepresentationnames}.
3149 \setlength{\extrarowheight}{0.1cm}
3150 \begin{longtable}{c|l}
3151 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3152 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3154 \bfseries Representation name&\bfseries Representation\\ \hline
3156 \hline \emph{Continued on next page}
3161 \addtoindex{sbyte}& signed, 1\dash byte integer \\
3162 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
3163 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
3164 \addtoindex{uword}&unsigned, 4\dash byte integer \\
3170 \section{Type Signature Computation}
3171 \label{datarep:typesignaturecomputation}
3173 A type signature is computed only by the DWARF producer;
3174 \addtoindexx{type signature!computation}
3175 it is used by a DWARF consumer to resolve type references to
3176 the type definitions that are contained in
3177 \addtoindexx{type unit}
3181 The type signature for a type T0 is formed from the
3182 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3183 R.L. Rivest, RFC 1321, April 1992}
3184 hash of a flattened description of the type. The flattened
3185 description of the type is a byte sequence derived from the
3186 DWARF encoding of the type as follows:
3187 \begin{enumerate}[1. ]
3189 \item Start with an empty sequence S and a list V of visited
3190 types, where V is initialized to a list containing the type
3191 T0 as its single element. Elements in V are indexed from 1,
3194 \item If the debugging information entry represents a type that
3195 is nested inside another type or a namespace, append to S
3196 the type\textquoteright s context as follows: For each surrounding type
3197 or namespace, beginning with the outermost such construct,
3198 append the letter 'C', the DWARF tag of the construct, and
3199 the name (taken from
3200 \addtoindexx{name attribute}
3201 the \DWATname{} attribute) of the type
3202 \addtoindexx{name attribute}
3203 or namespace (including its trailing null byte).
3205 \item Append to S the letter 'D', followed by the DWARF tag of
3206 the debugging information entry.
3208 \item For each of the attributes in
3209 Table \refersec{tab:attributesusedintypesignaturecomputation}
3211 the debugging information entry, in the order listed,
3212 append to S a marker letter (see below), the DWARF attribute
3213 code, and the attribute value.
3216 \caption{Attributes used in type signature computation}
3217 \label{tab:attributesusedintypesignaturecomputation}
3218 \simplerule[\textwidth]
3220 \autocols[0pt]{c}{2}{l}{
3235 \DWATcontainingtype,
3239 \DWATdatamemberlocation,
3260 \DWATrvaluereference,
3264 \DWATstringlengthbitsize,
3265 \DWATstringlengthbytesize,
3270 \DWATvariableparameter,
3273 \DWATvtableelemlocation
3276 \simplerule[\textwidth]
3279 Note that except for the initial
3280 \DWATname{} attribute,
3281 \addtoindexx{name attribute}
3282 attributes are appended in order according to the alphabetical
3283 spelling of their identifier.
3285 If an implementation defines any vendor-specific attributes,
3286 any such attributes that are essential to the definition of
3287 the type should also be included at the end of the above list,
3288 in their own alphabetical suborder.
3290 An attribute that refers to another type entry T is processed
3291 as follows: (a) If T is in the list V at some V[x], use the
3292 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3293 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3294 as the marker, process the type T recursively by performing
3295 Steps 2 through 7, and use the result as the attribute value.
3297 Other attribute values use the letter 'A' as the marker, and
3298 the value consists of the form code (encoded as an unsigned
3299 LEB128 value) followed by the encoding of the value according
3300 to the form code. To ensure reproducibility of the signature,
3301 the set of forms used in the signature computation is limited
3310 \item If the tag in Step 3 is one of \DWTAGpointertype,
3311 \DWTAGreferencetype,
3312 \DWTAGrvaluereferencetype,
3313 \DWTAGptrtomembertype,
3314 or \DWTAGfriend, and the referenced
3315 type (via the \DWATtype{} or
3316 \DWATfriend{} attribute) has a
3317 \DWATname{} attribute, append to S the letter 'N', the DWARF
3318 attribute code (\DWATtype{} or
3319 \DWATfriend), the context of
3320 the type (according to the method in Step 2), the letter 'E',
3321 and the name of the type. For \DWTAGfriend, if the referenced
3322 entry is a \DWTAGsubprogram, the context is omitted and the
3323 name to be used is the ABI-specific name of the subprogram
3324 (for example, the mangled linker name).
3327 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3328 \DWTAGreferencetype,
3329 \DWTAGrvaluereferencetype,
3330 \DWTAGptrtomembertype, or
3331 \DWTAGfriend, but has
3332 a \DWATtype{} attribute, or if the referenced type (via
3334 \DWATfriend{} attribute) does not have a
3335 \DWATname{} attribute, the attribute is processed according to
3336 the method in Step 4 for an attribute that refers to another
3340 \item Visit each child C of the debugging information
3341 entry as follows: If C is a nested type entry or a member
3342 function entry, and has
3343 a \DWATname{} attribute, append to
3344 \addtoindexx{name attribute}
3345 S the letter 'S', the tag of C, and its name; otherwise,
3346 process C recursively by performing Steps 3 through 7,
3347 appending the result to S. Following the last child (or if
3348 there are no children), append a zero byte.
3353 For the purposes of this algorithm, if a debugging information
3355 \DWATspecification{}
3356 attribute that refers to
3357 another entry D (which has a
3360 then S inherits the attributes and children of D, and S is
3361 processed as if those attributes and children were present in
3362 the entry S. Exception: if a particular attribute is found in
3363 both S and D, the attribute in S is used and the corresponding
3364 one in D is ignored.
3367 DWARF tag and attribute codes are appended to the sequence
3368 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3369 using the values defined earlier in this chapter.
3371 \textit{A grammar describing this computation may be found in
3372 Appendix \refersec{app:typesignaturecomputationgrammar}.
3375 \textit{An attribute that refers to another type entry should
3376 be recursively processed or replaced with the name of the
3377 referent (in Step 4, 5 or 6). If neither treatment applies to
3378 an attribute that references another type entry, the entry
3379 that contains that attribute should not be considered for a
3380 separate \addtoindex{type unit}.}
3382 \textit{If a debugging information entry contains an attribute from
3383 the list above that would require an unsupported form, that
3384 entry should not be considered for a separate
3385 \addtoindex{type unit}.}
3387 \textit{A type should be considered for a separate
3388 \addtoindex{type unit} only
3389 if all of the type entries that it contains or refers to in
3390 Steps 6 and 7 can themselves each be considered for a separate
3391 \addtoindex{type unit}.}
3394 Where the DWARF producer may reasonably choose two or more
3395 different forms for a given attribute, it should choose
3396 the simplest possible form in computing the signature. (For
3397 example, a constant value should be preferred to a location
3398 expression when possible.)
3400 Once the string S has been formed from the DWARF encoding,
3401 an \MDfive{} hash is computed for the string and the
3402 least significant 64 bits are taken as the type signature.
3404 \textit{The string S is intended to be a flattened representation of
3405 the type that uniquely identifies that type (that is, a different
3406 type is highly unlikely to produce the same string).}
3408 \textit{A debugging information entry should not be placed in a
3409 separate \addtoindex{type unit}
3410 if any of the following apply:}
3414 \item \textit{The entry has an attribute whose value is a location
3415 expression, and the location expression contains a reference to
3416 another debugging information entry (for example, a \DWOPcallref{}
3417 operator), as it is unlikely that the entry will remain
3418 identical across compilation units.}
3420 \item \textit{The entry has an attribute whose value refers
3421 to a code location or a \addtoindex{location list}.}
3423 \item \textit{The entry has an attribute whose value refers
3424 to another debugging information entry that does not represent
3430 \textit{Certain attributes are not included in the type signature:}
3433 \item \textit{The \DWATdeclaration{} attribute is not included because it
3434 indicates that the debugging information entry represents an
3435 incomplete declaration, and incomplete declarations should
3437 \addtoindexx{type unit}
3438 separate type units.}
3440 \item \textit{The \DWATdescription{} attribute is not included because
3441 it does not provide any information unique to the defining
3442 declaration of the type.}
3444 \item \textit{The \DWATdeclfile,
3446 \DWATdeclcolumn{} attributes are not included because they
3447 may vary from one source file to the next, and would prevent
3448 two otherwise identical type declarations from producing the
3449 same \MDfive{} hash.}
3451 \item \textit{The \DWATobjectpointer{} attribute is not included
3452 because the information it provides is not necessary for the
3453 computation of a unique type signature.}
3457 \textit{Nested types and some types referred to by a debugging
3458 information entry are encoded by name rather than by recursively
3459 encoding the type to allow for cases where a complete definition
3460 of the type might not be available in all compilation units.}
3463 \textit{If a type definition contains the definition of a member function,
3464 it cannot be moved as is into a type unit, because the member function
3465 contains attributes that are unique to that compilation unit.
3466 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3467 moving the member function declaration into a separate declaration tree,
3468 and replacing the function definition in the type with a non-defining
3469 declaration of the function (as if the function had been defined out of
3472 An example that illustrates the computation of an \MDfive{} hash may be found in
3473 Appendix \refersec{app:usingtypeunits}.