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 (\DWTAGlouserMARK\DWTAGhiuserMARK{} DW\_TAG,
27 \DWATlouserMARK\DWAThiuserMARK{} DW\_AT,
28 \DWENDlouserMARK\DWENDhiuserMARK{} DW\_END,
29 \DWATElouserMARK\DWATEhiuserMARK{} DW\_ATE,
30 \DWOPlouserMARK\DWOPhiuserMARK{} DW\_OP,
31 \DWLANGlouserMARK\DWLANGhiuserMARK{}DW\_LANG,
32 \DWLNElouserMARK\DWLNEhiuserMARK{} DW\_LNE,
33 \DWCClouserMARK\DWCChiuserMARK{} DW\_CC or
34 \DWCFAlouserMARK\DWCFAhiuserMARK{} DW\_CFA
35 respectively) followed by
36 \_lo\_user or \_hi\_user.
37 \textit{For example, for entry tags, the special
38 labels are \DWTAGlouserNAME{} and \DWTAGhiuserNAME.}
39 Values in the range between \textit{prefix}\_lo\_user
40 and \textit{prefix}\_hi\_user inclusive,
41 are reserved for vendor specific extensions. Vendors may
42 use values in this range without conflicting with current or
43 future system\dash defined values. All other values are reserved
44 for use by the system.
46 \textit{There may also be codes for vendor specific extensions
47 between the number of standard line number opcodes and
48 the first special line number opcode. However, since the
49 number of standard opcodes varies with the DWARF version,
50 the range for extensions is also version dependent. Thus,
51 \DWLNSlouserTARG{} and
52 \DWLNShiuserTARG{} symbols are not defined.
55 Vendor defined tags, attributes, base type encodings, location
56 atoms, language names, line number actions, calling conventions
57 and call frame instructions, conventionally use the form
58 \text{prefix\_vendor\_id\_name}, where
59 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
60 character sequence chosen so as to avoid conflicts with
63 To ensure that extensions added by one vendor may be safely
64 ignored by consumers that do not understand those extensions,
65 the following rules should be followed:
66 \begin{enumerate}[1. ]
68 \item New attributes should be added in such a way that a
69 debugger may recognize the format of a new attribute value
70 without knowing the content of that attribute value.
72 \item The semantics of any new attributes should not alter
73 the semantics of previously existing attributes.
75 \item The semantics of any new tags should not conflict with
76 the semantics of previously existing tags.
78 \item Do not add any new forms of attribute value.
83 \section{Reserved Values}
84 \label{datarep:reservedvalues}
85 \subsection{Error Values}
86 \label{datarep:errorvalues}
87 \addtoindexx{reserved values!error}
90 \addtoindexx{error value}
91 a convenience for consumers of DWARF information, the value
92 0 is reserved in the encodings for attribute names, attribute
93 forms, base type encodings, location operations, languages,
94 line number program opcodes, macro information entries and tag
95 names to represent an error condition or unknown value. DWARF
96 does not specify names for these reserved values, since they
97 do not represent valid encodings for the given type and should
98 not appear in DWARF debugging information.
101 \subsection{Initial Length Values}
102 \label{datarep:initiallengthvalues}
103 \addtoindexx{reserved values!initial length}
105 An \livetarg{datarep:initiallengthvalues}{initial length field} is one of the length fields that occur
107 of those DWARF sections that
113 \dotdebugpubnames{}, and
114 \dotdebugpubtypes{}) or the length field
115 that occurs at the beginning of the CIE and FDE structures
116 in the \dotdebugframe{} section.
118 In an \addtoindex{initial length field}, the values \wfffffffzero through
119 \wffffffff are reserved by DWARF to indicate some form of
120 extension relative to \addtoindex{DWARF Version 2}; such values must not
121 be interpreted as a length field. The use of one such value,
122 \xffffffff, is defined below
123 (see Section \refersec{datarep:32bitand64bitdwarfformats});
125 the other values is reserved for possible future extensions.
129 \section{Relocatable, Executable, Shared and Split Objects}
130 \label{datarep:executableobjectsandsharedobjects}
132 \subsection{Relocatable Objects}
134 \subsection{Executable Objects}
135 \label{chap:executableobjects}
136 The relocated addresses in the debugging information for an
137 executable object are virtual addresses.
139 \subsection{Shared Objects}
140 \label{datarep:sharedobjects}
142 addresses in the debugging information for a shared object
143 are offsets relative to the start of the lowest region of
144 memory loaded from that shared object.
146 \textit{This requirement makes the debugging information for
147 shared objects position independent. Virtual addresses in a
148 shared object may be calculated by adding the offset to the
149 base address at which the object was attached. This offset
150 is available in the run\dash time linker\textquoteright s data structures.}
152 \subsection{Split DWARF Objects}
153 \label{datarep:splitdwarfobjects}
154 A DWARF producer may partition the debugging
155 information such that the majority of the debugging
156 information can remain in individual object files without
157 being processed by the linker. The first partition contains
158 debugging information that must still be processed by the linker,
159 and includes the following:
162 The line number tables, range tables, frame tables, and
163 accelerated access tables, in the usual sections:
164 \dotdebugline, \dotdebugranges, \dotdebugframe,
165 \dotdebugpubnames, \dotdebugpubtypes{} and \dotdebugaranges,
168 An address table, in the \dotdebugaddr{} section. This table
169 contains all addresses and constants that require
170 link-time relocation, and items in the table can be
171 referenced indirectly from the debugging information via
172 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
173 \DWOPconstx{} operators.
175 A skeleton compilation unit, as described in Section
176 \refersec{chap:skeletoncompilationunitentries},
177 in the \dotdebuginfo{} section.
179 An abbreviations table for the skeleton compilation unit,
180 in the \dotdebugabbrev{} section.
182 A string table, in the \dotdebugstr{} section. The string
183 table is necessary only if the skeleton compilation unit
184 uses either indirect string form, \DWFORMstrp{} or
187 A string offsets table, in the \dotdebugstroffsets{}
188 section. The string offsets table is necessary only if
189 the skeleton compilation unit uses the \DWFORMstrx{} form.
191 The attributes contained in the skeleton compilation
192 unit can be used by a DWARF consumer to find the object file
193 or DWARF object file that contains the second partition.
195 The second partition contains the debugging information that
196 does not need to be processed by the linker. These sections
197 may be left in the object files and ignored by the linker
198 (i.e., not combined and copied to the executable object), or
199 they may be placed by the producer in a separate DWARF object
200 file. This partition includes the following:
203 The full compilation unit, in the \dotdebuginfodwo{} section.
204 Attributes in debugging information entries may refer to
205 machine addresses indirectly using the \DWFORMaddrx{} form,
206 and location expressions may do so using the \DWOPaddrx{} and
207 \DWOPconstx{} forms. Attributes may refer to range table
208 entries with an offset relative to a base offset in the
209 range table for the compilation unit.
211 \item Separate type units, in the \dotdebugtypesdwo{} section.
214 Abbreviations table(s) for the compilation unit and type
215 units, in the \dotdebugabbrevdwo{} section.
217 \item Location lists, in the \dotdebuglocdwo{} section.
220 A skeleton line table (for the type units), in the
221 \dotdebuglinedwo{} section (see
222 Section \refersec{chap:skeletoncompilationunitentries}).
224 \item Macro information, in the \dotdebugmacinfodwo{} section.
226 \item A string table, in the \dotdebugstrdwo{} section.
228 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
232 Except where noted otherwise, all references in this document
233 to a debugging information section (for example, \dotdebuginfo),
234 applies also to the corresponding split DWARF section (for example,
238 \section{32-Bit and 64-Bit DWARF Formats}
239 \label{datarep:32bitand64bitdwarfformats}
240 \hypertarget{datarep:xxbitdwffmt}{}
241 \addtoindexx{32-bit DWARF format}
242 \addtoindexx{64-bit DWARF format}
243 There are two closely related file formats. In the 32\dash bit DWARF
244 format, all values that represent lengths of DWARF sections
245 and offsets relative to the beginning of DWARF sections are
246 represented using 32\dash bits. In the 64\dash bit DWARF format, all
247 values that represent lengths of DWARF sections and offsets
248 relative to the beginning of DWARF sections are represented
249 using 64\dash bits. A special convention applies to the initial
250 length field of certain DWARF sections, as well as the CIE and
251 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
252 can coexist and be distinguished within a single linked object.
254 The differences between the 32\dash\ and 64\dash bit
256 detailed in the following:
257 \begin{enumerate}[1. ]
259 \item In the 32\dash bit DWARF format, an
260 \addtoindex{initial length field}
262 \addtoindexx{initial length field!encoding}
263 Section \refersec{datarep:initiallengthvalues})
264 is an unsigned 32\dash bit integer (which
265 must be less than \xfffffffzero); in the 64\dash bit DWARF format,
266 an \addtoindex{initial length field} is 96 bits in size,
269 \item The first 32\dash bits have the value \xffffffff.
271 \item The following 64\dash bits contain the actual length
272 represented as an unsigned 64\dash bit integer.
275 \textit{This representation allows a DWARF consumer to dynamically
276 detect that a DWARF section contribution is using the 64\dash bit
277 format and to adapt its processing accordingly.}
279 \item Section offset and section length
280 \hypertarget{datarep:sectionoffsetlength}{}
281 \addtoindexx{section length!use in headers}
283 \addtoindexx{section offset!use in headers}
284 in the headers of DWARF sections (other
285 \addtoindexx{initial length field}
287 \addtoindex{initial length}
288 fields) are listed following. In the 32\dash bit DWARF format these
289 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
291 \addtoindexx{section length!in .debug\_aranges header}
293 \addtoindexx{section length!in .debug\_pubnames header}
295 \addtoindexx{section length!in .debug\_pubtypes header}
296 unsigned integer values.
300 Section &Name & Role \\ \hline
301 \dotdebugaranges{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
302 \dotdebugframe{}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
303 \dotdebugframe{}/FDE & \addtoindex{CIE\_pointer} & offset in \dotdebugframe{} \\
304 \dotdebuginfo{} & \addtoindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
305 \dotdebugline{} & \addtoindex{header\_length} & length of header itself \\
306 \dotdebugpubnames{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
307 & \addtoindex{debug\_info\_length} & length of \dotdebuginfo{} \\
309 \dotdebugpubtypes{} & \addtoindex{debug\_info\_offset} & offset in \dotdebuginfo{} \\
310 & \addtoindex{debug\_info\_length} & length of \dotdebuginfo{} \\
312 \dotdebugtypes{} & \addtoindex{debug\_abbrev\_offset} & offset in \dotdebugabbrev{} \\
313 & \addtoindex{type\_offset} & offset in \dotdebugtypes{} \\
318 The \texttt{CIE\_id} field in a CIE structure must be 64 bits because
319 it overlays the \texttt{CIE\_pointer} in a FDE structure; this implicit
320 union must be accessed to distinguish whether a CIE or FDE is
321 present, consequently, these two fields must exactly overlay
322 each other (both offset and size).
324 \item Within the body of the \dotdebuginfo{} or \dotdebugtypes{}
325 section, certain forms of attribute value depend on the choice
326 of DWARF format as follows. For the 32\dash bit DWARF format,
327 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
328 format, the value is a 64\dash bit unsigned integer.
331 Form & Role \\ \hline
332 \DWFORMrefaddr& offset in \dotdebuginfo{} \\
333 \DWFORMsecoffset& offset in a section other than \\
334 &\dotdebuginfo{} or \dotdebugstr{} \\
335 \DWFORMstrp&offset in \dotdebugstr{} \\
336 \DWOPcallref&offset in \dotdebuginfo{} \\
340 \item Within the body of the \dotdebugpubnames{} and
342 sections, the representation of the first field
343 of each tuple (which represents an offset in the
345 section) depends on the DWARF format as follows: in the
346 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
347 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
352 The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
353 intermixed within a single compilation unit.
355 \textit{Attribute values and section header fields that represent
356 addresses in the target program are not affected by these
359 A DWARF consumer that supports the 64\dash bit DWARF format must
360 support executables in which some compilation units use the
361 32\dash bit format and others use the 64\dash bit format provided that
362 the combination links correctly (that is, provided that there
363 are no link\dash time errors due to truncation or overflow). (An
364 implementation is not required to guarantee detection and
365 reporting of all such errors.)
367 \textit{It is expected that DWARF producing compilers will \emph{not} use
368 the 64\dash bit format \emph{by default}. In most cases, the division of
369 even very large applications into a number of executable and
370 shared objects will suffice to assure that the DWARF sections
371 within each individual linked object are less than 4 GBytes
372 in size. However, for those cases where needed, the 64\dash bit
373 format allows the unusual case to be handled as well. Even
374 in this case, it is expected that only application supplied
375 objects will need to be compiled using the 64\dash bit format;
376 separate 32\dash bit format versions of system supplied shared
377 executable libraries can still be used.}
381 \section{Format of Debugging Information}
382 \label{datarep:formatofdebugginginformation}
384 For each compilation unit compiled with a DWARF producer,
385 a contribution is made to the \dotdebuginfo{} section of
386 the object file. Each such contribution consists of a
387 compilation unit header
388 (see Section \refersec{datarep:compilationunitheader})
390 single \DWTAGcompileunit{} or
391 \DWTAGpartialunit{} debugging
392 information entry, together with its children.
394 For each type defined in a compilation unit, a contribution may
395 be made to the \dotdebugtypes{}
396 section of the object file. Each
397 such contribution consists of a
398 \addtoindex{type unit} header
399 (see Section \refersec{datarep:typeunitheader})
400 followed by a \DWTAGtypeunit{} entry, together with
403 Each debugging information entry begins with a code that
404 represents an entry in a separate
405 \addtoindex{abbreviations table}. This
406 code is followed directly by a series of attribute values.
408 The appropriate entry in the
409 \addtoindex{abbreviations table} guides the
410 interpretation of the information contained directly in the
412 \dotdebugtypes{} section.
415 Multiple debugging information entries may share the same
416 abbreviation table entry. Each compilation unit is associated
417 with a particular abbreviation table, but multiple compilation
418 units may share the same table.
419 \subsection{Unit Headers}
420 \label{datarep:unitheaders}
422 \subsubsection{Compilation Unit Header}
423 \label{datarep:compilationunitheader}
424 \begin{enumerate}[1. ]
426 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
427 \addttindexx{unit\_length}
428 A 4\dash byte or 12\dash byte
429 \addtoindexx{initial length}
430 unsigned integer representing the length
431 of the \dotdebuginfo{}
432 contribution for that compilation unit,
433 not including the length field itself. In the \thirtytwobitdwarfformat,
434 this is a 4\dash byte unsigned integer (which must be less
435 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
436 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
437 integer that gives the actual length
438 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
441 \item \texttt{version} (\addtoindex{uhalf}) \\
442 A 2\dash byte unsigned integer representing the version of the
443 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
444 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
445 The value in this field is 4.
447 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
449 \addtoindexx{section offset!in .debug\_info header}
450 4\dash byte or 8\dash byte unsigned offset into the
452 section. This offset associates the compilation unit with a
453 particular set of debugging information entry abbreviations. In
454 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
455 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
456 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
458 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
459 A 1\dash byte unsigned integer representing the size in bytes of
460 \addttindexx{address\_size}
461 an address on the target architecture. If the system uses
462 \addtoindexx{address space!segmented}
463 segmented addressing, this value represents the size of the
464 offset portion of an address.
469 \subsubsection{Type Unit Header}
470 \label{datarep:typeunitheader}
472 The header for the series of debugging information entries
473 contributing to the description of a type that has been
474 placed in its own \addtoindex{type unit}, within the
475 \dotdebugtypes{} section,
476 consists of the following information:
477 \begin{enumerate}[1. ]
479 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
480 \addttindexx{unit\_length}
481 A 4\dash byte or 12\dash byte unsigned integer
482 \addtoindexx{initial length}
483 representing the length
484 of the \dotdebugtypes{} contribution for that type unit,
485 not including the length field itself. In the \thirtytwobitdwarfformat,
486 this is a 4\dash byte unsigned integer (which must be
487 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
488 consists of the 4\dash byte value \wffffffff followed by an
489 8\dash byte unsigned integer that gives the actual length
490 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
493 \item \texttt{version} (\addtoindex{uhalf}) \\
494 A 2\dash byte unsigned integer representing the version of the
495 DWARF information for the
496 type unit\addtoindexx{version number!type unit}
497 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
498 The value in this field is 4.
500 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
502 \addtoindexx{section offset!in .debug\_types header}
503 4\dash byte or 8\dash byte unsigned offset into the
505 section. This offset associates the type unit with a
506 particular set of debugging information entry abbreviations. In
507 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
508 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
509 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
511 \item \texttt{address\_size} (ubyte) \\
512 A 1\dash byte unsigned integer representing the size
513 \addtoindexx{size of an address}
515 \addttindexx{address\_size}
516 an address on the target architecture. If the system uses
517 \addtoindexx{address space!segmented}
518 segmented addressing, this value represents the size of the
519 offset portion of an address.
521 \item \texttt{type\_signature} (8\dash byte unsigned integer) \\
522 \addtoindexx{type signature}
524 \addttindexx{type\_signature}
525 64\dash bit unique signature (see Section
526 \refersec{datarep:typesignaturecomputation})
527 of the type described in this type
530 \textit{An attribute that refers (using
531 \DWFORMrefsigeight{}) to
532 the primary type contained in this
533 \addtoindex{type unit} uses this value.}
535 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
536 \addttindexx{type\_offset}
537 A 4\dash byte or 8\dash byte unsigned offset
538 \addtoindexx{section offset!in .debug\_types header}
539 relative to the beginning
540 of the \addtoindex{type unit} header.
541 This offset refers to the debugging
542 information entry that describes the type. Because the type
543 may be nested inside a namespace or other structures, and may
544 contain references to other types that have not been placed in
545 separate type units, it is not necessarily either the first or
546 the only entry in the type unit. In the \thirtytwobitdwarfformat,
547 this is a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat,
548 this is an 8\dash byte unsigned length
549 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
553 \subsection{Debugging Information Entry}
554 \label{datarep:debugginginformationentry}
556 Each debugging information entry begins with an unsigned LEB128
557 number containing the abbreviation code for the entry. This
558 code represents an entry within the abbreviations table
559 associated with the compilation unit containing this entry. The
560 abbreviation code is followed by a series of attribute values.
562 On some architectures, there are alignment constraints on
563 section boundaries. To make it easier to pad debugging
564 information sections to satisfy such constraints, the
565 abbreviation code 0 is reserved. Debugging information entries
566 consisting of only the abbreviation code 0 are considered
569 \subsection{Abbreviations Tables}
570 \label{datarep:abbreviationstables}
572 The abbreviations tables for all compilation units
573 are contained in a separate object file section called
575 As mentioned before, multiple compilation
576 units may share the same abbreviations table.
578 The abbreviations table for a single compilation unit consists
579 of a series of abbreviation declarations. Each declaration
580 specifies the tag and attributes for a particular form of
581 debugging information entry. Each declaration begins with
582 an unsigned LEB128 number representing the abbreviation
583 code itself. It is this code that appears at the beginning
584 of a debugging information entry in the
587 section. As described above, the abbreviation
588 code 0 is reserved for null debugging information entries. The
589 abbreviation code is followed by another unsigned LEB128
590 number that encodes the entry\textquoteright s tag. The encodings for the
591 tag names are given in
592 Table \refersec{tab:tagencodings}.
595 \setlength{\extrarowheight}{0.1cm}
596 \begin{longtable}{l|l}
598 \caption{Tag encodings} \label{tab:tagencodings} \\
599 \hline \bfseries Tag name&\bfseries Value\\ \hline
601 \bfseries Tag name&\bfseries Value \\ \hline
603 \hline \emph{Continued on next page}
607 \DWTAGarraytype{} &0x01 \\
608 \DWTAGclasstype&0x02 \\
609 \DWTAGentrypoint&0x03 \\
610 \DWTAGenumerationtype&0x04 \\
611 \DWTAGformalparameter&0x05 \\
612 \DWTAGimporteddeclaration&0x08 \\
614 \DWTAGlexicalblock&0x0b \\
616 \DWTAGpointertype&0x0f \\
617 \DWTAGreferencetype&0x10 \\
618 \DWTAGcompileunit&0x11 \\
619 \DWTAGstringtype&0x12 \\
620 \DWTAGstructuretype&0x13 \\
621 \DWTAGsubroutinetype&0x15 \\
622 \DWTAGtypedef&0x16 \\
623 \DWTAGuniontype&0x17 \\
624 \DWTAGunspecifiedparameters&0x18 \\
625 \DWTAGvariant&0x19 \\
626 \DWTAGcommonblock&0x1a \\
627 \DWTAGcommoninclusion&0x1b \\
628 \DWTAGinheritance&0x1c \\
629 \DWTAGinlinedsubroutine&0x1d \\
631 \DWTAGptrtomembertype&0x1f \\
632 \DWTAGsettype&0x20 \\
633 \DWTAGsubrangetype&0x21 \\
634 \DWTAGwithstmt&0x22 \\
635 \DWTAGaccessdeclaration&0x23 \\
636 \DWTAGbasetype&0x24 \\
637 \DWTAGcatchblock&0x25 \\
638 \DWTAGconsttype&0x26 \\
639 \DWTAGconstant&0x27 \\
640 \DWTAGenumerator&0x28 \\
641 \DWTAGfiletype&0x29 \\
643 \DWTAGnamelist&0x2b \\
644 \DWTAGnamelistitem&0x2c \\
645 \DWTAGpackedtype&0x2d \\
646 \DWTAGsubprogram&0x2e \\
647 \DWTAGtemplatetypeparameter&0x2f \\
648 \DWTAGtemplatevalueparameter&0x30 \\
649 \DWTAGthrowntype&0x31 \\
650 \DWTAGtryblock&0x32 \\
651 \DWTAGvariantpart&0x33 \\
652 \DWTAGvariable&0x34 \\
653 \DWTAGvolatiletype&0x35 \\
654 \DWTAGdwarfprocedure&0x36 \\
655 \DWTAGrestricttype&0x37 \\
656 \DWTAGinterfacetype&0x38 \\
657 \DWTAGnamespace&0x39 \\
658 \DWTAGimportedmodule&0x3a \\
659 \DWTAGunspecifiedtype&0x3b \\
660 \DWTAGpartialunit&0x3c \\
661 \DWTAGimportedunit&0x3d \\
662 \DWTAGcondition&\xiiif \\
663 \DWTAGsharedtype&0x40 \\
664 \DWTAGtypeunit{} &0x41 \\
665 \DWTAGrvaluereferencetype{} &0x42 \\
666 \DWTAGtemplatealias{} &0x43 \\
667 \DWTAGcoarraytype &0x44 \\
668 \DWTAGgenericsubrange &0x45 \\
669 \DWTAGlouser&0x4080 \\
670 \DWTAGhiuser&\xffff \\
674 Following the tag encoding is a 1\dash byte value that determines
675 whether a debugging information entry using this abbreviation
676 has child entries or not. If the value is
678 the next physically succeeding entry of any debugging
679 information entry using this abbreviation is the first
680 child of that entry. If the 1\dash byte value following the
681 abbreviation\textquoteright s tag encoding is
682 \DWCHILDRENnoTARG, the next
683 physically succeeding entry of any debugging information entry
684 using this abbreviation is a sibling of that entry. (Either
685 the first child or sibling entries may be null entries). The
686 encodings for the child determination byte are given in
687 Table \refersec{tab:childdeterminationencodings}
689 Section \refersec{chap:relationshipofdebugginginformationentries},
690 each chain of sibling entries is terminated by a null entry.)
694 \setlength{\extrarowheight}{0.1cm}
695 \begin{longtable}{l|l}
696 \caption{Child determination encodings}
697 \label{tab:childdeterminationencodings}
698 \addtoindexx{Child determination encodings} \\
699 \hline \bfseries Children determination name&\bfseries Value \\ \hline
701 \bfseries Children determination name&\bfseries Value \\ \hline
703 \hline \emph{Continued on next page}
707 \DWCHILDRENno&0x00 \\
708 \DWCHILDRENyes&0x01 \\ \hline
713 Finally, the child encoding is followed by a series of
714 attribute specifications. Each attribute specification
715 consists of two parts. The first part is an unsigned LEB128
716 number representing the attribute\textquoteright s name. The second part
717 is an unsigned LEB128 number representing the attribute\textquoteright s
718 form. The series of attribute specifications ends with an
719 entry containing 0 for the name and 0 for the form.
722 \DWFORMindirectTARG{} is a special case. For
723 attributes with this form, the attribute value itself in the
726 section begins with an unsigned
727 LEB128 number that represents its form. This allows producers
728 to choose forms for particular attributes
729 \addtoindexx{abbreviations table!dynamic forms in}
731 without having to add a new entry to the abbreviations table.
733 The abbreviations for a given compilation unit end with an
734 entry consisting of a 0 byte for the abbreviation code.
737 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
738 for a depiction of the organization of the
739 debugging information.}
742 \subsection{Attribute Encodings}
743 \label{datarep:attributeencodings}
745 The encodings for the attribute names are given in
746 Table \refersec{tab:attributeencodings}.
748 The attribute form governs how the value of the attribute is
749 encoded. There are nine classes of form, listed below. Each
750 class is a set of forms which have related representations
751 and which are given a common interpretation according to the
752 attribute in which the form is used.
754 Form \DWFORMsecoffsetTARG{}
756 \addtoindexx{rangelistptr class}
758 \addtoindexx{macptr class}
760 \addtoindexx{loclistptr class}
762 \addtoindexx{lineptr class}
763 namely \livelink{chap:classlineptr}{lineptr},
764 \livelink{chap:classloclistptr}{loclistptr},
765 \livelink{chap:classmacptr}{macptr} or
766 \livelink{chap:classrangelistptr}{rangelistptr}; the list
767 of classes allowed by the applicable attribute in
768 Table \refersec{tab:attributeencodings}
769 determines the class of the form.
771 \textit{In DWARF V3 the forms \DWFORMdatafour{} and
772 \DWFORMdataeight{} were
773 \addtoindexx{lineptr class}
775 \addtoindexx{rangelistptr class}
777 \addtoindexx{macptr class}
779 \addtoindexx{loclistptr class}
780 class constant \addtoindexx{constant class}
781 or one of the classes
782 \livelink{chap:classlineptr}{lineptr},
783 \livelink{chap:classloclistptr}{loclistptr},
784 \livelink{chap:classmacptr}{macptr} or
785 \livelink{chap:classrangelistptr}{rangelistptr}, depending on context. In
787 \DWFORMdatafour{} and
788 \DWFORMdataeight{} are members of class
789 constant in all cases.
791 \DWFORMsecoffset{} replaces
792 their usage for the other classes.}
794 Each possible form belongs to one or more of the following classes:
797 \item \livelinki{chap:classaddress}{address}{address class} \\
798 \livetarg{datarep:classaddress}{}
799 Represented as either:
801 \item An object of appropriate size to hold an
802 address on the target machine
804 The size is encoded in the compilation unit header
805 (see Section \refersec{datarep:compilationunitheader}).
806 This address is relocatable in a relocatable object file and
807 is relocated in an executable file or shared object.
809 \item As an indirect index into a table of addresses (as
810 described in the previous bullet) in the
811 \dotdebugaddr{} section (\DWFORMaddrxTARG).
812 The representation of a \DWFORMaddrxNAME{} value is an unsigned
813 \addtoindex{LEB128} value, which is interpreted as a zero-based
814 index into an array of addresses in the \dotdebugaddr{} section.
818 \item \livelink{chap:classblock}{block} \\
819 \livetarg{datarep:classblock}{}
820 Blocks come in four forms:
822 \begin{myindentpara}{1cm}
823 A 1\dash byte length followed by 0 to 255 contiguous information
824 bytes (\DWFORMblockoneTARG).
827 \begin{myindentpara}{1cm}
828 A 2\dash byte length followed by 0 to 65,535 contiguous information
829 bytes (\DWFORMblocktwoTARG).
832 \begin{myindentpara}{1cm}
833 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
834 information bytes (\DWFORMblockfourTARG).
837 \begin{myindentpara}{1cm}
838 An unsigned LEB128 length followed by the number of bytes
839 specified by the length (\DWFORMblockTARG).
842 In all forms, the length is the number of information bytes
843 that follow. The information bytes may contain any mixture
844 of relocated (or relocatable) addresses, references to other
845 debugging information entries or data bytes.
847 \item \livelinki{chap:classconstant}{constant}{constant class} \\
848 \livetarg{datarep:classconstant}{}
849 There are six forms of constants. There are fixed length
850 constant data forms for one, two, four and eight byte values
855 and \DWFORMdataeightTARG).
856 There are also variable length constant
857 data forms encoded using LEB128 numbers (see below). Both
858 signed (\DWFORMsdataTARG) and unsigned
859 (\DWFORMudataTARG) variable
860 length constants are available
862 The data in \DWFORMdataone,
864 \DWFORMdatafour{} and
866 can be anything. Depending on context, it may
867 be a signed integer, an unsigned integer, a floating\dash point
868 constant, or anything else. A consumer must use context to
869 know how to interpret the bits, which if they are target
870 machine data (such as an integer or floating point constant)
871 will be in target machine byte\dash order.
873 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
874 forms is used to represent a
875 signed or unsigned integer, it can be hard for a consumer
876 to discover the context necessary to determine which
877 interpretation is intended. Producers are therefore strongly
878 encouraged to use \DWFORMsdata{} or
879 \DWFORMudata{} for signed and
880 unsigned integers respectively, rather than
881 \DWFORMdata\textless n\textgreater.}
884 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
885 \livetarg{datarep:classexprloc}{}
886 This is an unsigned LEB128 length followed by the
887 number of information bytes specified by the length
888 (\DWFORMexprlocTARG).
889 The information bytes contain a DWARF expression
890 (see Section \refersec{chap:dwarfexpressions})
891 or location description
892 (see Section \refersec{chap:locationdescriptions}).
894 \item \livelinki{chap:classflag}{flag}{flag class} \\
895 \livetarg{datarep:classflag}{}
896 A flag \addtoindexx{flag class}
897 is represented explicitly as a single byte of data
899 implicitly (\DWFORMflagpresentTARG).
901 first case, if the \nolink{flag} has value zero, it indicates the
902 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
903 it indicates the presence of the attribute. In the second
904 case, the attribute is implicitly indicated as present, and
905 no value is encoded in the debugging information entry itself.
907 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
908 \livetarg{datarep:classlineptr}{}
909 This is an offset into
910 \addtoindexx{section offset!in class lineptr value}
912 \dotdebugline{} section
914 It consists of an offset from the beginning of the
916 section to the first byte of
917 the data making up the line number list for the compilation
919 It is relocatable in a relocatable object file, and
920 relocated in an executable or shared object. In the
921 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
922 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
923 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
926 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
927 \livetarg{datarep:classloclistptr}{}
928 This is an offset into the
932 It consists of an offset from the
933 \addtoindexx{section offset!in class loclistptr value}
936 section to the first byte of
937 the data making up the
938 \addtoindex{location list} for the compilation unit.
939 It is relocatable in a relocatable object file, and
940 relocated in an executable or shared object. In the
941 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
942 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
943 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
946 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
947 \livetarg{datarep:classmacptr}{}
949 \addtoindexx{section offset!in class macptr value}
951 \dotdebugmacinfo{} section
953 It consists of an offset from the
954 beginning of the \dotdebugmacinfo{}
955 section to the first byte of
956 the data making up the macro information list for the compilation
958 It is relocatable in a relocatable object file, and
959 relocated in an executable or shared object. In the
960 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
961 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
962 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
965 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
966 \livetarg{datarep:classrangelistptr}{}
968 \addtoindexx{section offset!in class rangelistptr value}
969 offset into the \dotdebugranges{} section
972 offset from the beginning of the
973 \dotdebugranges{} section
974 to the beginning of the non\dash contiguous address ranges
975 information for the referencing entity.
977 a relocatable object file, and relocated in an executable or
978 shared object. In the \thirtytwobitdwarfformat, this offset
979 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
980 format, it is an 8\dash byte unsigned value (see Section
981 \refersec{datarep:32bitand64bitdwarfformats}).
984 \textit{Because classes \livelink{chap:classlineptr}{lineptr},
985 \livelink{chap:classloclistptr}{loclistptr},
986 \livelink{chap:classmacptr}{macptr} and
987 \livelink{chap:classrangelistptr}{rangelistptr}
988 share a common representation, it is not possible for an
989 attribute to allow more than one of these classes}
993 \item \livelinki{chap:classreference}{reference}{reference class} \\
994 \livetarg{datarep:classreference}{}
995 There are three types of reference.
998 \addtoindexx{reference class}
999 first type of reference can identify any debugging
1000 information entry within the containing unit.
1003 \addtoindexx{section offset!in class reference value}
1004 offset from the first byte of the compilation
1005 header for the compilation unit containing the reference. There
1006 are five forms for this type of reference. There are fixed
1007 length forms for one, two, four and eight byte offsets
1013 and \DWFORMrefeightTARG).
1014 There is also an unsigned variable
1015 length offset encoded form that uses unsigned LEB128 numbers
1016 (\DWFORMrefudataTARG).
1017 Because this type of reference is within
1018 the containing compilation unit no relocation of the value
1021 The second type of reference can identify any debugging
1022 information entry within a
1023 \dotdebuginfo{} section; in particular,
1024 it may refer to an entry in a different compilation unit
1025 from the unit containing the reference, and may refer to an
1026 entry in a different shared object. This type of reference
1027 (\DWFORMrefaddrTARG)
1028 is an offset from the beginning of the
1030 section of the target executable or shared object;
1031 it is relocatable in a relocatable object file and frequently
1032 relocated in an executable file or shared object. For
1033 references from one shared object or static executable file
1034 to another, the relocation and identification of the target
1035 object must be performed by the consumer. In the
1036 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1037 in the \sixtyfourbitdwarfformat, it is an 8\dash byte
1039 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1041 \textit{A debugging information entry that may be referenced by
1042 another compilation unit using
1043 \DWFORMrefaddr{} must have a
1044 global symbolic name.}
1046 \textit{For a reference from one executable or shared object to
1047 another, the reference is resolved by the debugger to identify
1048 the shared object or executable and the offset into that
1049 object\textquoteright s \dotdebuginfo{}
1050 section in the same fashion as the run
1051 time loader, either when the debug information is first read,
1052 or when the reference is used.}
1054 The third type of reference can identify any debugging
1055 information type entry that has been placed in its own
1056 \addtoindex{type unit}. This type of
1057 reference (\DWFORMrefsigeightTARG) is the
1058 \addtoindexx{type signature}
1059 64\dash bit type signature
1060 (see Section \refersec{datarep:typesignaturecomputation})
1064 \textit{The use of compilation unit relative references will reduce the
1065 number of link\dash time relocations and so speed up linking. The
1066 use of the second and third type of reference allows for the
1067 sharing of information, such as types, across compilation
1070 \textit{A reference to any kind of compilation unit identifies the
1071 debugging information entry for that unit, not the preceding
1074 \item \livelinki{chap:classstring}{string}{string class} \\
1075 \livetarg{datarep:classstring}{}
1076 A string is a sequence of contiguous non\dash null bytes followed by
1078 \addtoindexx{string class}
1079 A string may be represented:
1081 \item immediately in the debugging information entry itself
1082 (\DWFORMstringTARG),
1084 \addtoindexx{section offset!in class string value}
1085 offset into a string table contained in
1086 the \dotdebugstr{} section of the object file
1088 In the \thirtytwobitdwarfformat, the representation of a
1090 value is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
1091 it is an 8\dash byte unsigned offset
1092 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1093 \item as an indirect offset into the string table using an
1094 index into a table of offsets contained in the
1095 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1096 The representation of a \DWFORMstrxNAME{} value is an unsigned
1097 \addtoindex{LEB128} value, which is interpreted as a zero-based
1098 index into an array of offsets in the \dotdebugstroffsets{} section.
1099 The offset entries in the \dotdebugstroffsets{} section have the
1100 same representation as \DWFORMstrp{} values.
1102 Any combination of these three forms may be used within a single compilation.
1104 If the \DWATuseUTFeight{}
1105 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1106 compilation, partial or type unit entry, string values are encoded using the
1107 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1108 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
1109 the string representation is unspecified.
1111 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1112 ISO/IEC 10646\dash 1:1993. It contains all the same characters
1113 and encoding points as ISO/IEC 10646, as well as additional
1114 information about the characters and their use.}
1116 \textit{Earlier versions of DWARF did not specify the representation
1117 of strings; for compatibility, this version also does
1118 not. However, the UTF\dash 8 representation is strongly recommended.}
1122 In no case does an attribute use
1123 \addtoindexx{rangelistptr class}
1125 \addtoindexx{loclistptr class}
1127 \addtoindexx{lineptr class}
1129 \addtoindexx{macptr class}
1130 classes \livelink{chap:classlineptr}{lineptr},
1131 \livelink{chap:classloclistptr}{loclistptr}, \livelink{chap:classmacptr}{macptr} or
1132 \livelink{chap:classrangelistptr}{rangelistptr} to point into either the
1133 \dotdebuginfo{} or \dotdebugstr{} section.
1135 The form encodings are listed in
1136 Table \refersec{tab:attributeformencodings}.
1140 \setlength{\extrarowheight}{0.1cm}
1141 \begin{longtable}{l|l|l}
1142 \caption{Attribute encodings}
1143 \label{tab:attributeencodings}
1144 \addtoindexx{attribute encodings} \\
1145 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1147 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1149 \hline \emph{Continued on next page}
1151 \hline \ddag\ \textit{New in DWARF Version 5}
1153 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1154 \addtoindexx{sibling attribute!encoding} \\
1155 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1156 \livelink{chap:classloclistptr}{loclistptr}\addtoindexx{location attribute!encoding} \\
1157 \DWATname&0x03&\livelink{chap:classstring}{string}
1158 \addtoindexx{name attribute!encoding} \\
1159 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1160 \addtoindexx{ordering attribute!encoding} \\
1161 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1162 \livelink{chap:classreference}{reference} \addtoindexx{byte size attribute!encoding} \\
1163 \DWATbitoffset&0x0c&\livelink{chap:classconstant}{constant},
1164 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{bit offset attribute!encoding} \\
1165 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1166 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{bit size attribute!encoding} \\
1167 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1168 \addtoindexx{statement list attribute!encoding} \\
1169 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1170 \addtoindexx{low PC attribute!encoding} \\
1171 \DWAThighpc&0x12&\livelink{chap:classaddress}{address}, \livelink{chap:classconstant}{constant}
1172 \addtoindexx{high PC attribute!encoding} \\
1173 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1174 \addtoindexx{language attribute!encoding} \\
1175 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1176 \addtoindexx{discriminant attribute!encoding} \\
1177 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1178 \addtoindexx{discriminant value attribute!encoding} \\
1179 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1180 \addtoindexx{visibility attribute!encoding} \\
1181 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1182 \addtoindexx{import attribute!encoding} \\
1183 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1184 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{string length attribute!encoding} \\
1185 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1186 \addtoindexx{common reference attribute!encoding} \\
1187 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1188 \addtoindexx{compilation directory attribute!encoding} \\
1189 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block}, \livelink{chap:classconstant}{constant}, \livelink{chap:classstring}{string}
1190 \addtoindexx{constant value attribute!encoding} \\
1191 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1192 \addtoindexx{containing type attribute!encoding} \\
1193 \DWATdefaultvalue&0x1e&\livelink{chap:classreference}{reference}, \livelink{chap:classflag}{flag}
1194 \addtoindexx{default value attribute!encoding} \\
1195 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1196 \addtoindexx{inline attribute!encoding} \\
1197 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1198 \addtoindexx{is optional attribute!encoding} \\
1199 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1200 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{lower bound attribute!encoding} \\
1201 \DWATproducer&0x25&\livelink{chap:classstring}{string} \addtoindexx{producer attribute!encoding} \\
1202 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1203 \addtoindexx{prototyped attribute!encoding} \\
1204 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1205 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{return address attribute!encoding} \\
1206 % FIXME: lower case , not Constant
1207 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1208 \livelink{chap:classrangelistptr}{rangelistptr} \addtoindexx{start scope attribute!encoding} \\
1209 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1210 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{bit stride attribute!encoding} \\
1211 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1212 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{upper bound attribute!encoding} \\
1213 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1214 \addtoindexx{abstract origin attribute!encoding} \\
1215 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1216 \addtoindexx{accessibility attribute!encoding} \\
1217 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1218 \addtoindexx{address class attribute!encoding} \\
1219 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1220 \addtoindexx{artificial attribute!encoding} \\
1221 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1222 \addtoindexx{base types attribute!encoding} \\
1223 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1224 \addtoindexx{calling convention attribute!encoding} \\
1225 \DWATcount&0x37&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference}
1226 \addtoindexx{count attribute!encoding} \\
1227 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1228 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classloclistptr}{loclistptr}
1229 \addtoindexx{data member attribute!encoding} \\
1230 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1231 \addtoindexx{declaration column attribute!encoding} \\
1232 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1233 \addtoindexx{declaration file attribute!encoding} \\
1234 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1235 \addtoindexx{declaration line attribute!encoding} \\
1236 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1237 \addtoindexx{declaration attribute!encoding} \\
1238 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1239 \addtoindexx{discriminant list attribute!encoding} \\
1240 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1241 \addtoindexx{encoding attribute!encoding} \\
1242 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1243 \addtoindexx{external attribute!encoding} \\
1244 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1245 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{frame base attribute!encoding} \\
1246 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1247 \addtoindexx{friend attribute!encoding} \\
1248 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1249 \addtoindexx{identifier case attribute!encoding} \\
1250 \DWATmacroinfo&0x43&\livelink{chap:classmacptr}{macptr}
1251 \addtoindexx{macro information attribute!encoding} \\
1252 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1253 \addtoindexx{name list item attribute!encoding} \\
1254 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1255 \addtoindexx{priority attribute!encoding} \\
1256 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1257 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{segment attribute!encoding} \\
1258 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1259 \addtoindexx{specification attribute!encoding} \\
1260 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1261 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{static link attribute!encoding} \\
1262 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1263 \addtoindexx{type attribute!encoding} \\
1264 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1265 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{location list attribute!encoding} \\
1266 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1267 \addtoindexx{variable parameter attribute!encoding} \\
1268 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1269 \addtoindexx{virtuality attribute!encoding} \\
1270 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1271 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{vtable element location attribute!encoding} \\
1272 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1273 \livelink{chap:classreference}{reference} \addtoindexx{allocated attribute!encoding} \\
1274 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1275 \livelink{chap:classreference}{reference} \addtoindexx{associated attribute!encoding} \\
1276 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1277 \addtoindexx{data location attribute!encoding} \\
1278 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1279 \livelink{chap:classreference}{reference} \addtoindexx{byte stride attribute!encoding} \\
1280 \DWATentrypc&0x52&\livelink{chap:classaddress}{address}, \livelink{chap:classconstant}{constant}
1281 \addtoindexx{entry pc attribute!encoding} \\
1282 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1283 \addtoindexx{use UTF8 attribute!encoding}\addtoindexx{UTF-8} \\
1284 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1285 \addtoindexx{extension attribute!encoding} \\
1286 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1287 \addtoindexx{ranges attribute!encoding} \\
1288 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address}, \livelink{chap:classflag}{flag},
1289 \livelink{chap:classreference}{reference}, \livelink{chap:classstring}{string} \addtoindexx{trampoline attribute!encoding} \\
1290 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1291 \addtoindexx{call column attribute!encoding} \\
1292 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1293 \addtoindexx{call file attribute!encoding} \\
1294 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1295 \addtoindexx{call line attribute!encoding} \\
1296 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1297 \addtoindexx{description attribute!encoding} \\
1298 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1299 \addtoindexx{binary scale attribute!encoding} \\
1300 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1301 \addtoindexx{decimal scale attribute!encoding} \\
1302 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1303 \addtoindexx{small attribute!encoding} \\
1304 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1305 \addtoindexx{decimal scale attribute!encoding} \\
1306 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1307 \addtoindexx{digit count attribute!encoding} \\
1308 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1309 \addtoindexx{picture string attribute!encoding} \\
1310 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1311 \addtoindexx{mutable attribute!encoding} \\
1312 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1313 \addtoindexx{thread scaled attribute!encoding} \\
1314 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1315 \addtoindexx{explicit attribute!encoding} \\
1316 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1317 \addtoindexx{object pointer attribute!encoding} \\
1318 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1319 \addtoindexx{endianity attribute!encoding} \\
1320 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1321 \addtoindexx{elemental attribute!encoding} \\
1322 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1323 \addtoindexx{pure attribute!encoding} \\
1324 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1325 \addtoindexx{recursive attribute!encoding} \\
1326 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1327 \addtoindexx{signature attribute!encoding} \\
1328 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1329 \addtoindexx{main subprogram attribute!encoding} \\
1330 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1331 \addtoindexx{data bit offset attribute!encoding} \\
1332 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1333 \addtoindexx{constant expression attribute!encoding} \\
1334 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1335 \addtoindexx{enumeration class attribute!encoding} \\
1336 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1337 \addtoindexx{linkage name attribute!encoding} \\
1338 \DWATstringlengthbitsize{} \ddag&0x6f&
1339 \livelink{chap:classconstant}{constant}\addtoindexx{string length attribute!size of length} \\
1340 \DWATstringlengthbytesize{} \ddag&0x70&
1341 \livelink{chap:classconstant}{constant}\addtoindexx{string length attribute!size of length} \\
1342 \DWATrank~\ddag&0x71&
1343 \livelink{chap:DWATrank}{constant, exprloc}\addtoindexx{rank attribute!encoding} \\
1344 \DWATstroffsetsbase~\ddag&0x72&
1345 \livelink{chap:classstring}{reference}\addtoindexx{string offsets base!encoding} \\
1346 \DWATaddrbase~\ddag &0x73&
1347 \livelink{chap:DWATaddrbase}{reference}\addtoindexx{address table base!encoding} \\
1348 \DWATrangesbase~\ddag&0x74&
1349 \livelink{chap:DWATrangesbase}{reference}\addtoindexx{ranges base!encoding} \\
1350 \DWATdwoid~\ddag &0x75&
1351 \livelink{chap:DWATdwoid}{constant}\addtoindexx{split DWARF object id!encoding} \\
1352 \DWATdwoname~\ddag &0x76&
1353 \livelink{chap:DWATdwname}{string}\addtoindexx{split DWARF object file name!encooding} \\
1354 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1355 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1362 \setlength{\extrarowheight}{0.1cm}
1363 \begin{longtable}{l|l|l}
1364 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1365 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1367 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1369 \hline \emph{Continued on next page}
1374 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1375 \textit{Reserved} &0x02& \\
1376 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1377 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1378 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1379 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1380 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1381 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1382 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1383 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1384 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1385 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1386 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1387 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1388 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1389 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1390 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1391 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1392 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1393 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
1394 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
1395 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1396 \DWFORMsecoffset{} &0x17&\livelink{chap:classlineptr}{lineptr}, \livelink{chap:classloclistptr}{loclistptr}, \livelink{chap:classmacptr}{macptr}, \livelink{chap:classrangelistptr}{rangelistptr} \\
1397 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
1398 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
1399 \DWFORMstrx &0x1a&\livelink{chap:classstring}{string} \\
1400 \DWFORMaddrx &0x1b&\livelink{chap:classaddess}{address} \\
1401 \DWFORMrefsigeight &0x20&\livelink{chap:classreference}{reference} \\
1408 \section{Variable Length Data}
1409 \label{datarep:variablelengthdata}
1410 \addtoindexx{variable length data|see {LEB128}}
1412 \addtoindexx{Little Endian Base 128|see{LEB128}}
1413 encoded using \doublequote{Little Endian Base 128}
1414 \addtoindexx{little-endian encoding|see{endian attribute}}
1416 \addtoindexx{LEB128}
1417 LEB128 is a scheme for encoding integers
1418 densely that exploits the assumption that most integers are
1421 \textit{This encoding is equally suitable whether the target machine
1422 architecture represents data in big\dash\ endian or little\dash endian
1423 order. It is \doublequote{little\dash endian} only in the sense that it
1424 avoids using space to represent the \doublequote{big} end of an
1425 unsigned integer, when the big end is all zeroes or sign
1428 Unsigned LEB128 (ULEB128) numbers are encoded as follows:
1429 \addtoindexx{LEB128!unsigned, encoding as}
1430 start at the low order end of an unsigned integer and chop
1431 it into 7\dash bit chunks. Place each chunk into the low order 7
1432 bits of a byte. Typically, several of the high order bytes
1433 will be zero; discard them. Emit the remaining bytes in a
1434 stream, starting with the low order byte; set the high order
1435 bit on each byte except the last emitted byte. The high bit
1436 of zero on the last byte indicates to the decoder that it
1437 has encountered the last byte.
1439 The integer zero is a special case, consisting of a single
1442 Table \refersec{tab:examplesofunsignedleb128encodings}
1443 gives some examples of unsigned LEB128 numbers. The
1444 0x80 in each case is the high order bit of the byte, indicating
1445 that an additional byte follows.
1448 The encoding for signed, two\textquoteright s complement LEB128 (SLEB128)
1449 \addtoindexx{LEB128!signed, encoding as}
1450 numbers is similar, except that the criterion for discarding
1451 high order bytes is not whether they are zero, but whether
1452 they consist entirely of sign extension bits. Consider the
1453 32\dash bit integer -2. The three high level bytes of the number
1454 are sign extension, thus LEB128 would represent it as a single
1455 byte containing the low order 7 bits, with the high order
1456 bit cleared to indicate the end of the byte stream. Note
1457 that there is nothing within the LEB128 representation that
1458 indicates whether an encoded number is signed or unsigned. The
1459 decoder must know what type of number to expect.
1460 Table \refersec{tab:examplesofunsignedleb128encodings}
1461 gives some examples of unsigned LEB128 numbers and
1462 Table \refersec{tab:examplesofsignedleb128encodings}
1463 gives some examples of signed LEB128
1466 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1467 \addtoindexx{LEB128!examples}
1468 gives algorithms for encoding and decoding these forms.}
1472 \setlength{\extrarowheight}{0.1cm}
1473 \begin{longtable}{l|l|l}
1474 \caption{Examples of unsigned LEB128 encodings}
1475 \label{tab:examplesofunsignedleb128encodings}
1476 \addtoindexx{LEB128 encoding!examples} \\
1477 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1479 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1481 \hline \emph{Continued on next page}
1487 128& 0 + 0x80 & 1 \\
1488 129& 1 + 0x80 & 1 \\
1489 130& 2 + 0x80 & 1 \\
1490 12857& 57 + 0x80 & 100 \\
1497 \setlength{\extrarowheight}{0.1cm}
1498 \begin{longtable}{l|l|l}
1499 \caption{Examples of signed LEB128 encodings} \label{tab:examplesofsignedleb128encodings} \\
1500 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1502 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1504 \hline \emph{Continued on next page}
1510 127& 127 + 0x80 & 0 \\
1511 -127& 1 + 0x80 & 0x7f \\
1512 128& 0 + 0x80 & 1 \\
1513 -128& 0 + 0x80 & 0x7f \\
1514 129& 1 + 0x80 & 1 \\
1515 -129& 0x7f + 0x80 & 0x7e \\
1522 \section{DWARF Expressions and Location Descriptions}
1523 \label{datarep:dwarfexpressionsandlocationdescriptions}
1524 \subsection{DWARF Expressions}
1525 \label{datarep:dwarfexpressions}
1528 \addtoindexx{DWARF Expression!operator encoding}
1529 DWARF expression is stored in a \nolink{block} of contiguous
1530 bytes. The bytes form a sequence of operations. Each operation
1531 is a 1\dash byte code that identifies that operation, followed by
1532 zero or more bytes of additional data. The encodings for the
1533 operations are described in
1534 Table \refersec{tab:dwarfoperationencodings}.
1537 \setlength{\extrarowheight}{0.1cm}
1538 \begin{longtable}{l|c|c|l}
1539 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1540 \hline & &\bfseries No. of &\\
1541 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1543 & &\bfseries No. of &\\
1544 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1546 \hline \emph{Continued on next page}
1551 \DWOPaddr&0x03&1 & constant address \\
1552 & & &(size is target specific) \\
1554 \DWOPderef&0x06&0 & \\
1556 \DWOPconstoneu&0x08&1&1\dash byte constant \\
1557 \DWOPconstones&0x09&1&1\dash byte constant \\
1558 \DWOPconsttwou&0x0a&1&2\dash byte constant \\
1559 \DWOPconsttwos&0x0b&1&2\dash byte constant \\
1560 \DWOPconstfouru&0x0c&1&4\dash byte constant \\
1561 \DWOPconstfours&0x0d&1&4\dash byte constant \\
1562 \DWOPconsteightu&0x0e&1&8\dash byte constant \\
1563 \DWOPconsteights&0x0f&1&8\dash byte constant \\
1564 \DWOPconstu&0x10&1&ULEB128 constant \\
1565 \DWOPconsts&0x11&1&SLEB128 constant \\
1566 \DWOPdup&0x12&0 & \\
1567 \DWOPdrop&0x13&0 & \\
1568 \DWOPover&0x14&0 & \\
1569 \DWOPpick&0x15&1&1\dash byte stack index \\
1570 \DWOPswap&0x16&0 & \\
1571 \DWOProt&0x17&0 & \\
1572 \DWOPxderef&0x18&0 & \\
1573 \DWOPabs&0x19&0 & \\
1574 \DWOPand&0x1a&0 & \\
1575 \DWOPdiv&0x1b&0 & \\
1576 \DWOPminus&0x1c&0 & \\
1577 \DWOPmod&0x1d&0 & \\
1578 \DWOPmul&0x1e&0 & \\
1579 \DWOPneg&0x1f&0 & \\
1580 \DWOPnot&0x20&0 & \\
1582 \DWOPplus&0x22&0 & \\
1583 \DWOPplusuconst&0x23&1&ULEB128 addend \\
1584 \DWOPshl&0x24&0 & \\
1585 \DWOPshr&0x25&0 & \\
1586 \DWOPshra&0x26&0 & \\
1587 \DWOPxor&0x27&0 & \\
1589 \DWOPbra&0x28&1 & signed 2\dash byte constant \\
1596 \DWOPskip&0x2f&1&signed 2\dash byte constant \\ \hline
1598 \DWOPlitzero & 0x30 & 0 & \\
1599 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
1600 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
1601 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
1603 \DWOPregzero & 0x50 & 0 & \\*
1604 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
1605 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
1606 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
1608 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
1609 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
1610 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
1611 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
1613 \DWOPregx{} & 0x90 &1&ULEB128 register \\
1614 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
1615 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
1616 & & &SLEB128 offset \\
1617 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
1618 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
1619 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
1620 \DWOPnop{} & 0x96 &0& \\
1622 \DWOPpushobjectaddress&0x97&0 & \\
1623 \DWOPcalltwo&0x98&1& 2\dash byte offset of DIE \\
1624 \DWOPcallfour&0x99&1& 4\dash byte offset of DIE \\
1625 \DWOPcallref&0x9a&1& 4\dash\ or 8\dash byte offset of DIE \\
1626 \DWOPformtlsaddress&0x9b &0& \\
1627 \DWOPcallframecfa{} &0x9c &0& \\
1628 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
1630 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
1631 &&&\nolink{block} of that size\\
1632 \DWOPstackvalue{} &0x9f &0& \\
1633 \DWOPimplicitpointer{} &0xa0& 2 &4- or 8-byte offset of DIE, \\*
1634 &&&SLEB128 constant offset \\
1635 \DWOPaddrx&0xa1&1&ULEB128 indirect address \\
1636 \DWOPconstx&0xa2&1&ULEB128 indirect constant \\
1637 \DWOPlouser{} &0xe0 && \\
1638 \DWOPhiuser{} &\xff && \\
1644 \subsection{Location Descriptions}
1645 \label{datarep:locationdescriptions}
1647 A location description is used to compute the
1648 location of a variable or other entity.
1650 \subsection{Location Lists}
1651 \label{datarep:locationlists}
1653 Each entry in a \addtoindex{location list} is either a location list entry,
1654 a base address selection entry, or an
1655 \addtoindexx{end of list entry!in location list}
1658 A \addtoindex{location list} entry consists of two address offsets followed
1659 by a 2\dash byte length, followed by a block of contiguous bytes
1660 that contains a DWARF location description. The length
1661 specifies the number of bytes in that block. The two offsets
1662 are the same size as an address on the target machine.
1665 A base address selection entry and an
1666 \addtoindexx{end of list entry!in location list}
1667 end of list entry each
1668 consist of two (constant or relocated) address offsets. The two
1669 offsets are the same size as an address on the target machine.
1671 For a \addtoindex{location list} to be specified, the base address of
1672 \addtoindexx{base address selection entry!in location list}
1673 the corresponding compilation unit must be defined
1674 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1676 \section{Base Type Attribute Encodings}
1677 \label{datarep:basetypeattributeencodings}
1679 The encodings of the
1680 \hypertarget{chap:DWATencodingencodingofbasetype}{}
1682 \addtoindexx{encoding attribute!encoding}
1685 attribute are given in
1686 Table \refersec{tab:basetypeencodingvalues}
1689 \setlength{\extrarowheight}{0.1cm}
1690 \begin{longtable}{l|c}
1691 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1692 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
1694 \bfseries Base type encoding name&\bfseries Value\\ \hline
1696 \hline \emph{Continued on next page}
1700 \DWATEaddress&0x01 \\
1701 \DWATEboolean&0x02 \\
1702 \DWATEcomplexfloat&0x03 \\
1704 \DWATEsigned&0x05 \\
1705 \DWATEsignedchar&0x06 \\
1706 \DWATEunsigned&0x07 \\
1707 \DWATEunsignedchar&0x08 \\
1708 \DWATEimaginaryfloat&0x09 \\
1709 \DWATEpackeddecimal&0x0a \\
1710 \DWATEnumericstring&0x0b \\
1711 \DWATEedited&0x0c \\
1712 \DWATEsignedfixed&0x0d \\
1713 \DWATEunsignedfixed&0x0e \\
1714 \DWATEdecimalfloat{} & 0x0f \\
1715 \DWATEUTF{} & 0x10 \\
1716 \DWATElouser{} & 0x80 \\
1717 \DWATEhiuser{} & \xff \\
1722 The encodings of the constants used in the
1723 \DWATdecimalsign{} attribute
1725 Table \refersec{tab:decimalsignencodings}.
1728 \setlength{\extrarowheight}{0.1cm}
1729 \begin{longtable}{l|c}
1730 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1731 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
1733 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1735 \hline \emph{Continued on next page}
1740 \DWDSunsigned{} & 0x01 \\
1741 \DWDSleadingoverpunch{} & 0x02 \\
1742 \DWDStrailingoverpunch{} & 0x03 \\
1743 \DWDSleadingseparate{} & 0x04 \\
1744 \DWDStrailingseparate{} & 0x05 \\
1750 The encodings of the constants used in the
1751 \DWATendianity{} attribute are given in
1752 Table \refersec{tab:endianityencodings}.
1755 \setlength{\extrarowheight}{0.1cm}
1756 \begin{longtable}{l|c}
1757 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1758 \hline \bfseries Endian code name&\bfseries Value \\ \hline
1760 \bfseries Endian code name&\bfseries Value\\ \hline
1762 \hline \emph{Continued on next page}
1767 \DWENDdefault{} & 0x00 \\
1768 \DWENDbig{} & 0x01 \\
1769 \DWENDlittle{} & 0x02 \\
1770 \DWENDlouser{} & 0x40 \\
1771 \DWENDhiuser{} & \xff \\
1776 \section{Accessibility Codes}
1777 \label{datarep:accessibilitycodes}
1778 The encodings of the constants used in the
1779 \DWATaccessibility{}
1781 \addtoindexx{accessibility attribute!encoding}
1783 Table \refersec{tab:accessibilityencodings}.
1786 \setlength{\extrarowheight}{0.1cm}
1787 \begin{longtable}{l|c}
1788 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1789 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
1791 \bfseries Accessibility code name&\bfseries Value\\ \hline
1793 \hline \emph{Continued on next page}
1798 \DWACCESSpublic&0x01 \\
1799 \DWACCESSprotected&0x02 \\
1800 \DWACCESSprivate&0x03 \\
1806 \section{Visibility Codes}
1807 \label{datarep:visibilitycodes}
1808 The encodings of the constants used in the
1809 \DWATvisibility{} attribute are given in
1810 Table \refersec{tab:visibilityencodings}.
1813 \setlength{\extrarowheight}{0.1cm}
1814 \begin{longtable}{l|c}
1815 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
1816 \hline \bfseries Visiibility code name&\bfseries Value \\ \hline
1818 \bfseries Visibility code name&\bfseries Value\\ \hline
1820 \hline \emph{Continued on next page}
1826 \DWVISexported&0x02 \\
1827 \DWVISqualified&0x03 \\
1832 \section{Virtuality Codes}
1833 \label{datarep:vitualitycodes}
1835 The encodings of the constants used in the
1836 \DWATvirtuality{} attribute are given in
1837 Table \refersec{tab:virtualityencodings}.
1840 \setlength{\extrarowheight}{0.1cm}
1841 \begin{longtable}{l|c}
1842 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
1843 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
1845 \bfseries Virtuality code name&\bfseries Value\\ \hline
1847 \hline \emph{Continued on next page}
1852 \DWVIRTUALITYnone&0x00 \\
1853 \DWVIRTUALITYvirtual&0x01 \\
1854 \DWVIRTUALITYpurevirtual&0x02 \\
1862 \DWVIRTUALITYnone{} is equivalent to the absence of the
1866 \section{Source Languages}
1867 \label{datarep:sourcelanguages}
1869 The encodings of the constants used
1870 \addtoindexx{language attribute, encoding}
1872 \addtoindexx{language name encoding}
1875 attribute are given in
1876 Table \refersec{tab:languageencodings}.
1878 % If we don't force a following space it looks odd
1880 and their associated values are reserved, but the
1881 languages they represent are not well supported.
1882 Table \refersec{tab:languageencodings}
1884 \addtoindexx{lower bound attribute!default}
1885 default lower bound, if any, assumed for
1886 an omitted \DWATlowerbound{} attribute in the context of a
1887 \DWTAGsubrangetype{} debugging information entry for each
1891 \setlength{\extrarowheight}{0.1cm}
1892 \begin{longtable}{l|c|c}
1893 \caption{Language encodings} \label{tab:languageencodings}\\
1894 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
1896 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
1898 \hline \emph{Continued on next page}
1901 \dag \ \textit{See text} \\ \ddag \ \textit{New in \addtoindex{DWARF Version 5}}
1904 \DWLANGCeightynine &0x0001 &0 \\
1905 \DWLANGC{} &0x0002 &0 \\
1906 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada} \\
1907 \DWLANGCplusplus{} &0x0004 &0 \\
1908 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \\
1909 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \\
1910 \DWLANGFortranseventyseven &0x0007 &1 \\
1911 \DWLANGFortranninety &0x0008 &1 \\
1912 \DWLANGPascaleightythree &0x0009 &1 \\
1913 \DWLANGModulatwo &0x000a &1 \\
1914 \DWLANGJava &0x000b &0 \\
1915 \DWLANGCninetynine &0x000c &0 \\
1916 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada} \\
1917 \DWLANGFortranninetyfive &0x000e &1 \\
1918 \DWLANGPLI{} \dag &0x000f &1 \\
1919 \DWLANGObjC{} &0x0010 &0 \\
1920 \DWLANGObjCplusplus{} &0x0011 &0 \\
1921 \DWLANGUPC{} &0x0012 &0 \\
1922 \DWLANGD{} &0x0013 &0 \\
1923 \DWLANGPython{} \dag &0x0014 &0 \\
1924 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \\
1925 \DWLANGGo{} \dag \ddag &0x0016 &0 \\
1926 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \\
1927 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \\
1928 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \\
1929 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \\
1930 \DWLANGOCaml{} \ddag &0x001b &0 \\
1931 \DWLANGlouser{} &0x8000 & \\
1932 \DWLANGhiuser{} &\xffff & \\
1937 \section{Address Class Encodings}
1938 \label{datarep:addressclassencodings}
1940 The value of the common
1941 \addtoindexi{address}{address class!attribute encoding}
1946 \section{Identifier Case}
1947 \label{datarep:identifiercase}
1949 The encodings of the constants used in the
1950 \DWATidentifiercase{} attribute are given in
1951 Table \refersec{tab:identifiercaseencodings}.
1954 \setlength{\extrarowheight}{0.1cm}
1955 \begin{longtable}{l|c}
1956 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
1957 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
1959 \bfseries Identifier case name&\bfseries Value\\ \hline
1961 \hline \emph{Continued on next page}
1965 \DWIDcasesensitive&0x00 \\
1967 \DWIDdowncase&0x02 \\
1968 \DWIDcaseinsensitive&0x03 \\
1972 \section{Calling Convention Encodings}
1973 \label{datarep:callingconventionencodings}
1974 The encodings of the constants used in the
1975 \DWATcallingconvention{} attribute are given in
1976 Table \refersec{tab:callingconventionencodings}.
1979 \setlength{\extrarowheight}{0.1cm}
1980 \begin{longtable}{l|c}
1981 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
1982 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
1984 \bfseries Calling convention name&\bfseries Value\\ \hline
1986 \hline \emph{Continued on next page}
1992 \DWCCprogram&0x02 \\
2000 \section{Inline Codes}
2001 \label{datarep:inlinecodes}
2003 The encodings of the constants used in
2004 \addtoindexx{inline attribute!encoding}
2006 \DWATinline{} attribute are given in
2007 Table \refersec{tab:inlineencodings}.
2011 \setlength{\extrarowheight}{0.1cm}
2012 \begin{longtable}{l|c}
2013 \caption{Inline encodings} \label{tab:inlineencodings}\\
2014 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2016 \bfseries Inline Code name&\bfseries Value\\ \hline
2018 \hline \emph{Continued on next page}
2023 \DWINLnotinlined&0x00 \\
2024 \DWINLinlined&0x01 \\
2025 \DWINLdeclarednotinlined&0x02 \\
2026 \DWINLdeclaredinlined&0x03 \\
2031 % this clearpage is ugly, but the following table came
2032 % out oddly without it.
2034 \section{Array Ordering}
2035 \label{datarep:arrayordering}
2037 The encodings of the constants used in the
2038 \DWATordering{} attribute are given in
2039 Table \refersec{tab:orderingencodings}.
2043 \setlength{\extrarowheight}{0.1cm}
2044 \begin{longtable}{l|c}
2045 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2046 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2048 \bfseries Ordering name&\bfseries Value\\ \hline
2050 \hline \emph{Continued on next page}
2055 \DWORDrowmajor&0x00 \\
2056 \DWORDcolmajor&0x01 \\
2062 \section{Discriminant Lists}
2063 \label{datarep:discriminantlists}
2065 The descriptors used in
2066 \addtoindexx{discriminant list attribute!encoding}
2068 \DWATdiscrlist{} attribute are
2069 encoded as 1\dash byte constants. The
2070 defined values are given in
2071 Table \refersec{tab:discriminantdescriptorencodings}.
2073 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2075 \setlength{\extrarowheight}{0.1cm}
2076 \begin{longtable}{l|c}
2077 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2078 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2080 \bfseries Descriptor name&\bfseries Value\\ \hline
2082 \hline \emph{Continued on next page}
2094 \section{Name Lookup Tables}
2095 \label{datarep:namelookuptables}
2097 Each set of entries in the table of global names contained
2098 in the \dotdebugpubnames{} and
2099 \dotdebugpubtypes{} sections begins
2100 with a header consisting of:
2101 \begin{enumerate}[1. ]
2103 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2104 \addttindexx{unit\_length}
2105 A 4\dash byte or 12\dash byte unsigned integer
2106 \addtoindexx{initial length}
2107 representing the length
2108 of the \dotdebuginfo{}
2109 contribution for that compilation unit,
2110 not including the length field itself. In the
2111 \thirtytwobitdwarfformat, this is a 4\dash byte unsigned integer (which must be less
2112 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
2113 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
2114 integer that gives the actual length
2115 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2117 \item version (\addtoindex{uhalf}) \\
2118 A 2\dash byte unsigned integer representing the version of the
2119 DWARF information for the name lookup table
2120 \addtoindexx{version number!name lookup table}
2121 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2122 The value in this field is 2.
2125 \item \addtoindex{debug\_info\_offset} (section offset) \\
2127 \addtoindexx{section offset!in name lookup table set of entries}
2128 4\dash byte or 8\dash byte
2131 section of the compilation unit header.
2132 In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned offset;
2133 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned offsets
2134 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2136 \item \addtoindex{debug\_info\_length} (\livelink{datarep:sectionoffsetlength}{section length}) \\
2137 \addtoindexx{section length!in .debug\_pubnames header}
2139 \addtoindexx{section length!in .debug\_pubtypes header}
2140 4\dash byte or 8\dash byte length containing the size in bytes of the
2141 contents of the \dotdebuginfo{}
2142 section generated to represent
2143 this compilation unit. In the \thirtytwobitdwarfformat, this is
2144 a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat, this
2145 is an 8-byte unsigned length
2146 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2151 This header is followed by a series of tuples. Each tuple
2152 consists of a 4\dash byte or 8\dash byte offset followed by a string
2153 of non\dash null bytes terminated by one null byte.
2155 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2156 format, it is an 8\dash byte offset.
2157 Each set is terminated by an
2158 offset containing the value 0.
2162 \section{Address Range Table}
2163 \label{datarep:addrssrangetable}
2165 Each set of entries in the table of address ranges contained
2166 in the \dotdebugaranges{}
2167 section begins with a header containing:
2168 \begin{enumerate}[1. ]
2169 % FIXME The unit length text is not fully consistent across
2172 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2173 \addttindexx{unit\_length}
2174 A 4-byte or 12-byte length containing the length of the
2175 \addtoindexx{initial length}
2176 set of entries for this compilation unit, not including the
2177 length field itself. In the \thirtytwobitdwarfformat, this is a
2178 4-byte unsigned integer (which must be less than \xfffffffzero);
2179 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2180 \wffffffff followed by an 8-byte unsigned integer that gives
2182 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2184 \item version (\addtoindex{uhalf}) \\
2185 A 2\dash byte version identifier representing the version of the
2186 DWARF information for the address range table
2187 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2188 This value in this field \addtoindexx{version number!address range table} is 2.
2191 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2193 \addtoindexx{section offset!in .debug\_aranges header}
2194 4\dash byte or 8\dash byte offset into the
2195 \dotdebuginfo{} section of
2196 the compilation unit header. In the \thirtytwobitdwarfformat,
2197 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2198 this is an 8\dash byte unsigned offset
2199 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2201 \item address\_size (ubyte) \\
2202 A 1\dash byte unsigned integer containing the size in bytes of an
2203 \addtoindexx{address\_size}
2205 \addtoindexx{size of an address}
2206 (or the offset portion of an address for segmented
2207 \addtoindexx{address space!segmented}
2208 addressing) on the target system.
2210 \item segment\_size (ubyte) \\
2212 \addtoindexx{segment\_size}
2213 1\dash byte unsigned integer containing the size in bytes of a
2214 segment selector on the target system.
2218 This header is followed by a series of tuples. Each tuple
2219 consists of a segment, an address and a length.
2221 size is given by the \addtoindex{segment\_size} field of the header; the
2222 address and length size are each given by the address\_size
2223 field of the header.
2224 The first tuple following the header in
2225 each set begins at an offset that is a multiple of the size
2226 of a single tuple (that is, the size of a segment selector
2227 plus twice the \addtoindex{size of an address}).
2228 The header is padded, if
2229 necessary, to that boundary. Each set of tuples is terminated
2230 by a 0 for the segment, a 0 for the address and 0 for the
2231 length. If the \addtoindex{segment\_size} field in the header is zero,
2232 the segment selectors are omitted from all tuples, including
2233 the terminating tuple.
2236 \section{Line Number Information}
2237 \label{datarep:linenumberinformation}
2239 The \addtoindexi{version number}{version number!line number information}
2240 in the line number program header is \versiondotdebugline{}
2241 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2243 The boolean values \doublequote{true} and \doublequote{false}
2244 used by the line number information program are encoded
2245 as a single byte containing the value 0
2246 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2248 The encodings for the standard opcodes are given in
2249 \addtoindexx{line number opcodes!standard opcode encoding}
2250 Table \refersec{tab:linenumberstandardopcodeencodings}.
2252 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2254 \setlength{\extrarowheight}{0.1cm}
2255 \begin{longtable}{l|c}
2256 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2257 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2259 \bfseries Opcode name&\bfseries Value\\ \hline
2261 \hline \emph{Continued on next page}
2267 \DWLNSadvancepc&0x02 \\
2268 \DWLNSadvanceline&0x03 \\
2269 \DWLNSsetfile&0x04 \\
2270 \DWLNSsetcolumn&0x05 \\
2271 \DWLNSnegatestmt&0x06 \\
2272 \DWLNSsetbasicblock&0x07 \\
2273 \DWLNSconstaddpc&0x08 \\
2274 \DWLNSfixedadvancepc&0x09 \\
2275 \DWLNSsetprologueend&0x0a \\*
2276 \DWLNSsetepiloguebegin&0x0b \\*
2277 \DWLNSsetisa&0x0c \\*
2284 The encodings for the extended opcodes are given in
2285 \addtoindexx{line number opcodes!extended opcode encoding}
2286 Table \refersec{tab:linenumberextendedopcodeencodings}.
2289 \setlength{\extrarowheight}{0.1cm}
2290 \begin{longtable}{l|c}
2291 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2292 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2294 \bfseries Opcode name&\bfseries Value\\ \hline
2296 \hline \emph{Continued on next page}
2301 \DWLNEendsequence &0x01 \\
2302 \DWLNEsetaddress &0x02 \\
2303 \DWLNEdefinefile &0x03 \\
2304 \DWLNEsetdiscriminator &0x04 \\
2305 \DWLNEdefinefileMDfive &0c05 \\
2306 \DWLNElouser &0x80 \\
2307 \DWLNEhiuser &\xff \\
2313 The encodings for the file entry format are given in
2314 \addtoindexx{line number opcodes!file entry format encoding}
2315 Table \refersec{tab:linenumberfileentryformatencodings}.
2318 \setlength{\extrarowheight}{0.1cm}
2319 \begin{longtable}{l|c}
2320 \caption{Line number file entry format \mbox{encodings}} \label{tab:linenumberfileentryformatencodings}\\
2321 \hline \bfseries File entry format name&\bfseries Value \\ \hline
2323 \bfseries File entry format name&\bfseries Value\\ \hline
2325 \hline \emph{Continued on next page}
2330 \DWLNFtimestampsize & 0x01 \\
2331 \DWLNFMDfive & 0x02 \\
2336 \section{Macro Information}
2337 \label{datarep:macroinformation}
2339 The source line numbers and source file indices encoded in the
2340 macro information section are represented as unsigned LEB128
2341 numbers as are the constants in a
2342 \DWMACINFOvendorext{} entry.
2344 The macinfo type is encoded as a single byte.
2346 \addtoindexx{macinfo types!encoding}
2348 Table \refersec{tab:macinfotypeencodings}.
2352 \setlength{\extrarowheight}{0.1cm}
2353 \begin{longtable}{l|c}
2354 \caption{Macinfo type encodings} \label{tab:macinfotypeencodings}\\
2355 \hline \bfseries Macinfo type name&\bfseries Value \\ \hline
2357 \bfseries Macinfo type name&\bfseries Value\\ \hline
2359 \hline \emph{Continued on next page}
2364 \DWMACINFOdefine&0x01 \\
2365 \DWMACINFOundef&0x02 \\
2366 \DWMACINFOstartfile&0x03 \\
2367 \DWMACINFOendfile&0x04 \\
2368 \DWMACINFOvendorext&\xff \\
2374 \section{Call Frame Information}
2375 \label{datarep:callframeinformation}
2377 In the \thirtytwobitdwarfformat, the value of the CIE id in the
2378 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
2379 value is \xffffffffffffffff.
2381 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2382 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2384 Call frame instructions are encoded in one or more bytes. The
2385 primary opcode is encoded in the high order two bits of
2386 the first byte (that is, opcode = byte $\gg$ 6). An operand
2387 or extended opcode may be encoded in the low order 6
2388 bits. Additional operands are encoded in subsequent bytes.
2389 The instructions and their encodings are presented in
2390 Table \refersec{tab:callframeinstructionencodings}.
2393 \setlength{\extrarowheight}{0.1cm}
2394 \begin{longtable}{l|c|c|l|l}
2395 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2396 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
2397 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2399 & \bfseries High 2 &\bfseries Low 6 & &\\
2400 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2402 \hline \emph{Continued on next page}
2407 \DWCFAadvanceloc&0x1&delta & \\
2408 \DWCFAoffset&0x2®ister&ULEB128 offset \\
2409 \DWCFArestore&0x3®ister & & \\
2410 \DWCFAnop&0&0 & & \\
2411 \DWCFAsetloc&0&0x01&address & \\
2412 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
2413 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
2414 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
2415 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
2416 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
2417 \DWCFAundefined&0&0x07&ULEB128 register & \\
2418 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
2419 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
2420 \DWCFArememberstate&0&0x0a & & \\
2421 \DWCFArestorestate&0&0x0b & & \\
2422 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
2423 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
2424 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
2425 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
2426 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
2428 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
2429 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
2430 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
2431 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
2432 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
2433 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
2434 \DWCFAlouser&0&0x1c & & \\
2435 \DWCFAhiuser&0&\xiiif & & \\
2439 \section{Non-contiguous Address Ranges}
2440 \label{datarep:noncontiguousaddressranges}
2442 Each entry in a \addtoindex{range list}
2443 (see Section \refersec{chap:noncontiguousaddressranges})
2445 \addtoindexx{base address selection entry!in range list}
2447 \addtoindexx{range list}
2448 a base address selection entry, or an end
2451 A \addtoindex{range list} entry consists of two relative addresses. The
2452 addresses are the same size as addresses on the target machine.
2454 A base address selection entry and an
2455 \addtoindexx{end of list entry!in range list}
2456 end of list entry each
2457 \addtoindexx{base address selection entry!in range list}
2458 consist of two (constant or relocated) addresses. The two
2459 addresses are the same size as addresses on the target machine.
2461 For a \addtoindex{range list} to be specified, the base address of the
2462 \addtoindexx{base address selection entry!in range list}
2463 corresponding compilation unit must be defined
2464 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2466 \section{String Offsets Table}
2467 \label{chap:stringoffsetstable}
2468 Each set of entries in the string offsets table contained in the
2469 \dotdebugstroffsets{} section begins with a header containing:
2470 \begin{enumerate}[1. ]
2471 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2472 A 4-byte or 12-byte length containing the length of
2473 the set of entries for this compilation unit, not
2474 including the length field itself. In the 32-bit
2475 DWARF format, this is a 4-byte unsigned integer
2476 (which must be less than \xfffffffzero); in the 64-bit
2477 DWARF format, this consists of the 4-byte value
2478 \wffffffff followed by an 8-byte unsigned integer
2479 that gives the actual length (see
2480 Section \refersec{datarep:32bitand64bitdwarfformats}).
2482 \item \texttt{version} (\addtoindex{uhalf}) \\
2483 A 2-byte version identifier containing the value
2484 \versiondotdebugstroffsets{}
2485 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2486 \item \texttt{padding} (\addtoindex{uhalf}) \\
2489 This header is followed by a series of string table offsets.
2490 For the 32-bit DWARF format, each offset is 4 bytes long; for
2491 the 64-bit DWARF format, each offset is 8 bytes long.
2493 The \DWATstroffsetsbase{} attribute points to the first
2494 entry following the header. The entries are indexed
2495 sequentially from this base entry, starting from 0.
2497 \section{Address Table}
2498 \label{chap:addresstable}
2499 Each set of entries in the address table contained in the
2500 \dotdebugaddr{} section begins with a header containing:
2501 \begin{enumerate}[1. ]
2502 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2503 A 4-byte or 12-byte length containing the length of
2504 the set of entries for this compilation unit, not
2505 including the length field itself. In the 32-bit
2506 DWARF format, this is a 4-byte unsigned integer
2507 (which must be less than \xfffffffzero); in the 64-bit
2508 DWARF format, this consists of the 4-byte value
2509 \wffffffff followed by an 8-byte unsigned integer
2510 that gives the actual length (see
2511 Section \refersec{datarep:32bitand64bitdwarfformats}).
2514 \item \texttt{version} (\addtoindex{uhalf}) \\
2515 A 2-byte version identifier containing the value
2516 \versiondotdebugaddr{}
2517 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2520 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2521 A 1-byte unsigned integer containing the size in
2522 bytes of an address (or the offset portion of an
2523 address for segmented addressing) on the target
2527 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2528 A 1-byte unsigned integer containing the size in
2529 bytes of a segment selector on the target system.
2532 This header is followed by a series of segment/address pairs.
2533 The segment size is given by the \texttt{segment\_size} field of the
2534 header, and the address size is given by the \texttt{address\_size}
2535 field of the header. If the \texttt{segment\_size} field in the header
2536 is zero, the entries consist only of an addresses.
2538 The \DWATaddrbase{} attribute points to the first entry
2539 following the header. The entries are indexed sequentially
2540 from this base entry, starting from 0.
2542 \section{Range List Table}
2543 \label{app:rangelisttable}
2544 Each set of entries in the range list table contained in the
2545 \dotdebugranges{} section begins with a header containing:
2546 \begin{enumerate}[1. ]
2547 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2548 A 4-byte or 12-byte length containing the length of
2549 the set of entries for this compilation unit, not
2550 including the length field itself. In the 32-bit
2551 DWARF format, this is a 4-byte unsigned integer
2552 (which must be less than \xfffffffzero); in the 64-bit
2553 DWARF format, this consists of the 4-byte value
2554 \wffffffff followed by an 8-byte unsigned integer
2555 that gives the actual length (see
2556 Section \refersec{datarep:32bitand64bitdwarfformats}).
2559 \item \texttt{version} (\addtoindex{uhalf}) \\
2560 A 2-byte version identifier containing the value
2561 \versiondotdebugranges{}
2562 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2565 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2566 A 1-byte unsigned integer containing the size in
2567 bytes of an address (or the offset portion of an
2568 address for segmented addressing) on the target
2572 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2573 A 1-byte unsigned integer containing the size in
2574 bytes of a segment selector on the target system.
2577 This header is followed by a series of range list entries as
2578 described in Section \refersec{chap:locationlists}.
2579 The segment size is given by the
2580 \texttt{segment\_size} field of the header, and the address size is
2581 given by the \texttt{address\_size} field of the header. If the
2582 \texttt{segment\_size} field in the header is zero, the segment
2583 selector is omitted from the range list entries.
2585 The \DWATrangesbase{} attribute points to the first entry
2586 following the header. The entries are referenced by a byte
2587 offset relative to this base address.
2590 \section{Location List Table}
2591 \label{datarep:locationlisttable}
2592 Each set of entries in the location list table contained in the
2593 \dotdebugloc{} or \dotdebuglocdwo{}sections begins with a header containing:
2594 \begin{enumerate}[1. ]
2595 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2596 A 4-byte or 12-byte length containing the length of
2597 the set of entries for this compilation unit, not
2598 including the length field itself. In the 32-bit
2599 DWARF format, this is a 4-byte unsigned integer
2600 (which must be less than \xfffffffzero); in the 64-bit
2601 DWARF format, this consists of the 4-byte value
2602 \wffffffff followed by an 8-byte unsigned integer
2603 that gives the actual length (see
2604 Section \refersec{datarep:32bitand64bitdwarfformats}).
2607 \item \texttt{version} (\addtoindex{uhalf}) \\
2608 A 2-byte version identifier containing the value
2609 \versiondotdebugloc{}
2610 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2613 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2614 A 1-byte unsigned integer containing the size in
2615 bytes of an address (or the offset portion of an
2616 address for segmented addressing) on the target
2620 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2621 A 1-byte unsigned integer containing the size in
2622 bytes of a segment selector on the target system.
2625 This header is followed by a series of location list entries as
2626 described in Section \refersec{chap:locationlists}.
2627 The segment size is given by the
2628 \texttt{segment\_size} field of the header, and the address size is
2629 given by the \texttt{address\_size} field of the header. If the
2630 \texttt{segment\_size} field in the header is zero, the segment
2631 selector is omitted from the range list entries.
2633 The entries are referenced by a byte offset relative to the first
2634 location list following this header.
2637 \section{Dependencies and Constraints}
2638 \label{datarep:dependenciesandconstraints}
2640 The debugging information in this format is intended to
2642 \addtoindexx{DWARF section names!list of}
2652 \dotdebugpubnames{},
2653 \dotdebugpubtypes{},
2656 \dotdebugstroffsets{}
2659 sections of an object file, or equivalent
2660 separate file or database. The information is not
2661 word\dash aligned. Consequently:
2664 \item For the \thirtytwobitdwarfformat{} and a target architecture with
2665 32\dash bit addresses, an assembler or compiler must provide a way
2666 to produce 2\dash byte and 4\dash byte quantities without alignment
2667 restrictions, and the linker must be able to relocate a
2668 4\dash byte address or
2669 \addtoindexx{section offset!alignment of}
2670 section offset that occurs at an arbitrary
2673 \item For the \thirtytwobitdwarfformat{} and a target architecture with
2674 64\dash bit addresses, an assembler or compiler must provide a
2675 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2676 alignment restrictions, and the linker must be able to relocate
2677 an 8\dash byte address or 4\dash byte
2678 \addtoindexx{section offset!alignment of}
2679 section offset that occurs at an
2680 arbitrary alignment.
2682 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
2683 32\dash bit addresses, an assembler or compiler must provide a
2684 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2685 alignment restrictions, and the linker must be able to relocate
2686 a 4\dash byte address or 8\dash byte
2687 \addtoindexx{section offset!alignment of}
2688 section offset that occurs at an
2689 arbitrary alignment.
2691 \textit{It is expected that this will be required only for very large
2692 32\dash bit programs or by those architectures which support
2693 a mix of 32\dash bit and 64\dash bit code and data within the same
2696 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
2697 64\dash bit addresses, an assembler or compiler must provide a
2698 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2699 alignment restrictions, and the linker must be able to
2700 relocate an 8\dash byte address or
2701 \addtoindexx{section offset!alignment of}
2702 section offset that occurs at
2703 an arbitrary alignment.
2706 \section{Integer Representation Names}
2707 \label{datarep:integerrepresentationnames}
2709 The sizes of the integers used in the lookup by name, lookup
2710 by address, line number and call frame information sections
2712 Table \ref{tab:integerrepresentationnames}.
2716 \setlength{\extrarowheight}{0.1cm}
2717 \begin{longtable}{c|l}
2718 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
2719 \hline \bfseries Representation name&\bfseries Representation \\ \hline
2721 \bfseries Representation name&\bfseries Representation\\ \hline
2723 \hline \emph{Continued on next page}
2728 \addtoindex{sbyte}& signed, 1\dash byte integer \\
2729 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
2730 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
2731 \addtoindex{uword}&unsigned, 4\dash byte integer \\
2737 \section{Type Signature Computation}
2738 \label{datarep:typesignaturecomputation}
2740 A type signature is computed only by the DWARF producer;
2741 \addtoindexx{type signature computation}
2742 it is used by a DWARF consumer to resolve type references to
2743 the type definitions that are contained in
2744 \addtoindexx{type unit}
2747 The type signature for a type T0 is formed from the
2748 \addtoindex{MD5 hash}
2749 of a flattened description of the type. The flattened
2750 description of the type is a byte sequence derived from the
2751 DWARF encoding of the type as follows:
2752 \begin{enumerate}[1. ]
2754 \item Start with an empty sequence S and a list V of visited
2755 types, where V is initialized to a list containing the type
2756 T0 as its single element. Elements in V are indexed from 1,
2759 \item If the debugging information entry represents a type that
2760 is nested inside another type or a namespace, append to S
2761 the type\textquoteright s context as follows: For each surrounding type
2762 or namespace, beginning with the outermost such construct,
2763 append the letter 'C', the DWARF tag of the construct, and
2764 the name (taken from
2765 \addtoindexx{name attribute}
2766 the \DWATname{} attribute) of the type
2767 \addtoindexx{name attribute}
2768 or namespace (including its trailing null byte).
2770 \item Append to S the letter 'D', followed by the DWARF tag of
2771 the debugging information entry.
2773 \item For each of the attributes in
2774 Table \refersec{tab:attributesusedintypesignaturecomputation}
2776 the debugging information entry, in the order listed,
2777 append to S a marker letter (see below), the DWARF attribute
2778 code, and the attribute value.
2781 \caption{Attributes used in type signature computation}
2782 \label{tab:attributesusedintypesignaturecomputation}
2783 \simplerule[\textwidth]
2785 \autocols[0pt]{c}{2}{l}{
2800 \DWATcontainingtype,
2804 \DWATdatamemberlocation,
2826 \DWATstringlengthbitsize,
2827 \DWATstringlengthbytesize,
2832 \DWATvariableparameter,
2835 \DWATvtableelemlocation
2838 \simplerule[\textwidth]
2841 Note that except for the initial
2842 \DWATname{} attribute,
2843 \addtoindexx{name attribute}
2844 attributes are appended in order according to the alphabetical
2845 spelling of their identifier.
2847 If an implementation defines any vendor-specific attributes,
2848 any such attributes that are essential to the definition of
2849 the type should also be included at the end of the above list,
2850 in their own alphabetical suborder.
2852 An attribute that refers to another type entry T is processed
2853 as follows: (a) If T is in the list V at some V[x], use the
2854 letter 'R' as the marker and use the unsigned LEB128 encoding
2855 of x as the attribute value; otherwise, (b) use the letter 'T'
2856 as the marker, process the type T recursively by performing
2857 Steps 2 through 7, and use the result as the attribute value.
2859 Other attribute values use the letter 'A' as the marker, and
2860 the value consists of the form code (encoded as an unsigned
2861 LEB128 value) followed by the encoding of the value according
2862 to the form code. To ensure reproducibility of the signature,
2863 the set of forms used in the signature computation is limited
2864 to the following: \DWFORMsdata,
2869 \item If the tag in Step 3 is one of \DWTAGpointertype,
2870 \DWTAGreferencetype,
2871 \DWTAGrvaluereferencetype,
2872 \DWTAGptrtomembertype,
2873 or \DWTAGfriend, and the referenced
2874 type (via the \DWATtype{} or
2875 \DWATfriend{} attribute) has a
2876 \DWATname{} attribute, append to S the letter 'N', the DWARF
2877 attribute code (\DWATtype{} or
2878 \DWATfriend), the context of
2879 the type (according to the method in Step 2), the letter 'E',
2880 and the name of the type. For \DWTAGfriend, if the referenced
2881 entry is a \DWTAGsubprogram, the context is omitted and the
2882 name to be used is the ABI-specific name of the subprogram
2883 (e.g., the mangled linker name).
2886 \item If the tag in Step 3 is not one of \DWTAGpointertype,
2887 \DWTAGreferencetype,
2888 \DWTAGrvaluereferencetype,
2889 \DWTAGptrtomembertype, or
2890 \DWTAGfriend, but has
2891 a \DWATtype{} attribute, or if the referenced type (via
2893 \DWATfriend{} attribute) does not have a
2894 \DWATname{} attribute, the attribute is processed according to
2895 the method in Step 4 for an attribute that refers to another
2899 \item Visit each child C of the debugging information
2900 entry as follows: If C is a nested type entry or a member
2901 function entry, and has
2902 a \DWATname{} attribute, append to
2903 \addtoindexx{name attribute}
2904 S the letter 'S', the tag of C, and its name; otherwise,
2905 process C recursively by performing Steps 3 through 7,
2906 appending the result to S. Following the last child (or if
2907 there are no children), append a zero byte.
2912 For the purposes of this algorithm, if a debugging information
2914 \DWATspecification{}
2915 attribute that refers to
2916 another entry D (which has a
2919 then S inherits the attributes and children of D, and S is
2920 processed as if those attributes and children were present in
2921 the entry S. Exception: if a particular attribute is found in
2922 both S and D, the attribute in S is used and the corresponding
2923 one in D is ignored.
2925 DWARF tag and attribute codes are appended to the sequence
2926 as unsigned LEB128 values, using the values defined earlier
2929 \textit{A grammar describing this computation may be found in
2930 Appendix \refersec{app:typesignaturecomputationgrammar}.
2933 \textit{An attribute that refers to another type entry should
2934 be recursively processed or replaced with the name of the
2935 referent (in Step 4, 5 or 6). If neither treatment applies to
2936 an attribute that references another type entry, the entry
2937 that contains that attribute should not be considered for a
2938 separate \addtoindex{type unit}.}
2940 \textit{If a debugging information entry contains an attribute from
2941 the list above that would require an unsupported form, that
2942 entry should not be considered for a separate
2943 \addtoindex{type unit}.}
2945 \textit{A type should be considered for a separate
2946 \addtoindex{type unit} only
2947 if all of the type entries that it contains or refers to in
2948 Steps 6 and 7 can themselves each be considered for a separate
2949 \addtoindex{type unit}.}
2952 Where the DWARF producer may reasonably choose two or more
2953 different forms for a given attribute, it should choose
2954 the simplest possible form in computing the signature. (For
2955 example, a constant value should be preferred to a location
2956 expression when possible.)
2958 Once the string S has been formed from the DWARF encoding,
2959 an \addtoindex{MD5 hash} is computed for the string and the
2960 least significant 64 bits are taken as the type signature.
2962 \textit{The string S is intended to be a flattened representation of
2963 the type that uniquely identifies that type (i.e., a different
2964 type is highly unlikely to produce the same string).}
2966 \textit{A debugging information entry should not be placed in a
2967 separate \addtoindex{type unit}
2968 if any of the following apply:}
2972 \item \textit{The entry has an attribute whose value is a location
2973 expression, and the location expression contains a reference to
2974 another debugging information entry (e.g., a \DWOPcallref{}
2975 operator), as it is unlikely that the entry will remain
2976 identical across compilation units.}
2978 \item \textit{The entry has an attribute whose value refers
2979 to a code location or a \addtoindex{location list}.}
2981 \item \textit{The entry has an attribute whose value refers
2982 to another debugging information entry that does not represent
2988 \textit{Certain attributes are not included in the type signature:}
2991 \item \textit{The \DWATdeclaration{} attribute is not included because it
2992 indicates that the debugging information entry represents an
2993 incomplete declaration, and incomplete declarations should
2995 \addtoindexx{type unit}
2996 separate type units.}
2998 \item \textit{The \DWATdescription{} attribute is not included because
2999 it does not provide any information unique to the defining
3000 declaration of the type.}
3002 \item \textit{The \DWATdeclfile,
3004 \DWATdeclcolumn{} attributes are not included because they
3005 may vary from one source file to the next, and would prevent
3006 two otherwise identical type declarations from producing the
3007 \addtoindexx{MD5 hash}
3010 \item \textit{The \DWATobjectpointer{} attribute is not included
3011 because the information it provides is not necessary for the
3012 computation of a unique type signature.}
3016 \textit{Nested types and some types referred to by a debugging
3017 information entry are encoded by name rather than by recursively
3018 encoding the type to allow for cases where a complete definition
3019 of the type might not be available in all compilation units.}
3021 \textit{If a type definition contains the definition of a member function,
3022 it cannot be moved as is into a type unit, because the member function
3023 contains attributes that are unique to that compilation unit.
3024 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3025 moving the member function declaration into a separate declaration tree,
3026 and replacing the function definition in the type with a non-defining
3027 declaration of the function (as if the function had been defined out of
3030 An example that illustrates the computation of an MD5 hash may be found in
3031 Appendix \refersec{app:usingtypeunits}.