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, Split, Executable and Shared Objects}
130 \label{datarep:executableobjectsandsharedobjects}
132 \subsection{Relocatable Objects}
134 \subsection{Split DWARF Objects}
135 \label{datarep:splitdwarfobjects}
136 A DWARF producer may partition the debugging
137 information such that the majority of the debugging
138 information can remain in individual object files without
139 being processed by the linker. The first partition contains
140 debugging information that must still be processed by the linker,
141 and includes the following:
144 The line number tables, range tables, frame tables, and
145 accelerated access tables, in the usual sections:
146 \dotdebugline, \dotdebugranges, \dotdebugframe,
147 \dotdebugpubnames, \dotdebugpubtypes{} and \dotdebugaranges,
150 An address table, in the \dotdebugaddr{} section. This table
151 contains all addresses and constants that require
152 link-time relocation, and items in the table can be
153 referenced indirectly from the debugging information via
154 the \DWFORMaddrx{} form, and by the \DWOPaddrx{} and
155 \DWOPconstx{} operators.
157 A skeleton compilation unit, as described in Section
158 \refersec{chap:skeletoncompilationunitentries},
159 in the \dotdebuginfo{} section.
161 An abbreviations table for the skeleton compilation unit,
162 in the \dotdebugabbrev{} section.
164 A string table, in the \dotdebugstr{} section. The string
165 table is necessary only if the skeleton compilation unit
166 uses either indirect string form, \DWFORMstrp{} or
169 A string offsets table, in the \dotdebugstroffsets{}
170 section. The string offsets table is necessary only if
171 the skeleton compilation unit uses the \DWFORMstrx{} form.
173 The attributes contained in the skeleton compilation
174 unit can be used by a DWARF consumer to find the object file
175 or DWARF object file that contains the second partition.
177 The second partition contains the debugging information that
178 does not need to be processed by the linker. These sections
179 may be left in the object files and ignored by the linker
180 (i.e., not combined and copied to the executable object), or
181 they may be placed by the producer in a separate DWARF object
182 file. This partition includes the following:
185 The full compilation unit, in the \dotdebuginfodwo{} section.
186 Attributes in debugging information entries may refer to
187 machine addresses indirectly using the \DWFORMaddrx{} form,
188 and location expressions may do so using the \DWOPaddrx{} and
189 \DWOPconstx{} forms. Attributes may refer to range table
190 entries with an offset relative to a base offset in the
191 range table for the compilation unit.
193 \item Separate type units, in the \dotdebugtypesdwo{} section.
196 Abbreviations table(s) for the compilation unit and type
197 units, in the \dotdebugabbrevdwo{} section.
199 \item Location lists, in the \dotdebuglocdwo{} section.
202 A skeleton line table (for the type units), in the
203 \dotdebuglinedwo{} section (see
204 Section \refersec{chap:skeletoncompilationunitentries}).
206 \item Macro information, in the \dotdebugmacinfodwo{} section.
208 \item A string table, in the \dotdebugstrdwo{} section.
210 \item A string offsets table, in the \dotdebugstroffsetsdwo{}
214 Except where noted otherwise, all references in this document
215 to a debugging information section (for example, \dotdebuginfo),
216 applies also to the corresponding split DWARF section (for example,
219 \subsection{Executable Objects}
220 \label{chap:executableobjects}
221 The relocated addresses in the debugging information for an
222 executable object are virtual addresses.
224 \subsection{Shared Objects}
225 \label{datarep:sharedobjects}
227 addresses in the debugging information for a shared object
228 are offsets relative to the start of the lowest region of
229 memory loaded from that shared object.
231 \textit{This requirement makes the debugging information for
232 shared objects position independent. Virtual addresses in a
233 shared object may be calculated by adding the offset to the
234 base address at which the object was attached. This offset
235 is available in the run\dash time linker\textquoteright s data structures.}
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.
350 \item In the body of the \dotdebugstroffsets{} and \dotdebugstroffsetsdwo{}
351 sections, the size of entries in the body depend on the DWARF
352 format as follows: in the 32-bit DWARF format, entries are 32-bit
353 unsigned integer values; in the 64-bit DWARF format, they are
354 64-bit unsigned integers.
356 \item In the body of the \dotdebugaddr{}, \dotdebugloc{} and \dotdebugranges{}
357 sections, the contents of the address size fields depends on the
358 DWARF format as follows: in the 32-bit DWARF format, these fields
359 contain 4; in the 64-bit DWARF format these fields contain 8.
363 The 32\dash bit and 64\dash bit DWARF format conventions must \emph{not} be
364 intermixed within a single compilation unit.
366 \textit{Attribute values and section header fields that represent
367 addresses in the target program are not affected by these
370 A DWARF consumer that supports the 64\dash bit DWARF format must
371 support executables in which some compilation units use the
372 32\dash bit format and others use the 64\dash bit format provided that
373 the combination links correctly (that is, provided that there
374 are no link\dash time errors due to truncation or overflow). (An
375 implementation is not required to guarantee detection and
376 reporting of all such errors.)
378 \textit{It is expected that DWARF producing compilers will \emph{not} use
379 the 64\dash bit format \emph{by default}. In most cases, the division of
380 even very large applications into a number of executable and
381 shared objects will suffice to assure that the DWARF sections
382 within each individual linked object are less than 4 GBytes
383 in size. However, for those cases where needed, the 64\dash bit
384 format allows the unusual case to be handled as well. Even
385 in this case, it is expected that only application supplied
386 objects will need to be compiled using the 64\dash bit format;
387 separate 32\dash bit format versions of system supplied shared
388 executable libraries can still be used.}
392 \section{Format of Debugging Information}
393 \label{datarep:formatofdebugginginformation}
395 For each compilation unit compiled with a DWARF producer,
396 a contribution is made to the \dotdebuginfo{} section of
397 the object file. Each such contribution consists of a
398 compilation unit header
399 (see Section \refersec{datarep:compilationunitheader})
401 single \DWTAGcompileunit{} or
402 \DWTAGpartialunit{} debugging
403 information entry, together with its children.
405 For each type defined in a compilation unit, a contribution may
406 be made to the \dotdebugtypes{}
407 section of the object file. Each
408 such contribution consists of a
409 \addtoindex{type unit} header
410 (see Section \refersec{datarep:typeunitheader})
411 followed by a \DWTAGtypeunit{} entry, together with
414 Each debugging information entry begins with a code that
415 represents an entry in a separate
416 \addtoindex{abbreviations table}. This
417 code is followed directly by a series of attribute values.
419 The appropriate entry in the
420 \addtoindex{abbreviations table} guides the
421 interpretation of the information contained directly in the
423 \dotdebugtypes{} section.
426 Multiple debugging information entries may share the same
427 abbreviation table entry. Each compilation unit is associated
428 with a particular abbreviation table, but multiple compilation
429 units may share the same table.
430 \subsection{Unit Headers}
431 \label{datarep:unitheaders}
433 \subsubsection{Compilation Unit Header}
434 \label{datarep:compilationunitheader}
435 \begin{enumerate}[1. ]
437 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
438 \addttindexx{unit\_length}
439 A 4\dash byte or 12\dash byte
440 \addtoindexx{initial length}
441 unsigned integer representing the length
442 of the \dotdebuginfo{}
443 contribution for that compilation unit,
444 not including the length field itself. In the \thirtytwobitdwarfformat,
445 this is a 4\dash byte unsigned integer (which must be less
446 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
447 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
448 integer that gives the actual length
449 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
452 \item \texttt{version} (\addtoindex{uhalf}) \\
453 A 2\dash byte unsigned integer representing the version of the
454 DWARF information for the compilation unit \addtoindexx{version number!compilation unit}
455 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
456 The value in this field is 4.
458 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
460 \addtoindexx{section offset!in .debug\_info header}
461 4\dash byte or 8\dash byte unsigned offset into the
463 section. This offset associates the compilation unit with a
464 particular set of debugging information entry abbreviations. In
465 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
466 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
467 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
469 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
470 A 1\dash byte unsigned integer representing the size in bytes of
471 \addttindexx{address\_size}
472 an address on the target architecture. If the system uses
473 \addtoindexx{address space!segmented}
474 segmented addressing, this value represents the size of the
475 offset portion of an address.
480 \subsubsection{Type Unit Header}
481 \label{datarep:typeunitheader}
483 The header for the series of debugging information entries
484 contributing to the description of a type that has been
485 placed in its own \addtoindex{type unit}, within the
486 \dotdebugtypes{} section,
487 consists of the following information:
488 \begin{enumerate}[1. ]
490 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
491 \addttindexx{unit\_length}
492 A 4\dash byte or 12\dash byte unsigned integer
493 \addtoindexx{initial length}
494 representing the length
495 of the \dotdebugtypes{} contribution for that type unit,
496 not including the length field itself. In the \thirtytwobitdwarfformat,
497 this is a 4\dash byte unsigned integer (which must be
498 less than \xfffffffzero); in the \sixtyfourbitdwarfformat, this
499 consists of the 4\dash byte value \wffffffff followed by an
500 8\dash byte unsigned integer that gives the actual length
501 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
504 \item \texttt{version} (\addtoindex{uhalf}) \\
505 A 2\dash byte unsigned integer representing the version of the
506 DWARF information for the
507 type unit\addtoindexx{version number!type unit}
508 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
509 The value in this field is 4.
511 \item \addttindex{debug\_abbrev\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
513 \addtoindexx{section offset!in .debug\_types header}
514 4\dash byte or 8\dash byte unsigned offset into the
516 section. This offset associates the type unit with a
517 particular set of debugging information entry abbreviations. In
518 the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned length;
519 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned length
520 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
522 \item \texttt{address\_size} (ubyte) \\
523 A 1\dash byte unsigned integer representing the size
524 \addtoindexx{size of an address}
526 \addttindexx{address\_size}
527 an address on the target architecture. If the system uses
528 \addtoindexx{address space!segmented}
529 segmented addressing, this value represents the size of the
530 offset portion of an address.
532 \item \texttt{type\_signature} (8\dash byte unsigned integer) \\
533 \addtoindexx{type signature}
535 \addttindexx{type\_signature}
536 64\dash bit unique signature (see Section
537 \refersec{datarep:typesignaturecomputation})
538 of the type described in this type
541 \textit{An attribute that refers (using
542 \DWFORMrefsigeight{}) to
543 the primary type contained in this
544 \addtoindex{type unit} uses this value.}
546 \item \texttt{type\_offset} (\livelink{datarep:sectionoffsetlength}{section offset}) \\
547 \addttindexx{type\_offset}
548 A 4\dash byte or 8\dash byte unsigned offset
549 \addtoindexx{section offset!in .debug\_types header}
550 relative to the beginning
551 of the \addtoindex{type unit} header.
552 This offset refers to the debugging
553 information entry that describes the type. Because the type
554 may be nested inside a namespace or other structures, and may
555 contain references to other types that have not been placed in
556 separate type units, it is not necessarily either the first or
557 the only entry in the type unit. In the \thirtytwobitdwarfformat,
558 this is a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat,
559 this is an 8\dash byte unsigned length
560 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
564 \subsection{Debugging Information Entry}
565 \label{datarep:debugginginformationentry}
567 Each debugging information entry begins with an unsigned LEB128
568 number containing the abbreviation code for the entry. This
569 code represents an entry within the abbreviations table
570 associated with the compilation unit containing this entry. The
571 abbreviation code is followed by a series of attribute values.
573 On some architectures, there are alignment constraints on
574 section boundaries. To make it easier to pad debugging
575 information sections to satisfy such constraints, the
576 abbreviation code 0 is reserved. Debugging information entries
577 consisting of only the abbreviation code 0 are considered
580 \subsection{Abbreviations Tables}
581 \label{datarep:abbreviationstables}
583 The abbreviations tables for all compilation units
584 are contained in a separate object file section called
586 As mentioned before, multiple compilation
587 units may share the same abbreviations table.
589 The abbreviations table for a single compilation unit consists
590 of a series of abbreviation declarations. Each declaration
591 specifies the tag and attributes for a particular form of
592 debugging information entry. Each declaration begins with
593 an unsigned LEB128 number representing the abbreviation
594 code itself. It is this code that appears at the beginning
595 of a debugging information entry in the
598 section. As described above, the abbreviation
599 code 0 is reserved for null debugging information entries. The
600 abbreviation code is followed by another unsigned LEB128
601 number that encodes the entry\textquoteright s tag. The encodings for the
602 tag names are given in
603 Table \refersec{tab:tagencodings}.
606 \setlength{\extrarowheight}{0.1cm}
607 \begin{longtable}{l|l}
609 \caption{Tag encodings} \label{tab:tagencodings} \\
610 \hline \bfseries Tag name&\bfseries Value\\ \hline
612 \bfseries Tag name&\bfseries Value \\ \hline
614 \hline \emph{Continued on next page}
616 \hline \ddag\ \textit{New in DWARF Version 5}
618 \DWTAGarraytype{} &0x01 \\
619 \DWTAGclasstype&0x02 \\
620 \DWTAGentrypoint&0x03 \\
621 \DWTAGenumerationtype&0x04 \\
622 \DWTAGformalparameter&0x05 \\
623 \DWTAGimporteddeclaration&0x08 \\
625 \DWTAGlexicalblock&0x0b \\
627 \DWTAGpointertype&0x0f \\
628 \DWTAGreferencetype&0x10 \\
629 \DWTAGcompileunit&0x11 \\
630 \DWTAGstringtype&0x12 \\
631 \DWTAGstructuretype&0x13 \\
632 \DWTAGsubroutinetype&0x15 \\
633 \DWTAGtypedef&0x16 \\
634 \DWTAGuniontype&0x17 \\
635 \DWTAGunspecifiedparameters&0x18 \\
636 \DWTAGvariant&0x19 \\
637 \DWTAGcommonblock&0x1a \\
638 \DWTAGcommoninclusion&0x1b \\
639 \DWTAGinheritance&0x1c \\
640 \DWTAGinlinedsubroutine&0x1d \\
642 \DWTAGptrtomembertype&0x1f \\
643 \DWTAGsettype&0x20 \\
644 \DWTAGsubrangetype&0x21 \\
645 \DWTAGwithstmt&0x22 \\
646 \DWTAGaccessdeclaration&0x23 \\
647 \DWTAGbasetype&0x24 \\
648 \DWTAGcatchblock&0x25 \\
649 \DWTAGconsttype&0x26 \\
650 \DWTAGconstant&0x27 \\
651 \DWTAGenumerator&0x28 \\
652 \DWTAGfiletype&0x29 \\
654 \DWTAGnamelist&0x2b \\
655 \DWTAGnamelistitem&0x2c \\
656 \DWTAGpackedtype&0x2d \\
657 \DWTAGsubprogram&0x2e \\
658 \DWTAGtemplatetypeparameter&0x2f \\
659 \DWTAGtemplatevalueparameter&0x30 \\
660 \DWTAGthrowntype&0x31 \\
661 \DWTAGtryblock&0x32 \\
662 \DWTAGvariantpart&0x33 \\
663 \DWTAGvariable&0x34 \\
664 \DWTAGvolatiletype&0x35 \\
665 \DWTAGdwarfprocedure&0x36 \\
666 \DWTAGrestricttype&0x37 \\
667 \DWTAGinterfacetype&0x38 \\
668 \DWTAGnamespace&0x39 \\
669 \DWTAGimportedmodule&0x3a \\
670 \DWTAGunspecifiedtype&0x3b \\
671 \DWTAGpartialunit&0x3c \\
672 \DWTAGimportedunit&0x3d \\
673 \DWTAGcondition&\xiiif \\
674 \DWTAGsharedtype&0x40 \\
675 \DWTAGtypeunit{} &0x41 \\
676 \DWTAGrvaluereferencetype{} &0x42 \\
677 \DWTAGtemplatealias{} &0x43 \\
678 \DWTAGcoarraytype~\ddag &0x44 \\
679 \DWTAGgenericsubrange~\ddag &0x45 \\
680 \DWTAGdynamictype~\ddag & 0x46 \\
681 \DWTAGlouser&0x4080 \\
682 \DWTAGhiuser&\xffff \\
686 Following the tag encoding is a 1\dash byte value that determines
687 whether a debugging information entry using this abbreviation
688 has child entries or not. If the value is
690 the next physically succeeding entry of any debugging
691 information entry using this abbreviation is the first
692 child of that entry. If the 1\dash byte value following the
693 abbreviation\textquoteright s tag encoding is
694 \DWCHILDRENnoTARG, the next
695 physically succeeding entry of any debugging information entry
696 using this abbreviation is a sibling of that entry. (Either
697 the first child or sibling entries may be null entries). The
698 encodings for the child determination byte are given in
699 Table \refersec{tab:childdeterminationencodings}
701 Section \refersec{chap:relationshipofdebugginginformationentries},
702 each chain of sibling entries is terminated by a null entry.)
706 \setlength{\extrarowheight}{0.1cm}
707 \begin{longtable}{l|l}
708 \caption{Child determination encodings}
709 \label{tab:childdeterminationencodings}
710 \addtoindexx{Child determination encodings} \\
711 \hline \bfseries Children determination name&\bfseries Value \\ \hline
713 \bfseries Children determination name&\bfseries Value \\ \hline
715 \hline \emph{Continued on next page}
719 \DWCHILDRENno&0x00 \\
720 \DWCHILDRENyes&0x01 \\ \hline
725 Finally, the child encoding is followed by a series of
726 attribute specifications. Each attribute specification
727 consists of two parts. The first part is an unsigned LEB128
728 number representing the attribute\textquoteright s name. The second part
729 is an unsigned LEB128 number representing the attribute\textquoteright s
730 form. The series of attribute specifications ends with an
731 entry containing 0 for the name and 0 for the form.
734 \DWFORMindirectTARG{} is a special case. For
735 attributes with this form, the attribute value itself in the
738 section begins with an unsigned
739 LEB128 number that represents its form. This allows producers
740 to choose forms for particular attributes
741 \addtoindexx{abbreviations table!dynamic forms in}
743 without having to add a new entry to the abbreviations table.
745 The abbreviations for a given compilation unit end with an
746 entry consisting of a 0 byte for the abbreviation code.
749 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
750 for a depiction of the organization of the
751 debugging information.}
754 \subsection{Attribute Encodings}
755 \label{datarep:attributeencodings}
757 The encodings for the attribute names are given in
758 Table \refersec{tab:attributeencodings}.
760 The attribute form governs how the value of the attribute is
761 encoded. There are nine classes of form, listed below. Each
762 class is a set of forms which have related representations
763 and which are given a common interpretation according to the
764 attribute in which the form is used.
766 Form \DWFORMsecoffsetTARG{}
768 \addtoindexx{rangelistptr class}
770 \addtoindexx{macptr class}
772 \addtoindexx{loclistptr class}
774 \addtoindexx{lineptr class}
775 namely \livelink{chap:classlineptr}{lineptr},
776 \livelink{chap:classloclistptr}{loclistptr},
777 \livelink{chap:classmacptr}{macptr} or
778 \livelink{chap:classrangelistptr}{rangelistptr}; the list
779 of classes allowed by the applicable attribute in
780 Table \refersec{tab:attributeencodings}
781 determines the class of the form.
783 \textit{In DWARF V3 the forms \DWFORMdatafour{} and
784 \DWFORMdataeight{} were
785 \addtoindexx{lineptr class}
787 \addtoindexx{rangelistptr class}
789 \addtoindexx{macptr class}
791 \addtoindexx{loclistptr class}
792 class constant \addtoindexx{constant class}
793 or one of the classes
794 \livelink{chap:classlineptr}{lineptr},
795 \livelink{chap:classloclistptr}{loclistptr},
796 \livelink{chap:classmacptr}{macptr} or
797 \livelink{chap:classrangelistptr}{rangelistptr}, depending on context. In
799 \DWFORMdatafour{} and
800 \DWFORMdataeight{} are members of class
801 constant in all cases.
803 \DWFORMsecoffset{} replaces
804 their usage for the other classes.}
807 Each possible form belongs to one or more of the following classes:
810 \item \livelinki{chap:classaddress}{address}{address class} \\
811 \livetarg{datarep:classaddress}{}
812 Represented as either:
814 \item An object of appropriate size to hold an
815 address on the target machine
817 The size is encoded in the compilation unit header
818 (see Section \refersec{datarep:compilationunitheader}).
819 This address is relocatable in a relocatable object file and
820 is relocated in an executable file or shared object.
822 \item An indirect index into a table of addresses (as
823 described in the previous bullet) in the
824 \dotdebugaddr{} section (\DWFORMaddrxTARG).
825 The representation of a \DWFORMaddrxNAME{} value is an unsigned
826 \addtoindex{LEB128} value, which is interpreted as a zero-based
827 index into an array of addresses in the \dotdebugaddr{} section.
831 \item \livelink{chap:classblock}{block} \\
832 \livetarg{datarep:classblock}{}
833 Blocks come in four forms:
835 \begin{myindentpara}{1cm}
836 A 1\dash byte length followed by 0 to 255 contiguous information
837 bytes (\DWFORMblockoneTARG).
840 \begin{myindentpara}{1cm}
841 A 2\dash byte length followed by 0 to 65,535 contiguous information
842 bytes (\DWFORMblocktwoTARG).
845 \begin{myindentpara}{1cm}
846 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
847 information bytes (\DWFORMblockfourTARG).
850 \begin{myindentpara}{1cm}
851 An unsigned LEB128 length followed by the number of bytes
852 specified by the length (\DWFORMblockTARG).
855 In all forms, the length is the number of information bytes
856 that follow. The information bytes may contain any mixture
857 of relocated (or relocatable) addresses, references to other
858 debugging information entries or data bytes.
860 \item \livelinki{chap:classconstant}{constant}{constant class} \\
861 \livetarg{datarep:classconstant}{}
862 There are six forms of constants. There are fixed length
863 constant data forms for one, two, four and eight byte values
868 and \DWFORMdataeightTARG).
869 There are also variable length constant
870 data forms encoded using LEB128 numbers (see below). Both
871 signed (\DWFORMsdataTARG) and unsigned
872 (\DWFORMudataTARG) variable
873 length constants are available
876 The data in \DWFORMdataone,
878 \DWFORMdatafour{} and
880 can be anything. Depending on context, it may
881 be a signed integer, an unsigned integer, a floating\dash point
882 constant, or anything else. A consumer must use context to
883 know how to interpret the bits, which if they are target
884 machine data (such as an integer or floating point constant)
885 will be in target machine byte\dash order.
887 \textit{If one of the \DWFORMdataTARG\textless n\textgreater
888 forms is used to represent a
889 signed or unsigned integer, it can be hard for a consumer
890 to discover the context necessary to determine which
891 interpretation is intended. Producers are therefore strongly
892 encouraged to use \DWFORMsdata{} or
893 \DWFORMudata{} for signed and
894 unsigned integers respectively, rather than
895 \DWFORMdata\textless n\textgreater.}
898 \item \livelinki{chap:classexprloc}{exprloc}{exprloc class} \\
899 \livetarg{datarep:classexprloc}{}
900 This is an unsigned LEB128 length followed by the
901 number of information bytes specified by the length
902 (\DWFORMexprlocTARG).
903 The information bytes contain a DWARF expression
904 (see Section \refersec{chap:dwarfexpressions})
905 or location description
906 (see Section \refersec{chap:locationdescriptions}).
908 \item \livelinki{chap:classflag}{flag}{flag class} \\
909 \livetarg{datarep:classflag}{}
910 A flag \addtoindexx{flag class}
911 is represented explicitly as a single byte of data
913 implicitly (\DWFORMflagpresentTARG).
915 first case, if the \nolink{flag} has value zero, it indicates the
916 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
917 it indicates the presence of the attribute. In the second
918 case, the attribute is implicitly indicated as present, and
919 no value is encoded in the debugging information entry itself.
921 \item \livelinki{chap:classlineptr}{lineptr}{lineptr class} \\
922 \livetarg{datarep:classlineptr}{}
923 This is an offset into
924 \addtoindexx{section offset!in class lineptr value}
926 \dotdebugline{} section
928 It consists of an offset from the beginning of the
930 section to the first byte of
931 the data making up the line number list for the compilation
933 It is relocatable in a relocatable object file, and
934 relocated in an executable or shared object. In the
935 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
936 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
937 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
940 \item \livelinki{chap:classloclistptr}{loclistptr}{loclistptr class} \\
941 \livetarg{datarep:classloclistptr}{}
942 This is an offset into the
946 It consists of an offset from the
947 \addtoindexx{section offset!in class loclistptr value}
950 section to the first byte of
951 the data making up the
952 \addtoindex{location list} for the compilation unit.
953 It is relocatable in a relocatable object file, and
954 relocated in an executable or shared object. In the
955 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
956 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
957 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
960 \item \livelinki{chap:classmacptr}{macptr}{macptr class} \\
961 \livetarg{datarep:classmacptr}{}
963 \addtoindexx{section offset!in class macptr value}
965 \dotdebugmacinfo{} section
967 It consists of an offset from the
968 beginning of the \dotdebugmacinfo{}
969 section to the first byte of
970 the data making up the macro information list for the compilation
972 It is relocatable in a relocatable object file, and
973 relocated in an executable or shared object. In the
974 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
975 in the \sixtyfourbitdwarfformat, it is an 8\dash byte unsigned value
976 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
979 \item \livelinki{chap:classrangelistptr}{rangelistptr}{rangelistptr class} \\
980 \livetarg{datarep:classrangelistptr}{}
982 \addtoindexx{section offset!in class rangelistptr value}
983 offset into the \dotdebugranges{} section
986 offset from the beginning of the
987 \dotdebugranges{} section
988 to the beginning of the non\dash contiguous address ranges
989 information for the referencing entity.
991 a relocatable object file, and relocated in an executable or
992 shared object. In the \thirtytwobitdwarfformat, this offset
993 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
994 format, it is an 8\dash byte unsigned value (see Section
995 \refersec{datarep:32bitand64bitdwarfformats}).
998 \textit{Because classes \livelink{chap:classlineptr}{lineptr},
999 \livelink{chap:classloclistptr}{loclistptr},
1000 \livelink{chap:classmacptr}{macptr} and
1001 \livelink{chap:classrangelistptr}{rangelistptr}
1002 share a common representation, it is not possible for an
1003 attribute to allow more than one of these classes}
1007 \item \livelinki{chap:classreference}{reference}{reference class} \\
1008 \livetarg{datarep:classreference}{}
1009 There are three types of reference.
1012 \addtoindexx{reference class}
1013 first type of reference can identify any debugging
1014 information entry within the containing unit.
1017 \addtoindexx{section offset!in class reference value}
1018 offset from the first byte of the compilation
1019 header for the compilation unit containing the reference. There
1020 are five forms for this type of reference. There are fixed
1021 length forms for one, two, four and eight byte offsets
1027 and \DWFORMrefeightTARG).
1028 There is also an unsigned variable
1029 length offset encoded form that uses unsigned LEB128 numbers
1030 (\DWFORMrefudataTARG).
1031 Because this type of reference is within
1032 the containing compilation unit no relocation of the value
1035 The second type of reference can identify any debugging
1036 information entry within a
1037 \dotdebuginfo{} section; in particular,
1038 it may refer to an entry in a different compilation unit
1039 from the unit containing the reference, and may refer to an
1040 entry in a different shared object. This type of reference
1041 (\DWFORMrefaddrTARG)
1042 is an offset from the beginning of the
1044 section of the target executable or shared object;
1045 it is relocatable in a relocatable object file and frequently
1046 relocated in an executable file or shared object. For
1047 references from one shared object or static executable file
1048 to another, the relocation and identification of the target
1049 object must be performed by the consumer. In the
1050 \thirtytwobitdwarfformat, this offset is a 4\dash byte unsigned value;
1051 in the \sixtyfourbitdwarfformat, it is an 8\dash byte
1053 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1055 \textit{A debugging information entry that may be referenced by
1056 another compilation unit using
1057 \DWFORMrefaddr{} must have a
1058 global symbolic name.}
1060 \textit{For a reference from one executable or shared object to
1061 another, the reference is resolved by the debugger to identify
1062 the shared object or executable and the offset into that
1063 object\textquoteright s \dotdebuginfo{}
1064 section in the same fashion as the run
1065 time loader, either when the debug information is first read,
1066 or when the reference is used.}
1068 The third type of reference can identify any debugging
1069 information type entry that has been placed in its own
1070 \addtoindex{type unit}. This type of
1071 reference (\DWFORMrefsigeightTARG) is the
1072 \addtoindexx{type signature}
1073 64\dash bit type signature
1074 (see Section \refersec{datarep:typesignaturecomputation})
1078 \textit{The use of compilation unit relative references will reduce the
1079 number of link\dash time relocations and so speed up linking. The
1080 use of the second and third type of reference allows for the
1081 sharing of information, such as types, across compilation
1084 \textit{A reference to any kind of compilation unit identifies the
1085 debugging information entry for that unit, not the preceding
1088 \item \livelinki{chap:classstring}{string}{string class} \\
1089 \livetarg{datarep:classstring}{}
1090 A string is a sequence of contiguous non\dash null bytes followed by
1092 \addtoindexx{string class}
1093 A string may be represented:
1095 \item immediately in the debugging information entry itself
1096 (\DWFORMstringTARG),
1098 \addtoindexx{section offset!in class string value}
1099 offset into a string table contained in
1100 the \dotdebugstr{} section of the object file
1102 In the \thirtytwobitdwarfformat, the representation of a
1104 value is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
1105 it is an 8\dash byte unsigned offset
1106 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1107 \item as an indirect offset into the string table using an
1108 index into a table of offsets contained in the
1109 \dotdebugstroffsets{} section of the object file (\DWFORMstrxTARG).
1110 The representation of a \DWFORMstrxNAME{} value is an unsigned
1111 \addtoindex{LEB128} value, which is interpreted as a zero-based
1112 index into an array of offsets in the \dotdebugstroffsets{} section.
1113 The offset entries in the \dotdebugstroffsets{} section have the
1114 same representation as \DWFORMstrp{} values.
1116 Any combination of these three forms may be used within a single compilation.
1118 If the \DWATuseUTFeight{}
1119 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
1120 compilation, partial or type unit entry, string values are encoded using the
1121 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
1122 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
1123 the string representation is unspecified.
1125 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
1126 ISO/IEC 10646\dash 1:1993. It contains all the same characters
1127 and encoding points as ISO/IEC 10646, as well as additional
1128 information about the characters and their use.}
1130 \textit{Earlier versions of DWARF did not specify the representation
1131 of strings; for compatibility, this version also does
1132 not. However, the UTF\dash 8 representation is strongly recommended.}
1136 In no case does an attribute use
1137 \addtoindexx{rangelistptr class}
1139 \addtoindexx{loclistptr class}
1141 \addtoindexx{lineptr class}
1143 \addtoindexx{macptr class}
1144 classes \livelink{chap:classlineptr}{lineptr},
1145 \livelink{chap:classloclistptr}{loclistptr}, \livelink{chap:classmacptr}{macptr} or
1146 \livelink{chap:classrangelistptr}{rangelistptr} to point into either the
1147 \dotdebuginfo{} or \dotdebugstr{} section.
1149 The form encodings are listed in
1150 Table \refersec{tab:attributeformencodings}.
1154 \setlength{\extrarowheight}{0.1cm}
1155 \begin{longtable}{l|l|l}
1156 \caption{Attribute encodings}
1157 \label{tab:attributeencodings}
1158 \addtoindexx{attribute encodings} \\
1159 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1161 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1163 \hline \emph{Continued on next page}
1165 \hline \ddag\ \textit{New in DWARF Version 5}
1167 \DWATsibling&0x01&\livelink{chap:classreference}{reference}
1168 \addtoindexx{sibling attribute!encoding} \\
1169 \DWATlocation&0x02&\livelink{chap:classexprloc}{exprloc},
1170 \livelink{chap:classloclistptr}{loclistptr}\addtoindexx{location attribute!encoding} \\
1171 \DWATname&0x03&\livelink{chap:classstring}{string}
1172 \addtoindexx{name attribute!encoding} \\
1173 \DWATordering&0x09&\livelink{chap:classconstant}{constant}
1174 \addtoindexx{ordering attribute!encoding} \\
1175 \DWATbytesize&0x0b&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1176 \livelink{chap:classreference}{reference} \addtoindexx{byte size attribute!encoding} \\
1177 \DWATbitoffset&0x0c&\livelink{chap:classconstant}{constant},
1178 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{bit offset attribute!encoding} \\
1179 \DWATbitsize&0x0d&\livelink{chap:classconstant}{constant},
1180 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{bit size attribute!encoding} \\
1181 \DWATstmtlist&0x10&\livelink{chap:classlineptr}{lineptr}
1182 \addtoindexx{statement list attribute!encoding} \\
1183 \DWATlowpc&0x11&\livelink{chap:classaddress}{address}
1184 \addtoindexx{low PC attribute!encoding} \\
1185 \DWAThighpc&0x12&\livelink{chap:classaddress}{address}, \livelink{chap:classconstant}{constant}
1186 \addtoindexx{high PC attribute!encoding} \\
1187 \DWATlanguage&0x13&\livelink{chap:classconstant}{constant}
1188 \addtoindexx{language attribute!encoding} \\
1189 \DWATdiscr&0x15&\livelink{chap:classreference}{reference}
1190 \addtoindexx{discriminant attribute!encoding} \\
1191 \DWATdiscrvalue&0x16&\livelink{chap:classconstant}{constant}
1192 \addtoindexx{discriminant value attribute!encoding} \\
1193 \DWATvisibility&0x17&\livelink{chap:classconstant}{constant}
1194 \addtoindexx{visibility attribute!encoding} \\
1195 \DWATimport&0x18&\livelink{chap:classreference}{reference}
1196 \addtoindexx{import attribute!encoding} \\
1197 \DWATstringlength&0x19&\livelink{chap:classexprloc}{exprloc},
1198 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{string length attribute!encoding} \\
1199 \DWATcommonreference&0x1a&\livelink{chap:classreference}{reference}
1200 \addtoindexx{common reference attribute!encoding} \\
1201 \DWATcompdir&0x1b&\livelink{chap:classstring}{string}
1202 \addtoindexx{compilation directory attribute!encoding} \\
1203 \DWATconstvalue&0x1c&\livelink{chap:classblock}{block}, \livelink{chap:classconstant}{constant}, \livelink{chap:classstring}{string}
1204 \addtoindexx{constant value attribute!encoding} \\
1205 \DWATcontainingtype&0x1d&\livelink{chap:classreference}{reference}
1206 \addtoindexx{containing type attribute!encoding} \\
1207 \DWATdefaultvalue&0x1e&\livelink{chap:classreference}{reference}, \livelink{chap:classflag}{flag}
1208 \addtoindexx{default value attribute!encoding} \\
1209 \DWATinline&0x20&\livelink{chap:classconstant}{constant}
1210 \addtoindexx{inline attribute!encoding} \\
1211 \DWATisoptional&0x21&\livelink{chap:classflag}{flag}
1212 \addtoindexx{is optional attribute!encoding} \\
1213 \DWATlowerbound&0x22&\livelink{chap:classconstant}{constant},
1214 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{lower bound attribute!encoding} \\
1215 \DWATproducer&0x25&\livelink{chap:classstring}{string} \addtoindexx{producer attribute!encoding} \\
1216 \DWATprototyped&0x27&\livelink{chap:classflag}{flag}
1217 \addtoindexx{prototyped attribute!encoding} \\
1218 \DWATreturnaddr&0x2a&\livelink{chap:classexprloc}{exprloc},
1219 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{return address attribute!encoding} \\
1220 % FIXME: lower case , not Constant
1221 \DWATstartscope&0x2c&\livelink{chap:classconstant}{constant},
1222 \livelink{chap:classrangelistptr}{rangelistptr} \addtoindexx{start scope attribute!encoding} \\
1223 \DWATbitstride&0x2e&\livelink{chap:classconstant}{constant},
1224 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{bit stride attribute!encoding} \\
1225 \DWATupperbound&0x2f&\livelink{chap:classconstant}{constant},
1226 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference} \addtoindexx{upper bound attribute!encoding} \\
1227 \DWATabstractorigin&0x31&\livelink{chap:classreference}{reference}
1228 \addtoindexx{abstract origin attribute!encoding} \\
1229 \DWATaccessibility&0x32&\livelink{chap:classconstant}{constant}
1230 \addtoindexx{accessibility attribute!encoding} \\
1231 \DWATaddressclass&0x33&\livelink{chap:classconstant}{constant}
1232 \addtoindexx{address class attribute!encoding} \\
1233 \DWATartificial&0x34&\livelink{chap:classflag}{flag}
1234 \addtoindexx{artificial attribute!encoding} \\
1235 \DWATbasetypes&0x35&\livelink{chap:classreference}{reference}
1236 \addtoindexx{base types attribute!encoding} \\
1237 \DWATcallingconvention&0x36&\livelink{chap:classconstant}{constant}
1238 \addtoindexx{calling convention attribute!encoding} \\
1239 \DWATcount&0x37&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classreference}{reference}
1240 \addtoindexx{count attribute!encoding} \\
1241 \DWATdatamemberlocation&0x38&\livelink{chap:classconstant}{constant},
1242 \livelink{chap:classexprloc}{exprloc}, \livelink{chap:classloclistptr}{loclistptr}
1243 \addtoindexx{data member attribute!encoding} \\
1244 \DWATdeclcolumn&0x39&\livelink{chap:classconstant}{constant}
1245 \addtoindexx{declaration column attribute!encoding} \\
1246 \DWATdeclfile&0x3a&\livelink{chap:classconstant}{constant}
1247 \addtoindexx{declaration file attribute!encoding} \\
1248 \DWATdeclline&0x3b&\livelink{chap:classconstant}{constant}
1249 \addtoindexx{declaration line attribute!encoding} \\
1250 \DWATdeclaration&0x3c&\livelink{chap:classflag}{flag}
1251 \addtoindexx{declaration attribute!encoding} \\
1252 \DWATdiscrlist&0x3d&\livelink{chap:classblock}{block}
1253 \addtoindexx{discriminant list attribute!encoding} \\
1254 \DWATencoding&0x3e&\livelink{chap:classconstant}{constant}
1255 \addtoindexx{encoding attribute!encoding} \\
1256 \DWATexternal&\xiiif&\livelink{chap:classflag}{flag}
1257 \addtoindexx{external attribute!encoding} \\
1258 \DWATframebase&0x40&\livelink{chap:classexprloc}{exprloc},
1259 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{frame base attribute!encoding} \\
1260 \DWATfriend&0x41&\livelink{chap:classreference}{reference}
1261 \addtoindexx{friend attribute!encoding} \\
1262 \DWATidentifiercase&0x42&\livelink{chap:classconstant}{constant}
1263 \addtoindexx{identifier case attribute!encoding} \\
1264 \DWATmacroinfo&0x43&\livelink{chap:classmacptr}{macptr}
1265 \addtoindexx{macro information attribute!encoding} \\
1266 \DWATnamelistitem&0x44&\livelink{chap:classreference}{reference}
1267 \addtoindexx{name list item attribute!encoding} \\
1268 \DWATpriority&0x45&\livelink{chap:classreference}{reference}
1269 \addtoindexx{priority attribute!encoding} \\
1270 \DWATsegment&0x46&\livelink{chap:classexprloc}{exprloc},
1271 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{segment attribute!encoding} \\
1272 \DWATspecification&0x47&\livelink{chap:classreference}{reference}
1273 \addtoindexx{specification attribute!encoding} \\
1274 \DWATstaticlink&0x48&\livelink{chap:classexprloc}{exprloc},
1275 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{static link attribute!encoding} \\
1276 \DWATtype&0x49&\livelink{chap:classreference}{reference}
1277 \addtoindexx{type attribute!encoding} \\
1278 \DWATuselocation&0x4a&\livelink{chap:classexprloc}{exprloc},
1279 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{location list attribute!encoding} \\
1280 \DWATvariableparameter&0x4b&\livelink{chap:classflag}{flag}
1281 \addtoindexx{variable parameter attribute!encoding} \\
1282 \DWATvirtuality&0x4c&\livelink{chap:classconstant}{constant}
1283 \addtoindexx{virtuality attribute!encoding} \\
1284 \DWATvtableelemlocation&0x4d&\livelink{chap:classexprloc}{exprloc},
1285 \livelink{chap:classloclistptr}{loclistptr} \addtoindexx{vtable element location attribute!encoding} \\
1286 \DWATallocated&0x4e&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1287 \livelink{chap:classreference}{reference} \addtoindexx{allocated attribute!encoding} \\
1288 \DWATassociated&0x4f&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1289 \livelink{chap:classreference}{reference} \addtoindexx{associated attribute!encoding} \\
1290 \DWATdatalocation&0x50&\livelink{chap:classexprloc}{exprloc}
1291 \addtoindexx{data location attribute!encoding} \\
1292 \DWATbytestride&0x51&\livelink{chap:classconstant}{constant}, \livelink{chap:classexprloc}{exprloc},
1293 \livelink{chap:classreference}{reference} \addtoindexx{byte stride attribute!encoding} \\
1294 \DWATentrypc&0x52&\livelink{chap:classaddress}{address}, \livelink{chap:classconstant}{constant}
1295 \addtoindexx{entry pc attribute!encoding} \\
1296 \DWATuseUTFeight&0x53&\livelink{chap:classflag}{flag}
1297 \addtoindexx{use UTF8 attribute!encoding}\addtoindexx{UTF-8} \\
1298 \DWATextension&0x54&\livelink{chap:classreference}{reference}
1299 \addtoindexx{extension attribute!encoding} \\
1300 \DWATranges&0x55&\livelink{chap:classrangelistptr}{rangelistptr}
1301 \addtoindexx{ranges attribute!encoding} \\
1302 \DWATtrampoline&0x56&\livelink{chap:classaddress}{address}, \livelink{chap:classflag}{flag},
1303 \livelink{chap:classreference}{reference}, \livelink{chap:classstring}{string} \addtoindexx{trampoline attribute!encoding} \\
1304 \DWATcallcolumn&0x57&\livelink{chap:classconstant}{constant}
1305 \addtoindexx{call column attribute!encoding} \\
1306 \DWATcallfile&0x58&\livelink{chap:classconstant}{constant}
1307 \addtoindexx{call file attribute!encoding} \\
1308 \DWATcallline&0x59&\livelink{chap:classconstant}{constant}
1309 \addtoindexx{call line attribute!encoding} \\
1310 \DWATdescription&0x5a&\livelink{chap:classstring}{string}
1311 \addtoindexx{description attribute!encoding} \\
1312 \DWATbinaryscale&0x5b&\livelink{chap:classconstant}{constant}
1313 \addtoindexx{binary scale attribute!encoding} \\
1314 \DWATdecimalscale&0x5c&\livelink{chap:classconstant}{constant}
1315 \addtoindexx{decimal scale attribute!encoding} \\
1316 \DWATsmall{} &0x5d&\livelink{chap:classreference}{reference}
1317 \addtoindexx{small attribute!encoding} \\
1318 \DWATdecimalsign&0x5e&\livelink{chap:classconstant}{constant}
1319 \addtoindexx{decimal scale attribute!encoding} \\
1320 \DWATdigitcount&0x5f&\livelink{chap:classconstant}{constant}
1321 \addtoindexx{digit count attribute!encoding} \\
1322 \DWATpicturestring&0x60&\livelink{chap:classstring}{string}
1323 \addtoindexx{picture string attribute!encoding} \\
1324 \DWATmutable&0x61&\livelink{chap:classflag}{flag}
1325 \addtoindexx{mutable attribute!encoding} \\
1326 \DWATthreadsscaled&0x62&\livelink{chap:classflag}{flag}
1327 \addtoindexx{thread scaled attribute!encoding} \\
1328 \DWATexplicit&0x63&\livelink{chap:classflag}{flag}
1329 \addtoindexx{explicit attribute!encoding} \\
1330 \DWATobjectpointer&0x64&\livelink{chap:classreference}{reference}
1331 \addtoindexx{object pointer attribute!encoding} \\
1332 \DWATendianity&0x65&\livelink{chap:classconstant}{constant}
1333 \addtoindexx{endianity attribute!encoding} \\
1334 \DWATelemental&0x66&\livelink{chap:classflag}{flag}
1335 \addtoindexx{elemental attribute!encoding} \\
1336 \DWATpure&0x67&\livelink{chap:classflag}{flag}
1337 \addtoindexx{pure attribute!encoding} \\
1338 \DWATrecursive&0x68&\livelink{chap:classflag}{flag}
1339 \addtoindexx{recursive attribute!encoding} \\
1340 \DWATsignature{} &0x69&\livelink{chap:classreference}{reference}
1341 \addtoindexx{signature attribute!encoding} \\
1342 \DWATmainsubprogram{} &0x6a&\livelink{chap:classflag}{flag}
1343 \addtoindexx{main subprogram attribute!encoding} \\
1344 \DWATdatabitoffset{} &0x6b&\livelink{chap:classconstant}{constant}
1345 \addtoindexx{data bit offset attribute!encoding} \\
1346 \DWATconstexpr{} &0x6c&\livelink{chap:classflag}{flag}
1347 \addtoindexx{constant expression attribute!encoding} \\
1348 \DWATenumclass{} &0x6d&\livelink{chap:classflag}{flag}
1349 \addtoindexx{enumeration class attribute!encoding} \\
1350 \DWATlinkagename{} &0x6e&\livelink{chap:classstring}{string}
1351 \addtoindexx{linkage name attribute!encoding} \\
1352 \DWATstringlengthbitsize{} \ddag&0x6f&
1353 \livelink{chap:classconstant}{constant}\addtoindexx{string length attribute!size of length} \\
1354 \DWATstringlengthbytesize{} \ddag&0x70&
1355 \livelink{chap:classconstant}{constant}\addtoindexx{string length attribute!size of length} \\
1356 \DWATrank~\ddag&0x71&
1357 \livelink{chap:DWATrank}{constant, exprloc}\addtoindexx{rank attribute!encoding} \\
1358 \DWATstroffsetsbase~\ddag&0x72&
1359 \livelink{chap:classstring}{reference}\addtoindexx{string offsets base!encoding} \\
1360 \DWATaddrbase~\ddag &0x73&
1361 \livelink{chap:DWATaddrbase}{reference}\addtoindexx{address table base!encoding} \\
1362 \DWATrangesbase~\ddag&0x74&
1363 \livelink{chap:DWATrangesbase}{reference}\addtoindexx{ranges base!encoding} \\
1364 \DWATdwoid~\ddag &0x75&
1365 \livelink{chap:DWATdwoid}{constant}\addtoindexx{split DWARF object id!encoding} \\
1366 \DWATdwoname~\ddag &0x76&
1367 \livelink{chap:DWATdwname}{string}\addtoindexx{split DWARF object file name!encooding} \\
1368 \DWATlouser&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1369 \DWAThiuser&\xiiifff& --- \addtoindexx{high user attribute encoding} \\
1376 \setlength{\extrarowheight}{0.1cm}
1377 \begin{longtable}{l|l|l}
1378 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1379 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1381 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1383 \hline \emph{Continued on next page}
1388 \DWFORMaddr &0x01&\livelink{chap:classaddress}{address} \\
1389 \textit{Reserved} &0x02& \\
1390 \DWFORMblocktwo &0x03&\livelink{chap:classblock}{block} \\
1391 \DWFORMblockfour &0x04&\livelink{chap:classblock}{block} \\
1392 \DWFORMdatatwo &0x05&\livelink{chap:classconstant}{constant} \\
1393 \DWFORMdatafour &0x06&\livelink{chap:classconstant}{constant} \\
1394 \DWFORMdataeight &0x07&\livelink{chap:classconstant}{constant} \\
1395 \DWFORMstring&0x08&\livelink{chap:classstring}{string} \\
1396 \DWFORMblock&0x09&\livelink{chap:classblock}{block} \\
1397 \DWFORMblockone &0x0a&\livelink{chap:classblock}{block} \\
1398 \DWFORMdataone &0x0b&\livelink{chap:classconstant}{constant} \\
1399 \DWFORMflag&0x0c&\livelink{chap:classflag}{flag} \\
1400 \DWFORMsdata&0x0d&\livelink{chap:classconstant}{constant} \\
1401 \DWFORMstrp&0x0e&\livelink{chap:classstring}{string} \\
1402 \DWFORMudata&0x0f&\livelink{chap:classconstant}{constant} \\
1403 \DWFORMrefaddr&0x10&\livelink{chap:classreference}{reference} \\
1404 \DWFORMrefone&0x11&\livelink{chap:classreference}{reference} \\
1405 \DWFORMreftwo&0x12&\livelink{chap:classreference}{reference} \\
1406 \DWFORMreffour&0x13&\livelink{chap:classreference}{reference} \\
1407 \DWFORMrefeight&0x14&\livelink{chap:classreference}{reference} \\
1408 \DWFORMrefudata&0x15&\livelink{chap:classreference}{reference} \\
1409 \DWFORMindirect&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1410 \DWFORMsecoffset{} &0x17&\livelink{chap:classlineptr}{lineptr}, \livelink{chap:classloclistptr}{loclistptr}, \livelink{chap:classmacptr}{macptr}, \livelink{chap:classrangelistptr}{rangelistptr} \\
1411 \DWFORMexprloc{} &0x18&\livelink{chap:classexprloc}{exprloc} \\
1412 \DWFORMflagpresent{} &0x19&\livelink{chap:classflag}{flag} \\
1413 \DWFORMstrx &0x1a&\livelink{chap:classstring}{string} \\
1414 \DWFORMaddrx &0x1b&\livelink{chap:classaddess}{address} \\
1415 \DWFORMrefsigeight &0x20&\livelink{chap:classreference}{reference} \\
1422 \section{Variable Length Data}
1423 \label{datarep:variablelengthdata}
1424 \addtoindexx{variable length data|see {LEB128}}
1426 \addtoindexx{Little Endian Base 128|see{LEB128}}
1427 encoded using \doublequote{Little Endian Base 128}
1428 \addtoindexx{little-endian encoding|see{endian attribute}}
1430 \addtoindexx{LEB128}
1431 LEB128 is a scheme for encoding integers
1432 densely that exploits the assumption that most integers are
1435 \textit{This encoding is equally suitable whether the target machine
1436 architecture represents data in big\dash\ endian or little\dash endian
1437 order. It is \doublequote{little\dash endian} only in the sense that it
1438 avoids using space to represent the \doublequote{big} end of an
1439 unsigned integer, when the big end is all zeroes or sign
1442 Unsigned LEB128 (ULEB128) numbers are encoded as follows:
1443 \addtoindexx{LEB128!unsigned, encoding as}
1444 start at the low order end of an unsigned integer and chop
1445 it into 7\dash bit chunks. Place each chunk into the low order 7
1446 bits of a byte. Typically, several of the high order bytes
1447 will be zero; discard them. Emit the remaining bytes in a
1448 stream, starting with the low order byte; set the high order
1449 bit on each byte except the last emitted byte. The high bit
1450 of zero on the last byte indicates to the decoder that it
1451 has encountered the last byte.
1453 The integer zero is a special case, consisting of a single
1456 Table \refersec{tab:examplesofunsignedleb128encodings}
1457 gives some examples of unsigned LEB128 numbers. The
1458 0x80 in each case is the high order bit of the byte, indicating
1459 that an additional byte follows.
1462 The encoding for signed, two\textquoteright s complement LEB128 (SLEB128)
1463 \addtoindexx{LEB128!signed, encoding as}
1464 numbers is similar, except that the criterion for discarding
1465 high order bytes is not whether they are zero, but whether
1466 they consist entirely of sign extension bits. Consider the
1467 32\dash bit integer -2. The three high level bytes of the number
1468 are sign extension, thus LEB128 would represent it as a single
1469 byte containing the low order 7 bits, with the high order
1470 bit cleared to indicate the end of the byte stream. Note
1471 that there is nothing within the LEB128 representation that
1472 indicates whether an encoded number is signed or unsigned. The
1473 decoder must know what type of number to expect.
1474 Table \refersec{tab:examplesofunsignedleb128encodings}
1475 gives some examples of unsigned LEB128 numbers and
1476 Table \refersec{tab:examplesofsignedleb128encodings}
1477 gives some examples of signed LEB128
1480 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1481 \addtoindexx{LEB128!examples}
1482 gives algorithms for encoding and decoding these forms.}
1486 \setlength{\extrarowheight}{0.1cm}
1487 \begin{longtable}{l|l|l}
1488 \caption{Examples of unsigned LEB128 encodings}
1489 \label{tab:examplesofunsignedleb128encodings}
1490 \addtoindexx{LEB128 encoding!examples} \\
1491 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1493 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1495 \hline \emph{Continued on next page}
1501 128& 0 + 0x80 & 1 \\
1502 129& 1 + 0x80 & 1 \\
1503 130& 2 + 0x80 & 1 \\
1504 12857& 57 + 0x80 & 100 \\
1511 \setlength{\extrarowheight}{0.1cm}
1512 \begin{longtable}{l|l|l}
1513 \caption{Examples of signed LEB128 encodings} \label{tab:examplesofsignedleb128encodings} \\
1514 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1516 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1518 \hline \emph{Continued on next page}
1524 127& 127 + 0x80 & 0 \\
1525 -127& 1 + 0x80 & 0x7f \\
1526 128& 0 + 0x80 & 1 \\
1527 -128& 0 + 0x80 & 0x7f \\
1528 129& 1 + 0x80 & 1 \\
1529 -129& 0x7f + 0x80 & 0x7e \\
1536 \section{DWARF Expressions and Location Descriptions}
1537 \label{datarep:dwarfexpressionsandlocationdescriptions}
1538 \subsection{DWARF Expressions}
1539 \label{datarep:dwarfexpressions}
1542 \addtoindexx{DWARF Expression!operator encoding}
1543 DWARF expression is stored in a \nolink{block} of contiguous
1544 bytes. The bytes form a sequence of operations. Each operation
1545 is a 1\dash byte code that identifies that operation, followed by
1546 zero or more bytes of additional data. The encodings for the
1547 operations are described in
1548 Table \refersec{tab:dwarfoperationencodings}.
1551 \setlength{\extrarowheight}{0.1cm}
1552 \begin{longtable}{l|c|c|l}
1553 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1554 \hline & &\bfseries No. of &\\
1555 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1557 & &\bfseries No. of &\\
1558 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1560 \hline \emph{Continued on next page}
1565 \DWOPaddr&0x03&1 & constant address \\
1566 & & &(size is target specific) \\
1568 \DWOPderef&0x06&0 & \\
1570 \DWOPconstoneu&0x08&1&1\dash byte constant \\
1571 \DWOPconstones&0x09&1&1\dash byte constant \\
1572 \DWOPconsttwou&0x0a&1&2\dash byte constant \\
1573 \DWOPconsttwos&0x0b&1&2\dash byte constant \\
1574 \DWOPconstfouru&0x0c&1&4\dash byte constant \\
1575 \DWOPconstfours&0x0d&1&4\dash byte constant \\
1576 \DWOPconsteightu&0x0e&1&8\dash byte constant \\
1577 \DWOPconsteights&0x0f&1&8\dash byte constant \\
1578 \DWOPconstu&0x10&1&ULEB128 constant \\
1579 \DWOPconsts&0x11&1&SLEB128 constant \\
1580 \DWOPdup&0x12&0 & \\
1581 \DWOPdrop&0x13&0 & \\
1582 \DWOPover&0x14&0 & \\
1583 \DWOPpick&0x15&1&1\dash byte stack index \\
1584 \DWOPswap&0x16&0 & \\
1585 \DWOProt&0x17&0 & \\
1586 \DWOPxderef&0x18&0 & \\
1587 \DWOPabs&0x19&0 & \\
1588 \DWOPand&0x1a&0 & \\
1589 \DWOPdiv&0x1b&0 & \\
1590 \DWOPminus&0x1c&0 & \\
1591 \DWOPmod&0x1d&0 & \\
1592 \DWOPmul&0x1e&0 & \\
1593 \DWOPneg&0x1f&0 & \\
1594 \DWOPnot&0x20&0 & \\
1596 \DWOPplus&0x22&0 & \\
1597 \DWOPplusuconst&0x23&1&ULEB128 addend \\
1598 \DWOPshl&0x24&0 & \\
1599 \DWOPshr&0x25&0 & \\
1600 \DWOPshra&0x26&0 & \\
1601 \DWOPxor&0x27&0 & \\
1603 \DWOPbra&0x28&1 & signed 2\dash byte constant \\
1610 \DWOPskip&0x2f&1&signed 2\dash byte constant \\ \hline
1612 \DWOPlitzero & 0x30 & 0 & \\
1613 \DWOPlitone & 0x31 & 0& literals 0 .. 31 = \\
1614 \ldots & & &\hspace{0.3cm}(\DWOPlitzero{} + literal) \\
1615 \DWOPlitthirtyone & 0x4f & 0 & \\ \hline
1617 \DWOPregzero & 0x50 & 0 & \\*
1618 \DWOPregone & 0x51 & 0® 0 .. 31 = \\*
1619 \ldots & & &\hspace{0.3cm}(\DWOPregzero{} + regnum) \\*
1620 \DWOPregthirtyone & 0x6f & 0 & \\ \hline
1622 \DWOPbregzero & 0x70 &1 & SLEB128 offset \\*
1623 \DWOPbregone & 0x71 & 1 &base register 0 .. 31 = \\*
1624 ... & & &\hspace{0.3cm}(\DWOPbregzero{} + regnum) \\*
1625 \DWOPbregthirtyone & 0x8f & 1 & \\ \hline
1627 \DWOPregx{} & 0x90 &1&ULEB128 register \\
1628 \DWOPfbreg{} & 0x91&1&SLEB128 offset \\
1629 \DWOPbregx{} & 0x92&2 &ULEB128 register, \\*
1630 & & &SLEB128 offset \\
1631 \DWOPpiece{} & 0x93 &1& ULEB128 size of piece \\
1632 \DWOPderefsize{} & 0x94 &1& 1-byte size of data retrieved \\
1633 \DWOPxderefsize{} & 0x95&1&1-byte size of data retrieved \\
1634 \DWOPnop{} & 0x96 &0& \\
1636 \DWOPpushobjectaddress&0x97&0 & \\
1637 \DWOPcalltwo&0x98&1& 2\dash byte offset of DIE \\
1638 \DWOPcallfour&0x99&1& 4\dash byte offset of DIE \\
1639 \DWOPcallref&0x9a&1& 4\dash\ or 8\dash byte offset of DIE \\
1640 \DWOPformtlsaddress&0x9b &0& \\
1641 \DWOPcallframecfa{} &0x9c &0& \\
1642 \DWOPbitpiece&0x9d &2&ULEB128 size, \\*
1644 \DWOPimplicitvalue{} &0x9e &2&ULEB128 size, \\*
1645 &&&\nolink{block} of that size\\
1646 \DWOPstackvalue{} &0x9f &0& \\
1647 \DWOPimplicitpointer{} &0xa0& 2 &4- or 8-byte offset of DIE, \\*
1648 &&&SLEB128 constant offset \\
1649 \DWOPaddrx&0xa1&1&ULEB128 indirect address \\
1650 \DWOPconstx&0xa2&1&ULEB128 indirect constant \\
1651 \DWOPlouser{} &0xe0 && \\
1652 \DWOPhiuser{} &\xff && \\
1658 \subsection{Location Descriptions}
1659 \label{datarep:locationdescriptions}
1661 A location description is used to compute the
1662 location of a variable or other entity.
1664 \subsection{Location Lists}
1665 \label{datarep:locationlists}
1667 Each entry in a \addtoindex{location list} is either a location list entry,
1668 a base address selection entry, or an
1669 \addtoindexx{end of list entry!in location list}
1673 \subsubsection{Location List Entries in Non-Split Objects}
1674 A \addtoindex{location list} entry consists of two address offsets followed
1675 by a 2\dash byte length, followed by a block of contiguous bytes
1676 that contains a DWARF location description. The length
1677 specifies the number of bytes in that block. The two offsets
1678 are the same size as an address on the target machine.
1681 A base address selection entry and an
1682 \addtoindexx{end of list entry!in location list}
1683 end of list entry each
1684 consist of two (constant or relocated) address offsets. The two
1685 offsets are the same size as an address on the target machine.
1687 For a \addtoindex{location list} to be specified, the base address of
1688 \addtoindexx{base address selection entry!in location list}
1689 the corresponding compilation unit must be defined
1690 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1692 \subsubsection{Location List Entries in Split Objects}
1693 An alternate form for location list entries is used in split objects.
1694 Each entry begins with a one-byte code that indicates the kind of entry
1695 that follows. The encodings for these constants are given in
1696 Table \refersec{tab:locationlistentryencodingvalues}.
1699 \setlength{\extrarowheight}{0.1cm}
1700 \begin{longtable}{l|c}
1701 \caption{Location list entry encoding values} \label{tab:locationlistentryencodingvalues} \\
1702 \hline \bfseries Location list entry encoding name&\bfseries Value \\ \hline
1704 \bfseries Location list entry encoding name&\bfseries Value\\ \hline
1706 \hline \emph{Continued on next page}
1710 \DWLLEendoflistentry & 0x0 \\
1711 \DWLLEbaseaddressselectionentry & 0x01 \\
1712 \DWLLEstartendentry & 0x02 \\
1713 \DWLLEstartlengthentry & 0x03 \\
1714 \DWLLEoffsetpairentry & 0x04 \\
1718 \section{Base Type Attribute Encodings}
1719 \label{datarep:basetypeattributeencodings}
1721 The encodings of the
1722 \hypertarget{chap:DWATencodingencodingofbasetype}{}
1724 \addtoindexx{encoding attribute!encoding}
1727 attribute are given in
1728 Table \refersec{tab:basetypeencodingvalues}
1731 \setlength{\extrarowheight}{0.1cm}
1732 \begin{longtable}{l|c}
1733 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1734 \hline \bfseries Base type encoding name&\bfseries Value \\ \hline
1736 \bfseries Base type encoding name&\bfseries Value\\ \hline
1738 \hline \emph{Continued on next page}
1742 \DWATEaddress&0x01 \\
1743 \DWATEboolean&0x02 \\
1744 \DWATEcomplexfloat&0x03 \\
1746 \DWATEsigned&0x05 \\
1747 \DWATEsignedchar&0x06 \\
1748 \DWATEunsigned&0x07 \\
1749 \DWATEunsignedchar&0x08 \\
1750 \DWATEimaginaryfloat&0x09 \\
1751 \DWATEpackeddecimal&0x0a \\
1752 \DWATEnumericstring&0x0b \\
1753 \DWATEedited&0x0c \\
1754 \DWATEsignedfixed&0x0d \\
1755 \DWATEunsignedfixed&0x0e \\
1756 \DWATEdecimalfloat{} & 0x0f \\
1757 \DWATEUTF{} & 0x10 \\
1758 \DWATElouser{} & 0x80 \\
1759 \DWATEhiuser{} & \xff \\
1764 The encodings of the constants used in the
1765 \DWATdecimalsign{} attribute
1767 Table \refersec{tab:decimalsignencodings}.
1770 \setlength{\extrarowheight}{0.1cm}
1771 \begin{longtable}{l|c}
1772 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1773 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
1775 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1777 \hline \emph{Continued on next page}
1782 \DWDSunsigned{} & 0x01 \\
1783 \DWDSleadingoverpunch{} & 0x02 \\
1784 \DWDStrailingoverpunch{} & 0x03 \\
1785 \DWDSleadingseparate{} & 0x04 \\
1786 \DWDStrailingseparate{} & 0x05 \\
1792 The encodings of the constants used in the
1793 \DWATendianity{} attribute are given in
1794 Table \refersec{tab:endianityencodings}.
1797 \setlength{\extrarowheight}{0.1cm}
1798 \begin{longtable}{l|c}
1799 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1800 \hline \bfseries Endian code name&\bfseries Value \\ \hline
1802 \bfseries Endian code name&\bfseries Value\\ \hline
1804 \hline \emph{Continued on next page}
1809 \DWENDdefault{} & 0x00 \\
1810 \DWENDbig{} & 0x01 \\
1811 \DWENDlittle{} & 0x02 \\
1812 \DWENDlouser{} & 0x40 \\
1813 \DWENDhiuser{} & \xff \\
1818 \section{Accessibility Codes}
1819 \label{datarep:accessibilitycodes}
1820 The encodings of the constants used in the
1821 \DWATaccessibility{}
1823 \addtoindexx{accessibility attribute!encoding}
1825 Table \refersec{tab:accessibilityencodings}.
1828 \setlength{\extrarowheight}{0.1cm}
1829 \begin{longtable}{l|c}
1830 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1831 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
1833 \bfseries Accessibility code name&\bfseries Value\\ \hline
1835 \hline \emph{Continued on next page}
1840 \DWACCESSpublic&0x01 \\
1841 \DWACCESSprotected&0x02 \\
1842 \DWACCESSprivate&0x03 \\
1848 \section{Visibility Codes}
1849 \label{datarep:visibilitycodes}
1850 The encodings of the constants used in the
1851 \DWATvisibility{} attribute are given in
1852 Table \refersec{tab:visibilityencodings}.
1855 \setlength{\extrarowheight}{0.1cm}
1856 \begin{longtable}{l|c}
1857 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
1858 \hline \bfseries Visiibility code name&\bfseries Value \\ \hline
1860 \bfseries Visibility code name&\bfseries Value\\ \hline
1862 \hline \emph{Continued on next page}
1868 \DWVISexported&0x02 \\
1869 \DWVISqualified&0x03 \\
1874 \section{Virtuality Codes}
1875 \label{datarep:vitualitycodes}
1877 The encodings of the constants used in the
1878 \DWATvirtuality{} attribute are given in
1879 Table \refersec{tab:virtualityencodings}.
1882 \setlength{\extrarowheight}{0.1cm}
1883 \begin{longtable}{l|c}
1884 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
1885 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
1887 \bfseries Virtuality code name&\bfseries Value\\ \hline
1889 \hline \emph{Continued on next page}
1894 \DWVIRTUALITYnone&0x00 \\
1895 \DWVIRTUALITYvirtual&0x01 \\
1896 \DWVIRTUALITYpurevirtual&0x02 \\
1904 \DWVIRTUALITYnone{} is equivalent to the absence of the
1908 \section{Source Languages}
1909 \label{datarep:sourcelanguages}
1911 The encodings of the constants used
1912 \addtoindexx{language attribute, encoding}
1914 \addtoindexx{language name encoding}
1917 attribute are given in
1918 Table \refersec{tab:languageencodings}.
1920 % If we don't force a following space it looks odd
1922 and their associated values are reserved, but the
1923 languages they represent are not well supported.
1924 Table \refersec{tab:languageencodings}
1926 \addtoindexx{lower bound attribute!default}
1927 default lower bound, if any, assumed for
1928 an omitted \DWATlowerbound{} attribute in the context of a
1929 \DWTAGsubrangetype{} debugging information entry for each
1933 \setlength{\extrarowheight}{0.1cm}
1934 \begin{longtable}{l|c|c}
1935 \caption{Language encodings} \label{tab:languageencodings}\\
1936 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
1938 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
1940 \hline \emph{Continued on next page}
1943 \dag \ \textit{See text} \\ \ddag \ \textit{New in \addtoindex{DWARF Version 5}}
1946 \DWLANGCeightynine &0x0001 &0 \\
1947 \DWLANGC{} &0x0002 &0 \\
1948 \DWLANGAdaeightythree{} \dag &0x0003 &1 \addtoindexx{Ada} \\
1949 \DWLANGCplusplus{} &0x0004 &0 \\
1950 \DWLANGCobolseventyfour{} \dag &0x0005 &1 \\
1951 \DWLANGCoboleightyfive{} \dag &0x0006 &1 \\
1952 \DWLANGFortranseventyseven &0x0007 &1 \\
1953 \DWLANGFortranninety &0x0008 &1 \\
1954 \DWLANGPascaleightythree &0x0009 &1 \\
1955 \DWLANGModulatwo &0x000a &1 \\
1956 \DWLANGJava &0x000b &0 \\
1957 \DWLANGCninetynine &0x000c &0 \\
1958 \DWLANGAdaninetyfive{} \dag &0x000d &1 \addtoindexx{Ada} \\
1959 \DWLANGFortranninetyfive &0x000e &1 \\
1960 \DWLANGPLI{} \dag &0x000f &1 \\
1961 \DWLANGObjC{} &0x0010 &0 \\
1962 \DWLANGObjCplusplus{} &0x0011 &0 \\
1963 \DWLANGUPC{} &0x0012 &0 \\
1964 \DWLANGD{} &0x0013 &0 \\
1965 \DWLANGPython{} \dag &0x0014 &0 \\
1966 \DWLANGOpenCL{} \dag \ddag &0x0015 &0 \\
1967 \DWLANGGo{} \dag \ddag &0x0016 &0 \\
1968 \DWLANGModulathree{} \dag \ddag &0x0017 &1 \\
1969 \DWLANGHaskell{} \dag \ddag &0x0018 &0 \\
1970 \DWLANGCpluspluszerothree{} \ddag &0x0019 &0 \\
1971 \DWLANGCpluspluseleven{} \ddag &0x001a &0 \\
1972 \DWLANGOCaml{} \ddag &0x001b &0 \\
1973 \DWLANGlouser{} &0x8000 & \\
1974 \DWLANGhiuser{} &\xffff & \\
1979 \section{Address Class Encodings}
1980 \label{datarep:addressclassencodings}
1982 The value of the common
1983 \addtoindexi{address}{address class!attribute encoding}
1988 \section{Identifier Case}
1989 \label{datarep:identifiercase}
1991 The encodings of the constants used in the
1992 \DWATidentifiercase{} attribute are given in
1993 Table \refersec{tab:identifiercaseencodings}.
1996 \setlength{\extrarowheight}{0.1cm}
1997 \begin{longtable}{l|c}
1998 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
1999 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
2001 \bfseries Identifier case name&\bfseries Value\\ \hline
2003 \hline \emph{Continued on next page}
2007 \DWIDcasesensitive&0x00 \\
2009 \DWIDdowncase&0x02 \\
2010 \DWIDcaseinsensitive&0x03 \\
2014 \section{Calling Convention Encodings}
2015 \label{datarep:callingconventionencodings}
2016 The encodings of the constants used in the
2017 \DWATcallingconvention{} attribute are given in
2018 Table \refersec{tab:callingconventionencodings}.
2021 \setlength{\extrarowheight}{0.1cm}
2022 \begin{longtable}{l|c}
2023 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
2024 \hline \bfseries Calling convention name&\bfseries Value \\ \hline
2026 \bfseries Calling convention name&\bfseries Value\\ \hline
2028 \hline \emph{Continued on next page}
2034 \DWCCprogram&0x02 \\
2042 \section{Inline Codes}
2043 \label{datarep:inlinecodes}
2045 The encodings of the constants used in
2046 \addtoindexx{inline attribute!encoding}
2048 \DWATinline{} attribute are given in
2049 Table \refersec{tab:inlineencodings}.
2053 \setlength{\extrarowheight}{0.1cm}
2054 \begin{longtable}{l|c}
2055 \caption{Inline encodings} \label{tab:inlineencodings}\\
2056 \hline \bfseries Inline code name&\bfseries Value \\ \hline
2058 \bfseries Inline Code name&\bfseries Value\\ \hline
2060 \hline \emph{Continued on next page}
2065 \DWINLnotinlined&0x00 \\
2066 \DWINLinlined&0x01 \\
2067 \DWINLdeclarednotinlined&0x02 \\
2068 \DWINLdeclaredinlined&0x03 \\
2073 % this clearpage is ugly, but the following table came
2074 % out oddly without it.
2076 \section{Array Ordering}
2077 \label{datarep:arrayordering}
2079 The encodings of the constants used in the
2080 \DWATordering{} attribute are given in
2081 Table \refersec{tab:orderingencodings}.
2085 \setlength{\extrarowheight}{0.1cm}
2086 \begin{longtable}{l|c}
2087 \caption{Ordering encodings} \label{tab:orderingencodings}\\
2088 \hline \bfseries Ordering name&\bfseries Value \\ \hline
2090 \bfseries Ordering name&\bfseries Value\\ \hline
2092 \hline \emph{Continued on next page}
2097 \DWORDrowmajor&0x00 \\
2098 \DWORDcolmajor&0x01 \\
2104 \section{Discriminant Lists}
2105 \label{datarep:discriminantlists}
2107 The descriptors used in
2108 \addtoindexx{discriminant list attribute!encoding}
2110 \DWATdiscrlist{} attribute are
2111 encoded as 1\dash byte constants. The
2112 defined values are given in
2113 Table \refersec{tab:discriminantdescriptorencodings}.
2115 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2117 \setlength{\extrarowheight}{0.1cm}
2118 \begin{longtable}{l|c}
2119 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
2120 \hline \bfseries Descriptor name&\bfseries Value \\ \hline
2122 \bfseries Descriptor name&\bfseries Value\\ \hline
2124 \hline \emph{Continued on next page}
2136 \section{Name Lookup Tables}
2137 \label{datarep:namelookuptables}
2139 Each set of entries in the table of global names contained
2140 in the \dotdebugpubnames{} and
2141 \dotdebugpubtypes{} sections begins
2142 with a header consisting of:
2143 \begin{enumerate}[1. ]
2145 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2146 \addttindexx{unit\_length}
2147 A 4\dash byte or 12\dash byte unsigned integer
2148 \addtoindexx{initial length}
2149 representing the length
2150 of the \dotdebuginfo{}
2151 contribution for that compilation unit,
2152 not including the length field itself. In the
2153 \thirtytwobitdwarfformat, this is a 4\dash byte unsigned integer (which must be less
2154 than \xfffffffzero); in the \sixtyfourbitdwarfformat, this consists
2155 of the 4\dash byte value \wffffffff followed by an 8\dash byte unsigned
2156 integer that gives the actual length
2157 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2159 \item version (\addtoindex{uhalf}) \\
2160 A 2\dash byte unsigned integer representing the version of the
2161 DWARF information for the name lookup table
2162 \addtoindexx{version number!name lookup table}
2163 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2164 The value in this field is 2.
2167 \item \addtoindex{debug\_info\_offset} (section offset) \\
2169 \addtoindexx{section offset!in name lookup table set of entries}
2170 4\dash byte or 8\dash byte
2173 section of the compilation unit header.
2174 In the \thirtytwobitdwarfformat, this is a 4\dash byte unsigned offset;
2175 in the \sixtyfourbitdwarfformat, this is an 8\dash byte unsigned offsets
2176 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2178 \item \addtoindex{debug\_info\_length} (\livelink{datarep:sectionoffsetlength}{section length}) \\
2179 \addtoindexx{section length!in .debug\_pubnames header}
2181 \addtoindexx{section length!in .debug\_pubtypes header}
2182 4\dash byte or 8\dash byte length containing the size in bytes of the
2183 contents of the \dotdebuginfo{}
2184 section generated to represent
2185 this compilation unit. In the \thirtytwobitdwarfformat, this is
2186 a 4\dash byte unsigned length; in the \sixtyfourbitdwarfformat, this
2187 is an 8-byte unsigned length
2188 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2193 This header is followed by a series of tuples. Each tuple
2194 consists of a 4\dash byte or 8\dash byte offset followed by a string
2195 of non\dash null bytes terminated by one null byte.
2197 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2198 format, it is an 8\dash byte offset.
2199 Each set is terminated by an
2200 offset containing the value 0.
2204 \section{Address Range Table}
2205 \label{datarep:addrssrangetable}
2207 Each set of entries in the table of address ranges contained
2208 in the \dotdebugaranges{}
2209 section begins with a header containing:
2210 \begin{enumerate}[1. ]
2211 % FIXME The unit length text is not fully consistent across
2214 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2215 \addttindexx{unit\_length}
2216 A 4-byte or 12-byte length containing the length of the
2217 \addtoindexx{initial length}
2218 set of entries for this compilation unit, not including the
2219 length field itself. In the \thirtytwobitdwarfformat, this is a
2220 4-byte unsigned integer (which must be less than \xfffffffzero);
2221 in the \sixtyfourbitdwarfformat, this consists of the 4-byte value
2222 \wffffffff followed by an 8-byte unsigned integer that gives
2224 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2226 \item version (\addtoindex{uhalf}) \\
2227 A 2\dash byte version identifier representing the version of the
2228 DWARF information for the address range table
2229 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2230 This value in this field \addtoindexx{version number!address range table} is 2.
2233 \item debug\_info\_offset (\livelink{datarep:sectionoffsetlength}{section offset}) \\
2235 \addtoindexx{section offset!in .debug\_aranges header}
2236 4\dash byte or 8\dash byte offset into the
2237 \dotdebuginfo{} section of
2238 the compilation unit header. In the \thirtytwobitdwarfformat,
2239 this is a 4\dash byte unsigned offset; in the \sixtyfourbitdwarfformat,
2240 this is an 8\dash byte unsigned offset
2241 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2243 \item address\_size (ubyte) \\
2244 A 1\dash byte unsigned integer containing the size in bytes of an
2245 \addtoindexx{address\_size}
2247 \addtoindexx{size of an address}
2248 (or the offset portion of an address for segmented
2249 \addtoindexx{address space!segmented}
2250 addressing) on the target system.
2252 \item segment\_size (ubyte) \\
2254 \addtoindexx{segment\_size}
2255 1\dash byte unsigned integer containing the size in bytes of a
2256 segment selector on the target system.
2260 This header is followed by a series of tuples. Each tuple
2261 consists of a segment, an address and a length.
2263 size is given by the \addtoindex{segment\_size} field of the header; the
2264 address and length size are each given by the address\_size
2265 field of the header.
2266 The first tuple following the header in
2267 each set begins at an offset that is a multiple of the size
2268 of a single tuple (that is, the size of a segment selector
2269 plus twice the \addtoindex{size of an address}).
2270 The header is padded, if
2271 necessary, to that boundary. Each set of tuples is terminated
2272 by a 0 for the segment, a 0 for the address and 0 for the
2273 length. If the \addtoindex{segment\_size} field in the header is zero,
2274 the segment selectors are omitted from all tuples, including
2275 the terminating tuple.
2278 \section{Line Number Information}
2279 \label{datarep:linenumberinformation}
2281 The \addtoindexi{version number}{version number!line number information}
2282 in the line number program header is \versiondotdebugline{}
2283 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2285 The boolean values \doublequote{true} and \doublequote{false}
2286 used by the line number information program are encoded
2287 as a single byte containing the value 0
2288 for \doublequote{false,} and a non-zero value for \doublequote{true.}
2290 The encodings for the standard opcodes are given in
2291 \addtoindexx{line number opcodes!standard opcode encoding}
2292 Table \refersec{tab:linenumberstandardopcodeencodings}.
2294 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2296 \setlength{\extrarowheight}{0.1cm}
2297 \begin{longtable}{l|c}
2298 \caption{Line number standard opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2299 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2301 \bfseries Opcode name&\bfseries Value\\ \hline
2303 \hline \emph{Continued on next page}
2309 \DWLNSadvancepc&0x02 \\
2310 \DWLNSadvanceline&0x03 \\
2311 \DWLNSsetfile&0x04 \\
2312 \DWLNSsetcolumn&0x05 \\
2313 \DWLNSnegatestmt&0x06 \\
2314 \DWLNSsetbasicblock&0x07 \\
2315 \DWLNSconstaddpc&0x08 \\
2316 \DWLNSfixedadvancepc&0x09 \\
2317 \DWLNSsetprologueend&0x0a \\*
2318 \DWLNSsetepiloguebegin&0x0b \\*
2319 \DWLNSsetisa&0x0c \\*
2326 The encodings for the extended opcodes are given in
2327 \addtoindexx{line number opcodes!extended opcode encoding}
2328 Table \refersec{tab:linenumberextendedopcodeencodings}.
2331 \setlength{\extrarowheight}{0.1cm}
2332 \begin{longtable}{l|c}
2333 \caption{Line number extended opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2334 \hline \bfseries Opcode name&\bfseries Value \\ \hline
2336 \bfseries Opcode name&\bfseries Value\\ \hline
2338 \hline \emph{Continued on next page}
2343 \DWLNEendsequence &0x01 \\
2344 \DWLNEsetaddress &0x02 \\
2345 \DWLNEdefinefile &0x03 \\
2346 \DWLNEsetdiscriminator &0x04 \\
2347 \DWLNEdefinefileMDfive &0c05 \\
2348 \DWLNElouser &0x80 \\
2349 \DWLNEhiuser &\xff \\
2355 The encodings for the file entry format are given in
2356 \addtoindexx{line number opcodes!file entry format encoding}
2357 Table \refersec{tab:linenumberfileentryformatencodings}.
2360 \setlength{\extrarowheight}{0.1cm}
2361 \begin{longtable}{l|c}
2362 \caption{Line number file entry format \mbox{encodings}} \label{tab:linenumberfileentryformatencodings}\\
2363 \hline \bfseries File entry format name&\bfseries Value \\ \hline
2365 \bfseries File entry format name&\bfseries Value\\ \hline
2367 \hline \emph{Continued on next page}
2372 \DWLNFtimestampsize & 0x01 \\
2373 \DWLNFMDfive & 0x02 \\
2378 \section{Macro Information}
2379 \label{datarep:macroinformation}
2381 The source line numbers and source file indices encoded in the
2382 macro information section are represented as unsigned LEB128
2383 numbers as are the constants in a
2384 \DWMACINFOvendorext{} entry.
2386 The macinfo type is encoded as a single byte.
2388 \addtoindexx{macinfo types!encoding}
2390 Table \refersec{tab:macinfotypeencodings}.
2394 \setlength{\extrarowheight}{0.1cm}
2395 \begin{longtable}{l|c}
2396 \caption{Macinfo type encodings} \label{tab:macinfotypeencodings}\\
2397 \hline \bfseries Macinfo type name&\bfseries Value \\ \hline
2399 \bfseries Macinfo type name&\bfseries Value\\ \hline
2401 \hline \emph{Continued on next page}
2406 \DWMACINFOdefine&0x01 \\
2407 \DWMACINFOundef&0x02 \\
2408 \DWMACINFOstartfile&0x03 \\
2409 \DWMACINFOendfile&0x04 \\
2410 \DWMACINFOvendorext&\xff \\
2416 \section{Call Frame Information}
2417 \label{datarep:callframeinformation}
2419 In the \thirtytwobitdwarfformat, the value of the CIE id in the
2420 CIE header is \xffffffff; in the \sixtyfourbitdwarfformat, the
2421 value is \xffffffffffffffff.
2423 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2424 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2426 Call frame instructions are encoded in one or more bytes. The
2427 primary opcode is encoded in the high order two bits of
2428 the first byte (that is, opcode = byte $\gg$ 6). An operand
2429 or extended opcode may be encoded in the low order 6
2430 bits. Additional operands are encoded in subsequent bytes.
2431 The instructions and their encodings are presented in
2432 Table \refersec{tab:callframeinstructionencodings}.
2435 \setlength{\extrarowheight}{0.1cm}
2436 \begin{longtable}{l|c|c|l|l}
2437 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2438 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
2439 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2441 & \bfseries High 2 &\bfseries Low 6 & &\\
2442 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2444 \hline \emph{Continued on next page}
2449 \DWCFAadvanceloc&0x1&delta & \\
2450 \DWCFAoffset&0x2®ister&ULEB128 offset \\
2451 \DWCFArestore&0x3®ister & & \\
2452 \DWCFAnop&0&0 & & \\
2453 \DWCFAsetloc&0&0x01&address & \\
2454 \DWCFAadvancelocone&0&0x02&1\dash byte delta & \\
2455 \DWCFAadvanceloctwo&0&0x03&2\dash byte delta & \\
2456 \DWCFAadvancelocfour&0&0x04&4\dash byte delta & \\
2457 \DWCFAoffsetextended&0&0x05&ULEB128 register&ULEB128 offset \\
2458 \DWCFArestoreextended&0&0x06&ULEB128 register & \\
2459 \DWCFAundefined&0&0x07&ULEB128 register & \\
2460 \DWCFAsamevalue&0&0x08 &ULEB128 register & \\
2461 \DWCFAregister&0&0x09&ULEB128 register &ULEB128 offset \\
2462 \DWCFArememberstate&0&0x0a & & \\
2463 \DWCFArestorestate&0&0x0b & & \\
2464 \DWCFAdefcfa&0&0x0c &ULEB128 register&ULEB128 offset \\
2465 \DWCFAdefcfaregister&0&0x0d&ULEB128 register & \\
2466 \DWCFAdefcfaoffset&0&0x0e &ULEB128 offset & \\
2467 \DWCFAdefcfaexpression&0&0x0f &BLOCK \\
2468 \DWCFAexpression&0&0x10&ULEB128 register & BLOCK \\
2470 \DWCFAoffsetextendedsf&0&0x11&ULEB128 register&SLEB128 offset \\
2471 \DWCFAdefcfasf&0&0x12&ULEB128 register&SLEB128 offset \\
2472 \DWCFAdefcfaoffsetsf&0&0x13&SLEB128 offset & \\
2473 \DWCFAvaloffset&0&0x14&ULEB128&ULEB128 \\
2474 \DWCFAvaloffsetsf&0&0x15&ULEB128&SLEB128 \\
2475 \DWCFAvalexpression&0&0x16&ULEB128&BLOCK \\
2476 \DWCFAlouser&0&0x1c & & \\
2477 \DWCFAhiuser&0&\xiiif & & \\
2481 \section{Non-contiguous Address Ranges}
2482 \label{datarep:noncontiguousaddressranges}
2484 Each entry in a \addtoindex{range list}
2485 (see Section \refersec{chap:noncontiguousaddressranges})
2487 \addtoindexx{base address selection entry!in range list}
2489 \addtoindexx{range list}
2490 a base address selection entry, or an end
2493 A \addtoindex{range list} entry consists of two relative addresses. The
2494 addresses are the same size as addresses on the target machine.
2496 A base address selection entry and an
2497 \addtoindexx{end of list entry!in range list}
2498 end of list entry each
2499 \addtoindexx{base address selection entry!in range list}
2500 consist of two (constant or relocated) addresses. The two
2501 addresses are the same size as addresses on the target machine.
2503 For a \addtoindex{range list} to be specified, the base address of the
2504 \addtoindexx{base address selection entry!in range list}
2505 corresponding compilation unit must be defined
2506 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2508 \section{String Offsets Table}
2509 \label{chap:stringoffsetstable}
2510 Each set of entries in the string offsets table contained in the
2511 \dotdebugstroffsets{} section begins with a header containing:
2512 \begin{enumerate}[1. ]
2513 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2514 A 4-byte or 12-byte length containing the length of
2515 the set of entries for this compilation unit, not
2516 including the length field itself. In the 32-bit
2517 DWARF format, this is a 4-byte unsigned integer
2518 (which must be less than \xfffffffzero); in the 64-bit
2519 DWARF format, this consists of the 4-byte value
2520 \wffffffff followed by an 8-byte unsigned integer
2521 that gives the actual length (see
2522 Section \refersec{datarep:32bitand64bitdwarfformats}).
2524 \item \texttt{version} (\addtoindex{uhalf}) \\
2525 A 2-byte version identifier containing the value
2526 \versiondotdebugstroffsets{}
2527 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2528 \item \texttt{padding} (\addtoindex{uhalf}) \\
2531 This header is followed by a series of string table offsets.
2532 For the 32-bit DWARF format, each offset is 4 bytes long; for
2533 the 64-bit DWARF format, each offset is 8 bytes long.
2535 The \DWATstroffsetsbase{} attribute points to the first
2536 entry following the header. The entries are indexed
2537 sequentially from this base entry, starting from 0.
2539 \section{Address Table}
2540 \label{chap:addresstable}
2541 Each set of entries in the address table contained in the
2542 \dotdebugaddr{} section begins with a header containing:
2543 \begin{enumerate}[1. ]
2544 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2545 A 4-byte or 12-byte length containing the length of
2546 the set of entries for this compilation unit, not
2547 including the length field itself. In the 32-bit
2548 DWARF format, this is a 4-byte unsigned integer
2549 (which must be less than \xfffffffzero); in the 64-bit
2550 DWARF format, this consists of the 4-byte value
2551 \wffffffff followed by an 8-byte unsigned integer
2552 that gives the actual length (see
2553 Section \refersec{datarep:32bitand64bitdwarfformats}).
2556 \item \texttt{version} (\addtoindex{uhalf}) \\
2557 A 2-byte version identifier containing the value
2558 \versiondotdebugaddr{}
2559 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2562 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2563 A 1-byte unsigned integer containing the size in
2564 bytes of an address (or the offset portion of an
2565 address for segmented addressing) on the target
2569 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2570 A 1-byte unsigned integer containing the size in
2571 bytes of a segment selector on the target system.
2574 This header is followed by a series of segment/address pairs.
2575 The segment size is given by the \texttt{segment\_size} field of the
2576 header, and the address size is given by the \texttt{address\_size}
2577 field of the header. If the \texttt{segment\_size} field in the header
2578 is zero, the entries consist only of an addresses.
2580 The \DWATaddrbase{} attribute points to the first entry
2581 following the header. The entries are indexed sequentially
2582 from this base entry, starting from 0.
2584 \section{Range List Table}
2585 \label{app:rangelisttable}
2586 Each set of entries in the range list table contained in the
2587 \dotdebugranges{} section begins with a header containing:
2588 \begin{enumerate}[1. ]
2589 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2590 A 4-byte or 12-byte length containing the length of
2591 the set of entries for this compilation unit, not
2592 including the length field itself. In the 32-bit
2593 DWARF format, this is a 4-byte unsigned integer
2594 (which must be less than \xfffffffzero); in the 64-bit
2595 DWARF format, this consists of the 4-byte value
2596 \wffffffff followed by an 8-byte unsigned integer
2597 that gives the actual length (see
2598 Section \refersec{datarep:32bitand64bitdwarfformats}).
2601 \item \texttt{version} (\addtoindex{uhalf}) \\
2602 A 2-byte version identifier containing the value
2603 \versiondotdebugranges{}
2604 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2607 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2608 A 1-byte unsigned integer containing the size in
2609 bytes of an address (or the offset portion of an
2610 address for segmented addressing) on the target
2614 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2615 A 1-byte unsigned integer containing the size in
2616 bytes of a segment selector on the target system.
2619 This header is followed by a series of range list entries as
2620 described in Section \refersec{chap:locationlists}.
2621 The segment size is given by the
2622 \texttt{segment\_size} field of the header, and the address size is
2623 given by the \texttt{address\_size} field of the header. If the
2624 \texttt{segment\_size} field in the header is zero, the segment
2625 selector is omitted from the range list entries.
2627 The \DWATrangesbase{} attribute points to the first entry
2628 following the header. The entries are referenced by a byte
2629 offset relative to this base address.
2632 \section{Location List Table}
2633 \label{datarep:locationlisttable}
2634 Each set of entries in the location list table contained in the
2635 \dotdebugloc{} or \dotdebuglocdwo{}sections begins with a header containing:
2636 \begin{enumerate}[1. ]
2637 \item \texttt{unit\_length} (\livelink{datarep:initiallengthvalues}{initial length}) \\
2638 A 4-byte or 12-byte length containing the length of
2639 the set of entries for this compilation unit, not
2640 including the length field itself. In the 32-bit
2641 DWARF format, this is a 4-byte unsigned integer
2642 (which must be less than \xfffffffzero); in the 64-bit
2643 DWARF format, this consists of the 4-byte value
2644 \wffffffff followed by an 8-byte unsigned integer
2645 that gives the actual length (see
2646 Section \refersec{datarep:32bitand64bitdwarfformats}).
2649 \item \texttt{version} (\addtoindex{uhalf}) \\
2650 A 2-byte version identifier containing the value
2651 \versiondotdebugloc{}
2652 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2655 \item \texttt{address\_size} (\addtoindex{ubyte}) \\
2656 A 1-byte unsigned integer containing the size in
2657 bytes of an address (or the offset portion of an
2658 address for segmented addressing) on the target
2662 \item \texttt{segment\_size} (\addtoindex{ubyte}) \\
2663 A 1-byte unsigned integer containing the size in
2664 bytes of a segment selector on the target system.
2667 This header is followed by a series of location list entries as
2668 described in Section \refersec{chap:locationlists}.
2669 The segment size is given by the
2670 \texttt{segment\_size} field of the header, and the address size is
2671 given by the \texttt{address\_size} field of the header. If the
2672 \texttt{segment\_size} field in the header is zero, the segment
2673 selector is omitted from the range list entries.
2675 The entries are referenced by a byte offset relative to the first
2676 location list following this header.
2679 \section{Dependencies and Constraints}
2680 \label{datarep:dependenciesandconstraints}
2682 The debugging information in this format is intended to
2684 \addtoindexx{DWARF section names!list of}
2694 \dotdebugpubnames{},
2695 \dotdebugpubtypes{},
2698 \dotdebugstroffsets{}
2701 sections of an object file, or equivalent
2702 separate file or database. The information is not
2703 word\dash aligned. Consequently:
2706 \item For the \thirtytwobitdwarfformat{} and a target architecture with
2707 32\dash bit addresses, an assembler or compiler must provide a way
2708 to produce 2\dash byte and 4\dash byte quantities without alignment
2709 restrictions, and the linker must be able to relocate a
2710 4\dash byte address or
2711 \addtoindexx{section offset!alignment of}
2712 section offset that occurs at an arbitrary
2715 \item For the \thirtytwobitdwarfformat{} and a target architecture with
2716 64\dash bit addresses, an assembler or compiler must provide a
2717 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2718 alignment restrictions, and the linker must be able to relocate
2719 an 8\dash byte address or 4\dash byte
2720 \addtoindexx{section offset!alignment of}
2721 section offset that occurs at an
2722 arbitrary alignment.
2724 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
2725 32\dash bit addresses, an assembler or compiler must provide a
2726 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2727 alignment restrictions, and the linker must be able to relocate
2728 a 4\dash byte address or 8\dash byte
2729 \addtoindexx{section offset!alignment of}
2730 section offset that occurs at an
2731 arbitrary alignment.
2733 \textit{It is expected that this will be required only for very large
2734 32\dash bit programs or by those architectures which support
2735 a mix of 32\dash bit and 64\dash bit code and data within the same
2738 \item For the \sixtyfourbitdwarfformat{} and a target architecture with
2739 64\dash bit addresses, an assembler or compiler must provide a
2740 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2741 alignment restrictions, and the linker must be able to
2742 relocate an 8\dash byte address or
2743 \addtoindexx{section offset!alignment of}
2744 section offset that occurs at
2745 an arbitrary alignment.
2748 \section{Integer Representation Names}
2749 \label{datarep:integerrepresentationnames}
2751 The sizes of the integers used in the lookup by name, lookup
2752 by address, line number and call frame information sections
2754 Table \ref{tab:integerrepresentationnames}.
2758 \setlength{\extrarowheight}{0.1cm}
2759 \begin{longtable}{c|l}
2760 \caption{Integer representation names} \label{tab:integerrepresentationnames}\\
2761 \hline \bfseries Representation name&\bfseries Representation \\ \hline
2763 \bfseries Representation name&\bfseries Representation\\ \hline
2765 \hline \emph{Continued on next page}
2770 \addtoindex{sbyte}& signed, 1\dash byte integer \\
2771 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
2772 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
2773 \addtoindex{uword}&unsigned, 4\dash byte integer \\
2779 \section{Type Signature Computation}
2780 \label{datarep:typesignaturecomputation}
2782 A type signature is computed only by the DWARF producer;
2783 \addtoindexx{type signature computation}
2784 it is used by a DWARF consumer to resolve type references to
2785 the type definitions that are contained in
2786 \addtoindexx{type unit}
2789 The type signature for a type T0 is formed from the
2790 \addtoindex{MD5 hash}
2791 of a flattened description of the type. The flattened
2792 description of the type is a byte sequence derived from the
2793 DWARF encoding of the type as follows:
2794 \begin{enumerate}[1. ]
2796 \item Start with an empty sequence S and a list V of visited
2797 types, where V is initialized to a list containing the type
2798 T0 as its single element. Elements in V are indexed from 1,
2801 \item If the debugging information entry represents a type that
2802 is nested inside another type or a namespace, append to S
2803 the type\textquoteright s context as follows: For each surrounding type
2804 or namespace, beginning with the outermost such construct,
2805 append the letter 'C', the DWARF tag of the construct, and
2806 the name (taken from
2807 \addtoindexx{name attribute}
2808 the \DWATname{} attribute) of the type
2809 \addtoindexx{name attribute}
2810 or namespace (including its trailing null byte).
2812 \item Append to S the letter 'D', followed by the DWARF tag of
2813 the debugging information entry.
2815 \item For each of the attributes in
2816 Table \refersec{tab:attributesusedintypesignaturecomputation}
2818 the debugging information entry, in the order listed,
2819 append to S a marker letter (see below), the DWARF attribute
2820 code, and the attribute value.
2823 \caption{Attributes used in type signature computation}
2824 \label{tab:attributesusedintypesignaturecomputation}
2825 \simplerule[\textwidth]
2827 \autocols[0pt]{c}{2}{l}{
2842 \DWATcontainingtype,
2846 \DWATdatamemberlocation,
2868 \DWATstringlengthbitsize,
2869 \DWATstringlengthbytesize,
2874 \DWATvariableparameter,
2877 \DWATvtableelemlocation
2880 \simplerule[\textwidth]
2883 Note that except for the initial
2884 \DWATname{} attribute,
2885 \addtoindexx{name attribute}
2886 attributes are appended in order according to the alphabetical
2887 spelling of their identifier.
2889 If an implementation defines any vendor-specific attributes,
2890 any such attributes that are essential to the definition of
2891 the type should also be included at the end of the above list,
2892 in their own alphabetical suborder.
2894 An attribute that refers to another type entry T is processed
2895 as follows: (a) If T is in the list V at some V[x], use the
2896 letter 'R' as the marker and use the unsigned LEB128 encoding
2897 of x as the attribute value; otherwise, (b) use the letter 'T'
2898 as the marker, process the type T recursively by performing
2899 Steps 2 through 7, and use the result as the attribute value.
2901 Other attribute values use the letter 'A' as the marker, and
2902 the value consists of the form code (encoded as an unsigned
2903 LEB128 value) followed by the encoding of the value according
2904 to the form code. To ensure reproducibility of the signature,
2905 the set of forms used in the signature computation is limited
2906 to the following: \DWFORMsdata,
2911 \item If the tag in Step 3 is one of \DWTAGpointertype,
2912 \DWTAGreferencetype,
2913 \DWTAGrvaluereferencetype,
2914 \DWTAGptrtomembertype,
2915 or \DWTAGfriend, and the referenced
2916 type (via the \DWATtype{} or
2917 \DWATfriend{} attribute) has a
2918 \DWATname{} attribute, append to S the letter 'N', the DWARF
2919 attribute code (\DWATtype{} or
2920 \DWATfriend), the context of
2921 the type (according to the method in Step 2), the letter 'E',
2922 and the name of the type. For \DWTAGfriend, if the referenced
2923 entry is a \DWTAGsubprogram, the context is omitted and the
2924 name to be used is the ABI-specific name of the subprogram
2925 (e.g., the mangled linker name).
2928 \item If the tag in Step 3 is not one of \DWTAGpointertype,
2929 \DWTAGreferencetype,
2930 \DWTAGrvaluereferencetype,
2931 \DWTAGptrtomembertype, or
2932 \DWTAGfriend, but has
2933 a \DWATtype{} attribute, or if the referenced type (via
2935 \DWATfriend{} attribute) does not have a
2936 \DWATname{} attribute, the attribute is processed according to
2937 the method in Step 4 for an attribute that refers to another
2941 \item Visit each child C of the debugging information
2942 entry as follows: If C is a nested type entry or a member
2943 function entry, and has
2944 a \DWATname{} attribute, append to
2945 \addtoindexx{name attribute}
2946 S the letter 'S', the tag of C, and its name; otherwise,
2947 process C recursively by performing Steps 3 through 7,
2948 appending the result to S. Following the last child (or if
2949 there are no children), append a zero byte.
2954 For the purposes of this algorithm, if a debugging information
2956 \DWATspecification{}
2957 attribute that refers to
2958 another entry D (which has a
2961 then S inherits the attributes and children of D, and S is
2962 processed as if those attributes and children were present in
2963 the entry S. Exception: if a particular attribute is found in
2964 both S and D, the attribute in S is used and the corresponding
2965 one in D is ignored.
2967 DWARF tag and attribute codes are appended to the sequence
2968 as unsigned LEB128 values, using the values defined earlier
2971 \textit{A grammar describing this computation may be found in
2972 Appendix \refersec{app:typesignaturecomputationgrammar}.
2975 \textit{An attribute that refers to another type entry should
2976 be recursively processed or replaced with the name of the
2977 referent (in Step 4, 5 or 6). If neither treatment applies to
2978 an attribute that references another type entry, the entry
2979 that contains that attribute should not be considered for a
2980 separate \addtoindex{type unit}.}
2982 \textit{If a debugging information entry contains an attribute from
2983 the list above that would require an unsupported form, that
2984 entry should not be considered for a separate
2985 \addtoindex{type unit}.}
2987 \textit{A type should be considered for a separate
2988 \addtoindex{type unit} only
2989 if all of the type entries that it contains or refers to in
2990 Steps 6 and 7 can themselves each be considered for a separate
2991 \addtoindex{type unit}.}
2994 Where the DWARF producer may reasonably choose two or more
2995 different forms for a given attribute, it should choose
2996 the simplest possible form in computing the signature. (For
2997 example, a constant value should be preferred to a location
2998 expression when possible.)
3000 Once the string S has been formed from the DWARF encoding,
3001 an \addtoindex{MD5 hash} is computed for the string and the
3002 least significant 64 bits are taken as the type signature.
3004 \textit{The string S is intended to be a flattened representation of
3005 the type that uniquely identifies that type (i.e., a different
3006 type is highly unlikely to produce the same string).}
3008 \textit{A debugging information entry should not be placed in a
3009 separate \addtoindex{type unit}
3010 if any of the following apply:}
3014 \item \textit{The entry has an attribute whose value is a location
3015 expression, and the location expression contains a reference to
3016 another debugging information entry (e.g., a \DWOPcallref{}
3017 operator), as it is unlikely that the entry will remain
3018 identical across compilation units.}
3020 \item \textit{The entry has an attribute whose value refers
3021 to a code location or a \addtoindex{location list}.}
3023 \item \textit{The entry has an attribute whose value refers
3024 to another debugging information entry that does not represent
3030 \textit{Certain attributes are not included in the type signature:}
3033 \item \textit{The \DWATdeclaration{} attribute is not included because it
3034 indicates that the debugging information entry represents an
3035 incomplete declaration, and incomplete declarations should
3037 \addtoindexx{type unit}
3038 separate type units.}
3040 \item \textit{The \DWATdescription{} attribute is not included because
3041 it does not provide any information unique to the defining
3042 declaration of the type.}
3044 \item \textit{The \DWATdeclfile,
3046 \DWATdeclcolumn{} attributes are not included because they
3047 may vary from one source file to the next, and would prevent
3048 two otherwise identical type declarations from producing the
3049 \addtoindexx{MD5 hash}
3052 \item \textit{The \DWATobjectpointer{} attribute is not included
3053 because the information it provides is not necessary for the
3054 computation of a unique type signature.}
3058 \textit{Nested types and some types referred to by a debugging
3059 information entry are encoded by name rather than by recursively
3060 encoding the type to allow for cases where a complete definition
3061 of the type might not be available in all compilation units.}
3063 \textit{If a type definition contains the definition of a member function,
3064 it cannot be moved as is into a type unit, because the member function
3065 contains attributes that are unique to that compilation unit.
3066 Such a type definition can be moved to a type unit by rewriting the DIE tree,
3067 moving the member function declaration into a separate declaration tree,
3068 and replacing the function definition in the type with a non-defining
3069 declaration of the function (as if the function had been defined out of
3072 An example that illustrates the computation of an MD5 hash may be found in
3073 Appendix \refersec{app:usingtypeunits}.