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|l}
644 \caption{Unit header unit kind encodings}
645 \label{tab:unitheaderunitkindencodings}
646 \addtoindexx{Unit header unit kind encodings} \\
647 \hline \bfseries Unit header unit kind encodings&\bfseries Value \\ \hline
649 \bfseries Unit header unit kind encodings&\bfseries Value \\ \hline
651 \hline \emph{Continued on next page}
655 \DWUTcompileTARG &0x01 \\
656 \DWUTtypeTARG &0x02 \\
657 \DWUTpartialTARG &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|l}
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|l}
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|l|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|l|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}{l|l|l}
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}{l|l|l}
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&ULEV128 size, \\*
2008 &&&\nolink{block} of that size\\
2009 \DWOPlouser{} &0xe0 && \\
2010 \DWOPhiuser{} &\xff && \\
2016 \subsection{Location Descriptions}
2017 \label{datarep:locationdescriptions}
2019 A location description is used to compute the
2020 location of a variable or other entity.
2022 \subsection{Location Lists}
2023 \label{datarep:locationlists}
2025 Each entry in a \addtoindex{location list} is either a location list entry,
2026 a base address selection entry, or an
2027 \addtoindexx{end of list entry!in location list}
2031 \subsubsection{Location List Entries in Non-Split Objects}
2032 A \addtoindex{location list} entry consists of two address offsets followed
2033 by an unsigned 2\dash byte length, followed by a block of contiguous bytes
2034 that contains a DWARF location description. The length
2035 specifies the number of bytes in that block. The two offsets
2036 are the same size as an address on the target machine.
2039 A base address selection entry and an
2040 \addtoindexx{end of list entry!in location list}
2041 end of list entry each
2042 consist of two (constant or relocated) address offsets. The two
2043 offsets are the same size as an address on the target machine.
2045 For a \addtoindex{location list} to be specified, the base address of
2046 \addtoindexx{base address selection entry!in location list}
2047 the corresponding compilation unit must be defined
2048 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2050 \subsubsection{Location List Entries in Split Objects}
2051 An alternate form for location list entries is used in split objects.
2052 Each entry begins with an unsigned 1-byte code that indicates the kind of entry
2053 that follows. The encodings for these constants are given in
2054 Table \refersec{tab:locationlistentryencodingvalues}.
2057 \setlength{\extrarowheight}{0.1cm}
2058 \begin{longtable}{l|c}
2059 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
2060 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
2062 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
2064 \hline \emph{Continued on next page}
2068 \DWLLEendoflistentry & 0x0 \\
2069 \DWLLEbaseaddressselectionentry & 0x01 \\
2070 \DWLLEstartendentry & 0x02 \\
2071 \DWLLEstartlengthentry & 0x03 \\
2072 \DWLLEoffsetpairentry & 0x04 \\
2076 \section{Base Type Attribute Encodings}
2077 \label{datarep:basetypeattributeencodings}
2079 The encodings of the
2080 \hypertarget{chap:DWATencodingencodingofbasetype}{}
2082 \addtoindexx{encoding attribute!encoding}
2085 attribute are given in
2086 Table \refersec{tab:basetypeencodingvalues}
2089 \setlength{\extrarowheight}{0.1cm}
2090 \begin{longtable}{l|c}
2091 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
2092 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
2094 \bfseries Base type encoding name&\bfseries Value\\ \hline
2096 \hline \emph{Continued on next page}
2099 \ddag \ \textit{New in \DWARFVersionV}
2101 \DWATEaddress&0x01 \\
2102 \DWATEboolean&0x02 \\
2103 \DWATEcomplexfloat&0x03 \\
2105 \DWATEsigned&0x05 \\
2106 \DWATEsignedchar&0x06 \\
2107 \DWATEunsigned&0x07 \\
2108 \DWATEunsignedchar&0x08 \\
2109 \DWATEimaginaryfloat&0x09 \\
2110 \DWATEpackeddecimal&0x0a \\
2111 \DWATEnumericstring&0x0b \\
2112 \DWATEedited&0x0c \\
2113 \DWATEsignedfixed&0x0d \\
2114 \DWATEunsignedfixed&0x0e \\
2115 \DWATEdecimalfloat & 0x0f \\
2116 \DWATEUTF{} & 0x10 \\
2117 \DWATEUCS~\ddag & 0x11 \\
2118 \DWATEASCII~\ddag & 0x12 \\
2119 \DWATElouser{} & 0x80 \\
2120 \DWATEhiuser{} & \xff \\
2125 The encodings of the constants used in the
2126 \DWATdecimalsign{} attribute
2128 Table \refersec{tab:decimalsignencodings}.
2131 \setlength{\extrarowheight}{0.1cm}
2132 \begin{longtable}{l|c}
2133 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
2134 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
2136 \bfseries Decimal sign code name&\bfseries Value\\ \hline
2138 \hline \emph{Continued on next page}
2143 \DWDSunsigned{} & 0x01 \\
2144 \DWDSleadingoverpunch{} & 0x02 \\
2145 \DWDStrailingoverpunch{} & 0x03 \\
2146 \DWDSleadingseparate{} & 0x04 \\
2147 \DWDStrailingseparate{} & 0x05 \\
2153 The encodings of the constants used in the
2154 \DWATendianity{} attribute are given in
2155 Table \refersec{tab:endianityencodings}.
2158 \setlength{\extrarowheight}{0.1cm}
2159 \begin{longtable}{l|c}
2160 \caption{Endianity encodings} \label{tab:endianityencodings}\\
2161 \hline \bfseries Endian code name&\bfseries Value \\ \hline
2163 \bfseries Endian code name&\bfseries Value\\ \hline
2165 \hline \emph{Continued on next page}
2170 \DWENDdefault{} & 0x00 \\
2171 \DWENDbig{} & 0x01 \\
2172 \DWENDlittle{} & 0x02 \\
2173 \DWENDlouser{} & 0x40 \\
2174 \DWENDhiuser{} & \xff \\
2179 \section{Accessibility Codes}
2180 \label{datarep:accessibilitycodes}
2181 The encodings of the constants used in the
2182 \DWATaccessibility{}
2184 \addtoindexx{accessibility attribute!encoding}
2186 Table \refersec{tab:accessibilityencodings}.
2189 \setlength{\extrarowheight}{0.1cm}
2190 \begin{longtable}{l|c}
2191 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
2192 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
2194 \bfseries Accessibility code name&\bfseries Value\\ \hline
2196 \hline \emph{Continued on next page}
2201 \DWACCESSpublic&0x01 \\
2202 \DWACCESSprotected&0x02 \\
2203 \DWACCESSprivate&0x03 \\
2209 \section{Visibility Codes}
2210 \label{datarep:visibilitycodes}
2211 The encodings of the constants used in the
2212 \DWATvisibility{} attribute are given in
2213 Table \refersec{tab:visibilityencodings}.
2216 \setlength{\extrarowheight}{0.1cm}
2217 \begin{longtable}{l|c}
2218 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
2219 \hline \bfseries Visibility code name&\bfseries Value \\ \hline
2221 \bfseries Visibility code name&\bfseries Value\\ \hline
2223 \hline \emph{Continued on next page}
2229 \DWVISexported&0x02 \\
2230 \DWVISqualified&0x03 \\
2235 \section{Virtuality Codes}
2236 \label{datarep:vitualitycodes}
2238 The encodings of the constants used in the
2239 \DWATvirtuality{} attribute are given in
2240 Table \refersec{tab:virtualityencodings}.
2243 \setlength{\extrarowheight}{0.1cm}
2244 \begin{longtable}{l|c}
2245 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
2246 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
2248 \bfseries Virtuality code name&\bfseries Value\\ \hline
2250 \hline \emph{Continued on next page}
2255 \DWVIRTUALITYnone&0x00 \\
2256 \DWVIRTUALITYvirtual&0x01 \\
2257 \DWVIRTUALITYpurevirtual&0x02 \\
2265 \DWVIRTUALITYnone{} is equivalent to the absence of the
2269 \section{Source Languages}
2270 \label{datarep:sourcelanguages}
2272 The encodings of the constants used
2273 \addtoindexx{language attribute, encoding}
2275 \addtoindexx{language name encoding}
2278 attribute are given in
2279 Table \refersec{tab:languageencodings}.
2281 % If we don't force a following space it looks odd
2283 and their associated values are reserved, but the
2284 languages they represent are not well supported.
2285 Table \refersec{tab:languageencodings}
2287 \addtoindexx{lower bound attribute!default}
2288 default lower bound, if any, assumed for
2289 an omitted \DWATlowerbound{} attribute in the context of a
2290 \DWTAGsubrangetype{} debugging information entry for each
2294 \setlength{\extrarowheight}{0.1cm}
2295 \begin{longtable}{l|c|c}
2296 \caption{Language encodings} \label{tab:languageencodings}\\
2297 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
2299 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
2301 \hline \emph{Continued on next page}
2304 \dag \ \textit{See text} \\ \ddag \ \textit{New in \DWARFVersionV}
2306 \addtoindexx{ISO-defined language names}
2308 \DWLANGCeightynine &0x0001 &0 \addtoindexx{C:1989 (ISO)} \\
2309 \DWLANGC{} &0x0002 &0 \addtoindexx{C!non-standard} \\
2310 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada:1983 (ISO)} \\
2311 \DWLANGCplusplus{} &0x0004 &0 \addtoindexx{C++:1998 (ISO)} \\
2312 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \addtoindexx{COBOL:1974 (ISO)} \\
2313 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \addtoindexx{COBOL:1985 (ISO)} \\
2314 \DWLANGFortranseventyseven &0x0007 &1 \addtoindexx{FORTRAN:1977 (ISO)} \\
2315 \DWLANGFortranninety &0x0008 &1 \addtoindexx{Fortran:1990 (ISO)} \\
2316 \DWLANGPascaleightythree &0x0009 &1 \addtoindexx{Pascal:1983 (ISO)} \\
2317 \DWLANGModulatwo &0x000a &1 \addtoindexx{Modula-2:1996 (ISO)} \\
2318 \DWLANGJava &0x000b &0 \addtoindexx{Java} \\
2319 \DWLANGCninetynine &0x000c &0 \addtoindexx{C:1999 (ISO)} \\
2320 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada:1995 (ISO)} \\
2321 \DWLANGFortranninetyfive &0x000e &1 \addtoindexx{Fortran:1995 (ISO)} \\
2322 \DWLANGPLI{} \dag &0x000f &1 \addtoindexx{PL/I:1976 (ANSI)}\\
2323 \DWLANGObjC{} &0x0010 &0 \addtoindexx{Objective C}\\
2324 \DWLANGObjCplusplus{} &0x0011 &0 \addtoindexx{Objective C++}\\
2325 \DWLANGUPC{} &0x0012 &0 \addtoindexx{UPC}\\
2326 \DWLANGD{} &0x0013 &0 \addtoindexx{D language}\\
2327 \DWLANGPython{} \dag &0x0014 &0 \addtoindexx{Python}\\
2328 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \addtoindexx{OpenCL}\\
2329 \DWLANGGo{} \dag \ddag &0x0016 &0 \addtoindexx{Go}\\
2330 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \addtoindexx{Modula-3}\\
2331 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \addtoindexx{Haskell}\\
2332 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \addtoindexx{C++:2003 (ISO)}\\
2333 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \addtoindexx{C++:2011 (ISO)}\\
2334 \DWLANGOCaml{} \ddag &0x001b &0 \addtoindexx{OCaml}\\
2335 \DWLANGRust{} \ddag &0x001c &0 \addtoindexx{Rust}\\
2336 \DWLANGCeleven{} \ddag &0x001d &0 \addtoindexx{C:2011 (ISO)}\\
2337 \DWLANGSwift{} \ddag &0x001e &0 \addtoindexx{Swift} \\
2338 \DWLANGJulia{} \ddag &0x001f &1 \addtoindexx{Julia} \\
2339 \DWLANGlouser{} &0x8000 & \\
2340 \DWLANGhiuser{} &\xffff & \\
2345 \section{Address Class Encodings}
2346 \label{datarep:addressclassencodings}
2348 The value of the common
2349 \addtoindexi{address}{address class!attribute encoding}
2354 \section{Identifier Case}
2355 \label{datarep:identifiercase}
2357 The encodings of the constants used in the
2358 \DWATidentifiercase{} attribute are given in
2359 Table \refersec{tab:identifiercaseencodings}.
2362 \setlength{\extrarowheight}{0.1cm}
2363 \begin{longtable}{l|c}
2364 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
2365 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2367 \bfseries Identifier case name&\bfseries Value\\ \hline
2369 \hline \emph{Continued on next page}
2373 \DWIDcasesensitive&0x00 \\
2375 \DWIDdowncase&0x02 \\
2376 \DWIDcaseinsensitive&0x03 \\
2380 \section{Calling Convention Encodings}
2381 \label{datarep:callingconventionencodings}
2382 The encodings of the constants used in the
2383 \DWATcallingconvention{} attribute are given in
2384 Table \refersec{tab:callingconventionencodings}.
2387 \setlength{\extrarowheight}{0.1cm}
2388 \begin{longtable}{l|c}
2389 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2390 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2392 \bfseries Calling convention name&\bfseries Value\\ \hline
2394 \hline \emph{Continued on next page}
2400 \DWCCprogram&0x02 \\
2408 \section{Inline Codes}
2409 \label{datarep:inlinecodes}
2411 The encodings of the constants used in
2412 \addtoindexx{inline attribute!encoding}
2414 \DWATinline{} attribute are given in
2415 Table \refersec{tab:inlineencodings}.
2419 \setlength{\extrarowheight}{0.1cm}
2420 \begin{longtable}{l|c}
2421 \caption{Inline encodings} \label{tab:inlineencodings}\\
2422 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2424 \bfseries Inline Code name&\bfseries Value\\ \hline
2426 \hline \emph{Continued on next page}
2431 \DWINLnotinlined&0x00 \\
2432 \DWINLinlined&0x01 \\
2433 \DWINLdeclarednotinlined&0x02 \\
2434 \DWINLdeclaredinlined&0x03 \\
2439 % this clearpage is ugly, but the following table came
2440 % out oddly without it.
2442 \section{Array Ordering}
2443 \label{datarep:arrayordering}
2445 The encodings of the constants used in the
2446 \DWATordering{} attribute are given in
2447 Table \refersec{tab:orderingencodings}.
2451 \setlength{\extrarowheight}{0.1cm}
2452 \begin{longtable}{l|c}
2453 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2454 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2456 \bfseries Ordering name&\bfseries Value\\ \hline
2458 \hline \emph{Continued on next page}
2463 \DWORDrowmajor&0x00 \\
2464 \DWORDcolmajor&0x01 \\
2470 \section{Discriminant Lists}
2471 \label{datarep:discriminantlists}
2473 The descriptors used in
2474 \addtoindexx{discriminant list attribute!encoding}
2476 \DWATdiscrlist{} attribute are
2477 encoded as 1\dash byte constants. The
2478 defined values are given in
2479 Table \refersec{tab:discriminantdescriptorencodings}.
2481 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2483 \setlength{\extrarowheight}{0.1cm}
2484 \begin{longtable}{l|c}
2485 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2486 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2488 \bfseries Descriptor name&\bfseries Value\\ \hline
2490 \hline \emph{Continued on next page}
2502 \section{Name Lookup Tables}
2503 \label{datarep:namelookuptables}
2505 Each set of entries in the table of global names contained
2506 in the \dotdebugpubnames{} and
2507 \dotdebugpubtypes{} sections begins
2508 with a header consisting of:
2509 \begin{enumerate}[1. ]
2511 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2512 \addttindexx{unit\_length}
2513 A 4\dash byte or 12\dash byte unsigned integer
2514 \addtoindexx{initial length}
2515 representing the length
2516 of the \dotdebuginfo{}
2517 contribution for that compilation unit,
2518 not including the length field itself. In the
2519 \thirtytwobitdwarfformat, this is a 4\dash byte unsigned integer (which must be less
2520 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
2521 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
2522 integer that gives the actual length
2523 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2525 \item version (\addtoindex{uhalf}) \\
2526 A 2\dash byte unsigned integer representing the version of the
2527 DWARF information for the name lookup table
2528 \addtoindexx{version number!name lookup table}
2529 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2530 The value in this field is 2.
2533 \item \addtoindex{debug\_info\_offset} (section offset) \\
2535 \addtoindexx{section offset!in name lookup table set of entries}
2536 4\dash byte or 8\dash byte
2538 \dotdebuginfo{} or \dotdebuginfodwo{}
2539 section of the compilation unit header.
2540 In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned offset;
2541 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned offsets
2542 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2544 \item \addtoindex{debug\_info\_length} (\livelink{datarep:sectionoffsetlength}{section length}) \\
2545 \addtoindexx{section length!in .debug\_pubnames header}
2547 \addtoindexx{section length!in .debug\_pubtypes header}
2548 4\dash byte or 8\dash byte length containing the size in bytes of the
2549 contents of the \dotdebuginfo{}
2550 section generated to represent
2551 this compilation unit. In the \thirtytwobitdwarfformat, this is
2552 a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat, this
2553 is an 8-byte unsigned length
2554 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2559 This header is followed by a series of tuples. Each tuple
2560 consists of a 4\dash byte or 8\dash byte offset followed by a string
2561 of non\dash null bytes terminated by one null byte.
2563 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2564 format, it is an 8\dash byte offset.
2565 Each set is terminated by an
2566 offset containing the value 0.
2570 \section{Address Range Table}
2571 \label{datarep:addrssrangetable}
2573 Each set of entries in the table of address ranges contained
2574 in the \dotdebugaranges{}
2575 section begins with a header containing:
2576 \begin{enumerate}[1. ]
2577 % FIXME The unit length text is not fully consistent across
2580 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2581 \addttindexx{unit\_length}
2582 A 4-byte or 12-byte length containing the length of the
2583 \addtoindexx{initial length}
2584 set of entries for this compilation unit, not including the
2585 length field itself. In the \thirtytwobitdwarfformat, this is a
2586 4-byte unsigned integer (which must be less than \xfffffffzero);
2587 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2588 \wffffffff followed by an 8-byte unsigned integer that gives
2590 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2592 \item version (\addtoindex{uhalf}) \\
2593 A 2\dash byte version identifier representing the version of the
2594 DWARF information for the address range table
2595 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2596 This value in this field \addtoindexx{version number!address range table} is 2.
2599 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2601 \addtoindexx{section offset!in .debug\_aranges header}
2602 4\dash byte or 8\dash byte offset into the
2603 \dotdebuginfo{} section of
2604 the compilation unit header. In the \thirtytwobitdwarfformat,
2605 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2606 this is an 8\dash byte unsigned offset
2607 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2609 \item address\_size (ubyte) \\
2610 A 1\dash byte unsigned integer containing the size in bytes of an
2611 \addtoindexx{address\_size}
2613 \addtoindexx{size of an address}
2614 (or the offset portion of an address for segmented
2615 \addtoindexx{address space!segmented}
2616 addressing) on the target system.
2618 \item segment\_size (ubyte) \\
2620 \addtoindexx{segment\_size}
2621 1\dash byte unsigned integer containing the size in bytes of a
2622 segment selector on the target system.
2626 This header is followed by a series of tuples. Each tuple
2627 consists of a segment, an address and a length.
2629 size is given by the \addtoindex{segment\_size} field of the header; the
2630 address and length size are each given by the address\_size
2631 field of the header.
2632 The first tuple following the header in
2633 each set begins at an offset that is a multiple of the size
2634 of a single tuple (that is, the size of a segment selector
2635 plus twice the \addtoindex{size of an address}).
2636 The header is padded, if
2637 necessary, to that boundary. Each set of tuples is terminated
2638 by a 0 for the segment, a 0 for the address and 0 for the
2639 length. If the \addtoindex{segment\_size} field in the header is zero,
2640 the segment selectors are omitted from all tuples, including
2641 the terminating tuple.
2644 \section{Line Number Information}
2645 \label{datarep:linenumberinformation}
2647 The \addtoindexi{version number}{version number!line number information}
2648 in the line number program header is \versiondotdebugline{}
2649 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2651 The boolean values \doublequote{true} and \doublequote{false}
2652 used by the line number information program are encoded
2653 as a single byte containing the value 0
2654 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2656 The encodings for the standard opcodes are given in
2657 \addtoindexx{line number opcodes!standard opcode encoding}
2658 Table \refersec{tab:linenumberstandardopcodeencodings}.
2660 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2662 \setlength{\extrarowheight}{0.1cm}
2663 \begin{longtable}{l|c}
2664 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2665 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2667 \bfseries Opcode name&\bfseries Value\\ \hline
2669 \hline \emph{Continued on next page}
2675 \DWLNSadvancepc&0x02 \\
2676 \DWLNSadvanceline&0x03 \\
2677 \DWLNSsetfile&0x04 \\
2678 \DWLNSsetcolumn&0x05 \\
2679 \DWLNSnegatestmt&0x06 \\
2680 \DWLNSsetbasicblock&0x07 \\
2681 \DWLNSconstaddpc&0x08 \\
2682 \DWLNSfixedadvancepc&0x09 \\
2683 \DWLNSsetprologueend&0x0a \\*
2684 \DWLNSsetepiloguebegin&0x0b \\*
2685 \DWLNSsetisa&0x0c \\*
2692 The encodings for the extended opcodes are given in
2693 \addtoindexx{line number opcodes!extended opcode encoding}
2694 Table \refersec{tab:linenumberextendedopcodeencodings}.
2697 \setlength{\extrarowheight}{0.1cm}
2698 \begin{longtable}{l|c}
2699 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2700 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2702 \bfseries Opcode name&\bfseries Value\\ \hline
2704 \hline \emph{Continued on next page}
2706 \hline \ddag~\textit{New in DWARF Version 5}
2709 \DWLNEendsequence &0x01 \\
2710 \DWLNEsetaddress &0x02 \\
2711 \DWLNEdefinefile &0x03 \\
2712 \DWLNEsetdiscriminator &0x04 \\
2713 \DWLNEdefinefileMDfive~\ddag &0x05 \\
2714 \DWLNElouser &0x80 \\
2715 \DWLNEhiuser &\xff \\
2721 The encodings for the file entry format are given in
2722 \addtoindexx{line number opcodes!file entry format encoding}
2723 Table \refersec{tab:linenumberfileentryformatencodings}.
2726 \setlength{\extrarowheight}{0.1cm}
2727 \begin{longtable}{l|c}
2728 \caption{Line number file entry format \mbox{encodings}} \label{tab:linenumberfileentryformatencodings}\\
2729 \hline \bfseries File entry format name&\bfseries Value \\ \hline
2731 \bfseries File entry format name&\bfseries Value\\ \hline
2733 \hline \emph{Continued on next page}
2738 \DWLNFtimestampsize & 0x01 \\
2739 \DWLNFMDfive & 0x02 \\
2744 \section{Macro Information}
2745 \label{datarep:macroinformation}
2746 The \addtoindexi{version number}{version number!macro information}
2747 in the macro information header is \versiondotdebugmacro{}
2748 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2750 The source line numbers and source file indices encoded in the
2751 macro information section are represented as
2752 unsigned LEB128\addtoindexx{LEB128!unsigned} numbers.
2754 The macro information entry type is encoded as a single unsigned byte.
2756 \addtoindexx{macro information entry types!encoding}
2758 Table \refersec{tab:macroinfoentrytypeencodings}.
2762 \setlength{\extrarowheight}{0.1cm}
2763 \begin{longtable}{l|c}
2764 \caption{Macro information entry type encodings} \label{tab:macroinfoentrytypeencodings}\\
2765 \hline \bfseries Macro information entry type name&\bfseries Value \\ \hline
2767 \bfseries Macro information entry type name&\bfseries Value\\ \hline
2769 \hline \emph{Continued on next page}
2774 \DWMACROdefine &0x01 \\
2775 \DWMACROundef &0x02 \\
2776 \DWMACROstartfile &0x03 \\
2777 \DWMACROendfile &0x04 \\
2778 \DWMACROdefineindirect &0x05 \\
2779 \DWMACROundefindirect &0x06 \\
2780 \DWMACROtransparentinclude &0x07 \\
2781 % what about 0x08 thru 0x0a??
2782 \DWMACROdefineindirectx &0x0b \\
2783 \DWMACROundefindirectx &0x0c \\
2784 \DWMACROlouser &0xe0 \\
2785 \DWMACROhiuser &\xff \\
2791 \section{Call Frame Information}
2792 \label{datarep:callframeinformation}
2794 In the \thirtytwobitdwarfformat, the value of the CIE id in the
2795 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
2796 value is \xffffffffffffffff.
2798 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2799 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2801 Call frame instructions are encoded in one or more bytes. The
2802 primary opcode is encoded in the high order two bits of
2803 the first byte (that is, opcode = byte $\gg$ 6). An operand
2804 or extended opcode may be encoded in the low order 6
2805 bits. Additional operands are encoded in subsequent bytes.
2806 The instructions and their encodings are presented in
2807 Table \refersec{tab:callframeinstructionencodings}.
2810 \setlength{\extrarowheight}{0.1cm}
2811 \begin{longtable}{l|c|c|l|l}
2812 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2813 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
2814 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2816 & \bfseries High 2 &\bfseries Low 6 & &\\
2817 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2819 \hline \emph{Continued on next page}
2824 \DWCFAadvanceloc&0x1&delta & \\
2825 \DWCFAoffset&0x2®ister&ULEB128 offset \\
2826 \DWCFArestore&0x3®ister & & \\
2827 \DWCFAnop&0&0 & & \\
2828 \DWCFAsetloc&0&0x01&address & \\
2829 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
2830 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
2831 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
2832 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
2833 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
2834 \DWCFAundefined&0&0x07&ULEB128 register & \\
2835 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
2836 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
2837 \DWCFArememberstate&0&0x0a & & \\
2838 \DWCFArestorestate&0&0x0b & & \\
2839 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
2840 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
2841 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
2842 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
2843 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
2845 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
2846 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
2847 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
2848 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
2849 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
2850 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
2851 \DWCFAlouser&0&0x1c & & \\
2852 \DWCFAhiuser&0&\xiiif & & \\
2856 \section{Non-contiguous Address Ranges}
2857 \label{datarep:noncontiguousaddressranges}
2859 Each entry in a \addtoindex{range list}
2860 (see Section \refersec{chap:noncontiguousaddressranges})
2862 \addtoindexx{base address selection entry!in range list}
2864 \addtoindexx{range list}
2865 a base address selection entry, or an end
2868 A \addtoindex{range list} entry consists of two relative addresses. The
2869 addresses are the same size as addresses on the target machine.
2872 A base address selection entry and an
2873 \addtoindexx{end of list entry!in range list}
2874 end of list entry each
2875 \addtoindexx{base address selection entry!in range list}
2876 consist of two (constant or relocated) addresses. The two
2877 addresses are the same size as addresses on the target machine.
2879 For a \addtoindex{range list} to be specified, the base address of the
2880 \addtoindexx{base address selection entry!in range list}
2881 corresponding compilation unit must be defined
2882 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2884 \section{String Offsets Table}
2885 \label{chap:stringoffsetstable}
2886 Each set of entries in the string offsets table contained in the
2887 \dotdebugstroffsets{} or \dotdebugstroffsetsdwo{}
2888 section begins with a header containing:
2889 \begin{enumerate}[1. ]
2890 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2891 A 4-byte or 12-byte length containing the length of
2892 the set of entries for this compilation unit, not
2893 including the length field itself. In the 32-bit
2894 DWARF format, this is a 4-byte unsigned integer
2895 (which must be less than \xfffffffzero); in the 64-bit
2896 DWARF format, this consists of the 4-byte value
2897 \wffffffff followed by an 8-byte unsigned integer
2898 that gives the actual length (see
2899 Section \refersec{datarep:32bitand64bitdwarfformats}).
2902 \item \texttt{version} (\addtoindex{uhalf}) \\
2903 A 2-byte version identifier containing the value
2904 \versiondotdebugstroffsets{}
2905 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2906 \item \texttt{padding} (\addtoindex{uhalf}) \\
2909 This header is followed by a series of string table offsets
2910 that have the same representation as \DWFORMstrp.
2911 For the 32-bit DWARF format, each offset is 4 bytes long; for
2912 the 64-bit DWARF format, each offset is 8 bytes long.
2914 The \DWATstroffsetsbase{} attribute points to the first
2915 entry following the header. The entries are indexed
2916 sequentially from this base entry, starting from 0.
2918 \section{Address Table}
2919 \label{chap:addresstable}
2920 Each set of entries in the address table contained in the
2921 \dotdebugaddr{} section begins with a header containing:
2922 \begin{enumerate}[1. ]
2923 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2924 A 4-byte or 12-byte length containing the length of
2925 the set of entries for this compilation unit, not
2926 including the length field itself. In the 32-bit
2927 DWARF format, this is a 4-byte unsigned integer
2928 (which must be less than \xfffffffzero); in the 64-bit
2929 DWARF format, this consists of the 4-byte value
2930 \wffffffff followed by an 8-byte unsigned integer
2931 that gives the actual length (see
2932 Section \refersec{datarep:32bitand64bitdwarfformats}).
2935 \item \texttt{version} (\addtoindex{uhalf}) \\
2936 A 2-byte version identifier containing the value
2937 \versiondotdebugaddr{}
2938 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2941 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2942 A 1-byte unsigned integer containing the size in
2943 bytes of an address (or the offset portion of an
2944 address for segmented addressing) on the target
2948 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2949 A 1-byte unsigned integer containing the size in
2950 bytes of a segment selector on the target system.
2953 This header is followed by a series of segment/address pairs.
2954 The segment size is given by the \texttt{segment\_size} field of the
2955 header, and the address size is given by the \texttt{address\_size}
2956 field of the header. If the \texttt{segment\_size} field in the header
2957 is zero, the entries consist only of an addresses.
2959 The \DWATaddrbase{} attribute points to the first entry
2960 following the header. The entries are indexed sequentially
2961 from this base entry, starting from 0.
2963 \section{Range List Table}
2964 \label{app:rangelisttable}
2965 Each set of entries in the range list table contained in the
2966 \dotdebugranges{} section begins with a header containing:
2967 \begin{enumerate}[1. ]
2968 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2969 A 4-byte or 12-byte length containing the length of
2970 the set of entries for this compilation unit, not
2971 including the length field itself. In the 32-bit
2972 DWARF format, this is a 4-byte unsigned integer
2973 (which must be less than \xfffffffzero); in the 64-bit
2974 DWARF format, this consists of the 4-byte value
2975 \wffffffff followed by an 8-byte unsigned integer
2976 that gives the actual length (see
2977 Section \refersec{datarep:32bitand64bitdwarfformats}).
2980 \item \texttt{version} (\addtoindex{uhalf}) \\
2981 A 2-byte version identifier containing the value
2982 \versiondotdebugranges{}
2983 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2986 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2987 A 1-byte unsigned integer containing the size in
2988 bytes of an address (or the offset portion of an
2989 address for segmented addressing) on the target
2993 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2994 A 1-byte unsigned integer containing the size in
2995 bytes of a segment selector on the target system.
2998 This header is followed by a series of range list entries as
2999 described in Section \refersec{chap:locationlists}.
3000 The segment size is given by the
3001 \texttt{segment\_size} field of the header, and the address size is
3002 given by the \texttt{address\_size} field of the header. If the
3003 \texttt{segment\_size} field in the header is zero, the segment
3004 selector is omitted from the range list entries.
3006 The \DWATrangesbase{} attribute points to the first entry
3007 following the header. The entries are referenced by a byte
3008 offset relative to this base address.
3011 \section{Location List Table}
3012 \label{datarep:locationlisttable}
3013 Each set of entries in the location list table contained in the
3014 \dotdebugloc{} or \dotdebuglocdwo{} sections begins with a header containing:
3015 \begin{enumerate}[1. ]
3016 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
3017 A 4-byte or 12-byte length containing the length of
3018 the set of entries for this compilation unit, not
3019 including the length field itself. In the 32-bit
3020 DWARF format, this is a 4-byte unsigned integer
3021 (which must be less than \xfffffffzero); in the 64-bit
3022 DWARF format, this consists of the 4-byte value
3023 \wffffffff followed by an 8-byte unsigned integer
3024 that gives the actual length (see
3025 Section \refersec{datarep:32bitand64bitdwarfformats}).
3028 \item \texttt{version} (\addtoindex{uhalf}) \\
3029 A 2-byte version identifier containing the value
3030 \versiondotdebugloc{}
3031 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
3034 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
3035 A 1-byte unsigned integer containing the size in
3036 bytes of an address (or the offset portion of an
3037 address for segmented addressing) on the target
3041 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
3042 A 1-byte unsigned integer containing the size in
3043 bytes of a segment selector on the target system.
3046 This header is followed by a series of location list entries as
3047 described in Section \refersec{chap:locationlists}.
3048 The segment size is given by the
3049 \texttt{segment\_size} field of the header, and the address size is
3050 given by the \texttt{address\_size} field of the header. If the
3051 \texttt{segment\_size} field in the header is zero, the segment
3052 selector is omitted from the range list entries.
3054 The entries are referenced by a byte offset relative to the first
3055 location list following this header.
3058 \section{Dependencies and Constraints}
3059 \label{datarep:dependenciesandconstraints}
3061 The debugging information in this format is intended to
3063 \addtoindexx{DWARF section names!list of}
3073 \dotdebugpubnames{},
3074 \dotdebugpubtypes{},
3078 \dotdebugstroffsets{}
3079 sections of an object file, or equivalent
3080 separate file or database. The information is not
3081 word\dash aligned. Consequently:
3084 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3085 32\dash bit addresses, an assembler or compiler must provide a way
3086 to produce 2\dash byte and 4\dash byte quantities without alignment
3087 restrictions, and the linker must be able to relocate a
3088 4\dash byte address or
3089 \addtoindexx{section offset!alignment of}
3090 section offset that occurs at an arbitrary
3093 \item For the \thirtytwobitdwarfformat{} and a target architecture with
3094 64\dash bit addresses, an assembler or compiler must provide a
3095 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3096 alignment restrictions, and the linker must be able to relocate
3097 an 8\dash byte address or 4\dash byte
3098 \addtoindexx{section offset!alignment of}
3099 section offset that occurs at an
3100 arbitrary alignment.
3102 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3103 32\dash bit addresses, an assembler or compiler must provide a
3104 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3105 alignment restrictions, and the linker must be able to relocate
3106 a 4\dash byte address or 8\dash byte
3107 \addtoindexx{section offset!alignment of}
3108 section offset that occurs at an
3109 arbitrary alignment.
3111 \textit{It is expected that this will be required only for very large
3112 32\dash bit programs or by those architectures which support
3113 a mix of 32\dash bit and 64\dash bit code and data within the same
3116 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
3117 64\dash bit addresses, an assembler or compiler must provide a
3118 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
3119 alignment restrictions, and the linker must be able to
3120 relocate an 8\dash byte address or
3121 \addtoindexx{section offset!alignment of}
3122 section offset that occurs at
3123 an arbitrary alignment.
3126 \section{Integer Representation Names}
3127 \label{datarep:integerrepresentationnames}
3129 The sizes of the integers used in the lookup by name, lookup
3130 by address, line number and call frame information sections
3132 Table \ref{tab:integerrepresentationnames}.
3136 \setlength{\extrarowheight}{0.1cm}
3137 \begin{longtable}{c|l}
3138 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
3139 \hline \bfseries Representation name&\bfseries Representation \\ \hline
3141 \bfseries Representation name&\bfseries Representation\\ \hline
3143 \hline \emph{Continued on next page}
3148 \addtoindex{sbyte}& signed, 1\dash byte integer \\
3149 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
3150 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
3151 \addtoindex{uword}&unsigned, 4\dash byte integer \\
3157 \section{Type Signature Computation}
3158 \label{datarep:typesignaturecomputation}
3160 A type signature is computed only by the DWARF producer;
3161 \addtoindexx{type signature!computation}
3162 it is used by a DWARF consumer to resolve type references to
3163 the type definitions that are contained in
3164 \addtoindexx{type unit}
3168 The type signature for a type T0 is formed from the
3169 \MDfive{}\footnote{\livetarg{def:MDfive}{MD5} Message Digest Algorithm,
3170 R.L. Rivest, RFC 1321, April 1992}
3171 hash of a flattened description of the type. The flattened
3172 description of the type is a byte sequence derived from the
3173 DWARF encoding of the type as follows:
3174 \begin{enumerate}[1. ]
3176 \item Start with an empty sequence S and a list V of visited
3177 types, where V is initialized to a list containing the type
3178 T0 as its single element. Elements in V are indexed from 1,
3181 \item If the debugging information entry represents a type that
3182 is nested inside another type or a namespace, append to S
3183 the type\textquoteright s context as follows: For each surrounding type
3184 or namespace, beginning with the outermost such construct,
3185 append the letter 'C', the DWARF tag of the construct, and
3186 the name (taken from
3187 \addtoindexx{name attribute}
3188 the \DWATname{} attribute) of the type
3189 \addtoindexx{name attribute}
3190 or namespace (including its trailing null byte).
3192 \item Append to S the letter 'D', followed by the DWARF tag of
3193 the debugging information entry.
3195 \item For each of the attributes in
3196 Table \refersec{tab:attributesusedintypesignaturecomputation}
3198 the debugging information entry, in the order listed,
3199 append to S a marker letter (see below), the DWARF attribute
3200 code, and the attribute value.
3203 \caption{Attributes used in type signature computation}
3204 \label{tab:attributesusedintypesignaturecomputation}
3205 \simplerule[\textwidth]
3207 \autocols[0pt]{c}{2}{l}{
3222 \DWATcontainingtype,
3226 \DWATdatamemberlocation,
3247 \DWATrvaluereference,
3251 \DWATstringlengthbitsize,
3252 \DWATstringlengthbytesize,
3257 \DWATvariableparameter,
3260 \DWATvtableelemlocation
3263 \simplerule[\textwidth]
3266 Note that except for the initial
3267 \DWATname{} attribute,
3268 \addtoindexx{name attribute}
3269 attributes are appended in order according to the alphabetical
3270 spelling of their identifier.
3272 If an implementation defines any vendor-specific attributes,
3273 any such attributes that are essential to the definition of
3274 the type should also be included at the end of the above list,
3275 in their own alphabetical suborder.
3277 An attribute that refers to another type entry T is processed
3278 as follows: (a) If T is in the list V at some V[x], use the
3279 letter 'R' as the marker and use the unsigned LEB128\addtoindexx{LEB128!unsigned}
3280 encoding of x as the attribute value; otherwise, (b) use the letter 'T'
3281 as the marker, process the type T recursively by performing
3282 Steps 2 through 7, and use the result as the attribute value.
3284 Other attribute values use the letter 'A' as the marker, and
3285 the value consists of the form code (encoded as an unsigned
3286 LEB128 value) followed by the encoding of the value according
3287 to the form code. To ensure reproducibility of the signature,
3288 the set of forms used in the signature computation is limited
3297 \item If the tag in Step 3 is one of \DWTAGpointertype,
3298 \DWTAGreferencetype,
3299 \DWTAGrvaluereferencetype,
3300 \DWTAGptrtomembertype,
3301 or \DWTAGfriend, and the referenced
3302 type (via the \DWATtype{} or
3303 \DWATfriend{} attribute) has a
3304 \DWATname{} attribute, append to S the letter 'N', the DWARF
3305 attribute code (\DWATtype{} or
3306 \DWATfriend), the context of
3307 the type (according to the method in Step 2), the letter 'E',
3308 and the name of the type. For \DWTAGfriend, if the referenced
3309 entry is a \DWTAGsubprogram, the context is omitted and the
3310 name to be used is the ABI-specific name of the subprogram
3311 (for example, the mangled linker name).
3314 \item If the tag in Step 3 is not one of \DWTAGpointertype,
3315 \DWTAGreferencetype,
3316 \DWTAGrvaluereferencetype,
3317 \DWTAGptrtomembertype, or
3318 \DWTAGfriend, but has
3319 a \DWATtype{} attribute, or if the referenced type (via
3321 \DWATfriend{} attribute) does not have a
3322 \DWATname{} attribute, the attribute is processed according to
3323 the method in Step 4 for an attribute that refers to another
3327 \item Visit each child C of the debugging information
3328 entry as follows: If C is a nested type entry or a member
3329 function entry, and has
3330 a \DWATname{} attribute, append to
3331 \addtoindexx{name attribute}
3332 S the letter 'S', the tag of C, and its name; otherwise,
3333 process C recursively by performing Steps 3 through 7,
3334 appending the result to S. Following the last child (or if
3335 there are no children), append a zero byte.
3340 For the purposes of this algorithm, if a debugging information
3342 \DWATspecification{}
3343 attribute that refers to
3344 another entry D (which has a
3347 then S inherits the attributes and children of D, and S is
3348 processed as if those attributes and children were present in
3349 the entry S. Exception: if a particular attribute is found in
3350 both S and D, the attribute in S is used and the corresponding
3351 one in D is ignored.
3353 DWARF tag and attribute codes are appended to the sequence
3354 as unsigned LEB128\addtoindexx{LEB128!unsigned} values,
3355 using the values defined earlier in this chapter.
3357 \textit{A grammar describing this computation may be found in
3358 Appendix \refersec{app:typesignaturecomputationgrammar}.
3361 \textit{An attribute that refers to another type entry should
3362 be recursively processed or replaced with the name of the
3363 referent (in Step 4, 5 or 6). If neither treatment applies to
3364 an attribute that references another type entry, the entry
3365 that contains that attribute should not be considered for a
3366 separate \addtoindex{type unit}.}
3368 \textit{If a debugging information entry contains an attribute from
3369 the list above that would require an unsupported form, that
3370 entry should not be considered for a separate
3371 \addtoindex{type unit}.}
3373 \textit{A type should be considered for a separate
3374 \addtoindex{type unit} only
3375 if all of the type entries that it contains or refers to in
3376 Steps 6 and 7 can themselves each be considered for a separate
3377 \addtoindex{type unit}.}
3380 Where the DWARF producer may reasonably choose two or more
3381 different forms for a given attribute, it should choose
3382 the simplest possible form in computing the signature. (For
3383 example, a constant value should be preferred to a location
3384 expression when possible.)
3386 Once the string S has been formed from the DWARF encoding,
3387 an \MDfive{} hash is computed for the string and the
3388 least significant 64 bits are taken as the type signature.
3390 \textit{The string S is intended to be a flattened representation of
3391 the type that uniquely identifies that type (that is, a different
3392 type is highly unlikely to produce the same string).}
3394 \textit{A debugging information entry should not be placed in a
3395 separate \addtoindex{type unit}
3396 if any of the following apply:}
3400 \item \textit{The entry has an attribute whose value is a location
3401 expression, and the location expression contains a reference to
3402 another debugging information entry (for example, a \DWOPcallref{}
3403 operator), as it is unlikely that the entry will remain
3404 identical across compilation units.}
3406 \item \textit{The entry has an attribute whose value refers
3407 to a code location or a \addtoindex{location list}.}
3409 \item \textit{The entry has an attribute whose value refers
3410 to another debugging information entry that does not represent
3416 \textit{Certain attributes are not included in the type signature:}
3419 \item \textit{The \DWATdeclaration{} attribute is not included because it
3420 indicates that the debugging information entry represents an
3421 incomplete declaration, and incomplete declarations should
3423 \addtoindexx{type unit}
3424 separate type units.}
3426 \item \textit{The \DWATdescription{} attribute is not included because
3427 it does not provide any information unique to the defining
3428 declaration of the type.}
3430 \item \textit{The \DWATdeclfile,
3432 \DWATdeclcolumn{} attributes are not included because they
3433 may vary from one source file to the next, and would prevent
3434 two otherwise identical type declarations from producing the
3435 same \MDfive{} hash.}
3437 \item \textit{The \DWATobjectpointer{} attribute is not included
3438 because the information it provides is not necessary for the
3439 computation of a unique type signature.}
3443 \textit{Nested types and some types referred to by a debugging
3444 information entry are encoded by name rather than by recursively
3445 encoding the type to allow for cases where a complete definition
3446 of the type might not be available in all compilation units.}
3449 \textit{If a type definition contains the definition of a member function,
3450 it cannot be moved as is into a type unit, because the member function
3451 contains attributes that are unique to that compilation unit.
3452 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3453 moving the member function declaration into a separate declaration tree,
3454 and replacing the function definition in the type with a non-defining
3455 declaration of the function (as if the function had been defined out of
3458 An example that illustrates the computation of an \MDfive{} hash may be found in
3459 Appendix \refersec{app:usingtypeunits}.