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}
12 To reserve a portion of the DWARF name space and ranges of
13 enumeration values for use for vendor specific extensions,
14 special labels are reserved for tag names, attribute names,
15 base type encodings, location operations, language names,
16 calling conventions and call frame instructions.
18 The labels denoting the beginning and end of the reserved
19 value range for vendor specific extensions consist of the
20 appropriate prefix (DW\-\_TAG, DW\-\_AT, DW\-\_END, DW\-\_ATE, DW\-\_OP,
21 DW\-\_LANG, DW\-\_LNE, DW\-\_CC or DW\-\_CFA respectively) followed by
22 \_lo\_user or \_hi\_user.
23 \textit{For example, for entry tags, the special
24 labels are \livetarg{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user} and
25 \livetarg{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}.}
27 range between prefix\_lo\_user and prefix\_hi\_user inclusive,
28 are reserved for vendor specific extensions. Vendors may
29 use values in this range without conflicting with current or
30 future system\dash defined values. All other values are reserved
31 for use by the system.
33 \textit{There may also be codes for vendor specific extensions
34 between the number of standard line number opcodes and
35 the first special line number opcode. However, since the
36 number of standard opcodes varies with the DWARF version,
37 the range for extensions is also version dependent. Thus,
38 \livetarg{chap:DWLNSlouser}{DW\-\_LNS\-\_lo\-\_user} and
39 \livetarg{chap:DWLNShiuser}{DW\-\_LNS\-\_hi\-\_user} symbols are not defined.}
41 Vendor defined tags, attributes, base type encodings, location
42 atoms, language names, line number actions, calling conventions
43 and call frame instructions, conventionally use the form
44 prefix\_vendor\_id\_name, where vendor\_id is some identifying
45 character sequence chosen so as to avoid conflicts with
48 To ensure that extensions added by one vendor may be safely
49 ignored by consumers that do not understand those extensions,
50 the following rules should be followed:
53 \item New attributes should be added in such a way that a
54 debugger may recognize the format of a new attribute value
55 without knowing the content of that attribute value.
57 \item The semantics of any new attributes should not alter
58 the semantics of previously existing attributes.
60 \item The semantics of any new tags should not conflict with
61 the semantics of previously existing tags.
63 \item Do not add any new forms of attribute value.
68 \section{Reserved Values}
69 \label{datarep:reservedvalues}
70 \subsection{Error Values}
71 \label{datarep:errorvalues}
73 As a convenience for consumers of DWARF information, the value
74 0 is reserved in the encodings for attribute names, attribute
75 forms, base type encodings, location operations, languages,
76 line number program opcodes, macro information entries and tag
77 names to represent an error condition or unknown value. DWARF
78 does not specify names for these reserved values, since they
79 do not represent valid encodings for the given type and should
80 not appear in DWARF debugging information.
83 \subsection{Initial Length Values}
84 \label{datarep:initiallengthvalues}
86 An initial length field is one of the length fields that occur
87 at the beginning of those DWARF sections that have a header
88 (.debug\_aranges, .debug\_info, .debug\_types, .debug\_line,
89 .debug\_pubnames, and .debug\_pubtypes) or the length field
90 that occurs at the beginning of the CIE and FDE structures
91 in the .debug\_frame section.
93 In an initial length field, the values 0xfffffff0 through
94 0xffffffff are reserved by DWARF to indicate some form of
95 extension relative to DWARF Version 2; such values must not
96 be interpreted as a length field. The use of one such value,
97 0xffffffff, is defined below
98 (see Section \refersec{datarep:32bitand64bitdwarfformats});
100 the other values is reserved for possible future extensions.
104 \section{Executable Objects and Shared Objects}
105 \label{datarep:executableobjectsandsharedobjects}
107 The relocated addresses in the debugging information for an
108 executable object are virtual addresses and the relocated
109 addresses in the debugging information for a shared object
110 are offsets relative to the start of the lowest region of
111 memory loaded from that shared object.
113 \textit{This requirement makes the debugging information for
114 shared objects position independent. Virtual addresses in a
115 shared object may be calculated by adding the offset to the
116 base address at which the object was attached. This offset
117 is available in the run\dash time linker’s data structures.}
121 \section{32-Bit and 64-Bit DWARF Formats}
122 \label{datarep:32bitand64bitdwarfformats}
124 There are two closely related file formats. In the 32\dash bit DWARF
125 format, all values that represent lengths of DWARF sections
126 and offsets relative to the beginning of DWARF sections are
127 represented using 32\dash bits. In the 64\dash bit DWARF format, all
128 values that represent lengths of DWARF sections and offsets
129 relative to the beginning of DWARF sections are represented
130 using 64\dash bits. A special convention applies to the initial
131 length field of certain DWARF sections, as well as the CIE and
132 FDE structures, so that the 32\dash bit and 64\dash bit DWARF formats
133 can coexist and be distinguished within a single linked object.
135 The differences between the 32\dash\ and 64\dash bit
137 detailed in the following:
140 \begin{enumerate}[1.]
142 \item In the 32\dash bit DWARF format, an initial length field
143 (see Section \refersec{datarep:initiallengthvalues})
144 is an unsigned 32\dash bit integer (which
145 must be less than 0xfffffff0); in the 64\dash bit DWARF format,
146 an initial length field is 96 bits in size, and has two parts:
148 \item The first 32\dash bits have the value 0xffffffff.
150 \item The following 64\dash bits contain the actual length
151 represented as an unsigned 64\dash bit integer.
154 \textit{This representation allows a DWARF consumer to dynamically
155 detect that a DWARF section contribution is using the 64\dash bit
156 format and to adapt its processing accordingly.}
158 \item Section offset and section length fields that occur
159 in the headers of DWARF sections (other than initial length
160 fields) are listed following. In the 32\dash bit DWARF format these
161 are 32\dash bit unsigned integer values; in the 64\dash bit DWARF format,
162 they are 64\dash bit unsigned integer values.
166 Section &Name & Role \\ \hline
167 .debug\_ranges & debug\_info\_offset & offset in .debug\_info \\
168 .debug\_frame/CIE & CIE\_id & CIE distinguished value \\
169 .debug\_frame/FDE & CIE\_pointer & offset in .debug\_frame \\
170 .debug\_info & debug\_abbrev\_offset & offset in .debug\_abbrev \\
171 .debug\_line & header\_length & length of header itself \\
172 .debug\_pubnames & debug\_info\_offset & offset in .debug\_info \\
173 & debug\_info\_length & length of .debug\_info \\
175 .debug\_pubtypes & debug\_info\_offset & offset in .debug\_info \\
176 & debug\_info\_length & length of .debug\_info \\
178 .debug\_types & debug\_abbrev\_offset & offset in .debug\_info \\
179 & type\_offset & offset in of .debug\_types \\
184 \textit{The CIE\_id field in a CIE structure must be 64 bits because
185 it overlays the CIE\_pointer in a FDE structure; this implicit
186 union must be accessed to distinguish whether a CIE or FDE is
187 present, consequently, these two fields must exactly overlay
188 each other (both offset and size).}
190 \item Within the body of the .debug\_info or .debug\_types
191 section, certain forms of attribute value depend on the choice
192 of DWARF format as follows. For the 32\dash bit DWARF format,
193 the value is a 32\dash bit unsigned integer; for the 64\dash bit DWARF
194 format, the value is a 64\dash bit unsigned integer.
197 Form & Role \\ \hline
198 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}& offset in .debug\_info \\
199 \livetarg{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}& offset in a section other than .debug\_info or .debug\_str \\
200 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&offset in .debug\_str \\
201 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&offset in .debug\_info \\
205 \item Within the body of the .debug\_pubnames and
206 .debug\_pubtypes sections, the representation of the first field
207 of each tuple (which represents an offset in the .debug\_info
208 section) depends on the DWARF format as follows: in the
209 32\dash bit DWARF format, this field is a 32\dash bit unsigned integer;
210 in the 64\dash bit DWARF format, it is a 64\dash bit unsigned integer.
215 The 32\dash bit and 64\dash bit DWARF format conventions must not be
216 intermixed within a single compilation unit.
218 \textit{Attribute values and section header fields that represent
219 addresses in the target program are not affected by these
222 A DWARF consumer that supports the 64\dash bit DWARF format must
223 support executables in which some compilation units use the
224 32\dash bit format and others use the 64\dash bit format provided that
225 the combination links correctly (that is, provided that there
226 are no link\dash time errors due to truncation or overflow). (An
227 implementation is not required to guarantee detection and
228 reporting of all such errors.)
230 \textit{It is expected that DWARF producing compilers will not use
231 the 64\dash bit format by default. In most cases, the division of
232 even very large applications into a number of executable and
233 shared objects will suffice to assure that the DWARF sections
234 within each individual linked object are less than 4 GBytes
235 in size. However, for those cases where needed, the 64\dash bit
236 format allows the unusual case to be handled as well. Even
237 in this case, it is expected that only application supplied
238 objects will need to be compiled using the 64\dash bit format;
239 separate 32\dash bit format versions of system supplied shared
240 executable libraries can still be used.}
244 \section{Format of Debugging Information}
245 \label{datarep:formatofdebugginginformation}
247 For each compilation unit compiled with a DWARF producer,
248 a contribution is made to the .debug\_info section of
249 the object file. Each such contribution consists of a
250 compilation unit header
251 (see Section \refersec{datarep:compilationunitheader})
253 single \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit} or \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit} debugging
254 information entry, together with its children.
256 For each type defined in a compilation unit, a contribution may
257 be made to the .debug\_types section of the object file. Each
258 such contribution consists of a type unit header
259 (see Section \refersec{datarep:typeunitheader})
260 followed by a \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} entry, together with
263 Each debugging information entry begins with a code that
264 represents an entry in a separate abbreviations table. This
265 code is followed directly by a series of attribute values.
267 The appropriate entry in the abbreviations table guides the
268 interpretation of the information contained directly in the
269 .debug\_info or .debug\_types section.
271 Multiple debugging information entries may share the same
272 abbreviation table entry. Each compilation unit is associated
273 with a particular abbreviation table, but multiple compilation
274 units may share the same table.
275 \subsection{Unit Headers}
276 \label{datarep:unitheaders}
278 \subsubsection{Compilation Unit Header}
279 \label{datarep:compilationunitheader}
281 \begin{enumerate}[1.]
283 \item unit\_length (initial length) \\
284 A 4\dash byte or 12\dash byte unsigned integer representing the length
285 of the .debug\_info contribution for that compilation unit,
286 not including the length field itself. In the 32\dash bit DWARF
287 format, this is a 4\dash byte unsigned integer (which must be less
288 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
289 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
290 integer that gives the actual length
291 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
293 \item version (uhalf)
294 A 2\dash byte unsigned integer representing the version of the
295 DWARF information for the compilation unit
296 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
297 The value in this field is 4.
299 \item debug\_abbrev\_offset (section offset) \\
300 A 4\dash byte or 8\dash byte unsigned offset into the .debug\_abbrev
301 section. This offset associates the compilation unit with a
302 particular set of debugging information entry abbreviations. In
303 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
304 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
305 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
307 \item address\_size (ubyte) \\
308 A 1\dash byte unsigned integer representing the size in bytes of
309 \addtoindexx{address\_size}
310 an address on the target architecture. If the system uses
311 \addtoindexx{address space!segmented}
312 segmented addressing, this value represents the size of the
313 offset portion of an address.
320 \subsubsection{Type Unit Header}
321 \label{datarep:typeunitheader}
323 The header for the series of debugging information entries
324 contributing to the description of a type that has been
325 placed in its own type unit, within the .debug\_types section,
326 consists of the following information:
328 \begin{enumerate}[1.]
330 \item unit\_length (initial length) \\
331 A 4\dash byte or 12\dash byte unsigned integer representing the length
332 of the .debug\_types contribution for that compilation unit,
333 not including the length field itself. In the 32\dash bit DWARF
334 format, this is a 4\dash byte unsigned integer (which must be
335 less than 0xfffffff0); in the 64\dash bit DWARF format, this
336 consists of the 4\dash byte value 0xffffffff followed by an
337 8\dash byte unsigned integer that gives the actual length
338 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
340 \item version (uhalf)
341 A 2\dash byte unsigned integer representing the version of the
342 DWARF information for the compilation unit
343 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
344 The value in this field is 4.
346 \item debug\_abbrev\_offset (section offset) \\
347 A 4\dash byte or 8\dash byte unsigned offset into the .debug\_abbrev
348 section. This offset associates the compilation unit with a
349 particular set of debugging information entry abbreviations. In
350 the 32\dash bit DWARF format, this is a 4\dash byte unsigned length;
351 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned length
352 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
354 \item address\_size (ubyte) \\
355 A 1\dash byte unsigned integer representing the size in bytes of
356 \addtoindexx{address\_size}
357 an address on the target architecture. If the system uses
358 \addtoindexx{address space!segmented}
359 segmented addressing, this value represents the size of the
360 offset portion of an address.
363 \item type\_signature (8\dash byte unsigned integer) \\
364 A 64\dash bit unique signature of the type described in this type
367 \textit{An attribute that refers(using \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) to
368 the primary type contained in this type unit uses this value.}
371 \item type\_offset (section offset) \\
372 A 4\dash byte or 8\dash byte unsigned offset relative to the beginning
373 of the type unit header. This offset refers to the debugging
374 information entry that describes the type. Because the type
375 may be nested inside a namespace or other structures, and may
376 contain references to other types that have not been placed in
377 separate type units, it is not necessarily either the first or
378 the only entry in the type unit. In the 32\dash bit DWARF format,
379 this is a 4\dash byte unsigned length; in the 64\dash bit DWARF format,
380 this is an 8\dash byte unsigned length
381 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
385 \subsection{Debugging Information Entry}
386 \label{datarep:debugginginformationentry}
388 Each debugging information entry begins with an unsigned LEB128
389 number containing the abbreviation code for the entry. This
390 code represents an entry within the abbreviations table
391 associated with the compilation unit containing this entry. The
392 abbreviation code is followed by a series of attribute values.
394 On some architectures, there are alignment constraints on
395 section boundaries. To make it easier to pad debugging
396 information sections to satisfy such constraints, the
397 abbreviation code 0 is reserved. Debugging information entries
398 consisting of only the abbreviation code 0 are considered
401 \subsection{Abbreviations Tables}
402 \label{datarep:abbreviationstables}
404 The abbreviations tables for all compilation units
405 are contained in a separate object file section called
406 .debug\_abbrev. As mentioned before, multiple compilation
407 units may share the same abbreviations table.
409 The abbreviations table for a single compilation unit consists
410 of a series of abbreviation declarations. Each declaration
411 specifies the tag and attributes for a particular form of
412 debugging information entry. Each declaration begins with
413 an unsigned LEB128 number representing the abbreviation
414 code itself. It is this code that appears at the beginning
415 of a debugging information entry in the .debug\_info or
416 .debug\_types section. As described above, the abbreviation
417 code 0 is reserved for null debugging information entries. The
418 abbreviation code is followed by another unsigned LEB128
419 number that encodes the entry’s tag. The encodings for the
420 tag names are given in
421 Table \refersec{tab:tagencodings}.
423 Following the tag encoding is a 1\dash byte value that determines
424 whether a debugging information entry using this abbreviation
425 has child entries or not. If the value is
426 \livetarg{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes},
427 the next physically succeeding entry of any debugging
428 information entry using this abbreviation is the first
429 child of that entry. If the 1\dash byte value following the
430 abbreviation’s tag encoding is
431 \livetarg{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}, the next
432 physically succeeding entry of any debugging information entry
433 using this abbreviation is a sibling of that entry. (Either
434 the first child or sibling entries may be null entries). The
435 encodings for the child determination byte are given in
436 Table \refersec{tab:childdeterminationencodings}
438 Section \refersec{chap:relationshipofdebugginginformationentries},
440 sibling entries is terminated by a null entry.)
442 Finally, the child encoding is followed by a series of
443 attribute specifications. Each attribute specification
444 consists of two parts. The first part is an unsigned LEB128
445 number representing the attribute’s name. The second part
446 is an unsigned LEB128 number representing the attribute’s
447 form. The series of attribute specifications ends with an
448 entry containing 0 for the name and 0 for the form.
451 \livetarg{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect} is a special case. For
452 attributes with this form, the attribute value itself in the
453 .debug\_info or .debug\_types section begins with an unsigned
454 LEB128 number that represents its form. This allows producers
455 to choose forms for particular attributes dynamically,
456 without having to add a new entry to the abbreviations table.
458 The abbreviations for a given compilation unit end with an
459 entry consisting of a 0 byte for the abbreviation code.
462 Appendix \refersec{app:compilationunitsandabbreviationstableexample}
463 for a depiction of the organization of the
464 debugging information.
466 \subsection{Attribute Encodings}
467 \label{datarep:attributeencodings}
469 The encodings for the attribute names are given in
470 Table \refersec{tab:attributeencodings}.
472 The attribute form governs how the value of the attribute is
473 encoded. There are nine classes of form, listed below. Each
474 class is a set of forms which have related representations
475 and which are given a common interpretation according to the
476 attribute in which the form is used.
478 Form \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} is a member of more than one class,
479 namely \livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr}; the list
480 of classes allowed by the applicable attribute in
481 Table \refersec{tab:attributeencodings}
482 determines the class of the form.
484 \textit{In DWARF V3 the forms \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} were
485 members of either class constant or one of the classes \livelink{chap:lineptr}{lineptr},
486 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr}, depending on context. In
487 DWARF V4 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8} are members of class
488 constant in all cases. The new \livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset} replaces
489 their usage for the other classes.}
491 Each possible form belongs to one or more of the following classes:
494 \item \livelinki{chap:DWATaddressclass}{address}{address class} \\
495 Represented as an object of appropriate size to hold an
496 address on the target machine
497 (\livetarg{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}).
499 encoded in the compilation unit header
500 (see Section \refersec{datarep:compilationunitheader}).
501 This address is relocatable in a relocatable object file and
502 is relocated in an executable file or shared object.
504 \item \livelink{chap:block}{block} \\
505 Blocks come in four forms:
507 \begin{myindentpara}{1cm}
508 A 1\dash byte length followed by 0 to 255 contiguous information
509 bytes (\livetarg{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}).
512 \begin{myindentpara}{1cm}
513 A 2\dash byte length followed by 0 to 65,535 contiguous information
514 bytes (\livetarg{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}).
518 \begin{myindentpara}{1cm}
519 A 4\dash byte length followed by 0 to 4,294,967,295 contiguous
520 information bytes (\livetarg{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}).
524 \begin{myindentpara}{1cm}
525 An unsigned LEB128 length followed by the number of bytes
526 specified by the length (\livetarg{chap:DWFORMblock}{DW\-\_FORM\-\_block}).
529 In all forms, the length is the number of information bytes
530 that follow. The information bytes may contain any mixture
531 of relocated (or relocatable) addresses, references to other
532 debugging information entries or data bytes.
535 There are six forms of constants. There are fixed length
536 constant data forms for one, two, four and eight byte values
538 \livetarg{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
539 \livetarg{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
540 \livetarg{chap:DWFORMdata4}{DW\-\_FORM\-\_data4},
541 and \livetarg{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}).
542 There are also variable length constant
543 data forms encoded using LEB128 numbers (see below). Both
544 signed (\livetarg{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}) and unsigned
545 (\livetarg{chap:DWFORMudata}{DW\-\_FORM\-\_udata}) variable
546 length constants are available
548 The data in \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1},
549 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2},
550 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4} and
551 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}
552 can be anything. Depending on context, it may
553 be a signed integer, an unsigned integer, a floating\dash point
554 constant, or anything else. A consumer must use context to
555 know how to interpret the bits, which if they are target
556 machine data (such as an integer or floating point constant)
557 will be in target machine byte\dash order.
559 \textit{If one of the \livetarg{chap:DWFORMdata}{DW\-\_FORM\-\_data}<n> forms is used to represent a
560 signed or unsigned integer, it can be hard for a consumer
561 to discover the context necessary to determine which
562 interpretation is intended. Producers are therefore strongly
563 encouraged to use \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata} or
564 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata} for signed and
565 unsigned integers respectively, rather than
566 \livelink{chap:DWFORMdata}{DW\-\_FORM\-\_data} \textless n \textgreater.}
569 \item \livelink{chap:exprloc}{exprloc} \\
570 This is an unsigned LEB128 length followed by the
571 number of information bytes specified by the length
572 (\livetarg{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc}).
573 The information bytes contain a DWARF
575 (see Section \refersec{chap:dwarfexpressions})
576 or location description
577 (see Section \refersec{chap:locationdescriptions}).
579 \item \livelink{chap:flag}{flag} \\
580 A flag is represented explicitly as a single byte of data
581 (\livetarg{chap:DWFORMflag}{DW\-\_FORM\-\_flag}) or
582 implicitly (\livetarg{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present}).
584 first case, if the \nolink{flag} has value zero, it indicates the
585 absence of the attribute; if the \nolink{flag} has a non\dash zero value,
586 it indicates the presence of the attribute. In the second
587 case, the attribute is implicitly indicated as present, and
588 no value is encoded in the debugging information entry itself.
590 \item \livelink{chap:lineptr}{lineptr} \\
591 This is an offset into the .debug\_line section
592 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
593 beginning of the .debug\_line section to the first byte of
594 the data making up the line number list for the compilation
596 It is relocatable in a relocatable object file, and
597 relocated in an executable or shared object. In the 32\dash bit
598 DWARF format, this offset is a 4\dash byte unsigned value;
599 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
600 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
603 \item \livelink{chap:loclistptr}{loclistptr} \\
604 This is an offset into the .debug\_loc section
605 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
606 beginning of the .debug\_loc section to the first byte of
607 the data making up the location list for the compilation
609 It is relocatable in a relocatable object file, and
610 relocated in an executable or shared object. In the 32\dash bit
611 DWARF format, this offset is a 4\dash byte unsigned value;
612 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
613 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
616 \item \livelink{chap:macptr}{macptr} \\
617 This is an offset into the .debug\_macinfo section
618 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}). It consists of an offset from the
619 beginning of the .debug\_macinfo section to the first byte of
620 the data making up the macro information list for the compilation
622 It is relocatable in a relocatable object file, and
623 relocated in an executable or shared object. In the 32\dash bit
624 DWARF format, this offset is a 4\dash byte unsigned value;
625 in the 64\dash bit DWARF format, it is an 8\dash byte unsigned value
626 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
628 \item \livelink{chap:rangelistptr}{rangelistptr} \\
629 This is an offset into the .debug\_ranges section
630 (\livelink{chap:DWFORMsecoffset}{DW\-\_FORM\-\_sec\-\_offset}).
632 offset from the beginning of the .debug\_ranges section
633 to the beginning of the non\dash contiguous address ranges
634 information for the referencing entity.
636 a relocatable object file, and relocated in an executable or
637 shared object. In the 32\dash bit DWARF format, this offset
638 is a 4\dash byte unsigned value; in the 64\dash bit DWARF
639 format, it is an 8\dash byte unsigned value (see Section
640 \refersec{datarep:32bitand64bitdwarfformats}).
643 \textit{Because classes \livelink{chap:lineptr}{lineptr}, \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} and \livelink{chap:rangelistptr}{rangelistptr}
644 share a common representation, it is not possible for an
645 attribute to allow more than one of these classes}
650 There are three types of reference.
652 The first type of reference can identify any debugging
653 information entry within the containing unit. This type of
654 reference is an offset from the first byte of the compilation
655 header for the compilation unit containing the reference. There
656 are five forms for this type of reference. There are fixed
657 length forms for one, two, four and eight byte offsets
658 (respectively, \livetarg{chap:DWFORMref1}{DW\-\_FORM\-\_ref1},
659 \livetarg{chap:DWFORMref2}{DW\-\_FORM\-\_ref2},
660 \livetarg{chap:DWFORMref4}{DW\-\_FORM\-\_ref4},
661 and \livetarg{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}).
662 There is also an unsigned variable
663 length offset encoded form that uses unsigned LEB128 numbers
664 (\livetarg{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}).
665 Because this type of reference is within
666 the containing compilation unit no relocation of the value
669 The second type of reference can identify any debugging
670 information entry within a .debug\_info section; in particular,
671 it may refer to an entry in a different compilation unit
672 from the unit containing the reference, and may refer to an
673 entry in a different shared object. This type of reference
674 (\livetarg{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}) is an offset from the beginning of the
675 .debug\_info section of the target executable or shared object;
676 it is relocatable in a relocatable object file and frequently
677 relocated in an executable file or shared object. For
678 references from one shared object or static executable file
679 to another, the relocation and identification of the target
680 object must be performed by the consumer. In the 32\dash bit DWARF
681 format, this offset is a 4\dash byte unsigned value;
682 in the 64\dash bit DWARF format, it is an 8\dash byte
684 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
686 A debugging information entry that may be referenced by
687 another compilation unit using \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr} must have a
688 global symbolic name.
690 For a reference from one executable or shared object to
691 another, the reference is resolved by the debugger to identify
692 the shared object or executable and the offset into that
693 object’s .debug\_info section in the same fashion as the run
694 time loader, either when the debug information is first read,
695 or when the reference is used.
697 The third type of reference can identify any debugging
698 information type entry that has been placed in its own
699 type unit. This type of
700 reference (\livetarg{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8}) is the
701 64\dash bit type signature
702 (see Section \refersec{datarep:typesignaturecomputation})
706 The use of compilation unit relative references will reduce the
707 number of link\dash time relocations and so speed up linking. The
708 use of the second and third type of reference allows for the
709 sharing of information, such as types, across compilation
712 A reference to any kind of compilation unit identifies the
713 debugging information entry for that unit, not the preceding
717 A string is a sequence of contiguous non\dash null bytes followed by
718 one null byte. A string may be represented immediately in the
719 debugging information entry itself
720 (\livetarg{chap:DWFORMstring}{DW\-\_FORM\-\_string}), or may
721 be represented as an offset into a string table contained in
722 the .debug\_str section of the object file
723 (\livetarg{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}). In
724 the 32\dash bit DWARF format, the representation of a
725 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}
726 value is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
727 it is an 8\dash byte unsigned offset
728 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
730 If the \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8} attribute is specified for the
731 compilation unit entry, string values are encoded using the
732 UTF\dash 8 (Unicode Transformation Format\dash 8) from the Universal
733 Character Set standard (ISO/IEC 10646\dash 1:1993). Otherwise,
734 the string representation is unspecified.
736 The Unicode Standard Version 3 is fully compatible with
737 ISO/IEC 10646\dash 1:1993. It contains all the same characters
738 and encoding points as ISO/IEC 10646, as well as additional
739 information about the characters and their use.
741 Earlier versions of DWARF did not specify the representation
742 of strings; for compatibility, this version also does
743 not. However, the UTF\dash 8 representation is strongly recommended.
747 In no case does an attribute use one of the classes \livelink{chap:lineptr}{lineptr},
748 \livelink{chap:loclistptr}{loclistptr}, \livelink{chap:macptr}{macptr} or \livelink{chap:rangelistptr}{rangelistptr} to point into either the
749 .debug\_info or .debug\_str section.
751 The form encodings are listed in
752 Table \refersec{tab:attributeformencodings}.
755 \setlength{\extrarowheight}{0.1cm}
756 \begin{longtable}{l|l}
757 \caption{Tag encodings} \label{tab:tagencodings} \\
758 \hline \\ \bfseries Tag name&\bfseries Value\\ \hline
760 \bfseries Tag name&\bfseries Value \\ \hline
762 \hline \emph{Continued on next page}
766 \livelink{chap:DWTAGarraytype}{DW\-\_TAG\-\_array\-\_type} &0x01 \\
767 \livelink{chap:DWTAGclasstype}{DW\-\_TAG\-\_class\-\_type}&0x02 \\
768 \livelink{chap:DWTAGentrypoint}{DW\-\_TAG\-\_entry\-\_point}&0x03 \\
769 \livelink{chap:DWTAGenumerationtype}{DW\-\_TAG\-\_enumeration\-\_type}&0x04 \\
770 \livelink{chap:DWTAGformalparameter}{DW\-\_TAG\-\_formal\-\_parameter}&0x05 \\
771 \livelink{chap:DWTAGimporteddeclaration}{DW\-\_TAG\-\_imported\-\_declaration}&0x08 \\
772 \livelink{chap:DWTAGlabel}{DW\-\_TAG\-\_label}&0x0a \\
773 \livelink{chap:DWTAGlexicalblock}{DW\-\_TAG\-\_lexical\-\_block}&0x0b \\
774 \livelink{chap:DWTAGmember}{DW\-\_TAG\-\_member}&0x0d \\
775 \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type}&0x0f \\
776 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type}&0x10 \\
777 \livelink{chap:DWTAGcompileunit}{DW\-\_TAG\-\_compile\-\_unit}&0x11 \\
778 \livelink{chap:DWTAGstringtype}{DW\-\_TAG\-\_string\-\_type}&0x12 \\
779 \livelink{chap:DWTAGstructuretype}{DW\-\_TAG\-\_structure\-\_type}&0x13 \\
780 \livelink{chap:DWTAGsubroutinetype}{DW\-\_TAG\-\_subroutine\-\_type}&0x15 \\
781 \livelink{chap:DWTAGtypedef}{DW\-\_TAG\-\_typedef}&0x16 \\
782 \livelink{chap:DWTAGuniontype}{DW\-\_TAG\-\_union\-\_type}&0x17 \\
783 \livelink{chap:DWTAGunspecifiedparameters}{DW\-\_TAG\-\_unspecified\-\_parameters}&0x18 \\
784 \livelink{chap:DWTAGvariant}{DW\-\_TAG\-\_variant}&0x19 \\
785 \livelink{chap:DWTAGcommonblock}{DW\-\_TAG\-\_common\-\_block}&0x1a \\
786 \livelink{chap:DWTAGcommoninclusion}{DW\-\_TAG\-\_common\-\_inclusion}&0x1b \\
787 \livelink{chap:DWTAGinheritance}{DW\-\_TAG\-\_inheritance}&0x1c \\
788 \livelink{chap:DWTAGinlinedsubroutine}{DW\-\_TAG\-\_inlined\-\_subroutine}&0x1d \\
789 \livelink{chap:DWTAGmodule}{DW\-\_TAG\-\_module}&0x1e \\
790 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}&0x1f \\
791 \livelink{chap:DWTAGsettype}{DW\-\_TAG\-\_set\-\_type}&0x20 \\
792 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type}&0x21 \\
793 \livelink{chap:DWTAGwithstmt}{DW\-\_TAG\-\_with\-\_stmt}&0x22 \\
794 \livelink{chap:DWTAGaccessdeclaration}{DW\-\_TAG\-\_access\-\_declaration}&0x23 \\
795 \livelink{chap:DWTAGbasetype}{DW\-\_TAG\-\_base\-\_type}&0x24 \\
796 \livelink{chap:DWTAGcatchblock}{DW\-\_TAG\-\_catch\-\_block}&0x25 \\
797 \livelink{chap:DWTAGconsttype}{DW\-\_TAG\-\_const\-\_type}&0x26 \\
798 \livelink{chap:DWTAGconstant}{DW\-\_TAG\-\_constant}&0x27 \\
799 \livelink{chap:DWTAGenumerator}{DW\-\_TAG\-\_enumerator}&0x28 \\
800 \livelink{chap:DWTAGfiletype}{DW\-\_TAG\-\_file\-\_type}&0x29 \\
801 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}&0x2a \\
802 \livelink{chap:DWTAGnamelist}{DW\-\_TAG\-\_namelist}&0x2b \\
803 \livelink{chap:DWTAGnamelistitem}{DW\-\_TAG\-\_namelist\-\_item}&0x2c \\
804 \livelink{chap:DWTAGpackedtype}{DW\-\_TAG\-\_packed\-\_type}&0x2d \\
805 \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}&0x2e \\
806 \livelink{chap:DWTAGtemplatetypeparameter}{DW\-\_TAG\-\_template\-\_type\-\_parameter}&0x2f \\
807 \livelink{chap:DWTAGtemplatevalueparameter}{DW\-\_TAG\-\_template\-\_value\-\_parameter}&0x30 \\
808 \livelink{chap:DWTAGthrowntype}{DW\-\_TAG\-\_thrown\-\_type}&0x31 \\
809 \livelink{chap:DWTAGtryblock}{DW\-\_TAG\-\_try\-\_block}&0x32 \\
810 \livelink{chap:DWTAGvariantpart}{DW\-\_TAG\-\_variant\-\_part}&0x33 \\
811 \livelink{chap:DWTAGvariable}{DW\-\_TAG\-\_variable}&0x34 \\
812 \livelink{chap:DWTAGvolatiletype}{DW\-\_TAG\-\_volatile\-\_type}&0x35 \\
813 \livelink{chap:DWTAGdwarfprocedure}{DW\-\_TAG\-\_dwarf\-\_procedure}&0x36 \\
814 \livelink{chap:DWTAGrestricttype}{DW\-\_TAG\-\_restrict\-\_type}&0x37 \\
815 \livelink{chap:DWTAGinterfacetype}{DW\-\_TAG\-\_interface\-\_type}&0x38 \\
816 \livelink{chap:DWTAGnamespace}{DW\-\_TAG\-\_namespace}&0x39 \\
817 \livelink{chap:DWTAGimportedmodule}{DW\-\_TAG\-\_imported\-\_module}&0x3a \\
818 \livelink{chap:DWTAGunspecifiedtype}{DW\-\_TAG\-\_unspecified\-\_type}&0x3b \\
819 \livelink{chap:DWTAGpartialunit}{DW\-\_TAG\-\_partial\-\_unit}&0x3c \\
820 \livelink{chap:DWTAGimportedunit}{DW\-\_TAG\-\_imported\-\_unit}&0x3d \\
821 \livelink{chap:DWTAGcondition}{DW\-\_TAG\-\_condition}&0x3f \\
822 \livelink{chap:DWTAGsharedtype}{DW\-\_TAG\-\_shared\-\_type}&0x40 \\
823 \livelink{chap:DWTAGtypeunit}{DW\-\_TAG\-\_type\-\_unit} \ddag &0x41 \\
824 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type} \ddag &0x42 \\
825 \livelink{chap:DWTAGtemplatealias}{DW\-\_TAG\-\_template\-\_alias} \ddag &0x43 \\
826 \livelink{chap:DWTAGlouser}{DW\-\_TAG\-\_lo\-\_user}&0x4080 \\
827 \livelink{chap:DWTAGhiuser}{DW\-\_TAG\-\_hi\-\_user}&0xffff \\
829 \ddag TAG new in DWARF Version 4
835 \setlength{\extrarowheight}{0.1cm}
836 \caption{Child determination encodings}
837 \label{tab:childdeterminationencodings}
838 \begin{tabular}{l|l} \hline
839 Child determination name& Value\\ \hline
840 \livelink{chap:DWCHILDRENno}{DW\-\_CHILDREN\-\_no}&0x00 \\
841 \livelink{chap:DWCHILDRENyes}{DW\-\_CHILDREN\-\_yes}&0x01 \\ \hline
847 \setlength{\extrarowheight}{0.1cm}
848 \begin{longtable}{l|l|l}
849 \caption{Attribute encodings} \label{tab:attributeencodings} \\
850 \hline \\ \bfseries Attribute name&\bfseries Value &\bfseries Classes \\ \hline
852 \bfseries Attribute name&\bfseries Value &\bfseries Classes\\ \hline
854 \hline \emph{Continued on next page}
858 \livelink{chap:DWATsibling}{DW\-\_AT\-\_sibling}&0x01&reference \\
859 \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}&0x02&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
860 \livelink{chap:DWATname}{DW\-\_AT\-\_name}&0x03&string \\
861 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}&0x09&constant \\
862 \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}&0x0b&constant, \livelink{chap:exprloc}{exprloc}, reference \\
863 \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}&0x0c&constant, \livelink{chap:exprloc}{exprloc}, reference \\
864 \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}&0x0d&constant, \livelink{chap:exprloc}{exprloc}, reference \\
865 \livelink{chap:DWATstmtlist}{DW\-\_AT\-\_stmt\-\_list}&0x10&\livelink{chap:lineptr}{lineptr} \\
866 \livelink{chap:DWATlowpc}{DW\-\_AT\-\_low\-\_pc}&0x11&address \\
867 \livelink{chap:DWAThighpc}{DW\-\_AT\-\_high\-\_pc}&0x12&address, constant \\
868 \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}&0x13&constant \\
869 \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}&0x15&reference \\
870 \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}&0x16&constant \\
871 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}&0x17&constant \\
872 \livelink{chap:DWATimport}{DW\-\_AT\-\_import}&0x18&reference \\
873 \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}&0x19&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
874 \livelink{chap:DWATcommonreference}{DW\-\_AT\-\_common\-\_reference}&0x1a&reference \\
875 \livelink{chap:DWATcompdir}{DW\-\_AT\-\_comp\-\_dir}&0x1b&string \\
876 \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}&0x1c&\livelink{chap:block}{block}, constant, string \\
877 \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}&0x1d&reference \\
878 \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}&0x1e&reference \\
879 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline}&0x20&constant \\
880 \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}&0x21&\livelink{chap:flag}{flag} \\
881 \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}&0x22&constant, \livelink{chap:exprloc}{exprloc}, reference \\
882 \livelink{chap:DWATproducer}{DW\-\_AT\-\_producer}&0x25&string \\
883 \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}&0x27&\livelink{chap:flag}{flag} \\
884 \livelink{chap:DWATreturnaddr}{DW\-\_AT\-\_return\-\_addr}&0x2a&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
885 % FIXME: lower case , not Constant
886 \livelink{chap:DWATstartscope}{DW\-\_AT\-\_start\-\_scope}&0x2c&Constant, \livelink{chap:rangelistptr}{rangelistptr} \\
887 \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}&0x2e&constant, \livelink{chap:exprloc}{exprloc}, reference \\
888 \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}&0x2f&constant, \livelink{chap:exprloc}{exprloc}, reference \\
889 \livelink{chap:DWATabstractorigin}{DW\-\_AT\-\_abstract\-\_origin}&0x31&reference \\
890 \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}&0x32&constant \\
891 \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}&0x33&constant \\
892 \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}&0x34&\livelink{chap:flag}{flag} \\
893 \livelink{chap:DWATbasetypes}{DW\-\_AT\-\_base\-\_types}&0x35&reference \\
894 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention}&0x36&constant \\
895 \livelink{chap:DWATcount}{DW\-\_AT\-\_count}&0x37&constant, \livelink{chap:exprloc}{exprloc}, reference \\
896 \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}&0x38&constant, \livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
897 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column}&0x39&constant \\
898 \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}&0x3a&constant \\
899 \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}&0x3b&constant \\
900 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}&0x3c&\livelink{chap:flag}{flag} \\
901 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}&0x3d&\livelink{chap:block}{block} \\
902 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}&0x3e&constant \\
903 \livelink{chap:DWATexternal}{DW\-\_AT\-\_external}&0x3f&\livelink{chap:flag}{flag} \\
904 \livelink{chap:DWATframebase}{DW\-\_AT\-\_frame\-\_base}&0x40&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
905 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}&0x41&reference \\
906 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case}&0x42&constant \\
907 \livelink{chap:DWATmacroinfo}{DW\-\_AT\-\_macro\-\_info}&0x43&\livelink{chap:macptr}{macptr} \\
908 \livelink{chap:DWATnamelistitem}{DW\-\_AT\-\_namelist\-\_item}&0x44&reference \\
909 \livelink{chap:DWATpriority}{DW\-\_AT\-\_priority}&0x45&reference \\
910 \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}&0x46&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
911 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}&0x47&reference \\
912 \livelink{chap:DWATstaticlink}{DW\-\_AT\-\_static\-\_link}&0x48&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
913 \livelink{chap:DWATtype}{DW\-\_AT\-\_type}&0x49&reference \\
914 \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}&0x4a&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
915 \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}&0x4b&\livelink{chap:flag}{flag} \\
916 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}&0x4c&constant \\
917 \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}&0x4d&\livelink{chap:exprloc}{exprloc}, \livelink{chap:loclistptr}{loclistptr} \\
920 \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}&0x4e&constant, \livelink{chap:exprloc}{exprloc}, reference \\
921 \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}&0x4f&constant, \livelink{chap:exprloc}{exprloc}, reference \\
922 \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}&0x50&\livelink{chap:exprloc}{exprloc} \\
923 \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}&0x51&constant, \livelink{chap:exprloc}{exprloc}, reference \\
924 \livelink{chap:DWATentrypc}{DW\-\_AT\-\_entry\-\_pc}&0x52&address \\
925 \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}&0x53&\livelink{chap:flag}{flag} \\
926 \livelink{chap:DWATextension}{DW\-\_AT\-\_extension}&0x54&reference \\
927 \livelink{chap:DWATranges}{DW\-\_AT\-\_ranges}&0x55&\livelink{chap:rangelistptr}{rangelistptr} \\
928 \livelink{chap:DWATtrampoline}{DW\-\_AT\-\_trampoline}&0x56&address, \livelink{chap:flag}{flag}, reference, string \\
929 \livelink{chap:DWATcallcolumn}{DW\-\_AT\-\_call\-\_column}&0x57&constant \\
930 \livelink{chap:DWATcallfile}{DW\-\_AT\-\_call\-\_file}&0x58&constant \\
931 \livelink{chap:DWATcallline}{DW\-\_AT\-\_call\-\_line}&0x59&constant \\
932 \livelink{chap:DWATdescription}{DW\-\_AT\-\_description}&0x5a&string \\
933 \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}&0x5b&constant \\
934 \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}&0x5c&constant \\
935 \livelink{chap:DWATsmall}{DW\-\_AT\-\_small} &0x5d&reference \\
936 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}&0x5e&constant \\
937 \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}&0x5f&constant \\
938 \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}&0x60&string \\
939 \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}&0x61&\livelink{chap:flag}{flag} \\
942 \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}&0x62&\livelink{chap:flag}{flag} \\
943 \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}&0x63&\livelink{chap:flag}{flag} \\
944 \livelink{chap:DWATobjectpointer}{DW\-\_AT\-\_object\-\_pointer}&0x64&reference \\
945 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}&0x65&constant \\
946 \livelink{chap:DWATelemental}{DW\-\_AT\-\_elemental}&0x66&\livelink{chap:flag}{flag} \\
947 \livelink{chap:DWATpure}{DW\-\_AT\-\_pure}&0x67&\livelink{chap:flag}{flag} \\
948 \livelink{chap:DWATrecursive}{DW\-\_AT\-\_recursive}&0x68&\livelink{chap:flag}{flag} \\
949 \livelink{chap:DWATsignature}{DW\-\_AT\-\_signature} \ddag &0x69&reference \\
950 \livelink{chap:DWATmainsubprogram}{DW\-\_AT\-\_main\-\_subprogram} \ddag &0x6a&\livelink{chap:flag}{flag} \\
951 \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset} \ddag &0x6b&constant \\
952 \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr} \ddag &0x6c&\livelink{chap:flag}{flag} \\
953 \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class} \ddag &0x6d&\livelink{chap:flag}{flag} \\
954 \livelink{chap:DWATlinkagename}{DW\-\_AT\-\_linkage\-\_name} \ddag &0x6e&string \\
955 \livetarg{chap:DWATlouser}{DW\-\_AT\-\_lo\-\_user}&0x2000 & --- \\
956 \livetarg{chap:DWAThiuser}{DW\-\_AT\-\_hi\-\_user}&0x3fff& --- \\
959 \ddag Attribute new in DWARF Version 4
963 \setlength{\extrarowheight}{0.1cm}
964 \begin{longtable}{l|l|l}
965 \caption{Attribute form encodings} \label{tab:attributeformencodings} \\
966 \hline \\ \bfseries Form name&\bfseries Value &\bfseries Classes \\ \hline
968 \bfseries Form name&\bfseries Value &\bfseries Classes\\ \hline
970 \hline \emph{Continued on next page}
974 \livelink{chap:DWFORMaddr}{DW\-\_FORM\-\_addr}&0x01&address \\
975 \livelink{chap:DWFORMblock2}{DW\-\_FORM\-\_block2}&0x03&\livelink{chap:block}{block} \\
976 \livelink{chap:DWFORMblock4}{DW\-\_FORM\-\_block4}&0x04&\livelink{chap:block}{block} \\
977 \livelink{chap:DWFORMdata2}{DW\-\_FORM\-\_data2}&0x05&constant \\
978 \livelink{chap:DWFORMdata4}{DW\-\_FORM\-\_data4}&0x06&constant \\
979 \livelink{chap:DWFORMdata8}{DW\-\_FORM\-\_data8}&0x07&constant \\
980 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string}&0x08&string \\
981 \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}&0x09&\livelink{chap:block}{block} \\
982 \livelink{chap:DWFORMblock1}{DW\-\_FORM\-\_block1}&0x0a&\livelink{chap:block}{block} \\
983 \livelink{chap:DWFORMdata1}{DW\-\_FORM\-\_data1}&0x0b&constant \\
984 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag}&0x0c&\livelink{chap:flag}{flag} \\
985 \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata}&0x0d&constant \\
986 \livelink{chap:DWFORMstrp}{DW\-\_FORM\-\_strp}&0x0e&string \\
987 \livelink{chap:DWFORMudata}{DW\-\_FORM\-\_udata}&0x0f&constant \\
988 \livelink{chap:DWFORMrefaddr}{DW\-\_FORM\-\_ref\-\_addr}&0x10&reference \\
989 \livelink{chap:DWFORMref1}{DW\-\_FORM\-\_ref1}&0x11&reference \\
990 \livelink{chap:DWFORMref2}{DW\-\_FORM\-\_ref2}&0x12&reference \\
991 \livelink{chap:DWFORMref4}{DW\-\_FORM\-\_ref4}&0x13&reference \\
992 \livelink{chap:DWFORMref8}{DW\-\_FORM\-\_ref8}&0x14&reference \\
993 \livelink{chap:DWFORMrefudata}{DW\-\_FORM\-\_ref\-\_udata}&0x15&reference \\
994 \livelink{chap:DWFORMindirect}{DW\-\_FORM\-\_indirect}&0x16&(see Section \refersec{datarep:abbreviationstables}) \\
995 \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} \\
996 \livelink{chap:DWFORMexprloc}{DW\-\_FORM\-\_exprloc} \ddag &0x18&\livelink{chap:exprloc}{exprloc} \\
997 \livelink{chap:DWFORMflagpresent}{DW\-\_FORM\-\_flag\-\_present} \ddag &0x19&\livelink{chap:flag}{flag} \\
998 \livelink{chap:DWFORMrefsig8}{DW\-\_FORM\-\_ref\-\_sig8} \ddag &0x20&reference \\
1001 \ddag FORM new in DWARF Version 4
1004 \section{Variable Length Data}
1005 \label{datarep:variablelengthdata}
1006 Integers may be encoded using ``Little Endian Base 128''
1007 (LEB128) numbers. LEB128 is a scheme for encoding integers
1008 densely that exploits the assumption that most integers are
1011 This encoding is equally suitable whether the target machine
1012 architecture represents data in big\dash\ endian or little\dash endian
1013 order. It is ``little\dash endian'' only in the sense that it
1014 avoids using space to represent the ``big'' end of an
1015 unsigned integer, when the big end is all zeroes or sign
1018 Unsigned LEB128 (ULEB128) numbers are encoded as follows:
1019 start at the low order end of an unsigned integer and chop
1020 it into 7\dash bit chunks. Place each chunk into the low order 7
1021 bits of a byte. Typically, several of the high order bytes
1022 will be zero; discard them. Emit the remaining bytes in a
1023 stream, starting with the low order byte; set the high order
1024 bit on each byte except the last emitted byte. The high bit
1025 of zero on the last byte indicates to the decoder that it
1026 has encountered the last byte.
1028 The integer zero is a special case, consisting of a single
1031 Table \refersec{tab:examplesofunsignedleb128encodings}
1032 gives some examples of unsigned LEB128 numbers. The
1033 0x80 in each case is the high order bit of the byte, indicating
1034 that an additional byte follows.
1037 The encoding for signed, two’s complement LEB128 (SLEB128)
1038 numbers is similar, except that the criterion for discarding
1039 high order bytes is not whether they are zero, but whether
1040 they consist entirely of sign extension bits. Consider the
1041 32\dash bit integer -2. The three high level bytes of the number
1042 are sign extension, thus LEB128 would represent it as a single
1043 byte containing the low order 7 bits, with the high order
1044 bit cleared to indicate the end of the byte stream. Note
1045 that there is nothing within the LEB128 representation that
1046 indicates whether an encoded number is signed or unsigned. The
1047 decoder must know what type of number to expect.
1048 Table \refersec{tab:examplesofunsignedleb128encodings}
1049 gives some examples of unsigned LEB128 numbers and
1050 Table \refersec{tab:examplesofsignedleb128encodings}
1051 gives some examples of signed LEB128 numbers.
1053 Appendix \refersec{app:variablelengthdataencodingdecodinginformative}
1054 gives algorithms for encoding and decoding these forms.
1058 \setlength{\extrarowheight}{0.1cm}
1059 \begin{longtable}{l|l|l}
1060 \caption{Examples of unsigned LEB32 encodings} \label{tab:examplesofunsignedleb128encodings} \\
1061 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1063 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1065 \hline \emph{Continued on next page}
1071 128& 0 + 0x80 & 1 \\
1072 129& 1 + 0x80 & 1 \\
1073 130& 2 + 0x80 & 1 \\
1074 12857& 57 + 0x80 & 100 \\
1082 \setlength{\extrarowheight}{0.1cm}
1083 \begin{longtable}{l|l|l}
1084 \caption{Examples of signed LEB32 encodings} \label{tab:examplesofsignedleb128encodings} \\
1085 \hline \\ \bfseries Number&\bfseries First byte &\bfseries Second byte \\ \hline
1087 \bfseries Number&\bfseries First Byte &\bfseries Second byte\\ \hline
1089 \hline \emph{Continued on next page}
1095 127& 127 + 0x80 & 0 \\
1096 -127& 1 + 0x80 & 0x7f \\
1097 128& 0 + 0x80 & 1 \\
1098 -128& 0 + 0x80 & 0x7f \\
1099 129& 1 + 0x80 & 1 \\
1100 -129& -x7f + 0x80 & 0xtc \\
1107 \section{DWARF Expressions and Location Descriptions}
1108 \label{datarep:dwarfexpressionsandlocationdescriptions}
1109 \subsection{DWARF Expressions}
1110 \label{datarep:dwarfexpressions}
1112 A DWARF expression is stored in a \nolink{block} of contiguous
1113 bytes. The bytes form a sequence of operations. Each operation
1114 is a 1\dash byte code that identifies that operation, followed by
1115 zero or more bytes of additional data. The encodings for the
1116 operations are described in
1117 Table \refersec{tab:dwarfoperationencodings}.
1120 \setlength{\extrarowheight}{0.1cm}
1121 \begin{longtable}{l|l|l|l}
1122 \caption{DWARF operation encodings} \label{tab:dwarfoperationencodings} \\
1123 \hline \\ & &\bfseries No. of &\\
1124 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1126 & &\bfseries No. of &\\
1127 \bfseries Operation&\bfseries Code &\bfseries Operands &\bfseries Notes\\ \hline
1129 \hline \emph{Continued on next page}
1134 \livelink{chap:DWOPaddr}{DW\-\_OP\-\_addr}&0x03&1 & constant address \\
1135 & & &(size target specific) \\
1137 \livelink{chap:DWOPderef}{DW\-\_OP\-\_deref}&0x06&0 & \\
1140 \livelink{chap:DWOPconst1u}{DW\-\_OP\-\_const1u}&0x08&1&1\dash byte constant \\
1141 \livelink{chap:DWOPconst1s}{DW\-\_OP\-\_const1s}&0x09&1&1\dash byte constant \\
1142 \livelink{chap:DWOPconst2u}{DW\-\_OP\-\_const2u}&0x0a&1&2\dash byte constant \\
1143 \livelink{chap:DWOPconst2s}{DW\-\_OP\-\_const2s}&0x0b&1&2\dash byte constant \\
1144 \livelink{chap:DWOPconst4u}{DW\-\_OP\-\_const4u}&0x0c&1&4\dash byte constant \\
1145 \livelink{chap:DWOPconst4s}{DW\-\_OP\-\_const4s}&0x0d&1&4\dash byte constant \\
1146 \livelink{chap:DWOPconst8u}{DW\-\_OP\-\_const8u}&0x0e&1&8\dash byte constant \\
1147 \livelink{chap:DWOPconst8s}{DW\-\_OP\-\_const8s}&0x0f&1&8\dash byte constant \\
1148 \livelink{chap:DWOPconstu}{DW\-\_OP\-\_constu}&0x10&1&ULEB128 constant \\
1149 \livelink{chap:DWOPconsts}{DW\-\_OP\-\_consts}&0x11&1&SLEB128 constant \\
1150 \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}&0x12&0 & \\
1151 \livelink{chap:DWOPdrop}{DW\-\_OP\-\_drop}&0x13&0 & \\
1152 \livelink{chap:DWOPover}{DW\-\_OP\-\_over}&0x14&0 & \\
1153 \livelink{chap:DWOPpick}{DW\-\_OP\-\_pick}&0x15&1&1\dash byte stack index \\
1154 \livelink{chap:DWOPswap}{DW\-\_OP\-\_swap}&0x16&0 & \\
1155 \livelink{chap:DWOProt}{DW\-\_OP\-\_rot}&0x17&0 & \\
1156 \livelink{chap:DWOPxderef}{DW\-\_OP\-\_xderef}&0x18&0 & \\
1157 \livelink{chap:DWOPabs}{DW\-\_OP\-\_abs}&0x19&0 & \\
1158 \livelink{chap:DWOPand}{DW\-\_OP\-\_and}&0x1a&0 & \\
1159 \livelink{chap:DWOPdiv}{DW\-\_OP\-\_div}&0x1b&0 & \\
1163 \livelink{chap:DWOPminus}{DW\-\_OP\-\_minus}&0x1c&0 & \\
1164 \livelink{chap:DWOPmod}{DW\-\_OP\-\_mod}&0x1d&0 & \\
1165 \livelink{chap:DWOPmul}{DW\-\_OP\-\_mul}&0x1e&0 & \\
1166 \livelink{chap:DWOPneg}{DW\-\_OP\-\_neg}&0x1f&0 & \\
1167 \livelink{chap:DWOPnot}{DW\-\_OP\-\_not}&0x20&0 & \\
1168 \livelink{chap:DWOPor}{DW\-\_OP\-\_or}&0x21&0 & \\
1169 \livelink{chap:DWOPplus}{DW\-\_OP\-\_plus}&0x22&0 & \\
1170 \livelink{chap:DWOPplusuconst}{DW\-\_OP\-\_plus\-\_uconst}&0x23&1&ULEB128 addend \\
1171 \livelink{chap:DWOPshl}{DW\-\_OP\-\_shl}&0x24&0 & \\
1172 \livelink{chap:DWOPshr}{DW\-\_OP\-\_shr}&0x25&0 & \\
1173 \livelink{chap:DWOPshra}{DW\-\_OP\-\_shra}&0x26&0 & \\
1174 \livelink{chap:DWOPxor}{DW\-\_OP\-\_xor}&0x27&0 & \\
1175 \livelink{chap:DWOPskip}{DW\-\_OP\-\_skip}&0x2f&1&signed 2\dash byte constant \\
1176 \livelink{chap:DWOPbra}{DW\-\_OP\-\_bra}&0x28&1 & signed 2\dash byte constant \\
1177 \livelink{chap:DWOPeq}{DW\-\_OP\-\_eq}&0x29&0 & \\
1178 \livelink{chap:DWOPge}{DW\-\_OP\-\_ge}&0x2a&0 & \\
1179 \livelink{chap:DWOPgt}{DW\-\_OP\-\_gt}&0x2b&0 & \\
1180 \livelink{chap:DWOPle}{DW\-\_OP\-\_le}&0x2c&0 & \\
1181 \livelink{chap:DWOPlt}{DW\-\_OP\-\_lt}&0x2d&0 & \\
1182 \livelink{chap:DWOPne}{DW\-\_OP\-\_ne}&0x2e&0 & \\ \hline
1186 \livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0}&0x30 & 0 & \\
1188 \livelink{chap:DWOPlit1}{DW\-\_OP\-\_lit1}&0x31 & 0& literals 0 .. 31 = \\
1189 \ldots & & & (\livelink{chap:DWOPlit0}{DW\-\_OP\-\_lit0} + literal) \\
1190 \livelink{chap:DWOPlit31}{DW\-\_OP\-\_lit31}&0x4f & 0 & \\ \hline
1192 \livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} & 0x50 & 0 & \\
1193 \livelink{chap:DWOPreg1}{DW\-\_OP\-\_reg1} & 0x51 & 0® 0 .. 31 = \\
1194 \ldots & & & (\livelink{chap:DWOPreg0}{DW\-\_OP\-\_reg0} + regnum) \\
1195 \livelink{chap:DWOPreg31}{DW\-\_OP\-\_reg31} & 0x6f & 0 & \\ \hline
1197 \livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} & 0x70 &1 & SLEB128 offset \\
1198 \livelink{chap:DWOPbreg1}{DW\-\_OP\-\_breg1} & 0x71 & 1 &base register 0 .. 31 = \\
1199 ... & & &(\livelink{chap:DWOPbreg0}{DW\-\_OP\-\_breg0} + regnum) \\
1200 \livelink{chap:DWOPbreg31}{DW\-\_OP\-\_breg31} & 0x8f & 1 & \\ \hline
1202 \livelink{chap:DWOPregx}{DW\-\_OP\-\_regx} & 0x90 &1&ULEB128 register \\
1203 \livelink{chap:DWOPfbreg}{DW\-\_OP\-\_fbreg} & 0x91&1&SLEB128 offset \\
1204 \livelink{chap:DWOPbregx}{DW\-\_OP\-\_bregx} & 0x92&2 &ULEB128 register followed \\
1205 & & & by SLEB128 offset \\
1206 \livelink{chap:DWOPpiece}{DW\-\_OP\-\_piece} & 0x93 &1& ULEB128 size of piece addressed \\
1207 \livelink{chap:DWOPderefsize}{DW\-\_OP\-\_deref\-\_size} & 0x94 &1& 1-byte size of data retrieved \\
1208 \livelink{chap:DWOPxderefsize}{DW\-\_OP\-\_xderef\-\_size} & 0x95&1&1-byte size of data retrieved \\
1209 \livelink{chap:DWOPnop}{DW\-\_OP\-\_nop} & 0x96 &0& \\
1212 \livelink{chap:DWOPpushobjectaddress}{DW\-\_OP\-\_push\-\_object\-\_address}&0x97&0 & \\
1213 \livelink{chap:DWOPcall2}{DW\-\_OP\-\_call2}&0x98&1& 2\dash byte offset of DIE \\
1214 \livelink{chap:DWOPcall4}{DW\-\_OP\-\_call4}&0x99&1& 4\dash byte offset of DIE \\
1215 \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}&0x9a&1& 4\dash\ or 8\dash byte\\
1216 &&& offset of DIE \\
1217 \livelink{chap:DWOPformtlsaddress}{DW\-\_OP\-\_form\-\_tls\-\_address}&0x9b &0& \\
1218 \livelink{chap:DWOPcallframecfa}{DW\-\_OP\-\_call\-\_frame\-\_cfa} &0x9c &0& \\
1219 \livelink{chap:DWOPbitpiece}{DW\-\_OP\-\_bit\-\_piece}&0x9d &2&ULEB128 size followed by \\
1221 \livelink{chap:DWOPimplicitvalue}{DW\-\_OP\-\_implicit\-\_value}&0x9e &2&ULEB128 size followed by \\
1222 &&&\nolink{block} of that size\\
1223 \livelink{chap:DWOPstackvalue}{DW\-\_OP\-\_stack\-\_value} &0x9f &0& \\
1224 \livetarg{chap:DWOPlouser}{DW\-\_OP\-\_lo\-\_user} &0xe0 && \\
1225 \livetarg{chap:DWOPhiuser}{DW\-\_OP\-\_hi\-\_user} &0xff && \\
1231 \subsection{Location Descriptions}
1232 \label{datarep:locationdescriptions}
1234 A location description is used to compute the
1235 location of a variable or other entity.
1237 \subsection{Location Lists}
1238 \label{datarep:locationlists}
1240 Each entry in a location list is either a location list entry,
1241 a base address selection entry, or an end of list entry.
1243 A location list entry consists of two address offsets followed
1244 by a 2\dash byte length, followed by a block of contiguous bytes
1245 that contains a DWARF location description. The length
1246 specifies the number of bytes in that block. The two offsets
1247 are the same size as an address on the target machine.
1249 A base address selection entry and an end of list entry each
1250 consist of two (constant or relocated) address offsets. The two
1251 offsets are the same size as an address on the target machine.
1253 For a location list to be specified, the base address of
1254 the corresponding compilation unit must be defined
1255 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1257 \section{Base Type Attribute Encodings}
1258 \label{datarep:basetypeattributeencodings}
1260 The encodings of the
1261 \hypertarget{chap:DWATencodingencodingofbasetype}
1262 constants used in the
1263 \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
1264 attribute are given in
1265 Table \refersec{tab:basetypeencodingvalues}
1268 \setlength{\extrarowheight}{0.1cm}
1269 \begin{longtable}{l|c}
1270 \caption{Base type encoding values} \label{tab:basetypeencodingvalues} \\
1271 \hline \\ \bfseries Base type encoding code name&\bfseries Value \\ \hline
1273 \bfseries Base type encoding code name&\bfseries Value\\ \hline
1275 \hline \emph{Continued on next page}
1280 \livelink{chap:DWATEaddress}{DW\-\_ATE\-\_address}&0x01 \\
1281 \livelink{chap:DWATEboolean}{DW\-\_ATE\-\_boolean}&0x02 \\
1282 \livelink{chap:DWATEcomplexfloat}{DW\-\_ATE\-\_complex\-\_float}&0x03 \\
1283 \livelink{chap:DWATEfloat}{DW\-\_ATE\-\_float}&0x04 \\
1284 \livelink{chap:DWATEsigned}{DW\-\_ATE\-\_signed}&0x05 \\
1285 \livelink{chap:DWATEsignedchar}{DW\-\_ATE\-\_signed\-\_char}&0x06 \\
1286 \livelink{chap:DWATEunsigned}{DW\-\_ATE\-\_unsigned}&0x07 \\
1287 \livelink{chap:DWATEunsignedchar}{DW\-\_ATE\-\_unsigned\-\_char}&0x08 \\
1288 \livelink{chap:DWATEimaginaryfloat}{DW\-\_ATE\-\_imaginary\-\_float}&0x09 \\
1289 \livelink{chap:DWATEpackeddecimal}{DW\-\_ATE\-\_packed\-\_decimal}&0x0a \\
1290 \livelink{chap:DWATEnumericstring}{DW\-\_ATE\-\_numeric\-\_string}&0x0b \\
1291 \livelink{chap:DWATEedited}{DW\-\_ATE\-\_edited}&0x0c \\
1292 \livelink{chap:DWATEsignedfixed}{DW\-\_ATE\-\_signed\-\_fixed}&0x0d \\
1293 \livelink{chap:DWATEunsignedfixed}{DW\-\_ATE\-\_unsigned\-\_fixed}&0x0e \\
1294 \livelink{chap:DWATEdecimalfloat}{DW\-\_ATE\-\_decimal\-\_float} & 0x0f \\
1295 \livelink{chap:DWATEUTF}{DW\-\_ATE\-\_UTF} \ddag & 0x10 \\
1296 \livetarg{chap:DWATElouser}{DW\-\_ATE\-\_lo\-\_user} & 0x80 \\
1297 \livetarg{chap:DWATEhiuser}{DW\-\_ATE\-\_hi\-\_user} & 0xff \\
1300 \ddag Base type encoding new in DWARF Version 4
1304 The encodings of the constants used in the
1305 \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign} attribute
1307 Table \refersec{tab:decimalsignencodings}.
1311 \setlength{\extrarowheight}{0.1cm}
1312 \begin{longtable}{l|c}
1313 \caption{Decimal sign encodings} \label{tab:decimalsignencodings} \\
1314 \hline \\ \bfseries Decimal sign code name&\bfseries Value \\ \hline
1316 \bfseries Decimal sign code name&\bfseries Value\\ \hline
1318 \hline \emph{Continued on next page}
1323 \livelink{chap:DWDSunsigned}{DW\-\_DS\-\_unsigned} & 0x01 \\
1324 \livelink{chap:DWDSleadingoverpunch}{DW\-\_DS\-\_leading\-\_overpunch} & 0x02 \\
1325 \livelink{chap:DWDStrailingoverpunch}{DW\-\_DS\-\_trailing\-\_overpunch} & 0x03 \\
1326 \livelink{chap:DWDSleadingseparate}{DW\-\_DS\-\_leading\-\_separate} & 0x04 \\
1327 \livelink{chap:DWDStrailingseparate}{DW\-\_DS\-\_trailing\-\_separate} & 0x05 \\
1332 The encodings of the constants used in the
1333 \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity} attribute are given in
1334 Table \refersec{tab:endianityencodings}.
1337 \setlength{\extrarowheight}{0.1cm}
1338 \begin{longtable}{l|c}
1339 \caption{Endianity encodings} \label{tab:endianityencodings}\\
1340 \hline \\ \bfseries Endian code name&\bfseries Value \\ \hline
1342 \bfseries Endian code name&\bfseries Value\\ \hline
1344 \hline \emph{Continued on next page}
1349 \livelink{chap:DWENDdefault}{DW\-\_END\-\_default} & 0x00 \\
1350 \livelink{chap:DWENDbig}{DW\-\_END\-\_big} & 0x01 \\
1351 \livelink{chap:DWENDlittle}{DW\-\_END\-\_little} & 0x02 \\
1352 \livetarg{chap:DWENDlouser}{DW\-\_END\-\_lo\-\_user} & 0x40 \\
1353 \livetarg{chap:DWENDhiuser}{DW\-\_END\-\_hi\-\_user} & 0xff \\
1358 \section{Accessibility Codes}
1359 \label{datarep:accessibilitycodes}
1360 The encodings of the constants used in the \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
1361 attribute are given in
1362 Table \refersec{tab:accessibilityencodings}.
1365 \setlength{\extrarowheight}{0.1cm}
1366 \begin{longtable}{l|c}
1367 \caption{Accessibility encodings} \label{tab:accessibilityencodings}\\
1368 \hline \\ \bfseries Accessibility code name&\bfseries Value \\ \hline
1370 \bfseries Accessibility code name&\bfseries Value\\ \hline
1372 \hline \emph{Continued on next page}
1377 \livelink{chap:DWACCESSpublic}{DW\-\_ACCESS\-\_public}&0x01 \\
1378 \livelink{chap:DWACCESSprotected}{DW\-\_ACCESS\-\_protected}&0x02 \\
1379 \livelink{chap:DWACCESSprivate}{DW\-\_ACCESS\-\_private}&0x03 \\
1385 \section{Visibility Codes}
1386 \label{datarep:visibilitycodes}
1387 The encodings of the constants used in the
1388 \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility} attribute are given in
1389 Table \refersec{tab:visibilityencodings}.
1392 \setlength{\extrarowheight}{0.1cm}
1393 \begin{longtable}{l|c}
1394 \caption{Visibility encodings} \label{tab:visibilityencodings}\\
1395 \hline \\ \bfseries Visiibility code name&\bfseries Value \\ \hline
1397 \bfseries Visibility code name&\bfseries Value\\ \hline
1399 \hline \emph{Continued on next page}
1404 \livelink{chap:DWVISlocal}{DW\-\_VIS\-\_local}&0x01 \\
1405 \livelink{chap:DWVISexported}{DW\-\_VIS\-\_exported}&0x02 \\
1406 \livelink{chap:DWVISqualified}{DW\-\_VIS\-\_qualified}&0x03 \\
1411 \section{Virtuality Codes}
1412 \label{datarep:vitualitycodes}
1414 The encodings of the constants used in the
1415 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality} attribute are given in
1416 Table \refersec{tab:virtualityencodings}.
1419 \setlength{\extrarowheight}{0.1cm}
1420 \begin{longtable}{l|c}
1421 \caption{Virtuality encodings} \label{tab:virtualityencodings}\\
1422 \hline \\ \bfseries Virtuality code name&\bfseries Value \\ \hline
1424 \bfseries Virtuality code name&\bfseries Value\\ \hline
1426 \hline \emph{Continued on next page}
1431 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none}&0x00 \\
1432 \livelink{chap:DWVIRTUALITYvirtual}{DW\-\_VIRTUALITY\-\_virtual}&0x01 \\
1433 \livelink{chap:DWVIRTUALITYpurevirtual}{DW\-\_VIRTUALITY\-\_pure\-\_virtual}&0x02 \\
1441 \livelink{chap:DWVIRTUALITYnone}{DW\-\_VIRTUALITY\-\_none} is equivalent to the absence of the
1442 \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
1445 \section{Source Languages}
1446 \label{datarep:sourcelanguages}
1448 The encodings of the constants used in the \livelink{chap:DWATlanguage}{DW\-\_AT\-\_language}
1449 attribute are given in
1450 Table \refersec{tab:languageencodings}.
1452 % If we don't force a following space it looks odd
1454 and their associated values are reserved, but the
1455 languages they represent are not well supported.
1456 Table \refersec{tab:languageencodings}
1457 also shows the default lower bound, if any, assumed for
1458 an omitted \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound} attribute in the context of a
1459 \livelink{chap:DWTAGsubrangetype}{DW\-\_TAG\-\_subrange\-\_type} debugging information entry for each
1463 \setlength{\extrarowheight}{0.1cm}
1464 \begin{longtable}{l|c|c}
1465 \caption{Language encodings} \label{tab:languageencodings}\\
1466 \hline \\ \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound \\ \hline
1468 \bfseries Language name&\bfseries Value &\bfseries Default Lower Bound\\ \hline
1470 \hline \emph{Continued on next page}
1475 \livelink{chap:DWLANGC89}{DW\-\_LANG\-\_C89}&0x0001&0 \\
1476 \livelink{chap:DWLANGC}{DW\-\_LANG\-\_C}&0x0002&0 \\
1477 \livelink{chap:DWLANGAda83}{DW\-\_LANG\-\_Ada83} \dag &0x0003&1 \\
1478 \livelink{chap:DWLANGCplusplus}{DW\-\_LANG\-\_C\-\_plus\-\_plus} &0x0004&0 \\
1479 \livelink{chap:DWLANGCobol74}{DW\-\_LANG\-\_Cobol74} \dag &0x0005&1 \\
1480 \livelink{chap:DWLANGCobol85}{DW\-\_LANG\-\_Cobol85} \dag &0x0006&1 \\
1481 \livelink{chap:DWLANGFortran77}{DW\-\_LANG\-\_Fortran77}&0x0007&1 \\
1482 \livelink{chap:DWLANGFortran90}{DW\-\_LANG\-\_Fortran90}&0x0008&1 \\
1483 \livelink{chap:DWLANGPascal83}{DW\-\_LANG\-\_Pascal83}&0x0009&1 \\
1484 \livelink{chap:DWLANGModula2}{DW\-\_LANG\-\_Modula2}&0x000a&1 \\
1485 \livelink{chap:DWLANGJava}{DW\-\_LANG\-\_Java}&0x000b&0 \\
1486 \livelink{chap:DWLANGC99}{DW\-\_LANG\-\_C99}&0x000c&0 \\
1487 \livelink{chap:DWLANGAda95}{DW\-\_LANG\-\_Ada95} \dag &0x000d&1 \\
1488 \livelink{chap:DWLANGFortran95}{DW\-\_LANG\-\_Fortran95} &0x000e&1 \\
1489 \livelink{chap:DWLANGPLI}{DW\-\_LANG\-\_PLI} \dag &0x000f&1 \\
1490 \livelink{chap:DWLANGObjC}{DW\-\_LANG\-\_ObjC}&0x0010&0 \\
1491 \livelink{chap:DWLANGObjCplusplus}{DW\-\_LANG\-\_ObjC\-\_plus\-\_plus}&0x0011&0 \\
1492 \livelink{chap:DWLANGUPC}{DW\-\_LANG\-\_UPC}&0x0012&0 \\
1493 \livelink{chap:DWLANGD}{DW\-\_LANG\-\_D}&0x0013&0 \\
1494 \livelink{chap:DWLANGPython}{DW\-\_LANG\-\_Python} \dag &0x0014&0 \\
1495 \livetarg{chap:DWLANGlouser}{DW\-\_LANG\-\_lo\-\_user}&0x8000 & \\
1496 \livetarg{chap:DWLANGhiuser}{DW\-\_LANG\-\_hi\-\_user}&0xffff & \\
1502 \section{Address Class Encodings}
1503 \label{datarep:addressclassencodings}
1505 The value of the common
1506 \addtoindexi{address}{address class!attribute encoding}
1508 \livelink{chap:DWADDRnone}{DW\-\_ADDR\-\_none} is 0.
1511 \section{Identifier Case}
1512 \label{datarep:identifiercase}
1514 The encodings of the constants used in the
1515 \livelink{chap:DWATidentifiercase}{DW\-\_AT\-\_identifier\-\_case} attribute are given in
1516 Table \refersec{tab:identifiercaseencodings}.
1519 \setlength{\extrarowheight}{0.1cm}
1520 \begin{longtable}{l|c}
1521 \caption{Identifier case encodings} \label{tab:identifiercaseencodings}\\
1522 \hline \\ \bfseries Identifier case name&\bfseries Value \\ \hline
1524 \bfseries Identifier case name&\bfseries Value\\ \hline
1526 \hline \emph{Continued on next page}
1530 \livelink{chap:DWIDcasesensitive}{DW\-\_ID\-\_case\-\_sensitive}&0x00 \\
1531 \livelink{chap:DWIDupcase}{DW\-\_ID\-\_up\-\_case}&0x01 \\
1532 \livelink{chap:DWIDdowncase}{DW\-\_ID\-\_down\-\_case}&0x02 \\
1533 \livelink{chap:DWIDcaseinsensitive}{DW\-\_ID\-\_case\-\_insensitive}&0x03 \\
1537 \section{Calling Convention Encodings}
1538 \label{datarep:callingconventionencodings}
1539 The encodings of the constants used in the
1540 \livelink{chap:DWATcallingconvention}{DW\-\_AT\-\_calling\-\_convention} attribute are given in
1541 Table \refersec{tab:callingconventionencodings}.
1544 \setlength{\extrarowheight}{0.1cm}
1545 \begin{longtable}{l|c}
1546 \caption{Calling convention encodings} \label{tab:callingconventionencodings}\\
1547 \hline \\ \bfseries Calling Convention name&\bfseries Value \\ \hline
1549 \bfseries Calling Convention name&\bfseries Value\\ \hline
1551 \hline \emph{Continued on next page}
1556 \livelink{chap:DWCCnormal}{DW\-\_CC\-\_normal}&0x01 \\
1557 \livelink{chap:DWCCprogram}{DW\-\_CC\-\_program}&0x02 \\
1558 \livelink{chap:DWCCnocall}{DW\-\_CC\-\_nocall}&0x03 \\
1559 \livetarg{chap:DWCClouser}{DW\-\_CC\-\_lo\-\_user}&0x40 \\
1560 \livetarg{chap:DWCChiuser}{DW\-\_CC\-\_hi\-\_user}&0xff \\
1565 \section{Inline Codes}
1566 \label{datarep:inlinecodes}
1568 The encodings of the constants used in the
1569 \livelink{chap:DWATinline}{DW\-\_AT\-\_inline} attribute are given in
1570 Table \refersec{tab:inlineencodings}.
1573 \setlength{\extrarowheight}{0.1cm}
1574 \begin{longtable}{l|c}
1575 \caption{Inline encodings} \label{tab:inlineencodings}\\
1576 \hline \\ \bfseries Iline Code name&\bfseries Value \\ \hline
1578 \bfseries Iline Code name&\bfseries Value\\ \hline
1580 \hline \emph{Continued on next page}
1585 \livelink{chap:DWINLnotinlined}{DW\-\_INL\-\_not\-\_inlined}&0x00 \\
1586 \livelink{chap:DWINLinlined}{DW\-\_INL\-\_inlined}&0x01 \\
1587 \livelink{chap:DWINLdeclarednotinlined}{DW\-\_INL\-\_declared\-\_not\-\_inlined}&0x02 \\
1588 \livelink{chap:DWINLdeclaredinlined}{DW\-\_INL\-\_declared\-\_inlined}&0x03 \\
1593 % this clearpage is ugly, but the following table came
1594 % out oddly without it.
1596 \section{Array Ordering}
1597 \label{datarep:arrayordering}
1599 The encodings of the constants used in the
1600 \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering} attribute are given in
1601 Table \refersec{tab:orderingencodings}.
1604 \setlength{\extrarowheight}{0.1cm}
1605 \begin{longtable}{l|c}
1606 \caption{Ordering encodings} \label{tab:orderingencodings}\\
1607 \hline \\ \bfseries Ordering name&\bfseries Value \\ \hline
1609 \bfseries Ordering name&\bfseries Value\\ \hline
1611 \hline \emph{Continued on next page}
1616 \livelink{chap:DWORDrowmajor}{DW\-\_ORD\-\_row\-\_major}&0x00 \\
1617 \livelink{chap:DWORDcolmajor}{DW\-\_ORD\-\_col\-\_major}&0x01 \\
1623 \section{Discriminant Lists}
1624 \label{datarep:discriminantlists}
1626 The descriptors used in the
1627 \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list} attribute are
1628 encoded as 1\dash byte constants. The
1629 defined values are given in
1630 Table \refersec{tab:discriminantdescriptorencodings}.
1632 % Odd that the 'Name' field captalized here, it is not caps elsewhere.
1634 \setlength{\extrarowheight}{0.1cm}
1635 \begin{longtable}{l|c}
1636 \caption{Discriminant descriptor encodings} \label{tab:discriminantdescriptorencodings}\\
1637 \hline \\ \bfseries Descriptor Name&\bfseries Value \\ \hline
1639 \bfseries Descriptor Name&\bfseries Value\\ \hline
1641 \hline \emph{Continued on next page}
1646 \livetarg{chap:DWDSClabel}{DW\-\_DSC\-\_label}&0x00 \\
1647 \livetarg{chap:DWDSCrange}{DW\-\_DSC\-\_range}&0x01 \\
1652 \section{Name Lookup Tables}
1653 \label{datarep:namelookuptables}
1655 Each set of entries in the table of global names contained
1656 in the .debug\_pubnames and .debug\_pubtypes sections begins
1657 with a header consisting of:
1660 \begin{enumerate}[1.]
1661 \item unit\_length (initial length) \\
1662 A 4\dash byte or 12\dash byte unsigned integer representing the length
1663 of the .debug\_info contribution for that compilation unit,
1664 not including the length field itself. In the 32\dash bit DWARF
1665 format, this is a 4\dash byte unsigned integer (which must be less
1666 than 0xfffffff0); in the 64\dash bit DWARF format, this consists
1667 of the 4\dash byte value 0xffffffff followed by an 8\dash byte unsigned
1668 integer that gives the actual length
1669 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1671 \item version (uhalf)
1672 A 2\dash byte unsigned integer representing the version of the
1673 DWARF information for the compilation unit
1674 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1675 The value in this field is 4.
1677 % Some say unsigned offset this just says offset: FIXME
1678 \item debug\_info\_offset (section offset) \\
1679 A 4\dash byte or 8\dash byte offset into the .debug\_info
1680 section of the compilation unit header.
1682 the 32\dash bit DWARF format, this is a 4\dash byte unsigned offset;
1683 in the 64\dash bit DWARF format, this is an 8\dash byte unsigned offsets
1684 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1686 \item debug\_info\_length (section length) \\
1687 A 4\dash byte or 8\dash byte length containing the size in bytes of the
1688 contents of the .debug\_info section generated to represent
1689 this compilation unit. In the 32\dash bit DWARF format, this is
1690 a 4\dash byte unsigned length; in the 64\dash bit DWARF format, this
1691 is an 8-byte unsigned length
1692 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1697 This header is followed by a series of tuples. Each tuple
1698 consists of a 4\dash byte or 8\dash byte offset followed by a string
1699 of non\dash null bytes terminated by one null byte.
1701 DWARF format, this is a 4\dash byte offset; in the 64\dash bit DWARF
1702 format, it is an 8\dash byte offset.
1703 Each set is terminated by an
1704 offset containing the value 0.
1707 \section{Address Range Table}
1708 \label{datarep:addrssrangetable}
1710 Each set of entries in the table of address ranges contained
1711 in the .debug\_aranges section begins with a header containing:
1713 \begin{enumerate}[1.]
1714 % FIXME The unit length text is not fully consistent across
1717 \item unit\_length (initial length) \\
1718 A 4-byte or 12-byte length containing the length of the
1719 set of entries for this compilation unit, not including the
1720 length field itself. In the 32-bit DWARF format, this is a
1721 4-byte unsigned integer (which must be less than 0xfffffff0);
1722 in the 64-bit DWARF format, this consists of the 4-byte value
1723 0xffffffff followed by an 8-byte unsigned integer that gives
1725 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1727 \item version (uhalf) \\
1728 A 2\dash byte version identifier containing the value 2
1729 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1731 \item debug\_info\_offset (section offset) \\
1732 A 4\dash byte or 8\dash byte offset into the .debug\_info section of
1733 the compilation unit header. In the 32\dash bit DWARF format,
1734 this is a 4\dash byte unsigned offset; in the 64\dash bit DWARF format,
1735 this is an 8\dash byte unsigned offset
1736 (see Section \refersec{datarep:32bitand64bitdwarfformats}).
1738 \item address\_size (ubyte) \\
1739 A 1\dash byte unsigned integer containing the size in bytes of an
1740 \addtoindexx{address\_size}
1741 address (or the offset portion of an address for segmented
1742 \addtoindexx{address space!segmented}
1743 addressing) on the target system.
1745 \item segment\_size (ubyte) \\
1746 A 1\dash byte unsigned integer containing the size in bytes of a
1747 segment selector on the target system.
1751 This header is followed by a series of tuples. Each tuple
1752 consists of a segment, an address and a length.
1754 size is given by the segment\_size field of the header; the
1755 address and length size are each given by the address\_size
1756 field of the header.
1757 The first tuple following the header in
1758 each set begins at an offset that is a multiple of the size
1759 of a single tuple (that is, the size of a segment selector
1760 plus twice the size of an address).
1761 The header is padded, if
1762 necessary, to that boundary. Each set of tuples is terminated
1763 by a 0 for the segment, a 0 for the address and 0 for the
1764 length. If the segment\_size field in the header is zero,
1765 the segment selectors are omitted from all tuples, including
1766 the terminating tuple.
1769 \section{Line Number Information}
1770 \label{datarep:linenumberinformation}
1772 The version number in the line number program header is 4
1773 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1775 The boolean values ``true'' and ``false''
1776 used by the line number information program are encoded
1777 as a single byte containing the value 0
1778 for ``false,'' and a non-zero value for ``true.''
1780 The encodings for the standard opcodes are given in
1781 Table \refersec{tab:linenumberstandardopcodeencodings}.
1783 % Odd that the 'Name' field captalized here, it is not caps elsewhere.
1785 \setlength{\extrarowheight}{0.1cm}
1786 \begin{longtable}{l|c}
1787 \caption{Line Number Standard Opcode encodings} \label{tab:linenumberstandardopcodeencodings}\\
1788 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
1790 \bfseries Opcode Name&\bfseries Value\\ \hline
1792 \hline \emph{Continued on next page}
1797 \livelink{chap:DWLNScopy}{DW\-\_LNS\-\_copy}&0x01 \\
1798 \livelink{chap:DWLNSadvancepc}{DW\-\_LNS\-\_advance\-\_pc}&0x02 \\
1799 \livelink{chap:DWLNSadvanceline}{DW\-\_LNS\-\_advance\-\_line}&0x03 \\
1800 \livelink{chap:DWLNSsetfile}{DW\-\_LNS\-\_set\-\_file}&0x04 \\
1801 \livelink{chap:DWLNSsetcolumn}{DW\-\_LNS\-\_set\-\_column}&0x05 \\
1802 \livelink{chap:DWLNSnegatestmt}{DW\-\_LNS\-\_negate\-\_stmt}&0x06 \\
1803 \livelink{chap:DWLNSsetbasicblock}{DW\-\_LNS\-\_set\-\_basic\-\_block}&0x07 \\
1804 \livelink{chap:DWLNSconstaddpc}{DW\-\_LNS\-\_const\-\_add\-\_pc}*0x08 \\
1805 \livelink{chap:DWLNSfixedadvancepc}{DW\-\_LNS\-\_fixed\-\_advance\-\_pc}&0x09 \\
1806 \livelink{chap:DWLNSsetprologueend}{DW\-\_LNS\-\_set\-\_prologue\-\_end}&0x0a \\
1807 \livelink{chap:DWLNSsetepiloguebegin}{DW\-\_LNS\-\_set\-\_epilogue\-\_begin}&0x0b \\
1808 \livelink{chap:DWLNSsetisa}{DW\-\_LNS\-\_set\-\_isa}&0x0c \\
1814 The encodings for the extended opcodes are given in
1815 Table \refersec{tab:linenumberextendedopcodeencodings}.
1818 \setlength{\extrarowheight}{0.1cm}
1819 \begin{longtable}{l|c}
1820 \caption{Line Number Extended Opcode encodings} \label{tab:linenumberextendedopcodeencodings}\\
1821 \hline \\ \bfseries Opcode Name&\bfseries Value \\ \hline
1823 \bfseries Opcode Name&\bfseries Value\\ \hline
1825 \hline \emph{Continued on next page}
1830 \livelink{chap:DWLNEendsequence}{DW\-\_LNE\-\_end\-\_sequence}&0x01 \\
1831 \livelink{chap:DWLNEsetaddress}{DW\-\_LNE\-\_set\-\_address}&0x02\\
1832 \livelink{chap:DWLNEdefinefile}{DW\-\_LNE\-\_define\-\_file}&0x03\\
1833 \livelink{chap:DWLNEsetdiscriminator}{DW\-\_LNE\-\_set\-\_discriminator} \ddag &0x04 \\
1834 \livetarg{chap:DWLNElouser}{DW\-\_LNE\-\_lo\-\_user}&0x80 \\
1835 \livetarg{chap:DWLNEhiuser}{DW\-\_LNE\-\_hi\-\_user}&0xff \\
1838 \ddag Extended opcode new in DWARF Version 4.
1841 \section{Macro Information}
1842 \label{datarep:macroinformation}
1844 The source line numbers and source file indices encoded in the
1845 macro information section are represented as unsigned LEB128
1846 numbers as are the constants in a \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext} entry.
1848 The macinfo type is encoded as a single byte.
1849 The encodings are given in
1850 Table \refersec{tab:macinfotypeencodings}.
1854 \setlength{\extrarowheight}{0.1cm}
1855 \begin{longtable}{l|c}
1856 \caption{Macinfo Type Encodings} \label{tab:macinfotypeencodings}\\
1857 \hline \\ \bfseries Macinfo Type Name&\bfseries Value \\ \hline
1859 \bfseries Macinfo Type Name&\bfseries Value\\ \hline
1861 \hline \emph{Continued on next page}
1866 \livelink{chap:DWMACINFOdefine}{DW\-\_MACINFO\-\_define}&0x01 \\
1867 \livelink{chap:DWMACINFOundef}{DW\-\_MACINFO\-\_undef}&0x02 \\
1868 \livelink{chap:DWMACINFOstartfile}{DW\-\_MACINFO\-\_start\-\_file}&0x03 \\
1869 \livelink{chap:DWMACINFOendfile}{DW\-\_MACINFO\-\_end\-\_file}&0x04 \\
1870 \livelink{chap:DWMACINFOvendorext}{DW\-\_MACINFO\-\_vendor\-\_ext}&0xff \\
1875 \section{Call Frame Information}
1876 \label{datarep:callframeinformation}
1878 In the 32\dash bit DWARF format, the value of the CIE id in the
1879 CIE header is 0xffffffff; in the 64\dash bit DWARF format, the
1880 value is 0xffffffffffffffff.
1882 The value of the CIE version number is 4
1883 (see Appendix \refersec{app:dwarfsectionversionnumbersinformative}).
1885 Call frame instructions are encoded in one or more bytes. The
1886 primary opcode is encoded in the high order two bits of
1887 the first byte (that is, opcode = byte >> 6). An operand
1888 or extended opcode may be encoded in the low order 6
1889 bits. Additional operands are encoded in subsequent bytes.
1890 The instructions and their encodings are presented in
1891 Table \refersec{tab:callframeinstructionencodings}.
1894 \setlength{\extrarowheight}{0.1cm}
1895 \begin{longtable}{l|c|c|l|l}
1896 \caption{Call frame instruction encodings} \label{tab:callframeinstructionencodings} \\
1897 \hline \\ &\bfseries High 2 &\bfseries Low 6 & & \\
1898 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
1900 & \bfseries High 2 &\bfseries Low 6 & &\\
1901 \bfseries Instruction&\bfseries Bits &\bfseries Bits &\bfseries Operand 1 &\bfseries Operand 2\\ \hline
1903 \hline \emph{Continued on next page}
1908 \livelink{chap:DWCFAadvanceloc}{DW\-\_CFA\-\_advance\-\_loc}&0x1&delta & \\
1909 \livelink{chap:DWCFAoffset}{DW\-\_CFA\-\_offset}&0x2®ister&ULEB128 offset \\
1910 \livelink{chap:DWCFArestore}{DW\-\_CFA\-\_restore}&0x3®ister & & \\
1911 \livelink{chap:DWCFAnop}{DW\-\_CFA\-\_nop}&0&0 & & \\
1912 \livelink{chap:DWCFAsetloc}{DW\-\_CFA\-\_set\-\_loc}&0&0x01&address & \\
1913 \livelink{chap:DWCFAadvanceloc1}{DW\-\_CFA\-\_advance\-\_loc1}&0&0x02&1\dash byte delta & \\
1914 \livelink{chap:DWCFAadvanceloc2}{DW\-\_CFA\-\_advance\-\_loc2}&0&0x03&2\dash byte delta & \\
1915 \livelink{chap:DWCFAadvanceloc4}{DW\-\_CFA\-\_advance\-\_loc4}&0&0x04&4\dash byte delta & \\
1916 \livelink{chap:DWCFAoffsetextended}{DW\-\_CFA\-\_offset\-\_extended}&0&0x05&ULEB128 register&ULEB128 offset \\
1917 \livelink{chap:DWCFArestoreextended}{DW\-\_CFA\-\_restore\-\_extended}&0&0x06&ULEB128 register & \\
1918 \livelink{chap:DWCFAundefined}{DW\-\_CFA\-\_undefined}&0&0x07&ULEB128 register & \\
1919 \livelink{chap:DWCFAsamevalue}{DW\-\_CFA\-\_same\-\_value}&0&0x08 &ULEB128 register & \\
1920 \livelink{chap:DWCFAregister}{DW\-\_CFA\-\_register}&0&0x09&ULEB128 register &ULEB128 offset \\
1921 \livelink{chap:DWCFArememberstate}{DW\-\_CFA\-\_remember\-\_state}&0&0x0a & & \\
1922 \livelink{chap:DWCFArestorestate}{DW\-\_CFA\-\_restore\-\_state}&0&0x0b & & \\
1923 \livelink{chap:DWCFAdefcfa}{DW\-\_CFA\-\_def\-\_cfa}&0&0x0c &ULEB128 register&ULEB128 offset \\
1924 \livelink{chap:DWCFAdefcfaregister}{DW\-\_CFA\-\_def\-\_cfa\-\_register}&0&0x0d&ULEB128 register & \\
1925 \livelink{chap:DWCFAdefcfaoffset}{DW\-\_CFA\-\_def\-\_cfa\-\_offset}&0&0x0e &ULEB128 offset & \\
1926 \livelink{chap:DWCFAdefcfaexpression}{DW\-\_CFA\-\_def\-\_cfa\-\_expression}&0&0x0f &BLOCK \\
1927 \livelink{chap:DWCFAexpression}{DW\-\_CFA\-\_expression}&0&0x10&ULEB128 register & BLOCK \\
1929 \livelink{chap:DWCFAoffsetextendedsf}{DW\-\_CFA\-\_offset\-\_extended\-\_sf}&0&0x11&ULEB128 register&SLEB128 offset \\
1930 \livelink{chap:DWCFAdefcfasf}{DW\-\_CFA\-\_def\-\_cfa\-\_sf}&0&0x12&ULEB128 register&SLEB128 offset \\
1931 \livelink{chap:DWCFAdefcfaoffsetsf}{DW\-\_CFA\-\_def\-\_cfa\-\_offset\-\_sf}&0&0x13&SLEB128 offset & \\
1932 \livelink{chap:DWCFAvaloffset}{DW\-\_CFA\-\_val\-\_offset}&0&0x14&ULEB128&ULEB128 \\
1933 \livelink{chap:DWCFAvaloffsetsf}{DW\-\_CFA\-\_val\-\_offset\-\_sf}&0&0x15&ULEB128&SLEB128 \\
1934 \livelink{chap:DWCFAvalexpression}{DW\-\_CFA\-\_val\-\_expression}&0&0x16&ULEB128&BLOCK \\
1935 \livetarg{chap:DWCFAlouser}{DW\-\_CFA\-\_lo\-\_user}&0&0x1c & & \\
1936 \livetarg{chap:DWCFAhiuser}{DW\-\_CFA\-\_hi\-\_user}&0&0x3f & & \\
1940 \section{Non-continguous Address Ranges}
1941 \label{datarep:noncontiguousaddressranges}
1943 Each entry in a range list
1944 (see Section \refersec{chap:noncontiguousaddressranges})
1946 range list entry, a base address selection entry, or an end
1949 A range list entry consists of two relative addresses. The
1950 addresses are the same size as addresses on the target machine.
1952 A base address selection entry and an end of list entry each
1953 consist of two (constant or relocated) addresses. The two
1954 addresses are the same size as addresses on the target machine.
1956 For a range list to be specified, the base address of the
1957 corresponding compilation unit must be defined
1958 (see Section \refersec{chap:normalandpartialcompilationunitentries}).
1961 \section{Dependencies and Constraints}
1962 \label{datarep:dependenciesandconstraints}
1964 The debugging information in this format is intended to
1965 exist in the .debug\_abbrev, .debug\_aranges, .debug\_frame,
1966 .debug\_info, .debug\_line, .debug\_loc, .debug\_macinfo,
1967 .debug\_pubnames, .debug\_pubtypes, .debug\_ranges, .debug\_str
1968 and .debug\_types sections of an object file, or equivalent
1969 separate file or database. The information is not
1970 word\dash aligned. Consequently: •
1973 \item For the 32\dash bit DWARF format and a target architecture with
1974 32\dash bit addresses, an assembler or compiler must provide a way
1975 to produce 2\dash byte and 4\dash byte quantities without alignment
1976 restrictions, and the linker must be able to relocate a
1977 4\dash byte address or section offset that occurs at an arbitrary
1980 \item For the 32\dash bit DWARF format and a target architecture with
1981 64\dash bit addresses, an assembler or compiler must provide a
1982 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
1983 alignment restrictions, and the linker must be able to relocate
1984 an 8\dash byte address or 4\dash byte section offset that occurs at an
1985 arbitrary alignment.
1987 \item For the 64\dash bit DWARF format and a target architecture with
1988 32\dash bit addresses, an assembler or compiler must provide a
1989 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
1990 alignment restrictions, and the linker must be able to relocate
1991 a 4\dash byte address or 8\dash byte section offset that occurs at an
1992 arbitrary alignment.
1994 \textit{It is expected that this will be required only for very large
1995 32\dash bit programs or by those architectures which support
1996 a mix of 32\dash bit and 64\dash bit code and data within the same
1999 \item For the 64\dash bit DWARF format and a target architecture with
2000 64\dash bit addresses, an assembler or compiler must provide a
2001 way to produce 2\dash byte, 4\dash byte and 8\dash byte quantities without
2002 alignment restrictions, and the linker must be able to
2003 relocate an 8\dash byte address or section offset that occurs at
2004 an arbitrary alignment.
2007 \section{Integer Representation Names}
2008 \label{datarep:integerrepresentationnames}
2010 The sizes of the integers used in the lookup by name, lookup
2011 by address, line number and call frame information sections
2013 Table 41 \refersec{tab:integerrepresentationnames}.
2016 \setlength{\extrarowheight}{0.1cm}
2017 \begin{longtable}{c|l}
2018 \caption{Integer Representation Names} \label{tab:integerrepresentationnames}\\
2019 \hline \\ \bfseries Representation Name&\bfseries Representation \\ \hline
2021 \bfseries Representation Name&\bfseries Representation\\ \hline
2023 \hline \emph{Continued on next page}
2028 sbyte& signed, 1\dash byte integer \\
2029 ubyte&unsigned, 1\dash byte integer \\
2030 uhalf&unsigned, 2\dash byte integer \\
2031 uword&unsigned, 4\dash byte integer \\
2036 \section{Type Signature Computation}
2037 \label{datarep:typesignaturecomputation}
2039 A type signature is computed only by the DWARF producer;
2040 it is used by a DWARF consumer to resolve type references to
2041 the type definitions that are contained in type units.
2043 The type signature for a type T0 is formed from the MD5
2044 hash of a flattened description of the type. The flattened
2045 description of the type is a byte sequence derived from the
2046 DWARF encoding of the type as follows:
2048 \begin{enumerate}[1.]
2050 \item Start with an empty sequence S and a list V of visited
2051 types, where V is initialized to a list containing the type
2052 T0 as its single element. Elements in V are indexed from 1,
2055 \item If the debugging information entry represents a type that
2056 is nested inside another type or a namespace, append to S
2057 the type’s context as follows: For each surrounding type
2058 or namespace, beginning with the outermost such construct,
2059 append the letter 'C', the DWARF tag of the construct, and
2060 the name (taken from the \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute) of the type
2061 or namespace (including its trailing null byte).
2063 \item Append to S the letter 'D', followed by the DWARF tag of
2064 the debugging information entry.
2066 \item For each of the following attributes that are present in
2067 the debugging information entry, in the order listed below,
2068 append to S a marker letter (see below), the DWARF attribute
2069 code, and the attribute value.
2072 \item \livelink{chap:DWATname}{DW\-\_AT\-\_name}
2073 \item \livelink{chap:DWATaccessibility}{DW\-\_AT\-\_accessibility}
2074 \item \livelink{chap:DWATaddressclass}{DW\-\_AT\-\_address\-\_class}
2075 \item \livelink{chap:DWATallocated}{DW\-\_AT\-\_allocated}
2076 \item \livelink{chap:DWATartificial}{DW\-\_AT\-\_artificial}
2077 \item \livelink{chap:DWATassociated}{DW\-\_AT\-\_associated}
2078 \item \livelink{chap:DWATbinaryscale}{DW\-\_AT\-\_binary\-\_scale}
2079 \item \livelink{chap:DWATbitoffset}{DW\-\_AT\-\_bit\-\_offset}
2080 \item \livelink{chap:DWATbitsize}{DW\-\_AT\-\_bit\-\_size}
2081 \item \livelink{chap:DWATbitstride}{DW\-\_AT\-\_bit\-\_stride}
2082 \item \livelink{chap:DWATbytesize}{DW\-\_AT\-\_byte\-\_size}
2083 \item \livelink{chap:DWATbytestride}{DW\-\_AT\-\_byte\-\_stride}
2084 \item \livelink{chap:DWATconstexpr}{DW\-\_AT\-\_const\-\_expr}
2085 \item \livelink{chap:DWATconstvalue}{DW\-\_AT\-\_const\-\_value}
2086 \item \livelink{chap:DWATcontainingtype}{DW\-\_AT\-\_containing\-\_type}
2087 \item \livelink{chap:DWATcount}{DW\-\_AT\-\_count}
2088 \item \livelink{chap:DWATdatabitoffset}{DW\-\_AT\-\_data\-\_bit\-\_offset}
2089 \item \livelink{chap:DWATdatalocation}{DW\-\_AT\-\_data\-\_location}
2090 \item \livelink{chap:DWATdatamemberlocation}{DW\-\_AT\-\_data\-\_member\-\_location}
2091 \item \livelink{chap:DWATdecimalscale}{DW\-\_AT\-\_decimal\-\_scale}
2092 \item \livelink{chap:DWATdecimalsign}{DW\-\_AT\-\_decimal\-\_sign}
2093 \item \livelink{chap:DWATdefaultvalue}{DW\-\_AT\-\_default\-\_value}
2094 \item \livelink{chap:DWATdigitcount}{DW\-\_AT\-\_digit\-\_count}
2095 \item \livelink{chap:DWATdiscr}{DW\-\_AT\-\_discr}
2096 \item \livelink{chap:DWATdiscrlist}{DW\-\_AT\-\_discr\-\_list}
2097 \item \livelink{chap:DWATdiscrvalue}{DW\-\_AT\-\_discr\-\_value}
2098 \item \livelink{chap:DWATencoding}{DW\-\_AT\-\_encoding}
2099 \item \livelink{chap:DWATenumclass}{DW\-\_AT\-\_enum\-\_class}
2100 \item \livelink{chap:DWATendianity}{DW\-\_AT\-\_endianity}
2101 \item \livelink{chap:DWATexplicit}{DW\-\_AT\-\_explicit}
2102 \item \livelink{chap:DWATisoptional}{DW\-\_AT\-\_is\-\_optional}
2103 \item \livelink{chap:DWATlocation}{DW\-\_AT\-\_location}
2104 \item \livelink{chap:DWATlowerbound}{DW\-\_AT\-\_lower\-\_bound}
2105 \item \livelink{chap:DWATmutable}{DW\-\_AT\-\_mutable}
2106 \item \livelink{chap:DWATordering}{DW\-\_AT\-\_ordering}
2107 \item \livelink{chap:DWATpicturestring}{DW\-\_AT\-\_picture\-\_string}
2108 \item \livelink{chap:DWATprototyped}{DW\-\_AT\-\_prototyped}
2109 \item \livelink{chap:DWATsmall}{DW\-\_AT\-\_small}
2110 \item \livelink{chap:DWATsegment}{DW\-\_AT\-\_segment}
2111 \item \livelink{chap:DWATstringlength}{DW\-\_AT\-\_string\-\_length}
2112 \item \livelink{chap:DWATthreadsscaled}{DW\-\_AT\-\_threads\-\_scaled}
2113 \item \livelink{chap:DWATupperbound}{DW\-\_AT\-\_upper\-\_bound}
2114 \item \livelink{chap:DWATuselocation}{DW\-\_AT\-\_use\-\_location}
2115 \item \livelink{chap:DWATuseUTF8}{DW\-\_AT\-\_use\-\_UTF8}
2116 \item \livelink{chap:DWATvariableparameter}{DW\-\_AT\-\_variable\-\_parameter}
2117 \item \livelink{chap:DWATvirtuality}{DW\-\_AT\-\_virtuality}
2118 \item \livelink{chap:DWATvisibility}{DW\-\_AT\-\_visibility}
2119 \item \livelink{chap:DWATvtableelemlocation}{DW\-\_AT\-\_vtable\-\_elem\-\_location}
2122 Note that except for the initial \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute,
2123 attributes are appended in order according to the alphabetical
2124 spelling of their identifier.
2126 If an implementation defines any vendor-specific attributes,
2127 any such attributes that are essential to the definition of
2128 the type should also be included at the end of the above list,
2129 in their own alphabetical suborder.
2131 An attribute that refers to another type entry T is processed
2132 as follows: (a) If T is in the list V at some V[x], use the
2133 letter 'R' as the marker and use the unsigned LEB128 encoding
2134 of x as the attribute value; otherwise, (b) use the letter 'T'
2135 as the marker, process the type T recursively by performing
2136 Steps 2 through 7, and use the result as the attribute value.
2138 Other attribute values use the letter 'A' as the marker, and
2139 the value consists of the form code (encoded as an unsigned
2140 LEB128 value) followed by the encoding of the value according
2141 to the form code. To ensure reproducibility of the signature,
2142 the set of forms used in the signature computation is limited
2143 to the following: \livelink{chap:DWFORMsdata}{DW\-\_FORM\-\_sdata},
2144 \livelink{chap:DWFORMflag}{DW\-\_FORM\-\_flag},
2145 \livelink{chap:DWFORMstring}{DW\-\_FORM\-\_string},
2146 and \livelink{chap:DWFORMblock}{DW\-\_FORM\-\_block}.
2148 \item If the tag in Step 3 is one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2149 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2150 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2151 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type},
2152 or \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, and the referenced
2153 type (via the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2154 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) has a
2155 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to S the letter 'N', the DWARF
2156 attribute code (\livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2157 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend}), the context of
2158 the type (according to the method in Step 2), the letter 'E',
2159 and the name of the type. For \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, if the referenced
2160 entry is a \livelink{chap:DWTAGsubprogram}{DW\-\_TAG\-\_subprogram}, the context is omitted and the
2161 name to be used is the ABI-specific name of the subprogram
2162 (e.g., the mangled linker name).
2165 \item 6.If the tag in Step 3 is not one of \livelink{chap:DWTAGpointertype}{DW\-\_TAG\-\_pointer\-\_type},
2166 \livelink{chap:DWTAGreferencetype}{DW\-\_TAG\-\_reference\-\_type},
2167 \livelink{chap:DWTAGrvaluereferencetype}{DW\-\_TAG\-\_rvalue\-\_reference\-\_type},
2168 \livelink{chap:DWTAGptrtomembertype}{DW\-\_TAG\-\_ptr\-\_to\-\_member\-\_type}, or
2169 \livelink{chap:DWTAGfriend}{DW\-\_TAG\-\_friend}, but has
2170 a \livelink{chap:DWATtype}{DW\-\_AT\-\_type} attribute, or if the referenced type (via
2171 the \livelink{chap:DWATtype}{DW\-\_AT\-\_type} or
2172 \livelink{chap:DWATfriend}{DW\-\_AT\-\_friend} attribute) does not have a
2173 \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, the attribute is processed according to
2174 the method in Step 4 for an attribute that refers to another
2178 \item Visit each child C of the debugging information
2179 entry as follows: If C is a nested type entry or a member
2180 function entry, and has a \livelink{chap:DWATname}{DW\-\_AT\-\_name} attribute, append to
2181 S the letter 'S', the tag of C, and its name; otherwise,
2182 process C recursively by performing Steps 3 through 7,
2183 appending the result to S. Following the last child (or if
2184 there are no children), append a zero byte.
2189 For the purposes of this algorithm, if a debugging information
2191 \livelink{chap:DWATspecification}{DW\-\_AT\-\_specification}
2192 attribute that refers to
2193 another entry D (which has a
2194 \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration}
2196 then S inherits the attributes and children of D, and S is
2197 processed as if those attributes and children were present in
2198 the entry S. Exception: if a particular attribute is found in
2199 both S and D, the attribute in S is used and the corresponding
2200 one in D is ignored.
2202 DWARF tag and attribute codes are appended to the sequence
2203 as unsigned LEB128 values, using the values defined earlier
2206 \textit{A grammar describing this computation may be found in
2207 Appendix \refersec{app:typesignaturecomputationgrammar}.
2210 \textit{An attribute that refers to another type entry should
2211 be recursively processed or replaced with the name of the
2212 referent (in Step 4, 5 or 6). If neither treatment applies to
2213 an attribute that references another type entry, the entry
2214 that contains that attribute should not be considered for a
2215 separate type unit.}
2217 \textit{If a debugging information entry contains an attribute from
2218 the list above that would require an unsupported form, that
2219 entry should not be considered for a separate type unit.}
2221 \textit{A type should be considered for a separate type unit only
2222 if all of the type entries that it contains or refers to in
2223 Steps 6 and 7 can themselves each be considered for a separate
2226 Where the DWARF producer may reasonably choose two or more
2227 different forms for a given attribute, it should choose
2228 the simplest possible form in computing the signature. (For
2229 example, a constant value should be preferred to a location
2230 expression when possible.)
2232 Once the string S has been formed from the DWARF encoding,
2233 an MD5 hash is computed for the string and the lower 64 bits
2234 are taken as the type signature.
2236 \textit{The string S is intended to be a flattened representation of
2237 the type that uniquely identifies that type (i.e., a different
2238 type is highly unlikely to produce the same string).}
2240 \textit{A debugging information entry should not be placed in a
2241 separate type unit if any of the following apply:}
2245 \item \textit{The entry has an attribute whose value is a location
2246 expression, and the location expression contains a reference to
2247 another debugging information entry (e.g., a \livelink{chap:DWOPcallref}{DW\-\_OP\-\_call\-\_ref}
2248 operator), as it is unlikely that the entry will remain
2249 identical across compilation units.}
2251 \item \textit{The entry has an attribute whose value refers
2252 to a code location or a location list.}
2254 \item \textit{The entry has an attribute whose value refers
2255 to another debugging information entry that does not represent
2260 \textit{Certain attributes are not included in the type signature:}
2263 \item \textit{The \livelink{chap:DWATdeclaration}{DW\-\_AT\-\_declaration} attribute is not included because it
2264 indicates that the debugging information entry represents an
2265 incomplete declaration, and incomplete declarations should
2266 not be placed in separate type units.}
2268 \item \textit{The \livelink{chap:DWATdescription}{DW\-\_AT\-\_description} attribute is not included because
2269 it does not provide any information unique to the defining
2270 declaration of the type.}
2272 \item \textit{The \livelink{chap:DWATdeclfile}{DW\-\_AT\-\_decl\-\_file}, \livelink{chap:DWATdeclline}{DW\-\_AT\-\_decl\-\_line}, and
2273 \livelink{chap:DWATdeclcolumn}{DW\-\_AT\-\_decl\-\_column} attributes are not included because they
2274 may vary from one source file to the next, and would prevent
2275 two otherwise identical type declarations from producing the