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:
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’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:
158 \begin{enumerate}[1.]
160 \item In the 32\dash bit DWARF format, an
161 \addtoindex{initial length field}
163 \addtoindex{initial length field!encoding}
164 Section \refersec{datarep:initiallengthvalues})
165 is an unsigned 32\dash bit integer (which
166 must be less than 0xfffffff0); in the 64\dash bit DWARF format,
167 an \addtoindex{initial length field} is 96 bits in size,
170 \item The first 32\dash bits have the value 0xffffffff.
172 \item The following 64\dash bits contain the actual length
173 represented as an unsigned 64\dash bit integer.
176 \textit{This representation allows a DWARF consumer to dynamically
177 detect that a DWARF section contribution is using the 64\dash bit
178 format and to adapt its processing accordingly.}
180 \item Section offset and section length
181 \addtoindexx{section length!use in headers}
183 \addtoindexx{section offset!use in headers}
184 in the headers of DWARF sections (other
185 \addtoindex{initial length field}
187 \addtoindex{initial length}
188 fields) are listed following. In the 32\dash bit DWARF format these
189 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
191 \addtoindexx{section length!in .debug\_aranges header}
193 \addtoindexx{section length!in .debug\_pubnames header}
195 \addtoindexx{section length!in .debug\_pubtypes header}
196 unsigned integer values.
200 Section &Name & Role \\ \hline
201 \addtoindex{.debug\_ranges} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
202 \addtoindex{.debug\_frame}/CIE & \addtoindex{CIE\_id} & CIE distinguished value \\
203 \addtoindex{.debug\_frame}/FDE & \addtoindex{CIE\_pointer} & offset in \addtoindex{.debug\_frame} \\
204 \addtoindex{.debug\_info} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_abbrev} \\
205 \addtoindex{.debug\_line} & \addtoindex{header\_length} & length of header itself \\
206 \addtoindex{.debug\_pubnames} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
207 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
209 \addtoindex{.debug\_pubtypes} & \addtoindex{debug\_info\_offset} & offset in \addtoindex{.debug\_info} \\
210 & \addtoindex{debug\_info\_length} & length of \addtoindex{.debug\_info} \\
212 \addtoindex{.debug\_types} & \addtoindex{debug\_abbrev\_offset} & offset in \addtoindex{.debug\_info} \\
213 & \addtoindex{type\_offset} & offset in of \addtoindex{.debug\_types} \\
218 \textit{The CIE\_id field in a CIE structure must be 64 bits because
219 it overlays the CIE\_pointer in a FDE structure; this implicit
220 union must be accessed to distinguish whether a CIE or FDE is
221 present, consequently, these two fields must exactly overlay
222 each other (both offset and size).}
224 \item Within the body of the \addtoindex{.debug\_info} or \addtoindex{.debug\_types}
225 section, certain forms of attribute value depend on the choice
226 of DWARF format as follows. For the 32\dash bit DWARF format,
227 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
228 format, the value is a 64\dash bit unsigned integer.
231 Form & Role \\ \hline
232 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}& offset in \addtoindex{.debug\_info} \\
233 \livetarg{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}& offset in a section other than \addtoindex{.debug\_info} or \addtoindex{.debug\_str} \\
234 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&offset in \addtoindex{.debug\_str} \\
235 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&offset in \addtoindex{.debug\_info} \\
239 \item Within the body of the \addtoindex{.debug\_pubnames} and
240 \addtoindex{.debug\_pubtypes}
241 sections, the representation of the first field
242 of each tuple (which represents an offset in the
243 \addtoindex{.debug\_info}
244 section) depends on the DWARF format as follows: in the
245 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
246 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
251 The 32\dash bit and 64\dash bit DWARF format conventions must not be
252 intermixed within a single compilation unit.
254 \textit{Attribute values and section header fields that represent
255 addresses in the target program are not affected by these
258 A DWARF consumer that supports the 64\dash bit DWARF format must
259 support executables in which some compilation units use the
260 32\dash bit format and others use the 64\dash bit format provided that
261 the combination links correctly (that is, provided that there
262 are no link\dash time errors due to truncation or overflow). (An
263 implementation is not required to guarantee detection and
264 reporting of all such errors.)
266 \textit{It is expected that DWARF producing compilers will not use
267 the 64\dash bit format by default. In most cases, the division of
268 even very large applications into a number of executable and
269 shared objects will suffice to assure that the DWARF sections
270 within each individual linked object are less than 4 GBytes
271 in size. However, for those cases where needed, the 64\dash bit
272 format allows the unusual case to be handled as well. Even
273 in this case, it is expected that only application supplied
274 objects will need to be compiled using the 64\dash bit format;
275 separate 32\dash bit format versions of system supplied shared
276 executable libraries can still be used.}
280 \section{Format of Debugging Information}
281 \label{datarep:formatofdebugginginformation}
283 For each compilation unit compiled with a DWARF producer,
284 a contribution is made to the \addtoindex{.debug\_info} section of
285 the object file. Each such contribution consists of a
286 compilation unit header
287 (see Section \refersec{datarep:compilationunitheader})
289 single \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} or \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.
312 Multiple debugging information entries may share the same
313 abbreviation table entry. Each compilation unit is associated
314 with a particular abbreviation table, but multiple compilation
315 units may share the same table.
316 \subsection{Unit Headers}
317 \label{datarep:unitheaders}
319 \subsubsection{Compilation Unit Header}
320 \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:
377 \begin{enumerate}[1.]
379 \item unit\_length (initial length) \\
380 \addtoindexx{unit\_length}
381 A 4\dash byte or 12\dash byte unsigned integer
382 \addtoindexx{initial length}
383 representing the length
384 of the \addtoindex{.debug\_types} contribution for that compilation unit,
385 not including the length field itself. In the 32\dash bit DWARF
386 format, this is a 4\dash byte unsigned integer (which must be
387 less than 0xfffffff0); in the 64\dash bit DWARF format, this
388 consists of the 4\dash byte value 0xffffffff followed by an
389 8\dash byte unsigned integer that gives the actual length
390 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
392 \item version (\addtoindex(uhalf))
393 A 2\dash byte unsigned integer representing the version of the
394 DWARF information for the
395 compilation unit\addtoindexx{version number!type unit}
396 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
397 The value in this field is 4.
399 \item \addtoindex{debug\_abbrev\_offset} (section offset) \\
401 \addtoindexx{section offset!in .debug\_types header}
402 4\dash byte or 8\dash byte unsigned offset into the
403 \addtoindex{.debug\_abbrev}
404 section. This offset associates the compilation unit with a
405 particular set of debugging information entry abbreviations. In
406 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
407 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
408 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
410 \item address\_size (ubyte) \\
411 A 1\dash byte unsigned integer representing the size
412 \addtoindexx{size of an address}
414 \addtoindexx{address\_size}
415 an address on the target architecture. If the system uses
416 \addtoindexx{address space!segmented}
417 segmented addressing, this value represents the size of the
418 offset portion of an address.
421 \item type\_signature (8\dash byte unsigned integer) \\
422 \addtoindexx{type signature}
424 \addtoindexx{type\_signature}
425 64\dash bit unique signature of the type described in this type
428 \textit{An attribute that refers(using \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) to
429 the primary type contained in
430 this \addtoindex{type unit} uses this value.}
433 \item type\_offset (section offset) \\
434 \addtoindexx{type\_offset}
435 A 4\dash byte or 8\dash byte unsigned offset
436 \addtoindexx{section offset!in .debug\_types header}
437 relative to the beginning
438 of the \addtoindex{type unit} header.
439 This offset refers to the debugging
440 information entry that describes the type. Because the type
441 may be nested inside a namespace or other structures, and may
442 contain references to other types that have not been placed in
443 separate type units, it is not necessarily either the first or
444 the only entry in the type unit. In the 32\dash bit DWARF format,
445 this is a 4\dash byte unsigned length; in the 64\dash bit DWARF format,
446 this is an 8\dash byte unsigned length
447 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
451 \subsection{Debugging Information Entry}
452 \label{datarep:debugginginformationentry}
454 Each debugging information entry begins with an unsigned LEB128
455 number containing the abbreviation code for the entry. This
456 code represents an entry within the abbreviations table
457 associated with the compilation unit containing this entry. The
458 abbreviation code is followed by a series of attribute values.
460 On some architectures, there are alignment constraints on
461 section boundaries. To make it easier to pad debugging
462 information sections to satisfy such constraints, the
463 abbreviation code 0 is reserved. Debugging information entries
464 consisting of only the abbreviation code 0 are considered
467 \subsection{Abbreviations Tables}
468 \label{datarep:abbreviationstables}
470 The abbreviations tables for all compilation units
471 are contained in a separate object file section called
472 \addtoindex{.debug\_abbrev}.
473 As mentioned before, multiple compilation
474 units may share the same abbreviations table.
476 The abbreviations table for a single compilation unit consists
477 of a series of abbreviation declarations. Each declaration
478 specifies the tag and attributes for a particular form of
479 debugging information entry. Each declaration begins with
480 an unsigned LEB128 number representing the abbreviation
481 code itself. It is this code that appears at the beginning
482 of a debugging information entry in the
483 \addtoindex{.debug\_info} or
484 \addtoindex{.debug\_types}
485 section. As described above, the abbreviation
486 code 0 is reserved for null debugging information entries. The
487 abbreviation code is followed by another unsigned LEB128
488 number that encodes the entry’s tag. The encodings for the
489 tag names are given in
490 Table \refersec{tab:tagencodings}.
492 Following the tag encoding is a 1\dash byte value that determines
493 whether a debugging information entry using this abbreviation
494 has child entries or not. If the value is
495 \livetarg{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes},
496 the next physically succeeding entry of any debugging
497 information entry using this abbreviation is the first
498 child of that entry. If the 1\dash byte value following the
499 abbreviation’s tag encoding is
500 \livetarg{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}, the next
501 physically succeeding entry of any debugging information entry
502 using this abbreviation is a sibling of that entry. (Either
503 the first child or sibling entries may be null entries). The
504 encodings for the child determination byte are given in
505 Table \refersec{tab:childdeterminationencodings}
507 Section \refersec{chap:relationshipofdebugginginformationentries},
509 sibling entries is terminated by a null entry.)
511 Finally, the child encoding is followed by a series of
512 attribute specifications. Each attribute specification
513 consists of two parts. The first part is an unsigned LEB128
514 number representing the attribute’s name. The second part
515 is an unsigned LEB128 number representing the attribute’s
516 form. The series of attribute specifications ends with an
517 entry containing 0 for the name and 0 for the form.
520 \livetarg{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect} is a special case. For
521 attributes with this form, the attribute value itself in the
522 \addtoindex{.debug\_info} or
523 \addtoindex{.debug\_types}
524 section begins with an unsigned
525 LEB128 number that represents its form. This allows producers
526 to choose forms for particular attributes
527 \addtoindexx{abbreviations table!dynamic forms in}
529 without having to add a new entry to the abbreviations table.
531 The abbreviations for a given compilation unit end with an
532 entry consisting of a 0 byte for the abbreviation code.
535 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
536 for a depiction of the organization of the
537 debugging information.
539 \subsection{Attribute Encodings}
540 \label{datarep:attributeencodings}
542 The encodings for the attribute names are given in
543 Table \refersec{tab:attributeencodings}.
545 The attribute form governs how the value of the attribute is
546 encoded. There are nine classes of form, listed below. Each
547 class is a set of forms which have related representations
548 and which are given a common interpretation according to the
549 attribute in which the form is used.
551 Form \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}
553 \addtoindexx{rangelistptr class}
555 \addtoindexx{macptr class}
557 \addtoindexx{loclistptr class}
559 \addtoindexx{lineptr class}
560 namely \livelink{chap:lineptr}{lineptr},
561 \livelink{chap:loclistptr}{loclistptr},
562 \livelink{chap:macptr}{macptr} or
563 \livelink{chap:rangelistptr}{rangelistptr}; the list
564 of classes allowed by the applicable attribute in
565 Table \refersec{tab:attributeencodings}
566 determines the class of the form.
568 \textit{In DWARF V3 the forms \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} were
569 \addtoindexx{lineptr class}
571 \addtoindexx{rangelistptr class}
573 \addtoindexx{macptr class}
575 \addtoindexx{loclistptr class}
576 class constant \addtoindexx{constant class}
577 or one of the classes
578 \livelink{chap:lineptr}{lineptr},
579 \livelink{chap:loclistptr}{loclistptr},
580 \livelink{chap:macptr}{macptr} or
581 \livelink{chap:rangelistptr}{rangelistptr}, depending on context. In
583 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
584 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} are members of class
585 constant in all cases.
587 \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} replaces
588 their usage for the other classes.}
590 Each possible form belongs to one or more of the following classes:
593 \item \livelinki{chap:DWATaddressclass}{address}{address class} \\
594 Represented as an object of appropriate size to hold an
595 address on the target machine
596 (\livetarg{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}).
598 encoded in the compilation unit header
599 (see Section \refersec{datarep:compilationunitheader}).
600 This address is relocatable in a relocatable object file and
601 is relocated in an executable file or shared object.
603 \item \livelink{chap:block}{block} \\
604 Blocks come in four forms:
606 \begin{myindentpara}{1cm}
607 A 1\dash byte length followed by 0 to 255 contiguous information
608 bytes (\livetarg{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}).
611 \begin{myindentpara}{1cm}
612 A 2\dash byte length followed by 0 to 65,535 contiguous information
613 bytes (\livetarg{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}).
617 \begin{myindentpara}{1cm}
618 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
619 information bytes (\livetarg{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}).
623 \begin{myindentpara}{1cm}
624 An unsigned LEB128 length followed by the number of bytes
625 specified by the length (\livetarg{chap:DWFORMblock}{DW\-\_FORM\-\_block}).
628 In all forms, the length is the number of information bytes
629 that follow. The information bytes may contain any mixture
630 of relocated (or relocatable) addresses, references to other
631 debugging information entries or data bytes.
634 There are six forms of constants. There are fixed length
635 constant data forms for one, two, four and eight byte values
637 \livetarg{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
638 \livetarg{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
639 \livetarg{chap:DWFORMdata4}{DW\-\_FORM\-\_data4},
640 and \livetarg{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}).
641 There are also variable length constant
642 data forms encoded using LEB128 numbers (see below). Both
643 signed (\livetarg{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}) and unsigned
644 (\livetarg{chap:DWFORMudata}{DW\-\_FORM\-\_udata}) variable
645 length constants are available
647 The data in \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
648 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
649 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
650 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}
651 can be anything. Depending on context, it may
652 be a signed integer, an unsigned integer, a floating\dash point
653 constant, or anything else. A consumer must use context to
654 know how to interpret the bits, which if they are target
655 machine data (such as an integer or floating point constant)
656 will be in target machine byte\dash order.
658 \textit{If one of the \livetarg{chap:DWFORMdata}{DW\-\_FORM\-\_data}<n> forms is used to represent a
659 signed or unsigned integer, it can be hard for a consumer
660 to discover the context necessary to determine which
661 interpretation is intended. Producers are therefore strongly
662 encouraged to use \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata} or
663 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata} for signed and
664 unsigned integers respectively, rather than
665 \livelink{chap:DWFORMdata}{DW\-\_FORM\-\_data} \textless n \textgreater.}
668 \item \livelink{chap:exprloc}{exprloc} \\
669 This is an unsigned LEB128 length followed by the
670 number of information bytes specified by the length
671 (\livetarg{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc}).
672 The information bytes contain a DWARF
674 (see Section \refersec{chap:dwarfexpressions})
675 or location description
676 (see Section \refersec{chap:locationdescriptions}).
678 \item \livelink{chap:flag}{flag} \\
679 A flag \addtoindexx{flag class}
680 is represented explicitly as a single byte of data
681 (\livetarg{chap:DWFORMflag}{DW\-\_FORM\-\_flag}) or
682 implicitly (\livetarg{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present}).
684 first case, if the \nolink{flag} has value zero, it indicates the
685 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
686 it indicates the presence of the attribute. In the second
687 case, the attribute is implicitly indicated as present, and
688 no value is encoded in the debugging information entry itself.
690 \item \livelink{chap:lineptr}{lineptr} \\
691 This is an offset into
692 \addtoindexx{section offset!in class lineptr value}
694 \addtoindex{.debug\_line} section
695 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
696 It consists of an offset from the
698 \addtoindex{.debug\_line}
699 section to the first byte of
700 the data making up the line number list for the compilation
702 It is relocatable in a relocatable object file, and
703 relocated in an executable or shared object. In the 32\dash bit
704 DWARF format, this offset is a 4\dash byte unsigned value;
705 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
706 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
709 \item \livelink{chap:loclistptr}{loclistptr} \\
710 This is an offset into the
711 \addtoindex{.debug\_loc}
713 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
714 It consists of an offset from the
715 \addtoindexx{section offset!in class loclistptr value}
717 \addtoindex{.debug\_loc}
718 section to the first byte of
719 the data making up the
720 \addtoindex{location list} for the compilation
722 It is relocatable in a relocatable object file, and
723 relocated in an executable or shared object. In the 32\dash bit
724 DWARF format, this offset is a 4\dash byte unsigned value;
725 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
726 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
729 \item \livelink{chap:macptr}{macptr} \\
731 \addtoindexx{section offset!in class macptr value}
733 \addtoindex{.debug\_macinfo} section
734 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
735 beginning of the \addtoindex{.debug\_macinfo}
736 section to the first byte of
737 the data making up the macro information list for the compilation
739 It is relocatable in a relocatable object file, and
740 relocated in an executable or shared object. In the 32\dash bit
741 DWARF format, this offset is a 4\dash byte unsigned value;
742 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
743 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
745 \item \livelink{chap:rangelistptr}{rangelistptr} \\
747 \addtoindexx{section offset!in class rangelistptr value}
748 offset into the \addtoindex{.debug\_ranges} section
749 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
751 offset from the beginning of the
752 \addtoindex{.debug\_ranges} section
753 to the beginning of the non\dash contiguous address ranges
754 information for the referencing entity.
756 a relocatable object file, and relocated in an executable or
757 shared object. In the 32\dash bit DWARF format, this offset
758 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
759 format, it is an 8\dash byte unsigned value (see Section
760 \refersec{datarep:32bitand64bitdwarfformats}).
763 \textit{Because classes \livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} and \livelink{chap:rangelistptr}{rangelistptr}
764 share a common representation, it is not possible for an
765 attribute to allow more than one of these classes}
770 There are three types of reference.
773 \addtoindexx{reference class}
774 first type of reference can identify any debugging
775 information entry within the containing unit.
778 \addtoindexx{section offset!in class reference value}
779 offset from the first byte of the compilation
780 header for the compilation unit containing the reference. There
781 are five forms for this type of reference. There are fixed
782 length forms for one, two, four and eight byte offsets
783 (respectively, \livetarg{chap:DWFORMref1}{DW\-\_FORM\-\_ref1},
784 \livetarg{chap:DWFORMref2}{DW\-\_FORM\-\_ref2},
785 \livetarg{chap:DWFORMref4}{DW\-\_FORM\-\_ref4},
786 and \livetarg{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}).
787 There is also an unsigned variable
788 length offset encoded form that uses unsigned LEB128 numbers
789 (\livetarg{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}).
790 Because this type of reference is within
791 the containing compilation unit no relocation of the value
794 The second type of reference can identify any debugging
795 information entry within a
796 \addtoindex{.debug\_info} section; in particular,
797 it may refer to an entry in a different compilation unit
798 from the unit containing the reference, and may refer to an
799 entry in a different shared object. This type of reference
800 (\livetarg{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}) is an offset from the beginning of the
801 \addtoindex{.debug\_info}
802 section of the target executable or shared object;
803 it is relocatable in a relocatable object file and frequently
804 relocated in an executable file or shared object. For
805 references from one shared object or static executable file
806 to another, the relocation and identification of the target
807 object must be performed by the consumer. In the 32\dash bit DWARF
808 format, this offset is a 4\dash byte unsigned value;
809 in the 64\dash bit DWARF format, it is an 8\dash byte
811 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
813 A debugging information entry that may be referenced by
814 another compilation unit using \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr} must have a
815 global symbolic name.
817 For a reference from one executable or shared object to
818 another, the reference is resolved by the debugger to identify
819 the shared object or executable and the offset into that
820 object’s \addtoindex{.debug\_info}
821 section in the same fashion as the run
822 time loader, either when the debug information is first read,
823 or when the reference is used.
825 The third type of reference can identify any debugging
826 information type entry that has been placed in its own
827 \addtoindex{type unit}. This type of
828 reference (\livetarg{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) is the
829 \addtoindexx{type signature}
830 64\dash bit type signature
831 (see Section \refersec{datarep:typesignaturecomputation})
835 The use of compilation unit relative references will reduce the
836 number of link\dash time relocations and so speed up linking. The
837 use of the second and third type of reference allows for the
838 sharing of information, such as types, across compilation
841 A reference to any kind of compilation unit identifies the
842 debugging information entry for that unit, not the preceding
846 A string is a sequence of contiguous non\dash null bytes followed by
848 \addtoindexx{string class}
849 A string may be represented immediately in the
850 debugging information entry itself
851 (\livetarg{chap:DWFORMstring}{DW\-\_FORM\-\_string}), or may
853 \addtoindexx{section offset!in class string value}
854 offset into a string table contained in
855 the \addtoindex{.debug\_str} section of the object file
856 (\livetarg{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}). In
857 the 32\dash bit DWARF format, the representation of a
858 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}
859 value is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
860 it is an 8\dash byte unsigned offset
861 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
863 If the \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}
864 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8} attribute is specified for the
865 compilation unit entry, string values are encoded using the
866 UTF\dash 8 (\addtoindex{Unicode} Transformation Format\dash 8) from the Universal
867 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
868 the string representation is unspecified.
870 The \addtoindex{Unicode} Standard Version 3 is fully compatible with
871 ISO/IEC 10646\dash 1:1993. It contains all the same characters
872 and encoding points as ISO/IEC 10646, as well as additional
873 information about the characters and their use.
875 Earlier versions of DWARF did not specify the representation
876 of strings; for compatibility, this version also does
877 not. However, the UTF\dash 8 representation is strongly recommended.
881 In no case does an attribute use
882 \addtoindexx{rangelistptr class}
884 \addtoindexx{loclistptr class}
886 \addtoindexx{lineptr class}
888 \addtoindexx{macptr class}
889 classes \livelink{chap:lineptr}{lineptr},
890 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr} to point into either the
891 \addtoindex{.debug\_info} or \addtoindex{.debug\_str} section.
893 The form encodings are listed in
894 Table \refersec{tab:attributeformencodings}.
897 \setlength{\extrarowheight}{0.1cm}
898 \begin{longtable}{l|l}
899 \caption{Tag encodings} \label{tab:tagencodings} \\
900 \hline \\ \bfseries Tag name&\bfseries Value\\ \hline
902 \bfseries Tag name&\bfseries Value \\ \hline
904 \hline \emph{Continued on next page}
908 \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type} &0x01 \\
909 \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type}&0x02 \\
910 \livelink{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point}&0x03 \\
911 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}&0x04 \\
912 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}&0x05 \\
913 \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}&0x08 \\
914 \livelink{chap:DWTAGlabel}{DW\-\_TAG\-\_label}&0x0a \\
915 \livelink{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}&0x0b \\
916 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}&0x0d \\
917 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}&0x0f \\
918 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}&0x10 \\
919 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}&0x11 \\
920 \livelink{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}&0x12 \\
921 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}&0x13 \\
922 \livelink{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}&0x15 \\
923 \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}&0x16 \\
924 \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}&0x17 \\
925 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}&0x18 \\
926 \livelink{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}&0x19 \\
927 \livelink{chap:DWTAGcommonblock}{DW\-\_TAG\-\_common\-\_block}&0x1a \\
928 \livelink{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}&0x1b \\
929 \livelink{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}&0x1c \\
930 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}&0x1d \\
931 \livelink{chap:DWTAGmodule}{DW\-\_TAG\-\_module}&0x1e \\
932 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}&0x1f \\
933 \livelink{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}&0x20 \\
934 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}&0x21 \\
935 \livelink{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}&0x22 \\
936 \livelink{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}&0x23 \\
937 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}&0x24 \\
938 \livelink{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}&0x25 \\
939 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type}&0x26 \\
940 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant}&0x27 \\
941 \livelink{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}&0x28 \\
942 \livelink{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}&0x29 \\
943 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}&0x2a \\
944 \livelink{chap:DWTAGnamelist}{DW\-\_TAG\-\_namelist}&0x2b \\
945 \livelink{chap:DWTAGnamelistitem}{DW\-\_TAG\-\_namelist\-\_item}&0x2c \\
946 \livelink{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}&0x2d \\
947 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}&0x2e \\
948 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}&0x2f \\
949 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}&0x30 \\
950 \livelink{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}&0x31 \\
951 \livelink{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}&0x32 \\
952 \livelink{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part}&0x33 \\
953 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}&0x34 \\
954 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&0x35 \\
955 \livelink{chap:DWTAGdwarfprocedure}{DW\-\_TAG\-\_dwarf\-\_procedure}&0x36 \\
956 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&0x37 \\
957 \livelink{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}&0x38 \\
958 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}&0x39 \\
959 \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}&0x3a \\
960 \livelink{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}&0x3b \\
961 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}&0x3c \\
962 \livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}&0x3d \\
963 \livelink{chap:DWTAGcondition}{DW\-\_TAG\-\_condition}&0x3f \\
964 \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&0x40 \\
965 \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} \ddag &0x41 \\
966 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} \ddag &0x42 \\
967 \livelink{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias} \ddag &0x43 \\
968 \livelink{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user}&0x4080 \\
969 \livelink{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}&0xffff \\
971 \ddag TAG new in \addtoindex{DWARF Version 4}
977 \setlength{\extrarowheight}{0.1cm}
978 \caption{Child determination encodings}
979 \label{tab:childdeterminationencodings}
980 \begin{tabular}{l|l} \hline
981 Child determination name& Value\\ \hline
982 \livelink{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}&0x00 \\
983 \livelink{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes}&0x01 \\ \hline
989 \setlength{\extrarowheight}{0.1cm}
990 \begin{longtable}{l|l|l}
991 \caption{Attribute encodings} \label{tab:attributeencodings} \addtoindexx{attribute encodings} \\
992 \hline \\ \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
994 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
996 \hline \emph{Continued on next page}
1000 \livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling}&0x01&reference
1001 \addtoindexx{sibling attribute!encoding} \\
1002 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}&0x02&\livelink{chap:exprloc}{exprloc},
1003 \livelink{chap:loclistptr}{loclistptr}\addtoindex{location attribute!encoding} \\
1004 \livelink{chap:DWATname}{DW\-\_AT\-\_name}&0x03&string
1005 \addtoindexx{name attribute!encoding} \\
1006 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}&0x09&constant
1007 \addtoindexx{ordering attribute!encoding} \\
1008 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}&0x0b&constant, \livelink{chap:exprloc}{exprloc},
1009 reference \addtoindexx{byte size attribute!encoding} \\
1010 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}&0x0c&constant,
1011 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit offset attribute!encoding} \\
1012 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}&0x0d&constant,
1013 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit size attribute!encoding} \\
1014 \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list}&0x10&\livelink{chap:lineptr}{lineptr}
1015 \addtoindex{statement list attribute!encoding} \\
1016 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}&0x11&address
1017 \addtoindexx{low PC attribute!encoding} \\
1018 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}&0x12&address, constant
1019 \addtoindexx{high PC attribute!encoding} \\
1020 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}&0x13&constant
1021 \addtoindexx{language attribute!encoding} \\
1022 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}&0x15&reference
1023 \addtoindexx{discriminant attribute!encoding} \\
1024 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}&0x16&constant
1025 \addtoindexx{discriminant value attribute!encoding} \\
1026 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}&0x17&constant
1027 \addtoindexx{visibility attribute!encoding} \\
1028 \livelink{chap:DWATimport}{DW\-\_AT\-\_import}&0x18&reference
1029 \addtoindexx{import attribute!encoding} \\
1030 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}&0x19&\livelink{chap:exprloc}{exprloc},
1031 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{string length attribute!encoding} \\
1032 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference}&0x1a&reference
1033 \addtoindexx{common reference attribute!encoding} \\
1034 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}&0x1b&string
1035 \addtoindexx{compilation directory attribute!encoding} \\
1036 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}&0x1c&\livelink{chap:block}{block}, constant, string
1037 \addtoindexx{constant value attribute!encoding} \\
1038 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}&0x1d&reference
1039 \addtoindexx{containing type attribute!encoding} \\
1040 \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}&0x1e&reference
1041 \addtoindexx{default value attribute!encoding} \\
1042 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline}&0x20&constant
1043 \addtoindexx{inline attribute!encoding} \\
1044 \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}&0x21&\livelink{chap:flag}{flag}
1045 \addtoindexx{is optional attribute!encoding} \\
1046 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}&0x22&constant,
1047 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{lower bound attribute!encoding} \\
1048 \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer}&0x25&string \addtoindexx{producer attribute!encoding} \\
1049 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}&0x27&\livelink{chap:flag}{flag}
1050 \addtoindexx{prototyped attribute!encoding} \\
1051 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}&0x2a&\livelink{chap:exprloc}{exprloc},
1052 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{return address attribute!encoding} \\
1053 % FIXME: lower case , not Constant
1054 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}&0x2c&Constant,
1055 \livelink{chap:rangelistptr}{rangelistptr} \addtoindexx{start scope attribute!encoding} \\
1056 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}&0x2e&constant,
1057 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{bit stride attribute!encoding} \\
1058 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}&0x2f&constant,
1059 \livelink{chap:exprloc}{exprloc}, reference \addtoindexx{upper bound attribute!encoding} \\
1060 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}&0x31&reference
1061 \addtoindexx{abstract origin attribute!encoding} \\
1062 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}&0x32&constant
1063 \addtoindexx{accessibility attribute!encoding} \\
1064 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}&0x33&constant
1065 \addtoindexx{address class attribute!encoding} \\
1066 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}&0x34&\livelink{chap:flag}{flag}
1067 \addtoindexx{artificial attribute!encoding} \\
1068 \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types}&0x35&reference
1069 \addtoindexx{base types attribute!encoding} \\
1070 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}&0x36&constant
1071 \addtoindexx{calling convention attribute!encoding} \\
1072 \livelink{chap:DWATcount}{DW\-\_AT\-\_count}&0x37&constant, \livelink{chap:exprloc}{exprloc}, reference
1073 \addtoindexx{count attribute!encoding} \\
1074 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}&0x38&constant,
1075 \livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr}
1076 \addtoindexx{data member attribute!encoding} \\
1077 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column}&0x39&constant
1078 \addtoindexx{declaration column attribute!encoding} \\
1079 \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}&0x3a&constant
1080 \addtoindexx{declaration file attribute!encoding} \\
1081 \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}&0x3b&constant
1082 \addtoindexx{declaration line attribute!encoding} \\
1083 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}&0x3c&\livelink{chap:flag}{flag}
1084 \addtoindexx{declaration attribute!encoding} \\
1085 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}&0x3d&\livelink{chap:block}{block}
1086 \addtoindexx{discriminant list attribute!encoding} \\
1087 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}&0x3e&constant
1088 \addtoindexx{encoding attribute!encoding} \\
1089 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external}&0x3f&\livelink{chap:flag}{flag}
1090 \addtoindexx{external attribute!encoding} \\
1091 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base}&0x40&\livelink{chap:exprloc}{exprloc},
1092 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{frame base attribute!encoding} \\
1093 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}&0x41&reference
1094 \addtoindexx{friend attribute!encoding} \\
1095 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}&0x42&constant
1096 \addtoindexx{identifier case attribute!encoding} \\
1097 \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info}&0x43&\livelink{chap:macptr}{macptr}
1098 \addtoindexx{macro information attribute!encoding} \\
1099 \livelink{chap:DWATnamelistitem}{DW\-\_AT\-\_namelist\-\_item}&0x44&reference
1100 \addtoindexx{name list item attribute!encoding} \\
1101 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority}&0x45&reference
1102 \addtoindexx{priority attribute!encoding} \\
1103 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}&0x46&\livelink{chap:exprloc}{exprloc},
1104 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{segment attribute!encoding} \\
1105 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}&0x47&reference
1106 \addtoindexx{specification attribute!encoding} \\
1107 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}&0x48&\livelink{chap:exprloc}{exprloc},
1108 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{static link attribute!encoding} \\
1109 \livelink{chap:DWATtype}{DW\-\_AT\-\_type}&0x49&reference
1110 \addtoindexx{type attribute!encoding} \\
1111 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}&0x4a&\livelink{chap:exprloc}{exprloc},
1112 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{location list attribute!encoding} \\
1113 \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}&0x4b&\livelink{chap:flag}{flag}
1114 \addtoindexx{variable parameter attribute!encoding} \\
1115 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}&0x4c&constant
1116 \addtoindexx{virtuality attribute!encoding} \\
1117 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}&0x4d&\livelink{chap:exprloc}{exprloc},
1118 \livelink{chap:loclistptr}{loclistptr} \addtoindexx{vtable element location attribute!encoding} \\
1120 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}&0x4e&constant, \livelink{chap:exprloc}{exprloc},
1121 reference \addtoindexx{allocated attribute!encoding} \\
1122 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}&0x4f&constant, \livelink{chap:exprloc}{exprloc},
1123 reference \addtoindexx{associated attribute!encoding} \\
1124 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}&0x50&\livelink{chap:exprloc}{exprloc}
1125 \addtoindexx{data location attribute!encoding} \\
1126 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}&0x51&constant, \livelink{chap:exprloc}{exprloc},
1127 reference \addtoindexx{byte stride attribute!encoding} \\
1128 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}&0x52&address
1129 \addtoindexx{entry pc attribute!encoding} \\
1130 \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}&0x53&\livelink{chap:flag}{flag}
1131 \addtoindexx{use UTF8 attribute!encoding}\addtoindex{UTF-8} \\
1132 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}&0x54&reference
1133 \addtoindexx{extension attribute!encoding} \\
1134 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}&0x55&\livelink{chap:rangelistptr}{rangelistptr}
1135 \addtoindexx{ranges attribute!encoding} \\
1136 \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline}&0x56&address, \livelink{chap:flag}{flag},
1137 reference, string \addtoindexx{trampoline attribute!encoding} \\
1138 \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column}&0x57&constant
1139 \addtoindexx{call column attribute!encoding} \\
1140 \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file}&0x58&constant
1141 \addtoindexx{call file attribute!encoding} \\
1142 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line}&0x59&constant
1143 \addtoindexx{call line attribute!encoding} \\
1144 \livelink{chap:DWATdescription}{DW\-\_AT\-\_description}&0x5a&string
1145 \addtoindexx{description attribute!encoding} \\
1146 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}&0x5b&constant
1147 \addtoindexx{binary scale attribute!encoding} \\
1148 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}&0x5c&constant
1149 \addtoindexx{decimal scale attribute!encoding} \\
1150 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} &0x5d&reference
1151 \addtoindexx{small attribute!encoding} \\
1152 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}&0x5e&constant
1153 \addtoindexx{decimal scale attribute!encoding} \\
1154 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}&0x5f&constant
1155 \addtoindexx{digit count attribute!encoding} \\
1156 \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}&0x60&string
1157 \addtoindexx{picture string attribute!encoding} \\
1158 \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}&0x61&\livelink{chap:flag}{flag}
1159 \addtoindexx{mutable attribute!encoding} \\
1161 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}&0x62&\livelink{chap:flag}{flag}
1162 \addtoindexx{thread scaled attribute!encoding} \\
1163 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}&0x63&\livelink{chap:flag}{flag}
1164 \addtoindexx{explicit attribute!encoding} \\
1165 \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}&0x64&reference
1166 \addtoindexx{object pointer attribute!encoding} \\
1167 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}&0x65&constant
1168 \addtoindexx{endianity attribute!encoding} \\
1169 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental}&0x66&\livelink{chap:flag}{flag}
1170 \addtoindexx{elemental attribute!encoding} \\
1171 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure}&0x67&\livelink{chap:flag}{flag}
1172 \addtoindexx{pure attribute!encoding} \\
1173 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}&0x68&\livelink{chap:flag}{flag}
1174 \addtoindexx{recursive attribute!encoding} \\
1175 \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature} \ddag &0x69&reference
1176 \addtoindexx{signature attribute!encoding} \\
1177 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} \ddag &0x6a&\livelink{chap:flag}{flag}
1178 \addtoindexx{main subprogram attribute!encoding} \\
1179 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} \ddag &0x6b&constant
1180 \addtoindexx{data bit offset attribute!encoding} \\
1181 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} \ddag &0x6c&\livelink{chap:flag}{flag}
1182 \addtoindexx{constant expression attribute!encoding} \\
1183 \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class} \ddag &0x6d&\livelink{chap:flag}{flag}
1184 \addtoindexx{enumeration class attribute!encoding} \\
1185 \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} \ddag &0x6e&string
1186 \addtoindexx{linkage name attribute!encoding} \\
1187 \livetarg{chap:DWATlouser}{DW\-\_AT\-\_lo\-\_user}&0x2000 & --- \addtoindexx{low user attribute encoding} \\
1188 \livetarg{chap:DWAThiuser}{DW\-\_AT\-\_hi\-\_user}&0x3fff& --- \addtoindexx{high user attribute encoding} \\
1191 \ddag Attribute new in \addtoindex{DWARF Version 4}
1195 \setlength{\extrarowheight}{0.1cm}
1196 \begin{longtable}{l|l|l}
1197 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
1198 \hline \\ \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
1200 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
1202 \hline \emph{Continued on next page}
1206 \livelink{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}&0x01&address \\
1207 \livelink{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}&0x03&\livelink{chap:block}{block} \\
1208 \livelink{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}&0x04&\livelink{chap:block}{block} \\
1209 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2}&0x05&constant \\
1210 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4}&0x06&constant \\
1211 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}&0x07&constant \\
1212 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string}&0x08&string \\
1213 \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}&0x09&\livelink{chap:block}{block} \\
1214 \livelink{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}&0x0a&\livelink{chap:block}{block} \\
1215 \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1}&0x0b&constant \\
1216 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag}&0x0c&\livelink{chap:flag}{flag} \\
1217 \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}&0x0d&constant \\
1218 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&0x0e&string \\
1219 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata}&0x0f&constant \\
1220 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}&0x10&reference \\
1221 \livelink{chap:DWFORMref1}{DW\-\_FORM\-\_ref1}&0x11&reference \\
1222 \livelink{chap:DWFORMref2}{DW\-\_FORM\-\_ref2}&0x12&reference \\
1223 \livelink{chap:DWFORMref4}{DW\-\_FORM\-\_ref4}&0x13&reference \\
1224 \livelink{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}&0x14&reference \\
1225 \livelink{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}&0x15&reference \\
1226 \livelink{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect}&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
1227 \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} \\
1228 \livelink{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc} \ddag &0x18&\livelink{chap:exprloc}{exprloc} \\
1229 \livelink{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present} \ddag &0x19&\livelink{chap:flag}{flag} \\
1230 \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8} \ddag &0x20&reference \\
1233 \ddag FORM new in \addtoindex{DWARF Version 4}
1236 \section{Variable Length Data}
1237 \label{datarep:variablelengthdata}
1238 \addtoindexx{variable length data|see {LEB128}}
1240 \addtoindexx{Little Endian Base 128|see{LEB128}}
1241 encoded using ``Little Endian Base 128''
1242 \addtoindexx{little-endian encoding|see{endian attribute}}
1244 \addtoindexx{LEB128}
1245 LEB128 is a scheme for encoding integers
1246 densely that exploits the assumption that most integers are
1249 This encoding is equally suitable whether the target machine
1250 architecture represents data in big\dash\ endian or little\dash endian
1251 order. It is ``little\dash endian'' only in the sense that it
1252 avoids using space to represent the ``big'' end of an
1253 unsigned integer, when the big end is all zeroes or sign
1256 Unsigned LEB128 (ULEB128) numbers are encoded as follows:
1257 \addtoindexx{LEB128!unsigned, encoding as}
1258 start at the low order end of an unsigned integer and chop
1259 it into 7\dash bit chunks. Place each chunk into the low order 7
1260 bits of a byte. Typically, several of the high order bytes
1261 will be zero; discard them. Emit the remaining bytes in a
1262 stream, starting with the low order byte; set the high order
1263 bit on each byte except the last emitted byte. The high bit
1264 of zero on the last byte indicates to the decoder that it
1265 has encountered the last byte.
1267 The integer zero is a special case, consisting of a single
1270 Table \refersec{tab:examplesofunsignedleb128encodings}
1271 gives some examples of unsigned LEB128 numbers. The
1272 0x80 in each case is the high order bit of the byte, indicating
1273 that an additional byte follows.
1276 The encoding for signed, two’s complement LEB128 (SLEB128)
1277 \addtoindexx{LEB128!signed, encoding as}
1278 numbers is similar, except that the criterion for discarding
1279 high order bytes is not whether they are zero, but whether
1280 they consist entirely of sign extension bits. Consider the
1281 32\dash bit integer -2. The three high level bytes of the number
1282 are sign extension, thus LEB128 would represent it as a single
1283 byte containing the low order 7 bits, with the high order
1284 bit cleared to indicate the end of the byte stream. Note
1285 that there is nothing within the LEB128 representation that
1286 indicates whether an encoded number is signed or unsigned. The
1287 decoder must know what type of number to expect.
1288 Table \refersec{tab:examplesofunsignedleb128encodings}
1289 gives some examples of unsigned LEB128 numbers and
1290 Table \refersec{tab:examplesofsignedleb128encodings}
1291 gives some examples of signed LEB128
1294 Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1295 \addtoindexx{LEB128!examples}
1296 gives algorithms for encoding and decoding these forms.
1300 \setlength{\extrarowheight}{0.1cm}
1301 \begin{longtable}{l|l|l}
1302 \caption{Examples of unsigned LEB128 encodings} \label{tab:examplesofunsignedleb128encodings} \\
1303 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1305 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1307 \hline \emph{Continued on next page}
1313 128& 0 + 0x80 & 1 \\
1314 129& 1 + 0x80 & 1 \\
1315 130& 2 + 0x80 & 1 \\
1316 12857& 57 + 0x80 & 100 \\
1317 \addtoindex{LEB128 encoding!examples}
1324 \setlength{\extrarowheight}{0.1cm}
1325 \begin{longtable}{l|l|l}
1326 \caption{Examples of signed LEB128 encodings} \label{tab:examplesofsignedleb128encodings} \\
1327 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1329 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1331 \hline \emph{Continued on next page}
1337 127& 127 + 0x80 & 0 \\
1338 -127& 1 + 0x80 & 0x7f \\
1339 128& 0 + 0x80 & 1 \\
1340 -128& 0 + 0x80 & 0x7f \\
1341 129& 1 + 0x80 & 1 \\
1342 -129& -x7f + 0x80 & 0xtc \\
1349 \section{DWARF Expressions and Location Descriptions}
1350 \label{datarep:dwarfexpressionsandlocationdescriptions}
1351 \subsection{DWARF Expressions}
1352 \label{datarep:dwarfexpressions}
1355 \addtoindexx{DWARF Expression!operator encoding}
1356 DWARF expression is stored in a \nolink{block} of contiguous
1357 bytes. The bytes form a sequence of operations. Each operation
1358 is a 1\dash byte code that identifies that operation, followed by
1359 zero or more bytes of additional data. The encodings for the
1360 operations are described in
1361 Table \refersec{tab:dwarfoperationencodings}.
1364 \setlength{\extrarowheight}{0.1cm}
1365 \begin{longtable}{l|l|l|l}
1366 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1367 \hline \\ & &\bfseries No. of &\\
1368 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1370 & &\bfseries No. of &\\
1371 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1373 \hline \emph{Continued on next page}
1378 \livelink{chap:DWOPaddr}{DW\-\_OP\-\_addr}&0x03&1 & constant address \\
1379 & & &(size target specific) \\
1381 \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}&0x06&0 & \\
1384 \livelink{chap:DWOPconst1u}{DW\-\_OP\-\_const1u}&0x08&1&1\dash byte constant \\
1385 \livelink{chap:DWOPconst1s}{DW\-\_OP\-\_const1s}&0x09&1&1\dash byte constant \\
1386 \livelink{chap:DWOPconst2u}{DW\-\_OP\-\_const2u}&0x0a&1&2\dash byte constant \\
1387 \livelink{chap:DWOPconst2s}{DW\-\_OP\-\_const2s}&0x0b&1&2\dash byte constant \\
1388 \livelink{chap:DWOPconst4u}{DW\-\_OP\-\_const4u}&0x0c&1&4\dash byte constant \\
1389 \livelink{chap:DWOPconst4s}{DW\-\_OP\-\_const4s}&0x0d&1&4\dash byte constant \\
1390 \livelink{chap:DWOPconst8u}{DW\-\_OP\-\_const8u}&0x0e&1&8\dash byte constant \\
1391 \livelink{chap:DWOPconst8s}{DW\-\_OP\-\_const8s}&0x0f&1&8\dash byte constant \\
1392 \livelink{chap:DWOPconstu}{DW\-\_OP\-\_constu}&0x10&1&ULEB128 constant \\
1393 \livelink{chap:DWOPconsts}{DW\-\_OP\-\_consts}&0x11&1&SLEB128 constant \\
1394 \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}&0x12&0 & \\
1395 \livelink{chap:DWOPdrop}{DW\-\_OP\-\_drop}&0x13&0 & \\
1396 \livelink{chap:DWOPover}{DW\-\_OP\-\_over}&0x14&0 & \\
1397 \livelink{chap:DWOPpick}{DW\-\_OP\-\_pick}&0x15&1&1\dash byte stack index \\
1398 \livelink{chap:DWOPswap}{DW\-\_OP\-\_swap}&0x16&0 & \\
1399 \livelink{chap:DWOProt}{DW\-\_OP\-\_rot}&0x17&0 & \\
1400 \livelink{chap:DWOPxderef}{DW\-\_OP\-\_xderef}&0x18&0 & \\
1401 \livelink{chap:DWOPabs}{DW\-\_OP\-\_abs}&0x19&0 & \\
1402 \livelink{chap:DWOPand}{DW\-\_OP\-\_and}&0x1a&0 & \\
1403 \livelink{chap:DWOPdiv}{DW\-\_OP\-\_div}&0x1b&0 & \\
1407 \livelink{chap:DWOPminus}{DW\-\_OP\-\_minus}&0x1c&0 & \\
1408 \livelink{chap:DWOPmod}{DW\-\_OP\-\_mod}&0x1d&0 & \\
1409 \livelink{chap:DWOPmul}{DW\-\_OP\-\_mul}&0x1e&0 & \\
1410 \livelink{chap:DWOPneg}{DW\-\_OP\-\_neg}&0x1f&0 & \\
1411 \livelink{chap:DWOPnot}{DW\-\_OP\-\_not}&0x20&0 & \\
1412 \livelink{chap:DWOPor}{DW\-\_OP\-\_or}&0x21&0 & \\
1413 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}&0x22&0 & \\
1414 \livelink{chap:DWOPplusuconst}{DW\-\_OP\-\_plus\-\_uconst}&0x23&1&ULEB128 addend \\
1415 \livelink{chap:DWOPshl}{DW\-\_OP\-\_shl}&0x24&0 & \\
1416 \livelink{chap:DWOPshr}{DW\-\_OP\-\_shr}&0x25&0 & \\
1417 \livelink{chap:DWOPshra}{DW\-\_OP\-\_shra}&0x26&0 & \\
1418 \livelink{chap:DWOPxor}{DW\-\_OP\-\_xor}&0x27&0 & \\
1419 \livelink{chap:DWOPskip}{DW\-\_OP\-\_skip}&0x2f&1&signed 2\dash byte constant \\
1420 \livelink{chap:DWOPbra}{DW\-\_OP\-\_bra}&0x28&1 & signed 2\dash byte constant \\
1421 \livelink{chap:DWOPeq}{DW\-\_OP\-\_eq}&0x29&0 & \\
1422 \livelink{chap:DWOPge}{DW\-\_OP\-\_ge}&0x2a&0 & \\
1423 \livelink{chap:DWOPgt}{DW\-\_OP\-\_gt}&0x2b&0 & \\
1424 \livelink{chap:DWOPle}{DW\-\_OP\-\_le}&0x2c&0 & \\
1425 \livelink{chap:DWOPlt}{DW\-\_OP\-\_lt}&0x2d&0 & \\
1426 \livelink{chap:DWOPne}{DW\-\_OP\-\_ne}&0x2e&0 & \\ \hline
1430 \livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0}&0x30 & 0 & \\
1432 \livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1}&0x31 & 0& literals 0 .. 31 = \\
1433 \ldots & & & (\livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0} + literal) \\
1434 \livelink{chap:DWOPlit31}{DW\-\_OP\-\_lit31}&0x4f & 0 & \\ \hline
1436 \livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} & 0x50 & 0 & \\
1437 \livelink{chap:DWOPreg1}{DW\-\_OP\-\_reg1} & 0x51 & 0® 0 .. 31 = \\
1438 \ldots & & & (\livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} + regnum) \\
1439 \livelink{chap:DWOPreg31}{DW\-\_OP\-\_reg31} & 0x6f & 0 & \\ \hline
1441 \livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} & 0x70 &1 & SLEB128 offset \\
1442 \livelink{chap:DWOPbreg1}{DW\-\_OP\-\_breg1} & 0x71 & 1 &base register 0 .. 31 = \\
1443 ... & & &(\livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} + regnum) \\
1444 \livelink{chap:DWOPbreg31}{DW\-\_OP\-\_breg31} & 0x8f & 1 & \\ \hline
1446 \livelink{chap:DWOPregx}{DW\-\_OP\-\_regx} & 0x90 &1&ULEB128 register \\
1447 \livelink{chap:DWOPfbreg}{DW\-\_OP\-\_fbreg} & 0x91&1&SLEB128 offset \\
1448 \livelink{chap:DWOPbregx}{DW\-\_OP\-\_bregx} & 0x92&2 &ULEB128 register followed \\
1449 & & & by SLEB128 offset \\
1450 \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} & 0x93 &1& ULEB128 size of piece addressed \\
1451 \livelink{chap:DWOPderefsize}{DW\-\_OP\-\_deref\-\_size} & 0x94 &1& 1-byte size of data retrieved \\
1452 \livelink{chap:DWOPxderefsize}{DW\-\_OP\-\_xderef\-\_size} & 0x95&1&1-byte size of data retrieved \\
1453 \livelink{chap:DWOPnop}{DW\-\_OP\-\_nop} & 0x96 &0& \\
1456 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}&0x97&0 & \\
1457 \livelink{chap:DWOPcall2}{DW\-\_OP\-\_call2}&0x98&1& 2\dash byte offset of DIE \\
1458 \livelink{chap:DWOPcall4}{DW\-\_OP\-\_call4}&0x99&1& 4\dash byte offset of DIE \\
1459 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&0x9a&1& 4\dash\ or 8\dash byte\\
1460 &&& offset of DIE \\
1461 \livelink{chap:DWOPformtlsaddress}{DW\-\_OP\-\_form\-\_tls\-\_address}&0x9b &0& \\
1462 \livelink{chap:DWOPcallframecfa}{DW\-\_OP\-\_call\-\_frame\-\_cfa} &0x9c &0& \\
1463 \livelink{chap:DWOPbitpiece}{DW\-\_OP\-\_bit\-\_piece}&0x9d &2&ULEB128 size followed by \\
1465 \livelink{chap:DWOPimplicitvalue}{DW\-\_OP\-\_implicit\-\_value}&0x9e &2&ULEB128 size followed by \\
1466 &&&\nolink{block} of that size\\
1467 \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} &0x9f &0& \\
1468 \livetarg{chap:DWOPlouser}{DW\-\_OP\-\_lo\-\_user} &0xe0 && \\
1469 \livetarg{chap:DWOPhiuser}{DW\-\_OP\-\_hi\-\_user} &0xff && \\
1475 \subsection{Location Descriptions}
1476 \label{datarep:locationdescriptions}
1478 A location description is used to compute the
1479 location of a variable or other entity.
1481 \subsection{Location Lists}
1482 \label{datarep:locationlists}
1484 Each entry in a \addtoindex{location list} is either a location list entry,
1485 a base address selection entry, or an
1486 \addtoindex{end of list entry!in location list}
1489 A \addtoindex{location list} entry consists of two address offsets followed
1490 by a 2\dash byte length, followed by a block of contiguous bytes
1491 that contains a DWARF location description. The length
1492 specifies the number of bytes in that block. The two offsets
1493 are the same size as an address on the target machine.
1495 A base address selection entry and an
1496 \addtoindex{end of list entry!in location list}
1497 end of list entry each
1498 consist of two (constant or relocated) address offsets. The two
1499 offsets are the same size as an address on the target machine.
1501 For a \addtoindex{location list} to be specified, the base address of
1502 \addtoindexx{base address selection entry!in location list}
1503 the corresponding compilation unit must be defined
1504 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1506 \section{Base Type Attribute Encodings}
1507 \label{datarep:basetypeattributeencodings}
1509 The encodings of the
1510 \hypertarget{chap:DWATencodingencodingofbasetype}
1512 \addtoindexx{encoding attribute!encoding}
1514 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
1515 attribute are given in
1516 Table \refersec{tab:basetypeencodingvalues}
1519 \setlength{\extrarowheight}{0.1cm}
1520 \begin{longtable}{l|c}
1521 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1522 \hline \\ \bfseries Base type encoding code name&\bfseries Value \\ \hline
1524 \bfseries Base type encoding code name&\bfseries Value\\ \hline
1526 \hline \emph{Continued on next page}
1531 \livelink{chap:DWATEaddress}{DW\-\_ATE\-\_address}&0x01 \\
1532 \livelink{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}&0x02 \\
1533 \livelink{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}&0x03 \\
1534 \livelink{chap:DWATEfloat}{DW\-\_ATE\-\_float}&0x04 \\
1535 \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed}&0x05 \\
1536 \livelink{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}&0x06 \\
1537 \livelink{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned}&0x07 \\
1538 \livelink{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char}&0x08 \\
1539 \livelink{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}&0x09 \\
1540 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}&0x0a \\
1541 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}&0x0b \\
1542 \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}&0x0c \\
1543 \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed}&0x0d \\
1544 \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}&0x0e \\
1545 \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & 0x0f \\
1546 \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} \ddag & 0x10 \\
1547 \livetarg{chap:DWATElouser}{DW\-\_ATE\-\_lo\-\_user} & 0x80 \\
1548 \livetarg{chap:DWATEhiuser}{DW\-\_ATE\-\_hi\-\_user} & 0xff \\
1551 \ddag Base type encoding new in \addtoindex{DWARF Version 4}
1555 The encodings of the constants used in the
1556 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute
1558 Table \refersec{tab:decimalsignencodings}.
1562 \setlength{\extrarowheight}{0.1cm}
1563 \begin{longtable}{l|c}
1564 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1565 \hline \\ \bfseries Decimal sign code name&\bfseries Value \\ \hline
1567 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1569 \hline \emph{Continued on next page}
1574 \livelink{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & 0x01 \\
1575 \livelink{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & 0x02 \\
1576 \livelink{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & 0x03 \\
1577 \livelink{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate} & 0x04 \\
1578 \livelink{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate} & 0x05 \\
1583 The encodings of the constants used in the
1584 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute are given in
1585 Table \refersec{tab:endianityencodings}.
1588 \setlength{\extrarowheight}{0.1cm}
1589 \begin{longtable}{l|c}
1590 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1591 \hline \\ \bfseries Endian code name&\bfseries Value \\ \hline
1593 \bfseries Endian code name&\bfseries Value\\ \hline
1595 \hline \emph{Continued on next page}
1600 \livelink{chap:DWENDdefault}{DW\-\_END\-\_default} & 0x00 \\
1601 \livelink{chap:DWENDbig}{DW\-\_END\-\_big} & 0x01 \\
1602 \livelink{chap:DWENDlittle}{DW\-\_END\-\_little} & 0x02 \\
1603 \livetarg{chap:DWENDlouser}{DW\-\_END\-\_lo\-\_user} & 0x40 \\
1604 \livetarg{chap:DWENDhiuser}{DW\-\_END\-\_hi\-\_user} & 0xff \\
1609 \section{Accessibility Codes}
1610 \label{datarep:accessibilitycodes}
1611 The encodings of the constants used in the
1612 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1614 \addtoindexx{accessibility attribute!encoding}
1616 Table \refersec{tab:accessibilityencodings}.
1619 \setlength{\extrarowheight}{0.1cm}
1620 \begin{longtable}{l|c}
1621 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1622 \hline \\ \bfseries Accessibility code name&\bfseries Value \\ \hline
1624 \bfseries Accessibility code name&\bfseries Value\\ \hline
1626 \hline \emph{Continued on next page}
1631 \livelink{chap:DWACCESSpublic}{DW\-\_ACCESS\-\_public}&0x01 \\
1632 \livelink{chap:DWACCESSprotected}{DW\-\_ACCESS\-\_protected}&0x02 \\
1633 \livelink{chap:DWACCESSprivate}{DW\-\_ACCESS\-\_private}&0x03 \\
1639 \section{Visibility Codes}
1640 \label{datarep:visibilitycodes}
1641 The encodings of the constants used in the
1642 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility} attribute are given in
1643 Table \refersec{tab:visibilityencodings}.
1646 \setlength{\extrarowheight}{0.1cm}
1647 \begin{longtable}{l|c}
1648 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
1649 \hline \\ \bfseries Visiibility code name&\bfseries Value \\ \hline
1651 \bfseries Visibility code name&\bfseries Value\\ \hline
1653 \hline \emph{Continued on next page}
1658 \livelink{chap:DWVISlocal}{DW\-\_VIS\-\_local}&0x01 \\
1659 \livelink{chap:DWVISexported}{DW\-\_VIS\-\_exported}&0x02 \\
1660 \livelink{chap:DWVISqualified}{DW\-\_VIS\-\_qualified}&0x03 \\
1665 \section{Virtuality Codes}
1666 \label{datarep:vitualitycodes}
1668 The encodings of the constants used in the
1669 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute are given in
1670 Table \refersec{tab:virtualityencodings}.
1673 \setlength{\extrarowheight}{0.1cm}
1674 \begin{longtable}{l|c}
1675 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
1676 \hline \\ \bfseries Virtuality code name&\bfseries Value \\ \hline
1678 \bfseries Virtuality code name&\bfseries Value\\ \hline
1680 \hline \emph{Continued on next page}
1685 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none}&0x00 \\
1686 \livelink{chap:DWVIRTUALITYvirtual}{DW\-\_VIRTUALITY\-\_virtual}&0x01 \\
1687 \livelink{chap:DWVIRTUALITYpurevirtual}{DW\-\_VIRTUALITY\-\_pure\-\_virtual}&0x02 \\
1695 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none} is equivalent to the absence of the
1696 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
1699 \section{Source Languages}
1700 \label{datarep:sourcelanguages}
1702 The encodings of the constants used
1703 \addtoindexx{language attribute, encoding}
1705 \addtoindexx{language name encoding}
1707 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
1708 attribute are given in
1709 Table \refersec{tab:languageencodings}.
1711 % If we don't force a following space it looks odd
1713 and their associated values are reserved, but the
1714 languages they represent are not well supported.
1715 Table \refersec{tab:languageencodings}
1717 \addtoindexx{lower bound attribute!default}
1718 default lower bound, if any, assumed for
1719 an omitted \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound} attribute in the context of a
1720 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} debugging information entry for each
1724 \setlength{\extrarowheight}{0.1cm}
1725 \begin{longtable}{l|c|c}
1726 \caption{Language encodings} \label{tab:languageencodings}\\
1727 \hline \\ \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
1729 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
1731 \hline \emph{Continued on next page}
1736 \livelink{chap:DWLANGC89}{DW\-\_LANG\-\_C89}&0x0001&0 \\
1737 \livelink{chap:DWLANGC}{DW\-\_LANG\-\_C}&0x0002&0 \\
1738 \livelink{chap:DWLANGAda83}{DW\-\_LANG\-\_Ada83} \dag &0x0003&1 \addtoindexx{Ada} \\
1739 \livelink{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus} &0x0004&0 \\
1740 \livelink{chap:DWLANGCobol74}{DW\-\_LANG\-\_Cobol74} \dag &0x0005&1 \\
1741 \livelink{chap:DWLANGCobol85}{DW\-\_LANG\-\_Cobol85} \dag &0x0006&1 \\
1742 \livelink{chap:DWLANGFortran77}{DW\-\_LANG\-\_Fortran77}&0x0007&1 \\
1743 \livelink{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90}&0x0008&1 \\
1744 \livelink{chap:DWLANGPascal83}{DW\-\_LANG\-\_Pascal83}&0x0009&1 \\
1745 \livelink{chap:DWLANGModula2}{DW\-\_LANG\-\_Modula2}&0x000a&1 \\
1746 \livelink{chap:DWLANGJava}{DW\-\_LANG\-\_Java}&0x000b&0 \\
1747 \livelink{chap:DWLANGC99}{DW\-\_LANG\-\_C99}&0x000c&0 \\
1748 \livelink{chap:DWLANGAda95}{DW\-\_LANG\-\_Ada95} \dag &0x000d&1 \addtoindexx{Ada} \\
1749 \livelink{chap:DWLANGFortran95}{DW\-\_LANG\-\_Fortran95} &0x000e&1 \\
1750 \livelink{chap:DWLANGPLI}{DW\-\_LANG\-\_PLI} \dag &0x000f&1 \\
1751 \livelink{chap:DWLANGObjC}{DW\-\_LANG\-\_ObjC}&0x0010&0 \\
1752 \livelink{chap:DWLANGObjCplusplus}{DW\-\_LANG\-\_ObjC\-\_plus\-\_plus}&0x0011&0 \\
1753 \livelink{chap:DWLANGUPC}{DW\-\_LANG\-\_UPC}&0x0012&0 \\
1754 \livelink{chap:DWLANGD}{DW\-\_LANG\-\_D}&0x0013&0 \\
1755 \livelink{chap:DWLANGPython}{DW\-\_LANG\-\_Python} \dag &0x0014&0 \\
1756 \livetarg{chap:DWLANGlouser}{DW\-\_LANG\-\_lo\-\_user}&0x8000 & \\
1757 \livetarg{chap:DWLANGhiuser}{DW\-\_LANG\-\_hi\-\_user}&0xffff & \\
1763 \section{Address Class Encodings}
1764 \label{datarep:addressclassencodings}
1766 The value of the common
1767 \addtoindexi{address}{address class!attribute encoding}
1769 \livelink{chap:DWADDRnone}{DW\-\_ADDR\-\_none} is 0.
1772 \section{Identifier Case}
1773 \label{datarep:identifiercase}
1775 The encodings of the constants used in the
1776 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case} attribute are given in
1777 Table \refersec{tab:identifiercaseencodings}.
1780 \setlength{\extrarowheight}{0.1cm}
1781 \begin{longtable}{l|c}
1782 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
1783 \hline \\ \bfseries Identifier case name&\bfseries Value \\ \hline
1785 \bfseries Identifier case name&\bfseries Value\\ \hline
1787 \hline \emph{Continued on next page}
1791 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive}&0x00 \\
1792 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case}&0x01 \\
1793 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case}&0x02 \\
1794 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive}&0x03 \\
1798 \section{Calling Convention Encodings}
1799 \label{datarep:callingconventionencodings}
1800 The encodings of the constants used in the
1801 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention} attribute are given in
1802 Table \refersec{tab:callingconventionencodings}.
1805 \setlength{\extrarowheight}{0.1cm}
1806 \begin{longtable}{l|c}
1807 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
1808 \hline \\ \bfseries Calling Convention name&\bfseries Value \\ \hline
1810 \bfseries Calling Convention name&\bfseries Value\\ \hline
1812 \hline \emph{Continued on next page}
1817 \livelink{chap:DWCCnormal}{DW\-\_CC\-\_normal}&0x01 \\
1818 \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}&0x02 \\
1819 \livelink{chap:DWCCnocall}{DW\-\_CC\-\_nocall}&0x03 \\
1820 \livetarg{chap:DWCClouser}{DW\-\_CC\-\_lo\-\_user}&0x40 \\
1821 \livetarg{chap:DWCChiuser}{DW\-\_CC\-\_hi\-\_user}&0xff \\
1826 \section{Inline Codes}
1827 \label{datarep:inlinecodes}
1829 The encodings of the constants used in
1830 \addtoindexx{inline attribute!encoding}
1832 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute are given in
1833 Table \refersec{tab:inlineencodings}.
1836 \setlength{\extrarowheight}{0.1cm}
1837 \begin{longtable}{l|c}
1838 \caption{Inline encodings} \label{tab:inlineencodings}\\
1839 \hline \\ \bfseries Iline Code name&\bfseries Value \\ \hline
1841 \bfseries Iline Code name&\bfseries Value\\ \hline
1843 \hline \emph{Continued on next page}
1848 \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}&0x00 \\
1849 \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}&0x01 \\
1850 \livelink{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined}&0x02 \\
1851 \livelink{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined}&0x03 \\
1856 % this clearpage is ugly, but the following table came
1857 % out oddly without it.
1859 \section{Array Ordering}
1860 \label{datarep:arrayordering}
1862 The encodings of the constants used in the
1863 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute are given in
1864 Table \refersec{tab:orderingencodings}.
1867 \setlength{\extrarowheight}{0.1cm}
1868 \begin{longtable}{l|c}
1869 \caption{Ordering encodings} \label{tab:orderingencodings}\\
1870 \hline \\ \bfseries Ordering name&\bfseries Value \\ \hline
1872 \bfseries Ordering name&\bfseries Value\\ \hline
1874 \hline \emph{Continued on next page}
1879 \livelink{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}&0x00 \\
1880 \livelink{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major}&0x01 \\
1886 \section{Discriminant Lists}
1887 \label{datarep:discriminantlists}
1889 The descriptors used in
1890 \addtoindexx{discriminant list attribute!encoding}
1892 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute are
1893 encoded as 1\dash byte constants. The
1894 defined values are given in
1895 Table \refersec{tab:discriminantdescriptorencodings}.
1897 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
1899 \setlength{\extrarowheight}{0.1cm}
1900 \begin{longtable}{l|c}
1901 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
1902 \hline \\ \bfseries Descriptor Name&\bfseries Value \\ \hline
1904 \bfseries Descriptor Name&\bfseries Value\\ \hline
1906 \hline \emph{Continued on next page}
1911 \livetarg{chap:DWDSClabel}{DW\-\_DSC\-\_label}&0x00 \\
1912 \livetarg{chap:DWDSCrange}{DW\-\_DSC\-\_range}&0x01 \\
1917 \section{Name Lookup Tables}
1918 \label{datarep:namelookuptables}
1920 Each set of entries in the table of global names contained
1921 in the \addtoindex{.debug\_pubnames} and
1922 \addtoindex{.debug\_pubtypes} sections begins
1923 with a header consisting of:
1926 \begin{enumerate}[1.]
1927 \item unit\_length (initial length) \\
1928 \addtoindexx{unit\_length}
1929 A 4\dash byte or 12\dash byte unsigned integer
1930 \addtoindexx{initial length}
1931 representing the length
1932 of the \addtoindex{.debug\_info}
1933 contribution for that compilation unit,
1934 not including the length field itself. In the 32\dash bit DWARF
1935 format, this is a 4\dash byte unsigned integer (which must be less
1936 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
1937 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
1938 integer that gives the actual length
1939 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1941 \item version (\addtoindex(uhalf))
1942 A 2\dash byte unsigned integer representing the version of the
1943 DWARF information\addtoindexx{version number!compilation unit} for the compilation unit
1944 \addtoindexx{version number!name lookup table}
1945 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1946 The value in this field is 4.
1948 % Some say unsigned offset this just says offset: FIXME
1949 \item \addtoindex{debug\_info\_offset} (section offset) \\
1951 \addtoindexx{section offset!in name lookup table set of entries}
1952 4\dash byte or 8\dash byte
1954 \addtoindex{.debug\_info}
1955 section of the compilation unit header.
1957 the 32\dash bit DWARF format, this is a 4\dash byte unsigned offset;
1958 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned offsets
1959 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1961 \item \addtoindex{debug\_info\_length} (section length) \\
1962 \addtoindexx{section length!in .debug\_pubnames header}
1964 \addtoindexx{section length!in .debug\_pubtypes header}
1965 4\dash byte or 8\dash byte length containing the size in bytes of the
1966 contents of the \addtoindex{.debug\_info}
1967 section generated to represent
1968 this compilation unit. In the 32\dash bit DWARF format, this is
1969 a 4\dash byte unsigned length; in the 64\dash bit DWARF format, this
1970 is an 8-byte unsigned length
1971 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1976 This header is followed by a series of tuples. Each tuple
1977 consists of a 4\dash byte or 8\dash byte offset followed by a string
1978 of non\dash null bytes terminated by one null byte.
1980 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
1981 format, it is an 8\dash byte offset.
1982 Each set is terminated by an
1983 offset containing the value 0.
1986 \section{Address Range Table}
1987 \label{datarep:addrssrangetable}
1989 Each set of entries in the table of address ranges contained
1990 in the \addtoindex{.debug\_aranges}
1991 section begins with a header containing:
1993 \begin{enumerate}[1.]
1994 % FIXME The unit length text is not fully consistent across
1997 \item unit\_length (initial length) \\
1998 \addtoindexx{unit\_length}
1999 A 4-byte or 12-byte length containing the length of the
2000 \addtoindexx{initial length}
2001 set of entries for this compilation unit, not including the
2002 length field itself. In the 32-bit DWARF format, this is a
2003 4-byte unsigned integer (which must be less than 0xfffffff0);
2004 in the 64-bit DWARF format, this consists of the 4-byte value
2005 0xffffffff followed by an 8-byte unsigned integer that gives
2007 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2009 \item version (\addtoindex(uhalf)) \\
2010 A 2\dash byte version identifier
2011 \addtoindexx{version number!address range table} containing the value 2
2012 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2014 \item debug\_info\_offset (section offset) \\
2016 \addtoindexx{section offset!in .debug\_aranges header}
2017 4\dash byte or 8\dash byte offset into the
2018 \addtoindex{.debug\_info} section of
2019 the compilation unit header. In the 32\dash bit DWARF format,
2020 this is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
2021 this is an 8\dash byte unsigned offset
2022 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
2024 \item address\_size (ubyte) \\
2025 A 1\dash byte unsigned integer containing the size in bytes of an
2026 \addtoindexx{address\_size}
2028 \addtoindexx{size of an address}
2029 (or the offset portion of an address for segmented
2030 \addtoindexx{address space!segmented}
2031 addressing) on the target system.
2033 \item segment\_size (ubyte) \\
2035 \addtoindexx{segment\_size}
2036 1\dash byte unsigned integer containing the size in bytes of a
2037 segment selector on the target system.
2041 This header is followed by a series of tuples. Each tuple
2042 consists of a segment, an address and a length.
2044 size is given by the \addtoindex{segment\_size} field of the header; the
2045 address and length size are each given by the address\_size
2046 field of the header.
2047 The first tuple following the header in
2048 each set begins at an offset that is a multiple of the size
2049 of a single tuple (that is, the size of a segment selector
2050 plus twice the \addtoindex{size of an address}).
2051 The header is padded, if
2052 necessary, to that boundary. Each set of tuples is terminated
2053 by a 0 for the segment, a 0 for the address and 0 for the
2054 length. If the \addtoindex{segment\_size} field in the header is zero,
2055 the segment selectors are omitted from all tuples, including
2056 the terminating tuple.
2059 \section{Line Number Information}
2060 \label{datarep:linenumberinformation}
2062 The \addtoindexi{version number}{version number!line number information}
2063 in the line number program header is 4
2064 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2066 The boolean values ``true'' and ``false''
2067 used by the line number information program are encoded
2068 as a single byte containing the value 0
2069 for ``false,'' and a non-zero value for ``true.''
2071 The encodings for the standard opcodes are given in
2072 \addtoindexx{line number opcodes!standard opcode encoding}
2073 Table \refersec{tab:linenumberstandardopcodeencodings}.
2075 % Odd that the 'Name' field capitalized here, it is not caps elsewhere.
2077 \setlength{\extrarowheight}{0.1cm}
2078 \begin{longtable}{l|c}
2079 \caption{Line Number Standard Opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
2080 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
2082 \bfseries Opcode Name&\bfseries Value\\ \hline
2084 \hline \emph{Continued on next page}
2089 \livelink{chap:DWLNScopy}{DW\-\_LNS\-\_copy}&0x01 \\
2090 \livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}&0x02 \\
2091 \livelink{chap:DWLNSadvanceline}{DW\-\_LNS\-\_advance\-\_line}&0x03 \\
2092 \livelink{chap:DWLNSsetfile}{DW\-\_LNS\-\_set\-\_file}&0x04 \\
2093 \livelink{chap:DWLNSsetcolumn}{DW\-\_LNS\-\_set\-\_column}&0x05 \\
2094 \livelink{chap:DWLNSnegatestmt}{DW\-\_LNS\-\_negate\-\_stmt}&0x06 \\
2095 \livelink{chap:DWLNSsetbasicblock}{DW\-\_LNS\-\_set\-\_basic\-\_block}&0x07 \\
2096 \livelink{chap:DWLNSconstaddpc}{DW\-\_LNS\-\_const\-\_add\-\_pc}*0x08 \\
2097 \livelink{chap:DWLNSfixedadvancepc}{DW\-\_LNS\-\_fixed\-\_advance\-\_pc}&0x09 \\
2098 \livelink{chap:DWLNSsetprologueend}{DW\-\_LNS\-\_set\-\_prologue\-\_end}&0x0a \\
2099 \livelink{chap:DWLNSsetepiloguebegin}{DW\-\_LNS\-\_set\-\_epilogue\-\_begin}&0x0b \\
2100 \livelink{chap:DWLNSsetisa}{DW\-\_LNS\-\_set\-\_isa}&0x0c \\
2106 The encodings for the extended opcodes are given in
2107 \addtoindexx{line number opcodes!extended opcode encoding}
2108 Table \refersec{tab:linenumberextendedopcodeencodings}.
2111 \setlength{\extrarowheight}{0.1cm}
2112 \begin{longtable}{l|c}
2113 \caption{Line Number Extended Opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
2114 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
2116 \bfseries Opcode Name&\bfseries Value\\ \hline
2118 \hline \emph{Continued on next page}
2123 \livelink{chap:DWLNEendsequence}{DW\-\_LNE\-\_end\-\_sequence}&0x01 \\
2124 \livelink{chap:DWLNEsetaddress}{DW\-\_LNE\-\_set\-\_address}&0x02\\
2125 \livelink{chap:DWLNEdefinefile}{DW\-\_LNE\-\_define\-\_file}&0x03\\
2126 \livelink{chap:DWLNEsetdiscriminator}{DW\-\_LNE\-\_set\-\_discriminator} \ddag &0x04 \\
2127 \livetarg{chap:DWLNElouser}{DW\-\_LNE\-\_lo\-\_user}&0x80 \\
2128 \livetarg{chap:DWLNEhiuser}{DW\-\_LNE\-\_hi\-\_user}&0xff \\
2131 \ddag Extended opcode new in \addtoindex{DWARF Version 4}.
2134 \section{Macro Information}
2135 \label{datarep:macroinformation}
2137 The source line numbers and source file indices encoded in the
2138 macro information section are represented as unsigned LEB128
2139 numbers as are the constants in a
2140 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext} entry.
2142 The macinfo type is encoded as a single byte.
2144 \addtoindexx{macinfo types!encoding}
2146 Table \refersec{tab:macinfotypeencodings}.
2150 \setlength{\extrarowheight}{0.1cm}
2151 \begin{longtable}{l|c}
2152 \caption{Macinfo Type Encodings} \label{tab:macinfotypeencodings}\\
2153 \hline \\ \bfseries Macinfo Type Name&\bfseries Value \\ \hline
2155 \bfseries Macinfo Type Name&\bfseries Value\\ \hline
2157 \hline \emph{Continued on next page}
2162 \livelink{chap:DWMACINFOdefine}{DW\-\_MACINFO\-\_define}&0x01 \\
2163 \livelink{chap:DWMACINFOundef}{DW\-\_MACINFO\-\_undef}&0x02 \\
2164 \livelink{chap:DWMACINFOstartfile}{DW\-\_MACINFO\-\_start\-\_file}&0x03 \\
2165 \livelink{chap:DWMACINFOendfile}{DW\-\_MACINFO\-\_end\-\_file}&0x04 \\
2166 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext}&0xff \\
2171 \section{Call Frame Information}
2172 \label{datarep:callframeinformation}
2174 In the 32\dash bit DWARF format, the value of the CIE id in the
2175 CIE header is 0xffffffff; in the 64\dash bit DWARF format, the
2176 value is 0xffffffffffffffff.
2178 The value of the CIE \addtoindexi{version number}{version number!call frame information}
2179 is 4 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
2181 Call frame instructions are encoded in one or more bytes. The
2182 primary opcode is encoded in the high order two bits of
2183 the first byte (that is, opcode = byte >> 6). An operand
2184 or extended opcode may be encoded in the low order 6
2185 bits. Additional operands are encoded in subsequent bytes.
2186 The instructions and their encodings are presented in
2187 Table \refersec{tab:callframeinstructionencodings}.
2190 \setlength{\extrarowheight}{0.1cm}
2191 \begin{longtable}{l|c|c|l|l}
2192 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
2193 \hline \\ &\bfseries High 2 &\bfseries Low 6 & & \\
2194 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2196 & \bfseries High 2 &\bfseries Low 6 & &\\
2197 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
2199 \hline \emph{Continued on next page}
2204 \livelink{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\-\_loc}&0x1&delta & \\
2205 \livelink{chap:DWCFAoffset}{DW\-\_CFA\-\_offset}&0x2®ister&ULEB128 offset \\
2206 \livelink{chap:DWCFArestore}{DW\-\_CFA\-\_restore}&0x3®ister & & \\
2207 \livelink{chap:DWCFAnop}{DW\-\_CFA\-\_nop}&0&0 & & \\
2208 \livelink{chap:DWCFAsetloc}{DW\-\_CFA\-\_set\-\_loc}&0&0x01&address & \\
2209 \livelink{chap:DWCFAadvanceloc1}{DW\-\_CFA\-\_advance\-\_loc1}&0&0x02&1\dash byte delta & \\
2210 \livelink{chap:DWCFAadvanceloc2}{DW\-\_CFA\-\_advance\-\_loc2}&0&0x03&2\dash byte delta & \\
2211 \livelink{chap:DWCFAadvanceloc4}{DW\-\_CFA\-\_advance\-\_loc4}&0&0x04&4\dash byte delta & \\
2212 \livelink{chap:DWCFAoffsetextended}{DW\-\_CFA\-\_offset\-\_extended}&0&0x05&ULEB128 register&ULEB128 offset \\
2213 \livelink{chap:DWCFArestoreextended}{DW\-\_CFA\-\_restore\-\_extended}&0&0x06&ULEB128 register & \\
2214 \livelink{chap:DWCFAundefined}{DW\-\_CFA\-\_undefined}&0&0x07&ULEB128 register & \\
2215 \livelink{chap:DWCFAsamevalue}{DW\-\_CFA\-\_same\-\_value}&0&0x08 &ULEB128 register & \\
2216 \livelink{chap:DWCFAregister}{DW\-\_CFA\-\_register}&0&0x09&ULEB128 register &ULEB128 offset \\
2217 \livelink{chap:DWCFArememberstate}{DW\-\_CFA\-\_remember\-\_state}&0&0x0a & & \\
2218 \livelink{chap:DWCFArestorestate}{DW\-\_CFA\-\_restore\-\_state}&0&0x0b & & \\
2219 \livelink{chap:DWCFAdefcfa}{DW\-\_CFA\-\_def\-\_cfa}&0&0x0c &ULEB128 register&ULEB128 offset \\
2220 \livelink{chap:DWCFAdefcfaregister}{DW\-\_CFA\-\_def\-\_cfa\-\_register}&0&0x0d&ULEB128 register & \\
2221 \livelink{chap:DWCFAdefcfaoffset}{DW\-\_CFA\-\_def\-\_cfa\-\_offset}&0&0x0e &ULEB128 offset & \\
2222 \livelink{chap:DWCFAdefcfaexpression}{DW\-\_CFA\-\_def\-\_cfa\-\_expression}&0&0x0f &BLOCK \\
2223 \livelink{chap:DWCFAexpression}{DW\-\_CFA\-\_expression}&0&0x10&ULEB128 register & BLOCK \\
2225 \livelink{chap:DWCFAoffsetextendedsf}{DW\-\_CFA\-\_offset\-\_extended\-\_sf}&0&0x11&ULEB128 register&SLEB128 offset \\
2226 \livelink{chap:DWCFAdefcfasf}{DW\-\_CFA\-\_def\-\_cfa\-\_sf}&0&0x12&ULEB128 register&SLEB128 offset \\
2227 \livelink{chap:DWCFAdefcfaoffsetsf}{DW\-\_CFA\-\_def\-\_cfa\-\_offset\-\_sf}&0&0x13&SLEB128 offset & \\
2228 \livelink{chap:DWCFAvaloffset}{DW\-\_CFA\-\_val\-\_offset}&0&0x14&ULEB128&ULEB128 \\
2229 \livelink{chap:DWCFAvaloffsetsf}{DW\-\_CFA\-\_val\-\_offset\-\_sf}&0&0x15&ULEB128&SLEB128 \\
2230 \livelink{chap:DWCFAvalexpression}{DW\-\_CFA\-\_val\-\_expression}&0&0x16&ULEB128&BLOCK \\
2231 \livetarg{chap:DWCFAlouser}{DW\-\_CFA\-\_lo\-\_user}&0&0x1c & & \\
2232 \livetarg{chap:DWCFAhiuser}{DW\-\_CFA\-\_hi\-\_user}&0&0x3f & & \\
2236 \section{Non-contiguous Address Ranges}
2237 \label{datarep:noncontiguousaddressranges}
2239 Each entry in a \addtoindex{range list}
2240 (see Section \refersec{chap:noncontiguousaddressranges})
2242 \addtoindexx{base address selection entry!in range list}
2244 \addtoindexx{range list}
2245 a base address selection entry, or an end
2248 A \addtoindex{range list} entry consists of two relative addresses. The
2249 addresses are the same size as addresses on the target machine.
2251 A base address selection entry and an
2252 \addtoindex{end of list entry!in range list}
2253 end of list entry each
2254 \addtoindexx{base address selection entry!in range list}
2255 consist of two (constant or relocated) addresses. The two
2256 addresses are the same size as addresses on the target machine.
2258 For a \addtoindex{range list} to be specified, the base address of the
2259 \addtoindexx{base address selection entry!in range list}
2260 corresponding compilation unit must be defined
2261 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
2264 \section{Dependencies and Constraints}
2265 \label{datarep:dependenciesandconstraints}
2267 The debugging information in this format is intended to
2269 \addtoindexx{DWARF section names!list of}
2271 the \addtoindex{.debug\_abbrev},
2272 \addtoindex{.debug\_aranges},
2273 \addtoindex{.debug\_frame},
2274 \addtoindex{.debug\_info},
2275 \addtoindex{.debug\_line},
2276 \addtoindex{.debug\_loc},
2277 \addtoindex{.debug\_macinfo},
2278 \addtoindex{.debug\_pubnames},
2279 \addtoindex{.debug\_pubtypes},
2280 \addtoindex{.debug\_ranges},
2281 \addtoindex{.debug\_str}
2283 \addtoindex{.debug\_types}
2284 sections of an object file, or equivalent
2285 separate file or database. The information is not
2286 word\dash aligned. Consequently: •
2289 \item For the 32\dash bit DWARF format and a target architecture with
2290 32\dash bit addresses, an assembler or compiler must provide a way
2291 to produce 2\dash byte and 4\dash byte quantities without alignment
2292 restrictions, and the linker must be able to relocate a
2293 4\dash byte address or
2294 \addtoindexx{section offset!alignment of}
2295 section offset that occurs at an arbitrary
2298 \item For the 32\dash bit DWARF format and a target architecture with
2299 64\dash bit addresses, an assembler or compiler must provide a
2300 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2301 alignment restrictions, and the linker must be able to relocate
2302 an 8\dash byte address or 4\dash byte
2303 \addtoindexx{section offset!alignment of}
2304 section offset that occurs at an
2305 arbitrary alignment.
2307 \item For the 64\dash bit DWARF format and a target architecture with
2308 32\dash bit addresses, an assembler or compiler must provide a
2309 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2310 alignment restrictions, and the linker must be able to relocate
2311 a 4\dash byte address or 8\dash byte
2312 \addtoindexx{section offset!alignment of}
2313 section offset that occurs at an
2314 arbitrary alignment.
2316 \textit{It is expected that this will be required only for very large
2317 32\dash bit programs or by those architectures which support
2318 a mix of 32\dash bit and 64\dash bit code and data within the same
2321 \item For the 64\dash bit DWARF format and a target architecture with
2322 64\dash bit addresses, an assembler or compiler must provide a
2323 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2324 alignment restrictions, and the linker must be able to
2325 relocate an 8\dash byte address or
2326 \addtoindexx{section offset!alignment of}
2327 section offset that occurs at
2328 an arbitrary alignment.
2331 \section{Integer Representation Names}
2332 \label{datarep:integerrepresentationnames}
2334 The sizes of the integers used in the lookup by name, lookup
2335 by address, line number and call frame information sections
2337 Table 41 \refersec{tab:integerrepresentationnames}.
2340 \setlength{\extrarowheight}{0.1cm}
2341 \begin{longtable}{c|l}
2342 \caption{Integer Representation Names} \label{tab:integerrepresentationnames}\\
2343 \hline \bfseries Representation Name&\bfseries Representation \\ \hline
2345 \bfseries Representation Name&\bfseries Representation\\ \hline
2347 \hline \emph{Continued on next page}
2352 \addtoindex{sbyte}& signed, 1\dash byte integer \\
2353 \addtoindex{ubyte}&unsigned, 1\dash byte integer \\
2354 \addtoindex{uhalf}&unsigned, 2\dash byte integer \\
2355 \addtoindex{uword}&unsigned, 4\dash byte integer \\
2360 \section{Type Signature Computation}
2361 \label{datarep:typesignaturecomputation}
2363 A type signature is computed only by the DWARF producer;
2364 \addtoindexx{type signature computation}
2365 it is used by a DWARF consumer to resolve type references to
2366 the type definitions that are contained in
2367 \addtoindexx{type unit}
2370 The type signature for a type T0 is formed from the
2371 \addtoindex{MD5 hash}
2372 of a flattened description of the type. The flattened
2373 description of the type is a byte sequence derived from the
2374 DWARF encoding of the type as follows:
2376 \begin{enumerate}[1.]
2378 \item Start with an empty sequence S and a list V of visited
2379 types, where V is initialized to a list containing the type
2380 T0 as its single element. Elements in V are indexed from 1,
2383 \item If the debugging information entry represents a type that
2384 is nested inside another type or a namespace, append to S
2385 the type’s context as follows: For each surrounding type
2386 or namespace, beginning with the outermost such construct,
2387 append the letter 'C', the DWARF tag of the construct, and
2388 the name (taken from
2389 \addtoindexx{name attribute}
2390 the \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute) of the type
2391 \addtoindexx{name attribute}
2392 or namespace (including its trailing null byte).
2394 \item Append to S the letter 'D', followed by the DWARF tag of
2395 the debugging information entry.
2397 \item For each of the following attributes that are present in
2398 the debugging information entry, in the order listed below,
2399 append to S a marker letter (see below), the DWARF attribute
2400 code, and the attribute value.
2403 \item \livelink{chap:DWATname}{DW\-\_AT\-\_name}
2404 \item \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
2405 \item \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
2406 \item \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
2407 \item \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}
2408 \item \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}
2409 \item \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}
2410 \item \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
2411 \item \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
2412 \item \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
2413 \item \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
2414 \item \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
2415 \item \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
2416 \item \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
2417 \item \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
2418 \item \livelink{chap:DWATcount}{DW\-\_AT\-\_count}
2419 \item \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
2420 \item \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2421 \item \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
2422 \item \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
2423 \item \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}
2424 \item \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}
2425 \item \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
2426 \item \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}
2427 \item \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
2428 \item \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
2429 \item \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
2430 \item \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
2431 \item \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}
2432 \item \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}
2433 \item \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}
2434 \item \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}
2435 \item \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
2436 \item \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}
2437 \item \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}
2438 \item \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}
2439 \item \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}
2440 \item \livelink{chap:DWATsmall}{DW\-\_AT\-\_small}
2441 \item \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
2442 \item \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}
2443 \item \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}
2444 \item \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2445 \item \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}
2446 \item \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}
2447 \item \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}
2448 \item \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
2449 \item \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}
2450 \item \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}
2453 Note that except for the initial
2454 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2455 \addtoindexx{name attribute}
2456 attributes are appended in order according to the alphabetical
2457 spelling of their identifier.
2459 If an implementation defines any vendor-specific attributes,
2460 any such attributes that are essential to the definition of
2461 the type should also be included at the end of the above list,
2462 in their own alphabetical suborder.
2464 An attribute that refers to another type entry T is processed
2465 as follows: (a) If T is in the list V at some V[x], use the
2466 letter 'R' as the marker and use the unsigned LEB128 encoding
2467 of x as the attribute value; otherwise, (b) use the letter 'T'
2468 as the marker, process the type T recursively by performing
2469 Steps 2 through 7, and use the result as the attribute value.
2471 Other attribute values use the letter 'A' as the marker, and
2472 the value consists of the form code (encoded as an unsigned
2473 LEB128 value) followed by the encoding of the value according
2474 to the form code. To ensure reproducibility of the signature,
2475 the set of forms used in the signature computation is limited
2476 to the following: \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata},
2477 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag},
2478 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string},
2479 and \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}.
2481 \item If the tag in Step 3 is one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2482 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2483 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2484 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type},
2485 or \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, and the referenced
2486 type (via the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2487 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) has a
2488 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to S the letter 'N', the DWARF
2489 attribute code (\livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2490 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}), the context of
2491 the type (according to the method in Step 2), the letter 'E',
2492 and the name of the type. For \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, if the referenced
2493 entry is a \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}, the context is omitted and the
2494 name to be used is the ABI-specific name of the subprogram
2495 (e.g., the mangled linker name).
2498 \item 6.If the tag in Step 3 is not one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2499 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2500 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2501 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}, or
2502 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, but has
2503 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, or if the referenced type (via
2504 the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2505 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) does not have a
2506 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, the attribute is processed according to
2507 the method in Step 4 for an attribute that refers to another
2511 \item Visit each child C of the debugging information
2512 entry as follows: If C is a nested type entry or a member
2513 function entry, and has
2514 a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to
2515 \addtoindexx{name attribute}
2516 S the letter 'S', the tag of C, and its name; otherwise,
2517 process C recursively by performing Steps 3 through 7,
2518 appending the result to S. Following the last child (or if
2519 there are no children), append a zero byte.
2524 For the purposes of this algorithm, if a debugging information
2526 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
2527 attribute that refers to
2528 another entry D (which has a
2529 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}
2531 then S inherits the attributes and children of D, and S is
2532 processed as if those attributes and children were present in
2533 the entry S. Exception: if a particular attribute is found in
2534 both S and D, the attribute in S is used and the corresponding
2535 one in D is ignored.
2537 DWARF tag and attribute codes are appended to the sequence
2538 as unsigned LEB128 values, using the values defined earlier
2541 \textit{A grammar describing this computation may be found in
2542 Appendix \refersec{app:typesignaturecomputationgrammar}.
2545 \textit{An attribute that refers to another type entry should
2546 be recursively processed or replaced with the name of the
2547 referent (in Step 4, 5 or 6). If neither treatment applies to
2548 an attribute that references another type entry, the entry
2549 that contains that attribute should not be considered for a
2550 separate \addtoindex{type unit}.}
2552 \textit{If a debugging information entry contains an attribute from
2553 the list above that would require an unsupported form, that
2554 entry should not be considered for a separate
2555 \addtoindex{type unit}.}
2557 \textit{A type should be considered for a separate
2558 \addtoindex{type unit} only
2559 if all of the type entries that it contains or refers to in
2560 Steps 6 and 7 can themselves each be considered for a separate
2561 \addtoindex{type unit}.}
2563 Where the DWARF producer may reasonably choose two or more
2564 different forms for a given attribute, it should choose
2565 the simplest possible form in computing the signature. (For
2566 example, a constant value should be preferred to a location
2567 expression when possible.)
2569 Once the string S has been formed from the DWARF encoding,
2570 an \addtoindex{MD5 hash} is computed for the string and the lower 64 bits
2571 are taken as the type signature.
2573 \textit{The string S is intended to be a flattened representation of
2574 the type that uniquely identifies that type (i.e., a different
2575 type is highly unlikely to produce the same string).}
2577 \textit{A debugging information entry should not be placed in a
2578 separate \addtoindex{type unit}
2579 if any of the following apply:}
2583 \item \textit{The entry has an attribute whose value is a location
2584 expression, and the location expression contains a reference to
2585 another debugging information entry (e.g., a \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}
2586 operator), as it is unlikely that the entry will remain
2587 identical across compilation units.}
2589 \item \textit{The entry has an attribute whose value refers
2590 to a code location or a \addtoindex{location list}.}
2592 \item \textit{The entry has an attribute whose value refers
2593 to another debugging information entry that does not represent
2598 \textit{Certain attributes are not included in the type signature:}
2601 \item \textit{The \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute is not included because it
2602 indicates that the debugging information entry represents an
2603 incomplete declaration, and incomplete declarations should
2605 \addtoindexx{type unit}
2606 separate type units.}
2608 \item \textit{The \livelink{chap:DWATdescription}{DW\-\_AT\-\_description} attribute is not included because
2609 it does not provide any information unique to the defining
2610 declaration of the type.}
2612 \item \textit{The \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}, \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}, and
2613 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column} attributes are not included because they
2614 may vary from one source file to the next, and would prevent
2615 two otherwise identical type declarations from producing the
2616 \addtoindexx{MD5 hash}