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 value range for vendor specific extensions consist of the
24 appropriate prefix (DW\-\_TAG, DW\-\_AT, DW\-\_END, DW\-\_ATE, DW\-\_OP,
25 DW\-\_LANG, DW\-\_LNE, DW\-\_CC or DW\-\_CFA respectively) followed by
26 \_lo\_user or \_hi\_user.
27 \textit{For example, for entry tags, the special
28 labels are \livetarg{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user} and
29 \livetarg{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}.}
31 range between \textit{prefix}\_lo\_user and \textit{prefix}\_hi\_user inclusive,
32 are reserved for vendor specific extensions. Vendors may
33 use values in this range without conflicting with current or
34 future system\dash defined values. All other values are reserved
35 for use by the system.
37 \textit{There may also be codes for vendor specific extensions
38 between the number of standard line number opcodes and
39 the first special line number opcode. However, since the
40 number of standard opcodes varies with the DWARF version,
41 the range for extensions is also version dependent. Thus,
42 \livetarg{chap:DWLNSlouser}{DW\-\_LNS\-\_lo\-\_user} and
43 \livetarg{chap:DWLNShiuser}{DW\-\_LNS\-\_hi\-\_user} symbols are not defined.
46 Vendor defined tags, attributes, base type encodings, location
47 atoms, language names, line number actions, calling conventions
48 and call frame instructions, conventionally use the form
49 \text{prefix\_vendor\_id\_name}, where
50 \textit{vendor\_id}\addtoindexx{vendor id} is some identifying
51 character sequence chosen so as to avoid conflicts with
54 To ensure that extensions added by one vendor may be safely
55 ignored by consumers that do not understand those extensions,
56 the following rules should be followed:
57 \begin{enumerate}[1. ]
59 \item New attributes should be added in such a way that a
60 debugger may recognize the format of a new attribute value
61 without knowing the content of that attribute value.
63 \item The semantics of any new attributes should not alter
64 the semantics of previously existing attributes.
66 \item The semantics of any new tags should not conflict with
67 the semantics of previously existing tags.
69 \item Do not add any new forms of attribute value.
74 \section{Reserved Values}
75 \label{datarep:reservedvalues}
76 \subsection{Error Values}
77 \label{datarep:errorvalues}
78 \addtoindexx{reserved values!error}
81 \addtoindexx{error value}
82 a convenience for consumers of DWARF information, the value
83 0 is reserved in the encodings for attribute names, attribute
84 forms, base type encodings, location operations, languages,
85 line number program opcodes, macro information entries and tag
86 names to represent an error condition or unknown value. DWARF
87 does not specify names for these reserved values, since they
88 do not represent valid encodings for the given type and should
89 not appear in DWARF debugging information.
92 \subsection{Initial Length Values}
93 \label{datarep:initiallengthvalues}
94 \addtoindexx{reserved values!initial length}
96 An \addtoindex{initial length field} is one of the length fields that occur
98 of those DWARF sections that
100 (\addtoindex{.debug\_aranges},
101 \addtoindex{.debug\_info},
102 \addtoindex{.debug\_types},
103 \addtoindex{.debug\_line},
104 \addtoindex{.debug\_pubnames}, and
105 \addtoindex{.debug\_pubtypes}) or the length field
106 that occurs at the beginning of the CIE and FDE structures
107 in the \addtoindex{.debug\_frame} section.
109 In an \addtoindex{initial length field}, the values 0xfffffff0 through
110 0xffffffff are reserved by DWARF to indicate some form of
111 extension relative to \addtoindex{DWARF Version 2}; such values must not
112 be interpreted as a length field. The use of one such value,
113 0xffffffff, is defined below
114 (see Section \refersec{datarep:32bitand64bitdwarfformats});
116 the other values is reserved for possible future extensions.
120 \section{Executable Objects and Shared Objects}
121 \label{datarep:executableobjectsandsharedobjects}
123 The relocated addresses in the debugging information for an
124 executable object are virtual addresses and the relocated
125 addresses in the debugging information for a shared object
126 are offsets relative to the start of the lowest region of
127 memory loaded from that shared object.
129 \textit{This requirement makes the debugging information for
130 shared objects position independent. Virtual addresses in a
131 shared object may be calculated by adding the offset to the
132 base address at which the object was attached. This offset
133 is available in the run\dash time linker\textquoteright s data structures.}
137 \section{32-Bit and 64-Bit DWARF Formats}
138 \label{datarep:32bitand64bitdwarfformats}
140 \addtoindexx{32-bit DWARF format}
141 \addtoindexx{64-bit DWARF format}
142 There are two closely related file formats. In the 32\dash bit DWARF
143 format, all values that represent lengths of DWARF sections
144 and offsets relative to the beginning of DWARF sections are
145 represented using 32\dash bits. In the 64\dash bit DWARF format, all
146 values that represent lengths of DWARF sections and offsets
147 relative to the beginning of DWARF sections are represented
148 using 64\dash bits. A special convention applies to the initial
149 length field of certain DWARF sections, as well as the CIE and
150 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
151 can coexist and be distinguished within a single linked object.
153 The differences between the 32\dash\ and 64\dash bit
155 detailed in the following:
156 \begin{enumerate}[1. ]
158 \item In the 32\dash bit DWARF format, an
159 \addtoindex{initial length field}
161 \addtoindex{initial length field!encoding}
162 Section \refersec{datarep:initiallengthvalues})
163 is an unsigned 32\dash bit integer (which
164 must be less than 0xfffffff0); in the 64\dash bit DWARF format,
165 an \addtoindex{initial length field} is 96 bits in size,
168 \item The first 32\dash bits have the value 0xffffffff.
170 \item The following 64\dash bits contain the actual length
171 represented as an unsigned 64\dash bit integer.
174 \textit{This representation allows a DWARF consumer to dynamically
175 detect that a DWARF section contribution is using the 64\dash bit
176 format and to adapt its processing accordingly.}
178 \item Section offset and section length
179 \addtoindexx{section length!use in headers}
181 \addtoindexx{section offset!use in headers}
182 in the headers of DWARF sections (other
183 \addtoindex{initial length field}
185 \addtoindex{initial length}
186 fields) are listed following. In the 32\dash bit DWARF format these
187 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
189 \addtoindexx{section length!in .debug\_aranges header}
191 \addtoindexx{section length!in .debug\_pubnames header}
193 \addtoindexx{section length!in .debug\_pubtypes header}
194 unsigned integer values.
198 Section &Name & Role \\ \hline
199 \addtoindex{.debug\_ranges} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
200 \addtoindex{.debug\_frame}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
201 \addtoindex{.debug\_frame}/FDE & \addtoindex{CIE\_pointer} & offset in \addtoindex{.debug\_frame} \\
202 \addtoindex{.debug\_info} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_abbrev} \\
203 \addtoindex{.debug\_line} & \addtoindex{header\_length} & length of header itself \\
204 \addtoindex{.debug\_pubnames} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
205 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
207 \addtoindex{.debug\_pubtypes} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
208 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
210 \addtoindex{.debug\_types} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_info} \\
211 & \addtoindex{type\_offset} & offset in of \addtoindex{.debug\_types} \\
216 \textit{The CIE\_id field in a CIE structure must be 64 bits because
217 it overlays the CIE\_pointer in a FDE structure; this implicit
218 union must be accessed to distinguish whether a CIE or FDE is
219 present, consequently, these two fields must exactly overlay
220 each other (both offset and size).}
222 \item Within the body of the \addtoindex{.debug\_info} or \addtoindex{.debug\_types}
223 section, certain forms of attribute value depend on the choice
224 of DWARF format as follows. For the 32\dash bit DWARF format,
225 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
226 format, the value is a 64\dash bit unsigned integer.
229 Form & Role \\ \hline
230 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}& offset in \addtoindex{.debug\_info} \\
231 \livetarg{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}&
232 \parbox{5.5cm}{offset in a section other than \addtoindex{.debug\_info} or \addtoindex{.debug\_str}} \\
233 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&offset in \addtoindex{.debug\_str} \\
234 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&offset in \addtoindex{.debug\_info} \\
238 \item Within the body of the \addtoindex{.debug\_pubnames} and
239 \addtoindex{.debug\_pubtypes}
240 sections, the representation of the first field
241 of each tuple (which represents an offset in the
242 \addtoindex{.debug\_info}
243 section) depends on the DWARF format as follows: in the
244 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
245 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
250 The 32\dash bit and 64\dash bit DWARF format conventions must not be
251 intermixed within a single compilation unit.
253 \textit{Attribute values and section header fields that represent
254 addresses in the target program are not affected by these
257 A DWARF consumer that supports the 64\dash bit DWARF format must
258 support executables in which some compilation units use the
259 32\dash bit format and others use the 64\dash bit format provided that
260 the combination links correctly (that is, provided that there
261 are no link\dash time errors due to truncation or overflow). (An
262 implementation is not required to guarantee detection and
263 reporting of all such errors.)
265 \textit{It is expected that DWARF producing compilers will not use
266 the 64\dash bit format by default. In most cases, the division of
267 even very large applications into a number of executable and
268 shared objects will suffice to assure that the DWARF sections
269 within each individual linked object are less than 4 GBytes
270 in size. However, for those cases where needed, the 64\dash bit
271 format allows the unusual case to be handled as well. Even
272 in this case, it is expected that only application supplied
273 objects will need to be compiled using the 64\dash bit format;
274 separate 32\dash bit format versions of system supplied shared
275 executable libraries can still be used.}
279 \section{Format of Debugging Information}
280 \label{datarep:formatofdebugginginformation}
282 For each compilation unit compiled with a DWARF producer,
283 a contribution is made to the \addtoindex{.debug\_info} section of
284 the object file. Each such contribution consists of a
285 compilation unit header
286 (see Section \refersec{datarep:compilationunitheader})
288 single \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} or
289 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} debugging
290 information entry, together with its children.
292 For each type defined in a compilation unit, a contribution may
293 be made to the \addtoindex{.debug\_types}
294 section of the object file. Each
295 such contribution consists of a
296 \addtoindex{type unit} header
297 (see Section \refersec{datarep:typeunitheader})
298 followed by a \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} entry, together with
301 Each debugging information entry begins with a code that
302 represents an entry in a separate
303 \addtoindex{abbreviations table}. This
304 code is followed directly by a series of attribute values.
306 The appropriate entry in the
307 \addtoindex{abbreviations table} guides the
308 interpretation of the information contained directly in the
309 \addtoindex{.debug\_info} or
310 \addtoindex{.debug\_types} section.
313 Multiple debugging information entries may share the same
314 abbreviation table entry. Each compilation unit is associated
315 with a particular abbreviation table, but multiple compilation
316 units may share the same table.
317 \subsection{Unit Headers}
318 \label{datarep:unitheaders}
320 \subsubsection{Compilation Unit Header}
321 \label{datarep:compilationunitheader}
322 \begin{enumerate}[1. ]
324 \item unit\_length (initial length) \\
325 \addtoindexx{unit\_length}
326 A 4\dash byte or 12\dash byte
327 \addtoindexx{initial length}
328 unsigned integer representing the length
329 of the \addtoindex{.debug\_info}
330 contribution for that compilation unit,
331 not including the length field itself. In the 32\dash bit DWARF
332 format, this is a 4\dash byte unsigned integer (which must be less
333 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
334 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
335 integer that gives the actual length
336 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
338 \item version (\addtoindex{uhalf})
339 A 2\dash byte unsigned integer representing the version of the
340 DWARF information for the compilation unit\addtoindexx{version number!compilation unit}
341 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
342 The value in this field is 4.
344 \item \addtoindex{debug\_abbrev\_offset} (section offset) \\
346 \addtoindexx{section offset!in .debug\_info header}
347 4\dash byte or 8\dash byte unsigned offset into the
348 \addtoindex{.debug\_abbrev}
349 section. This offset associates the compilation unit with a
350 particular set of debugging information entry abbreviations. In
351 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
352 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
353 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
355 \item address\_size (\addtoindex{ubyte}) \\
356 A 1\dash byte unsigned integer representing the size in bytes of
357 \addtoindexx{address\_size}
358 an address on the target architecture. If the system uses
359 \addtoindexx{address space!segmented}
360 segmented addressing, this value represents the size of the
361 offset portion of an address.
368 \subsubsection{Type Unit Header}
369 \label{datarep:typeunitheader}
371 The header for the series of debugging information entries
372 contributing to the description of a type that has been
373 placed in its own \addtoindex{type unit}, within the
374 \addtoindex{.debug\_types} section,
375 consists of the following information:
376 \begin{enumerate}[1. ]
378 \item unit\_length (initial length) \\
379 \addtoindexx{unit\_length}
380 A 4\dash byte or 12\dash byte unsigned integer
381 \addtoindexx{initial length}
382 representing the length
383 of the \addtoindex{.debug\_types} contribution for that compilation unit,
384 not including the length field itself. In the 32\dash bit DWARF
385 format, this is a 4\dash byte unsigned integer (which must be
386 less than 0xfffffff0); in the 64\dash bit DWARF format, this
387 consists of the 4\dash byte value 0xffffffff followed by an
388 8\dash byte unsigned integer that gives the actual length
389 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
391 \item version (\addtoindex{uhalf})
392 A 2\dash byte unsigned integer representing the version of the
393 DWARF information for the
394 compilation unit\addtoindexx{version number!type unit}
395 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
396 The value in this field is 4.
398 \item \addtoindex{debug\_abbrev\_offset} (section offset) \\
400 \addtoindexx{section offset!in .debug\_types header}
401 4\dash byte or 8\dash byte unsigned offset into the
402 \addtoindex{.debug\_abbrev}
403 section. This offset associates the compilation unit with a
404 particular set of debugging information entry abbreviations. In
405 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
406 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
407 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
409 \item address\_size (ubyte) \\
410 A 1\dash byte unsigned integer representing the size
411 \addtoindexx{size of an address}
413 \addtoindexx{address\_size}
414 an address on the target architecture. If the system uses
415 \addtoindexx{address space!segmented}
416 segmented addressing, this value represents the size of the
417 offset portion of an address.
420 \item type\_signature (8\dash byte unsigned integer) \\
421 \addtoindexx{type signature}
423 \addtoindexx{type\_signature}
424 64\dash bit unique signature of the type described in this type
427 \textit{An attribute that refers(using \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) to
428 the primary type contained in
429 this \addtoindex{type unit} uses this value.}
432 \item type\_offset (section offset) \\
433 \addtoindexx{type\_offset}
434 A 4\dash byte or 8\dash byte unsigned offset
435 \addtoindexx{section offset!in .debug\_types header}
436 relative to the beginning
437 of the \addtoindex{type unit} header.
438 This offset refers to the debugging
439 information entry that describes the type. Because the type
440 may be nested inside a namespace or other structures, and may
441 contain references to other types that have not been placed in
442 separate type units, it is not necessarily either the first or
443 the only entry in the type unit. In the 32\dash bit DWARF format,
444 this is a 4\dash byte unsigned length; in the 64\dash bit DWARF format,
445 this is an 8\dash byte unsigned length
446 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
450 \subsection{Debugging Information Entry}
451 \label{datarep:debugginginformationentry}
453 Each debugging information entry begins with an unsigned LEB128
454 number containing the abbreviation code for the entry. This
455 code represents an entry within the abbreviations table
456 associated with the compilation unit containing this entry. The
457 abbreviation code is followed by a series of attribute values.
459 On some architectures, there are alignment constraints on
460 section boundaries. To make it easier to pad debugging
461 information sections to satisfy such constraints, the
462 abbreviation code 0 is reserved. Debugging information entries
463 consisting of only the abbreviation code 0 are considered
466 \subsection{Abbreviations Tables}
467 \label{datarep:abbreviationstables}
469 The abbreviations tables for all compilation units
470 are contained in a separate object file section called
471 \addtoindex{.debug\_abbrev}.
472 As mentioned before, multiple compilation
473 units may share the same abbreviations table.
475 The abbreviations table for a single compilation unit consists
476 of a series of abbreviation declarations. Each declaration
477 specifies the tag and attributes for a particular form of
478 debugging information entry. Each declaration begins with
479 an unsigned LEB128 number representing the abbreviation
480 code itself. It is this code that appears at the beginning
481 of a debugging information entry in the
482 \addtoindex{.debug\_info} or
483 \addtoindex{.debug\_types}
484 section. As described above, the abbreviation
485 code 0 is reserved for null debugging information entries. The
486 abbreviation code is followed by another unsigned LEB128
487 number that encodes the entry\textquoteright s tag. The encodings for the
488 tag names are given in
489 Table \refersec{tab:tagencodings}.
492 \setlength{\extrarowheight}{0.1cm}
493 \begin{longtable}{l|l}
495 \caption{Tag encodings} \label{tab:tagencodings} \\
496 \hline \bfseries Tag name&\bfseries Value\\ \hline
498 \bfseries Tag name&\bfseries Value \\ \hline
500 \hline \emph{Continued on next page}
503 \ddag \ \textit{New in \addtoindex{DWARF Version 4}}
505 \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type} &0x01 \\
506 \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type}&0x02 \\
507 \livelink{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point}&0x03 \\
508 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}&0x04 \\
509 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}&0x05 \\
510 \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}&0x08 \\
511 \livelink{chap:DWTAGlabel}{DW\-\_TAG\-\_label}&0x0a \\
512 \livelink{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}&0x0b \\
513 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}&0x0d \\
514 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}&0x0f \\
515 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}&0x10 \\
516 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}&0x11 \\
517 \livelink{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}&0x12 \\
518 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}&0x13 \\
519 \livelink{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}&0x15 \\
520 \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}&0x16 \\
521 \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}&0x17 \\
522 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}&0x18 \\
523 \livelink{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}&0x19 \\
524 \livelink{chap:DWTAGcommonblock}{DW\-\_TAG\-\_common\-\_block}&0x1a \\
525 \livelink{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}&0x1b \\
526 \livelink{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}&0x1c \\
527 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}&0x1d \\
528 \livelink{chap:DWTAGmodule}{DW\-\_TAG\-\_module}&0x1e \\
529 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}&0x1f \\
530 \livelink{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}&0x20 \\
531 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}&0x21 \\
532 \livelink{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}&0x22 \\
533 \livelink{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}&0x23 \\
534 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}&0x24 \\
535 \livelink{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}&0x25 \\
536 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type}&0x26 \\
537 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant}&0x27 \\
538 \livelink{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}&0x28 \\
539 \livelink{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}&0x29 \\
540 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}&0x2a \\
541 \livelink{chap:DWTAGnamelist}{DW\-\_TAG\-\_namelist}&0x2b \\
542 \livelink{chap:DWTAGnamelistitem}{DW\-\_TAG\-\_namelist\-\_item}&0x2c \\
543 \livelink{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}&0x2d \\
544 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}&0x2e \\
545 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}&0x2f \\
546 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}&0x30 \\
547 \livelink{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}&0x31 \\
548 \livelink{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}&0x32 \\
549 \livelink{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part}&0x33 \\
550 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}&0x34 \\
551 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&0x35 \\
552 \livelink{chap:DWTAGdwarfprocedure}{DW\-\_TAG\-\_dwarf\-\_procedure}&0x36 \\
553 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&0x37 \\
554 \livelink{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}&0x38 \\
555 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}&0x39 \\
556 \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}&0x3a \\
557 \livelink{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}&0x3b \\
558 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}&0x3c \\
559 \livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}&0x3d \\
560 \livelink{chap:DWTAGcondition}{DW\-\_TAG\-\_condition}&0x3f \\
561 \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&0x40 \\
562 \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} \ddag &0x41 \\
563 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} \ddag &0x42 \\
564 \livelink{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias} \ddag &0x43 \\
565 \livelink{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user}&0x4080 \\
566 \livelink{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}&0xffff \\
570 Following the tag encoding is a 1\dash byte value that determines
571 whether a debugging information entry using this abbreviation
572 has child entries or not. If the value is
573 \livetarg{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes},
574 the next physically succeeding entry of any debugging
575 information entry using this abbreviation is the first
576 child of that entry. If the 1\dash byte value following the
577 abbreviation\textquoteright s tag encoding is
578 \livetarg{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}, the next
579 physically succeeding entry of any debugging information entry
580 using this abbreviation is a sibling of that entry. (Either
581 the first child or sibling entries may be null entries). The
582 encodings for the child determination byte are given in
583 Table \refersec{tab:childdeterminationencodings}
585 Section \refersec{chap:relationshipofdebugginginformationentries},
586 each chain of sibling entries is terminated by a null entry.)
589 \setlength{\extrarowheight}{0.1cm}
590 \begin{longtable}{l|l}
591 \caption{Child determination encodings}
592 \label{tab:childdeterminationencodings}
593 \addtoindexx{Child determination encodings} \\
594 \hline \bfseries Children determination name&\bfseries Value \\ \hline
596 \bfseries Children determination name&\bfseries Value \\ \hline
598 \hline \emph{Continued on next page}
602 \livelink{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}&0x00 \\
603 \livelink{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes}&0x01 \\ \hline
607 Finally, the child encoding is followed by a series of
608 attribute specifications. Each attribute specification
609 consists of two parts. The first part is an unsigned LEB128
610 number representing the attribute\textquoteright s name. The second part
611 is an unsigned LEB128 number representing the attribute\textquoteright s
612 form. The series of attribute specifications ends with an
613 entry containing 0 for the name and 0 for the form.
616 \livetarg{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect} is a special case. For
617 attributes with this form, the attribute value itself in the
618 \addtoindex{.debug\_info} or
619 \addtoindex{.debug\_types}
620 section begins with an unsigned
621 LEB128 number that represents its form. This allows producers
622 to choose forms for particular attributes
623 \addtoindexx{abbreviations table!dynamic forms in}
625 without having to add a new entry to the abbreviations table.
627 The abbreviations for a given compilation unit end with an
628 entry consisting of a 0 byte for the abbreviation code.
631 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
632 for a depiction of the organization of the
633 debugging information.}
636 \subsection{Attribute Encodings}
637 \label{datarep:attributeencodings}
639 The encodings for the attribute names are given in
640 Table \refersec{tab:attributeencodings}.
642 The attribute form governs how the value of the attribute is
643 encoded. There are nine classes of form, listed below. Each
644 class is a set of forms which have related representations
645 and which are given a common interpretation according to the
646 attribute in which the form is used.
648 Form \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}
650 \addtoindexx{rangelistptr class}
652 \addtoindexx{macptr class}
654 \addtoindexx{loclistptr class}
656 \addtoindexx{lineptr class}
657 namely \livelink{chap:lineptr}{lineptr},
658 \livelink{chap:loclistptr}{loclistptr},
659 \livelink{chap:macptr}{macptr} or
660 \livelink{chap:rangelistptr}{rangelistptr}; the list
661 of classes allowed by the applicable attribute in
662 Table \refersec{tab:attributeencodings}
663 determines the class of the form.
665 \textit{In DWARF V3 the forms \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
666 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} were
667 \addtoindexx{lineptr class}
669 \addtoindexx{rangelistptr class}
671 \addtoindexx{macptr class}
673 \addtoindexx{loclistptr class}
674 class constant \addtoindexx{constant class}
675 or one of the classes
676 \livelink{chap:lineptr}{lineptr},
677 \livelink{chap:loclistptr}{loclistptr},
678 \livelink{chap:macptr}{macptr} or
679 \livelink{chap:rangelistptr}{rangelistptr}, depending on context. In
681 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
682 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} are members of class
683 constant in all cases.
685 \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} replaces
686 their usage for the other classes.}
688 Each possible form belongs to one or more of the following classes:
691 \item \livelinki{chap:DWATaddressclass}{address}{address class} \\
692 Represented as an object of appropriate size to hold an
693 address on the target machine
694 (\livetarg{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}).
696 encoded in the compilation unit header
697 (see Section \refersec{datarep:compilationunitheader}).
698 This address is relocatable in a relocatable object file and
699 is relocated in an executable file or shared object.
701 \item \livelink{chap:block}{block} \\
702 Blocks come in four forms:
704 \begin{myindentpara}{1cm}
705 A 1\dash byte length followed by 0 to 255 contiguous information
706 bytes (\livetarg{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}).
709 \begin{myindentpara}{1cm}
710 A 2\dash byte length followed by 0 to 65,535 contiguous information
711 bytes (\livetarg{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}).
715 \begin{myindentpara}{1cm}
716 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
717 information bytes (\livetarg{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}).
721 \begin{myindentpara}{1cm}
722 An unsigned LEB128 length followed by the number of bytes
723 specified by the length (\livetarg{chap:DWFORMblock}{DW\-\_FORM\-\_block}).
726 In all forms, the length is the number of information bytes
727 that follow. The information bytes may contain any mixture
728 of relocated (or relocatable) addresses, references to other
729 debugging information entries or data bytes.
732 There are six forms of constants. There are fixed length
733 constant data forms for one, two, four and eight byte values
735 \livetarg{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
736 \livetarg{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
737 \livetarg{chap:DWFORMdata4}{DW\-\_FORM\-\_data4},
738 and \livetarg{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}).
739 There are also variable length constant
740 data forms encoded using LEB128 numbers (see below). Both
741 signed (\livetarg{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}) and unsigned
742 (\livetarg{chap:DWFORMudata}{DW\-\_FORM\-\_udata}) variable
743 length constants are available
745 The data in \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
746 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
747 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
748 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}
749 can be anything. Depending on context, it may
750 be a signed integer, an unsigned integer, a floating\dash point
751 constant, or anything else. A consumer must use context to
752 know how to interpret the bits, which if they are target
753 machine data (such as an integer or floating point constant)
754 will be in target machine byte\dash order.
756 \textit{If one of the \livetarg{chap:DWFORMdata}{DW\-\_FORM\-\_data}\textless n\textgreater
757 forms is used to represent a
758 signed or unsigned integer, it can be hard for a consumer
759 to discover the context necessary to determine which
760 interpretation is intended. Producers are therefore strongly
761 encouraged to use \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata} or
762 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata} for signed and
763 unsigned integers respectively, rather than
764 \livelink{chap:DWFORMdata}{DW\-\_FORM\-\_data}\textless n\textgreater.}
767 \item \livelink{chap:exprloc}{exprloc} \\
768 This is an unsigned LEB128 length followed by the
769 number of information bytes specified by the length
770 (\livetarg{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc}).
771 The information bytes contain a DWARF
773 (see Section \refersec{chap:dwarfexpressions})
774 or location description
775 (see Section \refersec{chap:locationdescriptions}).
777 \item \livelink{chap:flag}{flag} \\
778 A flag \addtoindexx{flag class}
779 is represented explicitly as a single byte of data
780 (\livetarg{chap:DWFORMflag}{DW\-\_FORM\-\_flag}) or
781 implicitly (\livetarg{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present}).
783 first case, if the \nolink{flag} has value zero, it indicates the
784 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
785 it indicates the presence of the attribute. In the second
786 case, the attribute is implicitly indicated as present, and
787 no value is encoded in the debugging information entry itself.
789 \item \livelink{chap:lineptr}{lineptr} \\
790 This is an offset into
791 \addtoindexx{section offset!in class lineptr value}
793 \addtoindex{.debug\_line} section
794 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
795 It consists of an offset from the
797 \addtoindex{.debug\_line}
798 section to the first byte of
799 the data making up the line number list for the compilation
801 It is relocatable in a relocatable object file, and
802 relocated in an executable or shared object. In the 32\dash bit
803 DWARF format, this offset is a 4\dash byte unsigned value;
804 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
805 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
808 \item \livelink{chap:loclistptr}{loclistptr} \\
809 This is an offset into the
810 \addtoindex{.debug\_loc}
812 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
813 It consists of an offset from the
814 \addtoindexx{section offset!in class loclistptr value}
816 \addtoindex{.debug\_loc}
817 section to the first byte of
818 the data making up the
819 \addtoindex{location list} for the compilation
821 It is relocatable in a relocatable object file, and
822 relocated in an executable or shared object. In the 32\dash bit
823 DWARF format, this offset is a 4\dash byte unsigned value;
824 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
825 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
828 \item \livelink{chap:macptr}{macptr} \\
830 \addtoindexx{section offset!in class macptr value}
832 \addtoindex{.debug\_macinfo} section
833 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
834 It consists of an offset from the
835 beginning of the \addtoindex{.debug\_macinfo}
836 section to the first byte of
837 the data making up the macro information list for the compilation
839 It is relocatable in a relocatable object file, and
840 relocated in an executable or shared object. In the 32\dash bit
841 DWARF format, this offset is a 4\dash byte unsigned value;
842 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
843 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
846 \item \livelink{chap:rangelistptr}{rangelistptr} \\
848 \addtoindexx{section offset!in class rangelistptr value}
849 offset into the \addtoindex{.debug\_ranges} section
850 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
852 offset from the beginning of the
853 \addtoindex{.debug\_ranges} section
854 to the beginning of the non\dash contiguous address ranges
855 information for the referencing entity.
857 a relocatable object file, and relocated in an executable or
858 shared object. In the 32\dash bit DWARF format, this offset
859 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
860 format, it is an 8\dash byte unsigned value (see Section
861 \refersec{datarep:32bitand64bitdwarfformats}).
864 \textit{Because classes \livelink{chap:lineptr}{lineptr},
865 \livelink{chap:loclistptr}{loclistptr},
866 \livelink{chap:macptr}{macptr} and
867 \livelink{chap:rangelistptr}{rangelistptr}
868 share a common representation, it is not possible for an
869 attribute to allow more than one of these classes}
874 There are three types of reference.
877 \addtoindexx{reference class}
878 first type of reference can identify any debugging
879 information entry within the containing unit.
882 \addtoindexx{section offset!in class reference value}
883 offset from the first byte of the compilation
884 header for the compilation unit containing the reference. There
885 are five forms for this type of reference. There are fixed
886 length forms for one, two, four and eight byte offsets
887 (respectively, \livetarg{chap:DWFORMref1}{DW\-\_FORM\-\_ref1},
888 \livetarg{chap:DWFORMref2}{DW\-\_FORM\-\_ref2},
889 \livetarg{chap:DWFORMref4}{DW\-\_FORM\-\_ref4},
890 and \livetarg{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}).
891 There is also an unsigned variable
892 length offset encoded form that uses unsigned LEB128 numbers
893 (\livetarg{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}).
894 Because this type of reference is within
895 the containing compilation unit no relocation of the value
898 The second type of reference can identify any debugging
899 information entry within a
900 \addtoindex{.debug\_info} section; in particular,
901 it may refer to an entry in a different compilation unit
902 from the unit containing the reference, and may refer to an
903 entry in a different shared object. This type of reference
904 (\livetarg{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr})
905 is an offset from the beginning of the
906 \addtoindex{.debug\_info}
907 section of the target executable or shared object;
908 it is relocatable in a relocatable object file and frequently
909 relocated in an executable file or shared object. For
910 references from one shared object or static executable file
911 to another, the relocation and identification of the target
912 object must be performed by the consumer. In the 32\dash bit DWARF
913 format, this offset is a 4\dash byte unsigned value;
914 in the 64\dash bit DWARF format, it is an 8\dash byte
916 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
918 \textit{A debugging information entry that may be referenced by
919 another compilation unit using
920 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr} must have a
921 global symbolic name.}
923 \textit{For a reference from one executable or shared object to
924 another, the reference is resolved by the debugger to identify
925 the shared object or executable and the offset into that
926 object\textquoteright s \addtoindex{.debug\_info}
927 section in the same fashion as the run
928 time loader, either when the debug information is first read,
929 or when the reference is used.}
931 The third type of reference can identify any debugging
932 information type entry that has been placed in its own
933 \addtoindex{type unit}. This type of
934 reference (\livetarg{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) is the
935 \addtoindexx{type signature}
936 64\dash bit type signature
937 (see Section \refersec{datarep:typesignaturecomputation})
941 \textit{The use of compilation unit relative references will reduce the
942 number of link\dash time relocations and so speed up linking. The
943 use of the second and third type of reference allows for the
944 sharing of information, such as types, across compilation
947 \textit{A reference to any kind of compilation unit identifies the
948 debugging information entry for that unit, not the preceding
952 A string is a sequence of contiguous non\dash null bytes followed by
954 \addtoindexx{string class}
955 A string may be represented immediately in the
956 debugging information entry itself
957 (\livetarg{chap:DWFORMstring}{DW\-\_FORM\-\_string}), or may
959 \addtoindexx{section offset!in class string value}
960 offset into a string table contained in
961 the \addtoindex{.debug\_str} section of the object file
962 (\livetarg{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}). In
963 the 32\dash bit DWARF format, the representation of a
964 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}
965 value is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
966 it is an 8\dash byte unsigned offset
967 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
969 If the \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}
970 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
971 compilation unit entry, string values are encoded using the
972 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
973 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
974 the string representation is unspecified.
976 \textit{The \addtoindex{Unicode} Standard Version 3 is fully compatible with
977 ISO/IEC 10646\dash 1:1993. It contains all the same characters
978 and encoding points as ISO/IEC 10646, as well as additional
979 information about the characters and their use.}
981 \textit{Earlier versions of DWARF did not specify the representation
982 of strings; for compatibility, this version also does
983 not. However, the UTF\dash 8 representation is strongly recommended.}
987 In no case does an attribute use
988 \addtoindexx{rangelistptr class}
990 \addtoindexx{loclistptr class}
992 \addtoindexx{lineptr class}
994 \addtoindexx{macptr class}
995 classes \livelink{chap:lineptr}{lineptr},
996 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or
997 \livelink{chap:rangelistptr}{rangelistptr} to point into either the
998 \addtoindex{.debug\_info} or \addtoindex{.debug\_str} section.
1000 The form encodings are listed in
1001 Table \refersec{tab:attributeformencodings}.
1005 \setlength{\extrarowheight}{0.1cm}
1006 \begin{longtable}{l|l|l}
1007 \caption{Attribute encodings}
1008 \label{tab:attributeencodings}
1009 \addtoindexx{attribute encodings} \\
1010 \hline \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
1012 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
1014 \hline \emph{Continued on next page}
1017 \ddag \ \textit{New in \addtoindex{DWARF Version 4}}
1019 \livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling}&0x01&reference
1020 \addtoindexx{sibling attribute!encoding} \\
1021 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}&0x02&\livelink{chap:exprloc}{exprloc},
1022 \livelink{chap:loclistptr}{loclistptr}\addtoindex{location attribute!encoding} \\
1023 \livelink{chap:DWATname}{DW\-\_AT\-\_name}&0x03&string
1024 \addtoindexx{name attribute!encoding} \\
1025 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}&0x09&constant
1026 \addtoindexx{ordering attribute!encoding} \\
1027 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}&0x0b&constant, \livelink{chap:exprloc}{exprloc},
1028 reference \addtoindexx{byte size attribute!encoding} \\
1029 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}&0x0c&constant,
1030 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit offset attribute!encoding} \\
1031 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}&0x0d&constant,
1032 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit size attribute!encoding} \\
1033 \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list}&0x10&\livelink{chap:lineptr}{lineptr}
1034 \addtoindex{statement list attribute!encoding} \\
1035 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}&0x11&address
1036 \addtoindexx{low PC attribute!encoding} \\
1037 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}&0x12&address, constant
1038 \addtoindexx{high PC attribute!encoding} \\
1039 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}&0x13&constant
1040 \addtoindexx{language attribute!encoding} \\
1041 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}&0x15&reference
1042 \addtoindexx{discriminant attribute!encoding} \\
1043 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}&0x16&constant
1044 \addtoindexx{discriminant value attribute!encoding} \\
1045 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}&0x17&constant
1046 \addtoindexx{visibility attribute!encoding} \\
1047 \livelink{chap:DWATimport}{DW\-\_AT\-\_import}&0x18&reference
1048 \addtoindexx{import attribute!encoding} \\
1049 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}&0x19&\livelink{chap:exprloc}{exprloc},
1050 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{string length attribute!encoding} \\
1051 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference}&0x1a&reference
1052 \addtoindexx{common reference attribute!encoding} \\
1053 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}&0x1b&string
1054 \addtoindexx{compilation directory attribute!encoding} \\
1055 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}&0x1c&\livelink{chap:block}{block}, constant, string
1056 \addtoindexx{constant value attribute!encoding} \\
1057 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}&0x1d&reference
1058 \addtoindexx{containing type attribute!encoding} \\
1059 \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}&0x1e&reference
1060 \addtoindexx{default value attribute!encoding} \\
1061 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline}&0x20&constant
1062 \addtoindexx{inline attribute!encoding} \\
1063 \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}&0x21&\livelink{chap:flag}{flag}
1064 \addtoindexx{is optional attribute!encoding} \\
1065 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}&0x22&constant,
1066 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{lower bound attribute!encoding} \\
1067 \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer}&0x25&string \addtoindexx{producer attribute!encoding} \\
1068 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}&0x27&\livelink{chap:flag}{flag}
1069 \addtoindexx{prototyped attribute!encoding} \\
1070 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}&0x2a&\livelink{chap:exprloc}{exprloc},
1071 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{return address attribute!encoding} \\
1072 % FIXME: lower case , not Constant
1073 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}&0x2c&Constant,
1074 \livelink{chap:rangelistptr}{rangelistptr} \addtoindexx{start scope attribute!encoding} \\
1075 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}&0x2e&constant,
1076 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit stride attribute!encoding} \\
1077 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}&0x2f&constant,
1078 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{upper bound attribute!encoding} \\
1079 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}&0x31&reference
1080 \addtoindexx{abstract origin attribute!encoding} \\
1081 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}&0x32&constant
1082 \addtoindexx{accessibility attribute!encoding} \\
1083 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}&0x33&constant
1084 \addtoindexx{address class attribute!encoding} \\
1085 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}&0x34&\livelink{chap:flag}{flag}
1086 \addtoindexx{artificial attribute!encoding} \\
1087 \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types}&0x35&reference
1088 \addtoindexx{base types attribute!encoding} \\
1089 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}&0x36&constant
1090 \addtoindexx{calling convention attribute!encoding} \\
1091 \livelink{chap:DWATcount}{DW\-\_AT\-\_count}&0x37&constant, \livelink{chap:exprloc}{exprloc}, reference
1092 \addtoindexx{count attribute!encoding} \\
1093 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}&0x38&constant,
1094 \livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr}
1095 \addtoindexx{data member attribute!encoding} \\
1096 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column}&0x39&constant
1097 \addtoindexx{declaration column attribute!encoding} \\
1098 \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}&0x3a&constant
1099 \addtoindexx{declaration file attribute!encoding} \\
1100 \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}&0x3b&constant
1101 \addtoindexx{declaration line attribute!encoding} \\
1102 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}&0x3c&\livelink{chap:flag}{flag}
1103 \addtoindexx{declaration attribute!encoding} \\
1104 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}&0x3d&\livelink{chap:block}{block}
1105 \addtoindexx{discriminant list attribute!encoding} \\
1106 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}&0x3e&constant
1107 \addtoindexx{encoding attribute!encoding} \\
1108 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external}&0x3f&\livelink{chap:flag}{flag}
1109 \addtoindexx{external attribute!encoding} \\
1110 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base}&0x40&\livelink{chap:exprloc}{exprloc},
1111 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{frame base attribute!encoding} \\
1112 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}&0x41&reference
1113 \addtoindexx{friend attribute!encoding} \\
1114 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}&0x42&constant
1115 \addtoindexx{identifier case attribute!encoding} \\
1116 \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info}&0x43&\livelink{chap:macptr}{macptr}
1117 \addtoindexx{macro information attribute!encoding} \\
1118 \livelink{chap:DWATnamelistitem}{DW\-\_AT\-\_namelist\-\_item}&0x44&reference
1119 \addtoindexx{name list item attribute!encoding} \\
1120 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority}&0x45&reference
1121 \addtoindexx{priority attribute!encoding} \\
1122 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}&0x46&\livelink{chap:exprloc}{exprloc},
1123 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{segment attribute!encoding} \\
1124 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}&0x47&reference
1125 \addtoindexx{specification attribute!encoding} \\
1126 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}&0x48&\livelink{chap:exprloc}{exprloc},
1127 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{static link attribute!encoding} \\
1128 \livelink{chap:DWATtype}{DW\-\_AT\-\_type}&0x49&reference
1129 \addtoindexx{type attribute!encoding} \\
1130 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}&0x4a&\livelink{chap:exprloc}{exprloc},
1131 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{location list attribute!encoding} \\
1132 \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}&0x4b&\livelink{chap:flag}{flag}
1133 \addtoindexx{variable parameter attribute!encoding} \\
1134 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}&0x4c&constant
1135 \addtoindexx{virtuality attribute!encoding} \\
1136 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}&0x4d&\livelink{chap:exprloc}{exprloc},
1137 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{vtable element location attribute!encoding} \\
1139 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}&0x4e&constant, \livelink{chap:exprloc}{exprloc},
1140 reference \addtoindexx{allocated attribute!encoding} \\
1141 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}&0x4f&constant, \livelink{chap:exprloc}{exprloc},
1142 reference \addtoindexx{associated attribute!encoding} \\
1143 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}&0x50&\livelink{chap:exprloc}{exprloc}
1144 \addtoindexx{data location attribute!encoding} \\
1145 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}&0x51&constant, \livelink{chap:exprloc}{exprloc},
1146 reference \addtoindexx{byte stride attribute!encoding} \\
1147 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}&0x52&address
1148 \addtoindexx{entry pc attribute!encoding} \\
1149 \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}&0x53&\livelink{chap:flag}{flag}
1150 \addtoindexx{use UTF8 attribute!encoding}\addtoindex{UTF-8} \\
1151 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}&0x54&reference
1152 \addtoindexx{extension attribute!encoding} \\
1153 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}&0x55&\livelink{chap:rangelistptr}{rangelistptr}
1154 \addtoindexx{ranges attribute!encoding} \\
1155 \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline}&0x56&address, \livelink{chap:flag}{flag},
1156 reference, string \addtoindexx{trampoline attribute!encoding} \\
1157 \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column}&0x57&constant
1158 \addtoindexx{call column attribute!encoding} \\
1159 \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file}&0x58&constant
1160 \addtoindexx{call file attribute!encoding} \\
1161 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line}&0x59&constant
1162 \addtoindexx{call line attribute!encoding} \\
1163 \livelink{chap:DWATdescription}{DW\-\_AT\-\_description}&0x5a&string
1164 \addtoindexx{description attribute!encoding} \\
1165 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}&0x5b&constant
1166 \addtoindexx{binary scale attribute!encoding} \\
1167 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}&0x5c&constant
1168 \addtoindexx{decimal scale attribute!encoding} \\
1169 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} &0x5d&reference
1170 \addtoindexx{small attribute!encoding} \\
1171 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}&0x5e&constant
1172 \addtoindexx{decimal scale attribute!encoding} \\
1173 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}&0x5f&constant
1174 \addtoindexx{digit count attribute!encoding} \\
1175 \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}&0x60&string
1176 \addtoindexx{picture string attribute!encoding} \\
1177 \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}&0x61&\livelink{chap:flag}{flag}
1178 \addtoindexx{mutable attribute!encoding} \\
1180 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}&0x62&\livelink{chap:flag}{flag}
1181 \addtoindexx{thread scaled attribute!encoding} \\
1182 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}&0x63&\livelink{chap:flag}{flag}
1183 \addtoindexx{explicit attribute!encoding} \\
1184 \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}&0x64&reference
1185 \addtoindexx{object pointer attribute!encoding} \\
1186 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}&0x65&constant
1187 \addtoindexx{endianity attribute!encoding} \\
1188 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental}&0x66&\livelink{chap:flag}{flag}
1189 \addtoindexx{elemental attribute!encoding} \\
1190 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure}&0x67&\livelink{chap:flag}{flag}
1191 \addtoindexx{pure attribute!encoding} \\
1192 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}&0x68&\livelink{chap:flag}{flag}
1193 \addtoindexx{recursive attribute!encoding} \\
1194 \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature} \ddag &0x69&reference
1195 \addtoindexx{signature attribute!encoding} \\
1196 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} \ddag &0x6a&\livelink{chap:flag}{flag}
1197 \addtoindexx{main subprogram attribute!encoding} \\
1198 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} \ddag &0x6b&constant
1199 \addtoindexx{data bit offset attribute!encoding} \\
1200 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} \ddag &0x6c&\livelink{chap:flag}{flag}
1201 \addtoindexx{constant expression attribute!encoding} \\
1202 \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class} \ddag &0x6d&\livelink{chap:flag}{flag}
1203 \addtoindexx{enumeration class attribute!encoding} \\
1204 \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} \ddag &0x6e&string
1205 \addtoindexx{linkage name attribute!encoding} \\
1206 \livetarg{chap:DWATlouser}{DW\-\_AT\-\_lo\-\_user}&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1207 \livetarg{chap:DWAThiuser}{DW\-\_AT\-\_hi\-\_user}&0x3fff& --- \addtoindexx{high user attribute encoding} \\
1213 \setlength{\extrarowheight}{0.1cm}
1214 \begin{longtable}{l|l|l}
1215 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1216 \hline \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1218 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1220 \hline \emph{Continued on next page}
1223 \ddag \ \textit{New in \addtoindex{DWARF Version 4}}
1225 \livelink{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}&0x01&address \\
1226 \livelink{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}&0x03&\livelink{chap:block}{block} \\
1227 \livelink{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}&0x04&\livelink{chap:block}{block} \\
1228 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2}&0x05&constant \\
1229 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4}&0x06&constant \\
1230 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}&0x07&constant \\
1231 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string}&0x08&string \\
1232 \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}&0x09&\livelink{chap:block}{block} \\
1233 \livelink{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}&0x0a&\livelink{chap:block}{block} \\
1234 \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1}&0x0b&constant \\
1235 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag}&0x0c&\livelink{chap:flag}{flag} \\
1236 \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}&0x0d&constant \\
1237 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&0x0e&string \\
1238 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata}&0x0f&constant \\
1239 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}&0x10&reference \\
1240 \livelink{chap:DWFORMref1}{DW\-\_FORM\-\_ref1}&0x11&reference \\
1241 \livelink{chap:DWFORMref2}{DW\-\_FORM\-\_ref2}&0x12&reference \\
1242 \livelink{chap:DWFORMref4}{DW\-\_FORM\-\_ref4}&0x13&reference \\
1243 \livelink{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}&0x14&reference \\
1244 \livelink{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}&0x15&reference \\
1245 \livelink{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect}&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1246 \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} \ddag &0x17&\livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr}, \livelink{chap:rangelistptr}{rangelistptr} \\
1247 \livelink{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc} \ddag &0x18&\livelink{chap:exprloc}{exprloc} \\
1248 \livelink{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present} \ddag &0x19&\livelink{chap:flag}{flag} \\
1249 \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8} \ddag &0x20&reference \\
1256 \section{Variable Length Data}
1257 \label{datarep:variablelengthdata}
1258 \addtoindexx{variable length data|see {LEB128}}
1260 \addtoindexx{Little Endian Base 128|see{LEB128}}
1261 encoded using ``Little Endian Base 128''
1262 \addtoindexx{little-endian encoding|see{endian attribute}}
1264 \addtoindexx{LEB128}
1265 LEB128 is a scheme for encoding integers
1266 densely that exploits the assumption that most integers are
1269 \textit{This encoding is equally suitable whether the target machine
1270 architecture represents data in big\dash\ endian or little\dash endian
1271 order. It is ``little\dash endian'' only in the sense that it
1272 avoids using space to represent the ``big'' end of an
1273 unsigned integer, when the big end is all zeroes or sign
1276 Unsigned LEB128 (ULEB128) numbers are encoded as follows:
1277 \addtoindexx{LEB128!unsigned, encoding as}
1278 start at the low order end of an unsigned integer and chop
1279 it into 7\dash bit chunks. Place each chunk into the low order 7
1280 bits of a byte. Typically, several of the high order bytes
1281 will be zero; discard them. Emit the remaining bytes in a
1282 stream, starting with the low order byte; set the high order
1283 bit on each byte except the last emitted byte. The high bit
1284 of zero on the last byte indicates to the decoder that it
1285 has encountered the last byte.
1287 The integer zero is a special case, consisting of a single
1290 Table \refersec{tab:examplesofunsignedleb128encodings}
1291 gives some examples of unsigned LEB128 numbers. The
1292 0x80 in each case is the high order bit of the byte, indicating
1293 that an additional byte follows.
1296 The encoding for signed, two\textquoteright s complement LEB128 (SLEB128)
1297 \addtoindexx{LEB128!signed, encoding as}
1298 numbers is similar, except that the criterion for discarding
1299 high order bytes is not whether they are zero, but whether
1300 they consist entirely of sign extension bits. Consider the
1301 32\dash bit integer -2. The three high level bytes of the number
1302 are sign extension, thus LEB128 would represent it as a single
1303 byte containing the low order 7 bits, with the high order
1304 bit cleared to indicate the end of the byte stream. Note
1305 that there is nothing within the LEB128 representation that
1306 indicates whether an encoded number is signed or unsigned. The
1307 decoder must know what type of number to expect.
1308 Table \refersec{tab:examplesofunsignedleb128encodings}
1309 gives some examples of unsigned LEB128 numbers and
1310 Table \refersec{tab:examplesofsignedleb128encodings}
1311 gives some examples of signed LEB128
1314 \textit{Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1315 \addtoindexx{LEB128!examples}
1316 gives algorithms for encoding and decoding these forms.}
1320 \setlength{\extrarowheight}{0.1cm}
1321 \begin{longtable}{l|l|l}
1322 \caption{Examples of unsigned LEB128 encodings}
1323 \label{tab:examplesofunsignedleb128encodings}
1324 \addtoindexx{LEB128 encoding!examples} \\
1325 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1327 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1329 \hline \emph{Continued on next page}
1335 128& 0 + 0x80 & 1 \\
1336 129& 1 + 0x80 & 1 \\
1337 130& 2 + 0x80 & 1 \\
1338 12857& 57 + 0x80 & 100 \\
1345 \setlength{\extrarowheight}{0.1cm}
1346 \begin{longtable}{l|l|l}
1347 \caption{Examples of signed LEB128 encodings} \label{tab:examplesofsignedleb128encodings} \\
1348 \hline \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1350 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1352 \hline \emph{Continued on next page}
1358 127& 127 + 0x80 & 0 \\
1359 -127& 1 + 0x80 & 0x7f \\
1360 128& 0 + 0x80 & 1 \\
1361 -128& 0 + 0x80 & 0x7f \\
1362 129& 1 + 0x80 & 1 \\
1363 -129& -x7f + 0x80 & 0xtc \\
1370 \section{DWARF Expressions and Location Descriptions}
1371 \label{datarep:dwarfexpressionsandlocationdescriptions}
1372 \subsection{DWARF Expressions}
1373 \label{datarep:dwarfexpressions}
1376 \addtoindexx{DWARF Expression!operator encoding}
1377 DWARF expression is stored in a \nolink{block} of contiguous
1378 bytes. The bytes form a sequence of operations. Each operation
1379 is a 1\dash byte code that identifies that operation, followed by
1380 zero or more bytes of additional data. The encodings for the
1381 operations are described in
1382 Table \refersec{tab:dwarfoperationencodings}.
1385 \setlength{\extrarowheight}{0.1cm}
1386 \begin{longtable}{l|l|c|l}
1387 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1388 \hline & &\bfseries No. of &\\
1389 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1391 & &\bfseries No. of &\\
1392 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1394 \hline \emph{Continued on next page}
1397 \ddag \ \textit{New in \addtoindex{DWARF Version 4}}
1400 \livelink{chap:DWOPaddr}{DW\-\_OP\-\_addr}&0x03&1 & constant address \\
1401 & & &(size target specific) \\
1403 \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}&0x06&0 & \\
1406 \livelink{chap:DWOPconst1u}{DW\-\_OP\-\_const1u}&0x08&1&1\dash byte constant \\
1407 \livelink{chap:DWOPconst1s}{DW\-\_OP\-\_const1s}&0x09&1&1\dash byte constant \\
1408 \livelink{chap:DWOPconst2u}{DW\-\_OP\-\_const2u}&0x0a&1&2\dash byte constant \\
1409 \livelink{chap:DWOPconst2s}{DW\-\_OP\-\_const2s}&0x0b&1&2\dash byte constant \\
1410 \livelink{chap:DWOPconst4u}{DW\-\_OP\-\_const4u}&0x0c&1&4\dash byte constant \\
1411 \livelink{chap:DWOPconst4s}{DW\-\_OP\-\_const4s}&0x0d&1&4\dash byte constant \\
1412 \livelink{chap:DWOPconst8u}{DW\-\_OP\-\_const8u}&0x0e&1&8\dash byte constant \\
1413 \livelink{chap:DWOPconst8s}{DW\-\_OP\-\_const8s}&0x0f&1&8\dash byte constant \\
1414 \livelink{chap:DWOPconstu}{DW\-\_OP\-\_constu}&0x10&1&ULEB128 constant \\
1415 \livelink{chap:DWOPconsts}{DW\-\_OP\-\_consts}&0x11&1&SLEB128 constant \\
1416 \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}&0x12&0 & \\
1417 \livelink{chap:DWOPdrop}{DW\-\_OP\-\_drop}&0x13&0 & \\
1418 \livelink{chap:DWOPover}{DW\-\_OP\-\_over}&0x14&0 & \\
1419 \livelink{chap:DWOPpick}{DW\-\_OP\-\_pick}&0x15&1&1\dash byte stack index \\
1420 \livelink{chap:DWOPswap}{DW\-\_OP\-\_swap}&0x16&0 & \\
1421 \livelink{chap:DWOProt}{DW\-\_OP\-\_rot}&0x17&0 & \\
1422 \livelink{chap:DWOPxderef}{DW\-\_OP\-\_xderef}&0x18&0 & \\
1423 \livelink{chap:DWOPabs}{DW\-\_OP\-\_abs}&0x19&0 & \\
1424 \livelink{chap:DWOPand}{DW\-\_OP\-\_and}&0x1a&0 & \\
1425 \livelink{chap:DWOPdiv}{DW\-\_OP\-\_div}&0x1b&0 & \\
1429 \livelink{chap:DWOPminus}{DW\-\_OP\-\_minus}&0x1c&0 & \\
1430 \livelink{chap:DWOPmod}{DW\-\_OP\-\_mod}&0x1d&0 & \\
1431 \livelink{chap:DWOPmul}{DW\-\_OP\-\_mul}&0x1e&0 & \\
1432 \livelink{chap:DWOPneg}{DW\-\_OP\-\_neg}&0x1f&0 & \\
1433 \livelink{chap:DWOPnot}{DW\-\_OP\-\_not}&0x20&0 & \\
1434 \livelink{chap:DWOPor}{DW\-\_OP\-\_or}&0x21&0 & \\
1435 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}&0x22&0 & \\
1436 \livelink{chap:DWOPplusuconst}{DW\-\_OP\-\_plus\-\_uconst}&0x23&1&ULEB128 addend \\
1437 \livelink{chap:DWOPshl}{DW\-\_OP\-\_shl}&0x24&0 & \\
1438 \livelink{chap:DWOPshr}{DW\-\_OP\-\_shr}&0x25&0 & \\
1439 \livelink{chap:DWOPshra}{DW\-\_OP\-\_shra}&0x26&0 & \\
1440 \livelink{chap:DWOPxor}{DW\-\_OP\-\_xor}&0x27&0 & \\
1441 \livelink{chap:DWOPskip}{DW\-\_OP\-\_skip}&0x2f&1&signed 2\dash byte constant \\
1442 \livelink{chap:DWOPbra}{DW\-\_OP\-\_bra}&0x28&1 & signed 2\dash byte constant \\
1443 \livelink{chap:DWOPeq}{DW\-\_OP\-\_eq}&0x29&0 & \\
1444 \livelink{chap:DWOPge}{DW\-\_OP\-\_ge}&0x2a&0 & \\
1445 \livelink{chap:DWOPgt}{DW\-\_OP\-\_gt}&0x2b&0 & \\
1446 \livelink{chap:DWOPle}{DW\-\_OP\-\_le}&0x2c&0 & \\
1447 \livelink{chap:DWOPlt}{DW\-\_OP\-\_lt}&0x2d&0 & \\
1448 \livelink{chap:DWOPne}{DW\-\_OP\-\_ne}&0x2e&0 & \\ \hline
1452 \livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0}&0x30 & 0 & \\
1454 \livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1}&0x31 & 0& literals 0 .. 31 = \\
1455 \ldots & & &\hspace{0.5cm}(\livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0} + literal) \\
1456 \livelink{chap:DWOPlit31}{DW\-\_OP\-\_lit31}&0x4f & 0 & \\ \hline
1458 \livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} & 0x50 & 0 & \\
1459 \livelink{chap:DWOPreg1}{DW\-\_OP\-\_reg1} & 0x51 & 0® 0 .. 31 = \\
1460 \ldots & & &\hspace{0.5cm}(\livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} + regnum) \\
1461 \livelink{chap:DWOPreg31}{DW\-\_OP\-\_reg31} & 0x6f & 0 & \\ \hline
1463 \livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} & 0x70 &1 & SLEB128 offset \\
1464 \livelink{chap:DWOPbreg1}{DW\-\_OP\-\_breg1} & 0x71 & 1 &base register 0 .. 31 = \\
1465 ... & & &\hspace{0.5cm}(\livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} + regnum) \\
1466 \livelink{chap:DWOPbreg31}{DW\-\_OP\-\_breg31} & 0x8f & 1 & \\ \hline
1468 \livelink{chap:DWOPregx}{DW\-\_OP\-\_regx} & 0x90 &1&ULEB128 register \\
1469 \livelink{chap:DWOPfbreg}{DW\-\_OP\-\_fbreg} & 0x91&1&SLEB128 offset \\
1470 \livelink{chap:DWOPbregx}{DW\-\_OP\-\_bregx} & 0x92&2 &ULEB128 register followed \\
1471 & & & by SLEB128 offset \\
1472 \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} & 0x93 &1& ULEB128 size of piece addressed \\
1473 \livelink{chap:DWOPderefsize}{DW\-\_OP\-\_deref\-\_size} & 0x94 &1& 1-byte size of data retrieved \\
1474 \livelink{chap:DWOPxderefsize}{DW\-\_OP\-\_xderef\-\_size} & 0x95&1&1-byte size of data retrieved \\
1475 \livelink{chap:DWOPnop}{DW\-\_OP\-\_nop} & 0x96 &0& \\
1478 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}&0x97&0 & \\
1479 \livelink{chap:DWOPcall2}{DW\-\_OP\-\_call2}&0x98&1& 2\dash byte offset of DIE \\
1480 \livelink{chap:DWOPcall4}{DW\-\_OP\-\_call4}&0x99&1& 4\dash byte offset of DIE \\
1481 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&0x9a&1& 4\dash\ or 8\dash byte\\
1482 &&& offset of DIE \\
1483 \livelink{chap:DWOPformtlsaddress}{DW\-\_OP\-\_form\-\_tls\-\_address}&0x9b &0& \\
1484 \livelink{chap:DWOPcallframecfa}{DW\-\_OP\-\_call\-\_frame\-\_cfa} &0x9c &0& \\
1485 \livelink{chap:DWOPbitpiece}{DW\-\_OP\-\_bit\-\_piece}&0x9d &2&ULEB128 size followed by \\
1487 \livelink{chap:DWOPimplicitvalue}{DW\-\_OP\-\_implicit\-\_value} \ddag &0x9e &2&ULEB128 size followed by \\
1488 &&&\nolink{block} of that size\\
1489 \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} \ddag &0x9f &0& \\
1490 \livetarg{chap:DWOPlouser}{DW\-\_OP\-\_lo\-\_user} &0xe0 && \\
1491 \livetarg{chap:DWOPhiuser}{DW\-\_OP\-\_hi\-\_user} &0xff && \\
1497 \subsection{Location Descriptions}
1498 \label{datarep:locationdescriptions}
1500 A location description is used to compute the
1501 location of a variable or other entity.
1503 \subsection{Location Lists}
1504 \label{datarep:locationlists}
1506 Each entry in a \addtoindex{location list} is either a location list entry,
1507 a base address selection entry, or an
1508 \addtoindex{end of list entry!in location list}
1511 A \addtoindex{location list} entry consists of two address offsets followed
1512 by a 2\dash byte length, followed by a block of contiguous bytes
1513 that contains a DWARF location description. The length
1514 specifies the number of bytes in that block. The two offsets
1515 are the same size as an address on the target machine.
1517 A base address selection entry and an
1518 \addtoindex{end of list entry!in location list}
1519 end of list entry each
1520 consist of two (constant or relocated) address offsets. The two
1521 offsets are the same size as an address on the target machine.
1523 For a \addtoindex{location list} to be specified, the base address of
1524 \addtoindexx{base address selection entry!in location list}
1525 the corresponding compilation unit must be defined
1526 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1528 \section{Base Type Attribute Encodings}
1529 \label{datarep:basetypeattributeencodings}
1531 The encodings of the
1532 \hypertarget{chap:DWATencodingencodingofbasetype}
1534 \addtoindexx{encoding attribute!encoding}
1536 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
1537 attribute are given in
1538 Table \refersec{tab:basetypeencodingvalues}
1541 \setlength{\extrarowheight}{0.1cm}
1542 \begin{longtable}{l|c}
1543 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1544 \hline \bfseries Base type encoding code name&\bfseries Value \\ \hline
1546 \bfseries Base type encoding code name&\bfseries Value\\ \hline
1548 \hline \emph{Continued on next page}
1551 \ddag \ \textit{New in \addtoindex{DWARF Version 4}}
1554 \livelink{chap:DWATEaddress}{DW\-\_ATE\-\_address}&0x01 \\
1555 \livelink{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}&0x02 \\
1556 \livelink{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}&0x03 \\
1557 \livelink{chap:DWATEfloat}{DW\-\_ATE\-\_float}&0x04 \\
1558 \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed}&0x05 \\
1559 \livelink{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}&0x06 \\
1560 \livelink{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned}&0x07 \\
1561 \livelink{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char}&0x08 \\
1562 \livelink{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}&0x09 \\
1563 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}&0x0a \\
1564 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}&0x0b \\
1565 \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}&0x0c \\
1566 \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed}&0x0d \\
1567 \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}&0x0e \\
1568 \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & 0x0f \\
1569 \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} \ddag & 0x10 \\
1570 \livetarg{chap:DWATElouser}{DW\-\_ATE\-\_lo\-\_user} & 0x80 \\
1571 \livetarg{chap:DWATEhiuser}{DW\-\_ATE\-\_hi\-\_user} & 0xff \\
1577 The encodings of the constants used in the
1578 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute
1580 Table \refersec{tab:decimalsignencodings}.
1584 \setlength{\extrarowheight}{0.1cm}
1585 \begin{longtable}{l|c}
1586 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1587 \hline \bfseries Decimal sign code name&\bfseries Value \\ \hline
1589 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1591 \hline \emph{Continued on next page}
1596 \livelink{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & 0x01 \\
1597 \livelink{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & 0x02 \\
1598 \livelink{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & 0x03 \\
1599 \livelink{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate} & 0x04 \\
1600 \livelink{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate} & 0x05 \\
1605 The encodings of the constants used in the
1606 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute are given in
1607 Table \refersec{tab:endianityencodings}.
1610 \setlength{\extrarowheight}{0.1cm}
1611 \begin{longtable}{l|c}
1612 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1613 \hline \bfseries Endian code name&\bfseries Value \\ \hline
1615 \bfseries Endian code name&\bfseries Value\\ \hline
1617 \hline \emph{Continued on next page}
1622 \livelink{chap:DWENDdefault}{DW\-\_END\-\_default} & 0x00 \\
1623 \livelink{chap:DWENDbig}{DW\-\_END\-\_big} & 0x01 \\
1624 \livelink{chap:DWENDlittle}{DW\-\_END\-\_little} & 0x02 \\
1625 \livetarg{chap:DWENDlouser}{DW\-\_END\-\_lo\-\_user} & 0x40 \\
1626 \livetarg{chap:DWENDhiuser}{DW\-\_END\-\_hi\-\_user} & 0xff \\
1631 \section{Accessibility Codes}
1632 \label{datarep:accessibilitycodes}
1633 The encodings of the constants used in the
1634 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1636 \addtoindexx{accessibility attribute!encoding}
1638 Table \refersec{tab:accessibilityencodings}.
1641 \setlength{\extrarowheight}{0.1cm}
1642 \begin{longtable}{l|c}
1643 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1644 \hline \bfseries Accessibility code name&\bfseries Value \\ \hline
1646 \bfseries Accessibility code name&\bfseries Value\\ \hline
1648 \hline \emph{Continued on next page}
1653 \livelink{chap:DWACCESSpublic}{DW\-\_ACCESS\-\_public}&0x01 \\
1654 \livelink{chap:DWACCESSprotected}{DW\-\_ACCESS\-\_protected}&0x02 \\
1655 \livelink{chap:DWACCESSprivate}{DW\-\_ACCESS\-\_private}&0x03 \\
1661 \section{Visibility Codes}
1662 \label{datarep:visibilitycodes}
1663 The encodings of the constants used in the
1664 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility} attribute are given in
1665 Table \refersec{tab:visibilityencodings}.
1668 \setlength{\extrarowheight}{0.1cm}
1669 \begin{longtable}{l|c}
1670 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
1671 \hline \bfseries Visiibility code name&\bfseries Value \\ \hline
1673 \bfseries Visibility code name&\bfseries Value\\ \hline
1675 \hline \emph{Continued on next page}
1680 \livelink{chap:DWVISlocal}{DW\-\_VIS\-\_local}&0x01 \\
1681 \livelink{chap:DWVISexported}{DW\-\_VIS\-\_exported}&0x02 \\
1682 \livelink{chap:DWVISqualified}{DW\-\_VIS\-\_qualified}&0x03 \\
1687 \section{Virtuality Codes}
1688 \label{datarep:vitualitycodes}
1690 The encodings of the constants used in the
1691 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute are given in
1692 Table \refersec{tab:virtualityencodings}.
1695 \setlength{\extrarowheight}{0.1cm}
1696 \begin{longtable}{l|c}
1697 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
1698 \hline \bfseries Virtuality code name&\bfseries Value \\ \hline
1700 \bfseries Virtuality code name&\bfseries Value\\ \hline
1702 \hline \emph{Continued on next page}
1707 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none}&0x00 \\
1708 \livelink{chap:DWVIRTUALITYvirtual}{DW\-\_VIRTUALITY\-\_virtual}&0x01 \\
1709 \livelink{chap:DWVIRTUALITYpurevirtual}{DW\-\_VIRTUALITY\-\_pure\-\_virtual}&0x02 \\
1717 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none} is equivalent to the absence of the
1718 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
1721 \section{Source Languages}
1722 \label{datarep:sourcelanguages}
1724 The encodings of the constants used
1725 \addtoindexx{language attribute, encoding}
1727 \addtoindexx{language name encoding}
1729 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
1730 attribute are given in
1731 Table \refersec{tab:languageencodings}.
1733 % If we don't force a following space it looks odd
1735 and their associated values are reserved, but the
1736 languages they represent are not well supported.
1737 Table \refersec{tab:languageencodings}
1739 \addtoindexx{lower bound attribute!default}
1740 default lower bound, if any, assumed for
1741 an omitted \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound} attribute in the context of a
1742 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} debugging information entry for each
1746 \setlength{\extrarowheight}{0.1cm}
1747 \begin{longtable}{l|c|c}
1748 \caption{Language encodings} \label{tab:languageencodings}\\
1749 \hline \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
1751 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
1753 \hline \emph{Continued on next page}
1756 \dag \ \textit{See text}
1759 \livelink{chap:DWLANGC89}{DW\-\_LANG\-\_C89}&0x0001&0 \\
1760 \livelink{chap:DWLANGC}{DW\-\_LANG\-\_C}&0x0002&0 \\
1761 \livelink{chap:DWLANGAda83}{DW\-\_LANG\-\_Ada83} \dag &0x0003&1 \addtoindexx{Ada} \\
1762 \livelink{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus} &0x0004&0 \\
1763 \livelink{chap:DWLANGCobol74}{DW\-\_LANG\-\_Cobol74} \dag &0x0005&1 \\
1764 \livelink{chap:DWLANGCobol85}{DW\-\_LANG\-\_Cobol85} \dag &0x0006&1 \\
1765 \livelink{chap:DWLANGFortran77}{DW\-\_LANG\-\_Fortran77}&0x0007&1 \\
1766 \livelink{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90}&0x0008&1 \\
1767 \livelink{chap:DWLANGPascal83}{DW\-\_LANG\-\_Pascal83}&0x0009&1 \\
1768 \livelink{chap:DWLANGModula2}{DW\-\_LANG\-\_Modula2}&0x000a&1 \\
1769 \livelink{chap:DWLANGJava}{DW\-\_LANG\-\_Java}&0x000b&0 \\
1770 \livelink{chap:DWLANGC99}{DW\-\_LANG\-\_C99}&0x000c&0 \\
1771 \livelink{chap:DWLANGAda95}{DW\-\_LANG\-\_Ada95} \dag &0x000d&1 \addtoindexx{Ada} \\
1772 \livelink{chap:DWLANGFortran95}{DW\-\_LANG\-\_Fortran95} &0x000e&1 \\
1773 \livelink{chap:DWLANGPLI}{DW\-\_LANG\-\_PLI} \dag &0x000f&1 \\
1774 \livelink{chap:DWLANGObjC}{DW\-\_LANG\-\_ObjC}&0x0010&0 \\
1775 \livelink{chap:DWLANGObjCplusplus}{DW\-\_LANG\-\_ObjC\-\_plus\-\_plus}&0x0011&0 \\
1776 \livelink{chap:DWLANGUPC}{DW\-\_LANG\-\_UPC}&0x0012&0 \\
1777 \livelink{chap:DWLANGD}{DW\-\_LANG\-\_D}&0x0013&0 \\
1778 \livelink{chap:DWLANGPython}{DW\-\_LANG\-\_Python} \dag &0x0014&0 \\
1779 \livetarg{chap:DWLANGlouser}{DW\-\_LANG\-\_lo\-\_user}&0x8000 & \\
1780 \livetarg{chap:DWLANGhiuser}{DW\-\_LANG\-\_hi\-\_user}&0xffff & \\
1785 \section{Address Class Encodings}
1786 \label{datarep:addressclassencodings}
1788 The value of the common
1789 \addtoindexi{address}{address class!attribute encoding}
1791 \livelink{chap:DWADDRnone}{DW\-\_ADDR\-\_none} is 0.
1794 \section{Identifier Case}
1795 \label{datarep:identifiercase}
1797 The encodings of the constants used in the
1798 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case} attribute are given in
1799 Table \refersec{tab:identifiercaseencodings}.
1802 \setlength{\extrarowheight}{0.1cm}
1803 \begin{longtable}{l|c}
1804 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
1805 \hline \bfseries Identifier case name&\bfseries Value \\ \hline
1807 \bfseries Identifier case name&\bfseries Value\\ \hline
1809 \hline \emph{Continued on next page}
1813 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive}&0x00 \\
1814 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case}&0x01 \\
1815 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case}&0x02 \\
1816 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive}&0x03 \\
1820 \section{Calling Convention Encodings}
1821 \label{datarep:callingconventionencodings}
1822 The encodings of the constants used in the
1823 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention} attribute are given in
1824 Table \refersec{tab:callingconventionencodings}.
1827 \setlength{\extrarowheight}{0.1cm}
1828 \begin{longtable}{l|c}
1829 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
1830 \hline \bfseries Calling Convention name&\bfseries Value \\ \hline
1832 \bfseries Calling Convention name&\bfseries Value\\ \hline
1834 \hline \emph{Continued on next page}
1839 \livelink{chap:DWCCnormal}{DW\-\_CC\-\_normal}&0x01 \\
1840 \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}&0x02 \\
1841 \livelink{chap:DWCCnocall}{DW\-\_CC\-\_nocall}&0x03 \\
1842 \livetarg{chap:DWCClouser}{DW\-\_CC\-\_lo\-\_user}&0x40 \\
1843 \livetarg{chap:DWCChiuser}{DW\-\_CC\-\_hi\-\_user}&0xff \\
1848 \section{Inline Codes}
1849 \label{datarep:inlinecodes}
1851 The encodings of the constants used in
1852 \addtoindexx{inline attribute!encoding}
1854 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute are given in
1855 Table \refersec{tab:inlineencodings}.
1859 \setlength{\extrarowheight}{0.1cm}
1860 \begin{longtable}{l|c}
1861 \caption{Inline encodings} \label{tab:inlineencodings}\\
1862 \hline \bfseries Inline Code name&\bfseries Value \\ \hline
1864 \bfseries Inline Code name&\bfseries Value\\ \hline
1866 \hline \emph{Continued on next page}
1871 \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}&0x00 \\
1872 \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}&0x01 \\
1873 \livelink{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined}&0x02 \\
1874 \livelink{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined}&0x03 \\
1879 % this clearpage is ugly, but the following table came
1880 % out oddly without it.
1882 \section{Array Ordering}
1883 \label{datarep:arrayordering}
1885 The encodings of the constants used in the
1886 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute are given in
1887 Table \refersec{tab:orderingencodings}.
1890 \setlength{\extrarowheight}{0.1cm}
1891 \begin{longtable}{l|c}
1892 \caption{Ordering encodings} \label{tab:orderingencodings}\\
1893 \hline \bfseries Ordering name&\bfseries Value \\ \hline
1895 \bfseries Ordering name&\bfseries Value\\ \hline
1897 \hline \emph{Continued on next page}
1902 \livelink{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}&0x00 \\
1903 \livelink{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major}&0x01 \\
1909 \section{Discriminant Lists}
1910 \label{datarep:discriminantlists}
1912 The descriptors used in
1913 \addtoindexx{discriminant list attribute!encoding}
1915 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute are
1916 encoded as 1\dash byte constants. The
1917 defined values are given in
1918 Table \refersec{tab:discriminantdescriptorencodings}.
1920 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
1922 \setlength{\extrarowheight}{0.1cm}
1923 \begin{longtable}{l|c}
1924 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
1925 \hline \bfseries Descriptor Name&\bfseries Value \\ \hline
1927 \bfseries Descriptor Name&\bfseries Value\\ \hline
1929 \hline \emph{Continued on next page}
1934 \livetarg{chap:DWDSClabel}{DW\-\_DSC\-\_label}&0x00 \\
1935 \livetarg{chap:DWDSCrange}{DW\-\_DSC\-\_range}&0x01 \\
1941 \section{Name Lookup Tables}
1942 \label{datarep:namelookuptables}
1944 Each set of entries in the table of global names contained
1945 in the \addtoindex{.debug\_pubnames} and
1946 \addtoindex{.debug\_pubtypes} sections begins
1947 with a header consisting of:
1948 \begin{enumerate}[1. ]
1950 \item unit\_length (initial length) \\
1951 \addtoindexx{unit\_length}
1952 A 4\dash byte or 12\dash byte unsigned integer
1953 \addtoindexx{initial length}
1954 representing the length
1955 of the \addtoindex{.debug\_info}
1956 contribution for that compilation unit,
1957 not including the length field itself. In the 32\dash bit DWARF
1958 format, this is a 4\dash byte unsigned integer (which must be less
1959 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
1960 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
1961 integer that gives the actual length
1962 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1964 \item version (\addtoindex{uhalf})
1965 A 2\dash byte unsigned integer representing the version of the
1966 DWARF information\addtoindexx{version number!compilation unit} for the compilation unit
1967 \addtoindexx{version number!name lookup table}
1968 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1969 The value in this field is 4.
1971 % Some say unsigned offset this just says offset: FIXME
1972 \item \addtoindex{debug\_info\_offset} (section offset) \\
1974 \addtoindexx{section offset!in name lookup table set of entries}
1975 4\dash byte or 8\dash byte
1977 \addtoindex{.debug\_info}
1978 section of the compilation unit header.
1980 the 32\dash bit DWARF format, this is a 4\dash byte unsigned offset;
1981 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned offsets
1982 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1984 \item \addtoindex{debug\_info\_length} (section length) \\
1985 \addtoindexx{section length!in .debug\_pubnames header}
1987 \addtoindexx{section length!in .debug\_pubtypes header}
1988 4\dash byte or 8\dash byte length containing the size in bytes of the
1989 contents of the \addtoindex{.debug\_info}
1990 section generated to represent
1991 this compilation unit. In the 32\dash bit DWARF format, this is
1992 a 4\dash byte unsigned length; in the 64\dash bit DWARF format, this
1993 is an 8-byte unsigned length
1994 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1999 This header is followed by a series of tuples. Each tuple
2000 consists of a 4\dash byte or 8\dash byte offset followed by a string
2001 of non\dash null bytes terminated by one null byte.
2003 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
2004 format, it is an 8\dash byte offset.
2005 Each set is terminated by an
2006 offset containing the value 0.
2010 \section{Address Range Table}
2011 \label{datarep:addrssrangetable}
2013 Each set of entries in the table of address ranges contained
2014 in the \addtoindex{.debug\_aranges}
2015 section begins with a header containing:
2016 \begin{enumerate}[1. ]
2017 % FIXME The unit length text is not fully consistent across
2020 \item unit\_length (initial length) \\
2021 \addtoindexx{unit\_length}
2022 A 4-byte or 12-byte length containing the length of the
2023 \addtoindexx{initial length}
2024 set of entries for this compilation unit, not including the
2025 length field itself. In the 32-bit DWARF format, this is a
2026 4-byte unsigned integer (which must be less than 0xfffffff0);
2027 in the 64-bit DWARF format, this consists of the 4-byte value
2028 0xffffffff followed by an 8-byte unsigned integer that gives
2030 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2032 \item version (\addtoindex{uhalf}) \\
2033 A 2\dash byte version identifier
2034 \addtoindexx{version number!address range table} containing the value 2
2035 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2037 \item debug\_info\_offset (section offset) \\
2039 \addtoindexx{section offset!in .debug\_aranges header}
2040 4\dash byte or 8\dash byte offset into the
2041 \addtoindex{.debug\_info} section of
2042 the compilation unit header. In the 32\dash bit DWARF format,
2043 this is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
2044 this is an 8\dash byte unsigned offset
2045 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2047 \item address\_size (ubyte) \\
2048 A 1\dash byte unsigned integer containing the size in bytes of an
2049 \addtoindexx{address\_size}
2051 \addtoindexx{size of an address}
2052 (or the offset portion of an address for segmented
2053 \addtoindexx{address space!segmented}
2054 addressing) on the target system.
2056 \item segment\_size (ubyte) \\
2058 \addtoindexx{segment\_size}
2059 1\dash byte unsigned integer containing the size in bytes of a
2060 segment selector on the target system.
2064 This header is followed by a series of tuples. Each tuple
2065 consists of a segment, an address and a length.
2067 size is given by the \addtoindex{segment\_size} field of the header; the
2068 address and length size are each given by the address\_size
2069 field of the header.
2070 The first tuple following the header in
2071 each set begins at an offset that is a multiple of the size
2072 of a single tuple (that is, the size of a segment selector
2073 plus twice the \addtoindex{size of an address}).
2074 The header is padded, if
2075 necessary, to that boundary. Each set of tuples is terminated
2076 by a 0 for the segment, a 0 for the address and 0 for the
2077 length. If the \addtoindex{segment\_size} field in the header is zero,
2078 the segment selectors are omitted from all tuples, including
2079 the terminating tuple.
2082 \section{Line Number Information}
2083 \label{datarep:linenumberinformation}
2085 The \addtoindexi{version number}{version number!line number information}
2086 in the line number program header is 4
2087 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2089 The boolean values ``true'' and ``false''
2090 used by the line number information program are encoded
2091 as a single byte containing the value 0
2092 for ``false,'' and a non-zero value for ``true.''
2094 The encodings for the standard opcodes are given in
2095 \addtoindexx{line number opcodes!standard opcode encoding}
2096 Table \refersec{tab:linenumberstandardopcodeencodings}.
2098 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2100 \setlength{\extrarowheight}{0.1cm}
2101 \begin{longtable}{l|c}
2102 \caption{Line Number Standard Opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2103 \hline \bfseries Opcode Name&\bfseries Value \\ \hline
2105 \bfseries Opcode Name&\bfseries Value\\ \hline
2107 \hline \emph{Continued on next page}
2112 \livelink{chap:DWLNScopy}{DW\-\_LNS\-\_copy}&0x01 \\
2113 \livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}&0x02 \\
2114 \livelink{chap:DWLNSadvanceline}{DW\-\_LNS\-\_advance\-\_line}&0x03 \\
2115 \livelink{chap:DWLNSsetfile}{DW\-\_LNS\-\_set\-\_file}&0x04 \\
2116 \livelink{chap:DWLNSsetcolumn}{DW\-\_LNS\-\_set\-\_column}&0x05 \\
2117 \livelink{chap:DWLNSnegatestmt}{DW\-\_LNS\-\_negate\-\_stmt}&0x06 \\
2118 \livelink{chap:DWLNSsetbasicblock}{DW\-\_LNS\-\_set\-\_basic\-\_block}&0x07 \\
2119 \livelink{chap:DWLNSconstaddpc}{DW\-\_LNS\-\_const\-\_add\-\_pc}&0x08 \\
2120 \livelink{chap:DWLNSfixedadvancepc}{DW\-\_LNS\-\_fixed\-\_advance\-\_pc}&0x09 \\
2121 \livelink{chap:DWLNSsetprologueend}{DW\-\_LNS\-\_set\-\_prologue\-\_end}&0x0a \\
2122 \livelink{chap:DWLNSsetepiloguebegin}{DW\-\_LNS\-\_set\-\_epilogue\-\_begin}&0x0b \\
2123 \livelink{chap:DWLNSsetisa}{DW\-\_LNS\-\_set\-\_isa}&0x0c \\
2130 The encodings for the extended opcodes are given in
2131 \addtoindexx{line number opcodes!extended opcode encoding}
2132 Table \refersec{tab:linenumberextendedopcodeencodings}.
2135 \setlength{\extrarowheight}{0.1cm}
2136 \begin{longtable}{l|c}
2137 \caption{Line Number Extended Opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2138 \hline \bfseries Opcode Name&\bfseries Value \\ \hline
2140 \bfseries Opcode Name&\bfseries Value\\ \hline
2142 \hline \emph{Continued on next page}
2145 \ddag \ \textit{New in \addtoindex{DWARF Version 4}}
2148 \livelink{chap:DWLNEendsequence}{DW\-\_LNE\-\_end\-\_sequence}&0x01 \\
2149 \livelink{chap:DWLNEsetaddress}{DW\-\_LNE\-\_set\-\_address}&0x02\\
2150 \livelink{chap:DWLNEdefinefile}{DW\-\_LNE\-\_define\-\_file}&0x03\\
2151 \livelink{chap:DWLNEsetdiscriminator}{DW\-\_LNE\-\_set\-\_discriminator} \ddag &0x04 \\
2152 \livetarg{chap:DWLNElouser}{DW\-\_LNE\-\_lo\-\_user}&0x80 \\
2153 \livetarg{chap:DWLNEhiuser}{DW\-\_LNE\-\_hi\-\_user}&0xff \\
2158 \section{Macro Information}
2159 \label{datarep:macroinformation}
2161 The source line numbers and source file indices encoded in the
2162 macro information section are represented as unsigned LEB128
2163 numbers as are the constants in a
2164 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext} entry.
2166 The macinfo type is encoded as a single byte.
2168 \addtoindexx{macinfo types!encoding}
2170 Table \refersec{tab:macinfotypeencodings}.
2174 \setlength{\extrarowheight}{0.1cm}
2175 \begin{longtable}{l|c}
2176 \caption{Macinfo Type Encodings} \label{tab:macinfotypeencodings}\\
2177 \hline \bfseries Macinfo Type Name&\bfseries Value \\ \hline
2179 \bfseries Macinfo Type Name&\bfseries Value\\ \hline
2181 \hline \emph{Continued on next page}
2186 \livelink{chap:DWMACINFOdefine}{DW\-\_MACINFO\-\_define}&0x01 \\
2187 \livelink{chap:DWMACINFOundef}{DW\-\_MACINFO\-\_undef}&0x02 \\
2188 \livelink{chap:DWMACINFOstartfile}{DW\-\_MACINFO\-\_start\-\_file}&0x03 \\
2189 \livelink{chap:DWMACINFOendfile}{DW\-\_MACINFO\-\_end\-\_file}&0x04 \\
2190 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext}&0xff \\
2196 \section{Call Frame Information}
2197 \label{datarep:callframeinformation}
2199 In the 32\dash bit DWARF format, the value of the CIE id in the
2200 CIE header is 0xffffffff; in the 64\dash bit DWARF format, the
2201 value is 0xffffffffffffffff.
2203 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2204 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2206 Call frame instructions are encoded in one or more bytes. The
2207 primary opcode is encoded in the high order two bits of
2208 the first byte (that is, opcode = byte >> 6). An operand
2209 or extended opcode may be encoded in the low order 6
2210 bits. Additional operands are encoded in subsequent bytes.
2211 The instructions and their encodings are presented in
2212 Table \refersec{tab:callframeinstructionencodings}.
2215 \setlength{\extrarowheight}{0.1cm}
2216 \begin{longtable}{l|c|c|l|l}
2217 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2218 \hline &\bfseries High 2 &\bfseries Low 6 & & \\
2219 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2221 & \bfseries High 2 &\bfseries Low 6 & &\\
2222 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2224 \hline \emph{Continued on next page}
2229 \livelink{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\-\_loc}&0x1&delta & \\
2230 \livelink{chap:DWCFAoffset}{DW\-\_CFA\-\_offset}&0x2®ister&ULEB128 offset \\
2231 \livelink{chap:DWCFArestore}{DW\-\_CFA\-\_restore}&0x3®ister & & \\
2232 \livelink{chap:DWCFAnop}{DW\-\_CFA\-\_nop}&0&0 & & \\
2233 \livelink{chap:DWCFAsetloc}{DW\-\_CFA\-\_set\-\_loc}&0&0x01&address & \\
2234 \livelink{chap:DWCFAadvanceloc1}{DW\-\_CFA\-\_advance\-\_loc1}&0&0x02&1\dash byte delta & \\
2235 \livelink{chap:DWCFAadvanceloc2}{DW\-\_CFA\-\_advance\-\_loc2}&0&0x03&2\dash byte delta & \\
2236 \livelink{chap:DWCFAadvanceloc4}{DW\-\_CFA\-\_advance\-\_loc4}&0&0x04&4\dash byte delta & \\
2237 \livelink{chap:DWCFAoffsetextended}{DW\-\_CFA\-\_offset\-\_extended}&0&0x05&ULEB128 register&ULEB128 offset \\
2238 \livelink{chap:DWCFArestoreextended}{DW\-\_CFA\-\_restore\-\_extended}&0&0x06&ULEB128 register & \\
2239 \livelink{chap:DWCFAundefined}{DW\-\_CFA\-\_undefined}&0&0x07&ULEB128 register & \\
2240 \livelink{chap:DWCFAsamevalue}{DW\-\_CFA\-\_same\-\_value}&0&0x08 &ULEB128 register & \\
2241 \livelink{chap:DWCFAregister}{DW\-\_CFA\-\_register}&0&0x09&ULEB128 register &ULEB128 offset \\
2242 \livelink{chap:DWCFArememberstate}{DW\-\_CFA\-\_remember\-\_state}&0&0x0a & & \\
2243 \livelink{chap:DWCFArestorestate}{DW\-\_CFA\-\_restore\-\_state}&0&0x0b & & \\
2244 \livelink{chap:DWCFAdefcfa}{DW\-\_CFA\-\_def\-\_cfa}&0&0x0c &ULEB128 register&ULEB128 offset \\
2245 \livelink{chap:DWCFAdefcfaregister}{DW\-\_CFA\-\_def\-\_cfa\-\_register}&0&0x0d&ULEB128 register & \\
2246 \livelink{chap:DWCFAdefcfaoffset}{DW\-\_CFA\-\_def\-\_cfa\-\_offset}&0&0x0e &ULEB128 offset & \\
2247 \livelink{chap:DWCFAdefcfaexpression}{DW\-\_CFA\-\_def\-\_cfa\-\_expression}&0&0x0f &BLOCK \\
2248 \livelink{chap:DWCFAexpression}{DW\-\_CFA\-\_expression}&0&0x10&ULEB128 register & BLOCK \\
2250 \livelink{chap:DWCFAoffsetextendedsf}{DW\-\_CFA\-\_offset\-\_extended\-\_sf}&0&0x11&ULEB128 register&SLEB128 offset \\
2251 \livelink{chap:DWCFAdefcfasf}{DW\-\_CFA\-\_def\-\_cfa\-\_sf}&0&0x12&ULEB128 register&SLEB128 offset \\
2252 \livelink{chap:DWCFAdefcfaoffsetsf}{DW\-\_CFA\-\_def\-\_cfa\-\_offset\-\_sf}&0&0x13&SLEB128 offset & \\
2253 \livelink{chap:DWCFAvaloffset}{DW\-\_CFA\-\_val\-\_offset}&0&0x14&ULEB128&ULEB128 \\
2254 \livelink{chap:DWCFAvaloffsetsf}{DW\-\_CFA\-\_val\-\_offset\-\_sf}&0&0x15&ULEB128&SLEB128 \\
2255 \livelink{chap:DWCFAvalexpression}{DW\-\_CFA\-\_val\-\_expression}&0&0x16&ULEB128&BLOCK \\
2256 \livetarg{chap:DWCFAlouser}{DW\-\_CFA\-\_lo\-\_user}&0&0x1c & & \\
2257 \livetarg{chap:DWCFAhiuser}{DW\-\_CFA\-\_hi\-\_user}&0&0x3f & & \\
2261 \section{Non-contiguous Address Ranges}
2262 \label{datarep:noncontiguousaddressranges}
2264 Each entry in a \addtoindex{range list}
2265 (see Section \refersec{chap:noncontiguousaddressranges})
2267 \addtoindexx{base address selection entry!in range list}
2269 \addtoindexx{range list}
2270 a base address selection entry, or an end
2273 A \addtoindex{range list} entry consists of two relative addresses. The
2274 addresses are the same size as addresses on the target machine.
2276 A base address selection entry and an
2277 \addtoindex{end of list entry!in range list}
2278 end of list entry each
2279 \addtoindexx{base address selection entry!in range list}
2280 consist of two (constant or relocated) addresses. The two
2281 addresses are the same size as addresses on the target machine.
2283 For a \addtoindex{range list} to be specified, the base address of the
2284 \addtoindexx{base address selection entry!in range list}
2285 corresponding compilation unit must be defined
2286 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2289 \section{Dependencies and Constraints}
2290 \label{datarep:dependenciesandconstraints}
2292 The debugging information in this format is intended to
2294 \addtoindexx{DWARF section names!list of}
2296 the \addtoindex{.debug\_abbrev},
2297 \addtoindex{.debug\_aranges},
2298 \addtoindex{.debug\_frame},
2299 \addtoindex{.debug\_info},
2300 \addtoindex{.debug\_line},
2301 \addtoindex{.debug\_loc},
2302 \addtoindex{.debug\_macinfo},
2303 \addtoindex{.debug\_pubnames},
2304 \addtoindex{.debug\_pubtypes},
2305 \addtoindex{.debug\_ranges},
2306 \addtoindex{.debug\_str}
2308 \addtoindex{.debug\_types}
2309 sections of an object file, or equivalent
2310 separate file or database. The information is not
2311 word\dash aligned. Consequently:
2314 \item For the 32\dash bit DWARF format and a target architecture with
2315 32\dash bit addresses, an assembler or compiler must provide a way
2316 to produce 2\dash byte and 4\dash byte quantities without alignment
2317 restrictions, and the linker must be able to relocate a
2318 4\dash byte address or
2319 \addtoindexx{section offset!alignment of}
2320 section offset that occurs at an arbitrary
2323 \item For the 32\dash bit DWARF format and a target architecture with
2324 64\dash bit addresses, an assembler or compiler must provide a
2325 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2326 alignment restrictions, and the linker must be able to relocate
2327 an 8\dash byte address or 4\dash byte
2328 \addtoindexx{section offset!alignment of}
2329 section offset that occurs at an
2330 arbitrary alignment.
2332 \item For the 64\dash bit DWARF format and a target architecture with
2333 32\dash bit addresses, an assembler or compiler must provide a
2334 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2335 alignment restrictions, and the linker must be able to relocate
2336 a 4\dash byte address or 8\dash byte
2337 \addtoindexx{section offset!alignment of}
2338 section offset that occurs at an
2339 arbitrary alignment.
2341 \textit{It is expected that this will be required only for very large
2342 32\dash bit programs or by those architectures which support
2343 a mix of 32\dash bit and 64\dash bit code and data within the same
2346 \item For the 64\dash bit DWARF format and a target architecture with
2347 64\dash bit addresses, an assembler or compiler must provide a
2348 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2349 alignment restrictions, and the linker must be able to
2350 relocate an 8\dash byte address or
2351 \addtoindexx{section offset!alignment of}
2352 section offset that occurs at
2353 an arbitrary alignment.
2356 \section{Integer Representation Names}
2357 \label{datarep:integerrepresentationnames}
2359 The sizes of the integers used in the lookup by name, lookup
2360 by address, line number and call frame information sections
2362 Table 41 \refersec{tab:integerrepresentationnames}.
2365 \setlength{\extrarowheight}{0.1cm}
2366 \begin{longtable}{c|l}
2367 \caption{Integer Representation Names} \label{tab:integerrepresentationnames}\\
2368 \hline \bfseries Representation Name&\bfseries Representation \\ \hline
2370 \bfseries Representation Name&\bfseries Representation\\ \hline
2372 \hline \emph{Continued on next page}
2377 \addtoindex{sbyte}& signed, 1\dash byte integer \\
2378 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
2379 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
2380 \addtoindex{uword}&unsigned, 4\dash byte integer \\
2386 \section{Type Signature Computation}
2387 \label{datarep:typesignaturecomputation}
2389 A type signature is computed only by the DWARF producer;
2390 \addtoindexx{type signature computation}
2391 it is used by a DWARF consumer to resolve type references to
2392 the type definitions that are contained in
2393 \addtoindexx{type unit}
2396 The type signature for a type T0 is formed from the
2397 \addtoindex{MD5 hash}
2398 of a flattened description of the type. The flattened
2399 description of the type is a byte sequence derived from the
2400 DWARF encoding of the type as follows:
2401 \begin{enumerate}[1. ]
2403 \item Start with an empty sequence S and a list V of visited
2404 types, where V is initialized to a list containing the type
2405 T0 as its single element. Elements in V are indexed from 1,
2408 \item If the debugging information entry represents a type that
2409 is nested inside another type or a namespace, append to S
2410 the type\textquoteright s context as follows: For each surrounding type
2411 or namespace, beginning with the outermost such construct,
2412 append the letter 'C', the DWARF tag of the construct, and
2413 the name (taken from
2414 \addtoindexx{name attribute}
2415 the \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute) of the type
2416 \addtoindexx{name attribute}
2417 or namespace (including its trailing null byte).
2419 \item Append to S the letter 'D', followed by the DWARF tag of
2420 the debugging information entry.
2422 \item For each of the attributes in
2423 Table \refersec{tab:attributesusedintypesignaturecomputation}
2425 the debugging information entry, in the order listed,
2426 append to S a marker letter (see below), the DWARF attribute
2427 code, and the attribute value.
2430 \caption{Attributes used in type signature computation}
2431 \label{tab:attributesusedintypesignaturecomputation}
2432 \simplerule[\textwidth]
2434 \autocols[0pt]{c}{2}{l}{
2435 \livelink{chap:DWATname}{DW\-\_AT\-\_name},
2436 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility},
2437 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class},
2438 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated},
2439 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial},
2440 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated},
2441 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale},
2442 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset},
2443 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size},
2444 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride},
2445 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size},
2446 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride},
2447 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr},
2448 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value},
2449 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type},
2450 \livelink{chap:DWATcount}{DW\-\_AT\-\_count},
2451 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset},
2452 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location},
2453 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location},
2454 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale},
2455 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign},
2456 \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value},
2457 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count},
2458 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr},
2459 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list},
2460 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value},
2461 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding},
2462 \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class},
2463 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity},
2464 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit},
2465 \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional},
2466 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location},
2467 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound},
2468 \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable},
2469 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering},
2470 \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string},
2471 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped},
2472 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small},
2473 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment},
2474 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length},
2475 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled},
2476 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound},
2477 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location},
2478 \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8},
2479 \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter},
2480 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality},
2481 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility},
2482 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}
2485 \simplerule[\textwidth]
2488 Note that except for the initial
2489 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2490 \addtoindexx{name attribute}
2491 attributes are appended in order according to the alphabetical
2492 spelling of their identifier.
2494 If an implementation defines any vendor-specific attributes,
2495 any such attributes that are essential to the definition of
2496 the type should also be included at the end of the above list,
2497 in their own alphabetical suborder.
2499 An attribute that refers to another type entry T is processed
2500 as follows: (a) If T is in the list V at some V[x], use the
2501 letter 'R' as the marker and use the unsigned LEB128 encoding
2502 of x as the attribute value; otherwise, (b) use the letter 'T'
2503 as the marker, process the type T recursively by performing
2504 Steps 2 through 7, and use the result as the attribute value.
2506 Other attribute values use the letter 'A' as the marker, and
2507 the value consists of the form code (encoded as an unsigned
2508 LEB128 value) followed by the encoding of the value according
2509 to the form code. To ensure reproducibility of the signature,
2510 the set of forms used in the signature computation is limited
2511 to the following: \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata},
2512 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag},
2513 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string},
2514 and \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}.
2516 \item If the tag in Step 3 is one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2517 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2518 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2519 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type},
2520 or \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, and the referenced
2521 type (via the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2522 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) has a
2523 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to S the letter 'N', the DWARF
2524 attribute code (\livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2525 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}), the context of
2526 the type (according to the method in Step 2), the letter 'E',
2527 and the name of the type. For \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, if the referenced
2528 entry is a \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}, the context is omitted and the
2529 name to be used is the ABI-specific name of the subprogram
2530 (e.g., the mangled linker name).
2533 \item 6.If the tag in Step 3 is not one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2534 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2535 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2536 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}, or
2537 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, but has
2538 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, or if the referenced type (via
2539 the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2540 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) does not have a
2541 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, the attribute is processed according to
2542 the method in Step 4 for an attribute that refers to another
2546 \item Visit each child C of the debugging information
2547 entry as follows: If C is a nested type entry or a member
2548 function entry, and has
2549 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to
2550 \addtoindexx{name attribute}
2551 S the letter 'S', the tag of C, and its name; otherwise,
2552 process C recursively by performing Steps 3 through 7,
2553 appending the result to S. Following the last child (or if
2554 there are no children), append a zero byte.
2559 For the purposes of this algorithm, if a debugging information
2561 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
2562 attribute that refers to
2563 another entry D (which has a
2564 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}
2566 then S inherits the attributes and children of D, and S is
2567 processed as if those attributes and children were present in
2568 the entry S. Exception: if a particular attribute is found in
2569 both S and D, the attribute in S is used and the corresponding
2570 one in D is ignored.
2572 DWARF tag and attribute codes are appended to the sequence
2573 as unsigned LEB128 values, using the values defined earlier
2576 \textit{A grammar describing this computation may be found in
2577 Appendix \refersec{app:typesignaturecomputationgrammar}.
2580 \textit{An attribute that refers to another type entry should
2581 be recursively processed or replaced with the name of the
2582 referent (in Step 4, 5 or 6). If neither treatment applies to
2583 an attribute that references another type entry, the entry
2584 that contains that attribute should not be considered for a
2585 separate \addtoindex{type unit}.}
2587 \textit{If a debugging information entry contains an attribute from
2588 the list above that would require an unsupported form, that
2589 entry should not be considered for a separate
2590 \addtoindex{type unit}.}
2592 \textit{A type should be considered for a separate
2593 \addtoindex{type unit} only
2594 if all of the type entries that it contains or refers to in
2595 Steps 6 and 7 can themselves each be considered for a separate
2596 \addtoindex{type unit}.}
2599 Where the DWARF producer may reasonably choose two or more
2600 different forms for a given attribute, it should choose
2601 the simplest possible form in computing the signature. (For
2602 example, a constant value should be preferred to a location
2603 expression when possible.)
2605 Once the string S has been formed from the DWARF encoding,
2606 an \addtoindex{MD5 hash} is computed for the string and the lower 64 bits
2607 are taken as the type signature.
2609 \textit{The string S is intended to be a flattened representation of
2610 the type that uniquely identifies that type (i.e., a different
2611 type is highly unlikely to produce the same string).}
2613 \textit{A debugging information entry should not be placed in a
2614 separate \addtoindex{type unit}
2615 if any of the following apply:}
2619 \item \textit{The entry has an attribute whose value is a location
2620 expression, and the location expression contains a reference to
2621 another debugging information entry (e.g., a \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}
2622 operator), as it is unlikely that the entry will remain
2623 identical across compilation units.}
2625 \item \textit{The entry has an attribute whose value refers
2626 to a code location or a \addtoindex{location list}.}
2628 \item \textit{The entry has an attribute whose value refers
2629 to another debugging information entry that does not represent
2635 \textit{Certain attributes are not included in the type signature:}
2638 \item \textit{The \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute is not included because it
2639 indicates that the debugging information entry represents an
2640 incomplete declaration, and incomplete declarations should
2642 \addtoindexx{type unit}
2643 separate type units.}
2645 \item \textit{The \livelink{chap:DWATdescription}{DW\-\_AT\-\_description} attribute is not included because
2646 it does not provide any information unique to the defining
2647 declaration of the type.}
2649 \item \textit{The \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file},
2650 \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}, and
2651 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column} attributes are not included because they
2652 may vary from one source file to the next, and would prevent
2653 two otherwise identical type declarations from producing the
2654 \addtoindexx{MD5 hash}
2657 \item \textit{The \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer} attribute is not included
2658 because the information it provides is not necessary for the
2659 computation of a unique type signature.}
2663 \textit{Nested types and some types referred to by a debugging
2664 information entry are encoded by name rather than by recursively
2665 encoding the type to allow for cases where a complete definition
2666 of the type might not be available in all compilation units.}
2668 \textit{If a type definition contains the definition of a member function,
2669 it cannot be moved as is into a type unit, because the member function
2670 contains attributes that are unique to that compilation unit.
2671 Such a type definition can be moved to a type unit by rewriting the DIE tree,
2672 moving the member function declaration into a separate declaration tree,
2673 and replacing the function definition in the type with a non-defining
2674 declaration of the function (as if the function had been defined out of
2677 An example that illustrates the computation of an MD5 hash may be found in
2678 Appendix \refersec{app:usingtypeunits}.