1 \chapter{Program Scope Entries}
2 \label{chap:programscopeentries}
3 This section describes debugging information entries that
4 relate to different levels of program scope: compilation,
5 module, subprogram, and so on. Except for separate type
6 entries (see Section \refersec{chap:typeunitentries}),
7 these entries may be thought of as
8 \bb\eb ranges of text addresses within the program.
10 \section{Unit Entries}
11 \label{chap:unitentries}
12 A DWARF object file is an object file that contains one or more
13 DWARF compilation units, of which there are these kinds:
14 \addtoindexx{unit|see {compilation unit}}
15 \addtoindexx{compilation unit}
17 \item A \definition{full compilation unit} describes
18 a complete compilation, possibly in combination with
19 related partial compilation units and/or type units.
21 \item A \definition{partial compilation unit} describes
22 a part of a compilation (generally corresponding to an
23 imported module) which is imported into one or more
24 related full compilation units.
26 \item A \definition{type unit} is a specialized unit
27 (similar to a compilation unit) that represents a type
28 whose description may be usefully shared by multiple
32 \index{conventional compilation unit|see{
33 full compilation unit, partial compilation unit, type unit}}
35 \textit{These first three kinds of compilation unit are
36 sometimes called \doublequote{conventional} compilation
37 units--they are kinds of compilation units that were
38 defined prior to \DWARFVersionV. Conventional compilation units
39 are part of the same object file as the compiled code and
40 data (whether relocatable, executable, shared and so on).
41 The word \doublequote{conventional} is usually
42 omitted in these names, unless needed to distinguish them
43 from the similar split compilation units below.}
47 \item A \definition{skeleton compilation unit} represents
48 the DWARF debugging information for a compilation using a
49 minimal description that identifies a separate split
50 compilation unit that provides the remainder (and most)
54 \textit{A skeleton compilation acts as a minimal conventional full
55 compilation (see above) that identifies and is paired with a
56 corresponding split full compilation (as described below). Like
57 the conventional compilation units, a skeleton compilation unit
58 is part of the same object file as the compiled code and data.}
62 \definition{split compilation unit} describes
63 a complete compilation, possibly in combination with
64 related type compilation units. It corresponds
65 to a specific skeleton compilation unit.
67 \item A \definition{split type unit} is a specialized
68 compilation unit that represents a type whose description may
69 be usefully shared by multiple other units.
73 \textit{Split compilation units and split type units may be
74 contained in object files separate from those containing the
75 program code and data.
77 These object files are not processed by a linker; thus,
78 split units do not depend on underlying object file relocations.
81 \textit{Either a full compilation unit or a partial compilation
82 unit may be logically incorporated into another compilation unit
83 using an \addtoindex{imported unit entry}
84 (see Section \refersec{chap:importedunitentries}).}
87 combined split and partial
88 compilation unit kind is not defined.}
90 \textit{In the remainder of this document, the word
91 \doublequote{compilation} in the phrase \doublequote{compilation unit}
92 is generally omitted, unless it is deemed needed for clarity
95 \subsection{Full and Partial Compilation Unit Entries}
96 \label{chap:fullandpartialcompilationunitentries}
97 A \addtoindex{full compilation unit}\addtoindexx{compilation unit!full}
98 is represented by a debugging information entry with the tag
99 \DWTAGcompileunitTARG.
100 A \addtoindex{partial compilation unit}\addtoindexx{compilation unit!partial}
101 is represented by a debugging information entry with the tag
102 \DWTAGpartialunitTARG.
105 In a simple compilation, a single compilation unit with
107 \DWTAGcompileunit{} represents a complete object file
109 \DWTAGpartialunit{} (as well as tag \DWTAGtypeunit) is not used.
111 employing the DWARF space compression and duplicate elimination
113 Appendix \refersec{app:usingcompilationunits},
114 multiple compilation units using
117 \DWTAGpartialunit{} and/or
119 are used to represent portions of an object file.
121 \textit{A full compilation unit typically represents the text and
122 data contributed to an executable by a single relocatable
123 object file. It may be derived from several source files,
124 including pre-processed header files.
125 A \addtoindex{partial compilation unit} typically represents a part
126 of the text and data of a relocatable object file, in a manner that
127 can potentially be shared with the results of other compilations
128 to save space. It may be derived from an \doublequote{include file,}
129 template instantiation, or other implementation-dependent
130 portion of a compilation. A full compilation unit can also
131 function in a manner similar to a partial compilation unit
134 See Appendix \refersec{app:dwarfcompressionandduplicateeliminationinformative}
135 for discussion of related compression techniques.
139 A compilation unit entry owns debugging information
140 entries that represent all or part of the declarations
141 made in the corresponding compilation. In the case of a
142 partial compilation unit, the containing scope of its owned
143 declarations is indicated by imported unit entries in one
144 or more other compilation unit entries that refer to that
145 partial compilation unit (see
146 Section \refersec{chap:importedunitentries}).
148 Compilation unit entries may have the following
150 \begin{enumerate}[1. ]
151 \item Either a \DWATlowpc{} and
152 \DWAThighpc{} pair of
153 \addtoindexx{high PC attribute}
155 \addtoindexx{low PC attribute}
157 \addtoindexx{ranges attribute}
159 \DWATranges{} attribute
160 \addtoindexx{ranges attribute}
162 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
164 non-contiguous address ranges, respectively,
165 of the machine instructions generated for the compilation
166 unit (see Section \refersec{chap:codeaddressesandranges}).
168 A \DWATlowpc{} attribute
169 may also be specified in combination
170 \addtoindexx{ranges attribute}
172 \DWATranges{} to specify the
173 \addtoindexx{ranges attribute}
174 default base address for use in
175 \addtoindexx{location list}
176 location lists (see Section
177 \refersec{chap:locationlists}) and range lists
178 \addtoindexx{range list}
179 (see Section \refersec{chap:noncontiguousaddressranges}).
181 \item \hypertarget{chap:DWATnamepathnameofcompilationsource}{}
182 A \DWATnameDEFN{} attribute \addtoindexx{name attribute}
183 whose value is a null-terminated string
184 containing the full or relative path name
186 (relative to the value of the \DWATcompdir{} attribute,
190 source file from which the compilation unit was derived.
192 \item \hypertarget{chap:DWATlanguageprogramminglanguage}{}
193 A \DWATlanguageDEFN{} attribute\addtoindexx{language attribute}
194 whose constant value is an integer code
195 indicating the source language of the compilation
196 unit. The set of language names and their meanings are given
197 in Table \refersec{tab:languagenames}.
200 \setlength{\extrarowheight}{0.1cm}
201 \begin{longtable}{l|l}
202 \caption{Language names} \label{tab:languagenames} \\
203 \hline \bfseries Language name & \bfseries Meaning \\ \hline
205 \bfseries Language name & \bfseries Meaning \\ \hline
207 \hline \emph{Continued on next page}
210 \addtoindexx{ISO-defined language names}
211 \DWLANGAdaeightythreeTARG{} \dag & ISO Ada:1983 \addtoindexx{Ada:1983 (ISO)} \\
212 \DWLANGAdaninetyfiveTARG{} \dag & ISO Ada:1995 \addtoindexx{Ada:1995 (ISO)} \\
213 \DWLANGCTARG & Non-standardized C, such as K\&R \addtoindexx{C!non-standard}\\
214 \DWLANGCeightynineTARG & ISO C:1989 \addtoindexx{C:1989 (ISO)} \\
215 \DWLANGCninetynineTARG & ISO C:1999 \addtoindexx{C:1999 (ISO)} \\
216 \DWLANGCelevenTARG & ISO C:2011 \addtoindexx{C:2011 (ISO)} \\
218 \DWLANGCplusplusTARG & ISO C++98 \addtoindexx{C++98 (ISO)} \\
219 \DWLANGCpluspluszerothreeTARG & ISO C++03 \addtoindexx{C++03 (ISO)} \\
220 \DWLANGCpluspluselevenTARG & ISO C++11 \addtoindexx{C++11 (ISO)} \\
221 \DWLANGCplusplusfourteenTARG & ISO C++14 \addtoindexx{C++14 (ISO)}
224 \DWLANGCobolseventyfourTARG & ISO COBOL:1974 \addtoindexx{COBOL:1974 (ISO)} \\
225 \DWLANGCoboleightyfiveTARG & ISO COBOL:1985 \addtoindexx{COBOL:1985 (ISO)} \\
226 \DWLANGDTARG{}~\dag & D \addtoindexx{D language} \\
227 \DWLANGDylanTARG~\dag & Dylan \addtoindexx{Dylan} \\
228 \DWLANGFortranseventysevenTARG & ISO FORTRAN:1977 \addtoindexx{FORTRAN:1977 (ISO)} \\
229 \DWLANGFortranninetyTARG & ISO Fortran:1990 \addtoindexx{Fortran:1990 (ISO)} \\
230 \DWLANGFortranninetyfiveTARG & ISO Fortran:1995 \addtoindexx{Fortran:1995 (ISO)} \\
231 \DWLANGFortranzerothreeTARG & ISO Fortran:2004 \addtoindexx{Fortran:2004 (ISO)} \\
232 \DWLANGFortranzeroeightTARG & ISO Fortran:2010 \addtoindexx{Fortran:2010 (ISO)} \\
233 \DWLANGGoTARG{}~\dag & \addtoindex{Go} \\
234 \DWLANGHaskellTARG{} \dag & \addtoindex{Haskell} \\
235 \DWLANGJavaTARG{} & \addtoindex{Java}\\
236 \DWLANGJuliaTARG{}~\dag & \addtoindex{Julia} \\
237 \DWLANGModulatwoTARG & ISO Modula\dash 2:1996 \addtoindexx{Modula-2:1996 (ISO)} \\
238 \DWLANGModulathreeTARG & \addtoindex{Modula-3} \\
239 \DWLANGObjCTARG{} & \addtoindex{Objective C} \\
240 \DWLANGObjCplusplusTARG{} & \addtoindex{Objective C++} \\
241 \DWLANGOCamlTARG{}~\dag & \addtoindex{OCaml}\index{Objective Caml|see{OCaml}} \\
242 \DWLANGOpenCLTARG{}~\dag & \addtoindex{OpenCL} \\
243 \DWLANGPascaleightythreeTARG & ISO Pascal:1983 \addtoindexx{Pascal:1983 (ISO)} \\
244 \DWLANGPLITARG{}~\dag & ANSI PL/I:1976 \addtoindexx{PL/I:1976 (ANSI)} \\
245 \DWLANGPythonTARG{}~\dag & \addtoindex{Python} \\
246 \DWLANGRustTARG{}~\dag & \addtoindex{Rust} \\
250 & \addtoindex{Swift} \\
251 \DWLANGUPCTARG{} & UPC (Unified Parallel C) \addtoindexx{UPC}
252 \index{Unified Parallel C|see{UPC}} \\
254 \dag \ \ \textit{Support for these languages is limited}& \\
259 \item \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}{}
260 A \DWATstmtlistDEFN{}\addtoindexx{statement list attribute}
261 attribute whose value is a
262 \addtoindexx{section offset!in statement list attribute}
263 section offset to the line number information for this compilation
266 This information is placed in a separate object file
267 section from the debugging information entries themselves. The
268 value of the statement list attribute is the offset in the
269 \dotdebugline{} section of the first byte of the line number
270 information for this compilation unit
271 (see Section \refersec{chap:linenumberinformation}).
273 \item A \DWATmacrosDEFN{}\hypertarget{chap:DWATmacrosmacroinformation}{}
275 \addtoindexx{macro information attribute}
277 \addtoindexx{section offset!in macro information attribute}
278 section offset to the macro information for this compilation unit.
280 This information is placed in a separate object file section
281 from the debugging information entries themselves. The
282 value of the macro information attribute is the offset in
283 the \dotdebugmacro{} section of the first byte of the macro
284 information for this compilation unit
285 (see Section \refersec{chap:macroinformation}).
287 \textit{The \DWATmacrosNAME{} attribute is new in \DWARFVersionV,
289 \DWATmacroinfoDEFN{} attribute of earlier DWARF versions.
290 \livetarg{chap:DWATmacroinfomacroinformation}{}
291 While \DWATmacrosNAME{} and \DWATmacroinfoNAME{} attributes cannot both occur in the same
292 compilation unit, both may be found in the set of units that make up an executable
293 or shared object file. The two attributes have distinct encodings to facilitate such
297 \item \hypertarget{chap:DWATcompdircompilationdirectory}{}
298 A \DWATcompdirDEFN{} attribute\addtoindexx{compilation directory attribute}
300 null-terminated string containing the current working directory
301 of the compilation command that produced this compilation
302 unit in whatever form makes sense for the host system.
304 \item \hypertarget{chap:DWATproducercompileridentification}{}
305 A \DWATproducerDEFN{} attribute\addtoindexx{producer attribute}
306 whose value is a null-terminated string containing
307 information about the compiler
308 that produced the compilation unit. The actual contents of
309 the string will be specific to each producer, but should
310 begin with the name of the compiler vendor or some other
311 identifying character sequence that should avoid confusion
312 with other producer values.
315 \item \hypertarget{chap:DWATidentifiercaseidentifiercaserule}{}
316 A \DWATidentifiercaseDEFN{} attribute
317 \addtoindexx{identifier case attribute} whose integer
318 constant value is a code describing the treatment
319 of identifiers within this compilation unit. The
320 set of identifier case codes is given in
321 Table \refersec{tab:identifiercasecodes}.
323 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
324 \DWIDcasesensitive{} \\
327 \DWIDcaseinsensitive{} \\
328 \end{simplenametable}
330 \DWIDcasesensitiveTARG{} is the default for all compilation units
331 that do not have this attribute. It indicates that names given
332 as the values of \DWATname{} attributes
333 \addtoindexx{name attribute}
334 in debugging information
335 entries for the compilation unit reflect the names as they
336 appear in the source program. The debugger should be sensitive
337 to the case of \addtoindex{identifier names} when doing identifier
341 \DWIDupcaseTARG{} means that the
342 producer of the debugging
343 information for this compilation unit converted all source
344 names to upper case. The values of the name attributes may not
345 reflect the names as they appear in the source program. The
346 debugger should convert all names to upper case when doing
349 \DWIDdowncaseTARG{} means that
350 the producer of the debugging
351 information for this compilation unit converted all source
352 names to lower case. The values of the name attributes may not
353 reflect the names as they appear in the source program. The
354 debugger should convert all names to lower case when doing
358 \DWIDcaseinsensitiveTARG{} means that the values of the name
359 attributes reflect the names as they appear in the source
360 program but that a case insensitive lookup should be used to
364 \item \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{}
365 A \DWATbasetypesDEFN{} attribute\addtoindexx{base types attribute}
366 whose value is a \livelink{chap:classreference}{reference}.
367 This attribute points to a debugging information entry
368 representing another compilation unit. It may be used
369 to specify the compilation unit containing the base type
370 entries used by entries in the current compilation unit
371 (see Section \refersec{chap:basetypeentries}).
374 \textit{This attribute provides a consumer a way to find the definition
375 of base types for a compilation unit that does not itself
376 contain such definitions. This allows a consumer, for example,
377 to interpret a type conversion to a base type correctly.}
379 \item \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}{}
380 A \DWATuseUTFeightDEFN{} attribute,
381 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
382 which is a \livelink{chap:classflag}{flag} whose
383 presence indicates that all strings (such as the names of
384 declared entities in the source program, or filenames in the line number table)
385 are represented using the UTF-8 representation.
388 \item \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{}
389 A \DWATmainsubprogramDEFN{} attribute,\addtoindexx{main subprogram attribute}
390 which is a \livelink{chap:classflag}{flag},
391 whose presence indicates that the compilation unit contains a
392 subprogram that has been identified as the starting
396 of the program. If more than one compilation unit contains
397 this \nolink{flag}, any one of them may contain the starting
402 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
404 to specify and provide a user-specified name for the main
405 subroutine of a program.
406 \addtoindex{C} uses the name \doublequote{main} to identify
407 the main subprogram of a program. Some other languages provide
408 similar or other means to identify the main subprogram of
409 a program. The \DWATmainsubprogram{} attribute may also be used to
410 identify such subprograms (see
411 Section \refersec{chap:generalsubroutineandentrypointinformation}).}
414 \hypertarget{chap:DWATentrypcofcompileunit}{}
415 \hypertarget{chap:DWATentrypcofpartialunit}{}
416 A \DWATentrypc{} attribute whose value is the address of the first
417 \addtoindexx{entry pc attribute}
418 executable instruction of the unit (see
419 Section \refersec{chap:entryaddress}).
422 \item \hypertarget{chap:DWATstroffsetbaseforindirectstringtable}{}
423 A \DWATstroffsetsbaseDEFN\addtoindexx{string offset base attribute}
424 attribute, whose value is of class \CLASSstroffsetsptr.
425 This attribute points to the first string
426 offset of the compilation unit's contribution to the
427 \dotdebugstroffsets{} (or \dotdebugstroffsetsdwo{}) section.
428 Indirect string references
429 (using \DWFORMstrx) within the compilation unit are
430 interpreted as indices relative to this base.
433 \item \hypertarget{chap:DWATaddrbaseforaddresstable}{}
434 A \DWATaddrbaseDEFN\addtoindexx{address table base attribute}
435 attribute, whose value is of class \CLASSaddrptr.
436 This attribute points to the beginning of the compilation
437 unit's contribution to the \dotdebugaddr{} section.
438 Indirect references (using \DWFORMaddrx, \DWOPaddrx,
439 \DWOPconstx, \DWLLEbaseaddressselectionentry{},
440 \DWLLEstartendentry{} or \DWLLEstartlengthentry)
441 within the compilation unit are interpreted as indices
442 relative to this base.
445 \item \hypertarget{chap:DWATrangesbaseforrangelists}{}
446 A \DWATrangesbaseDEFN\addtoindexx{ranges table base attribute}
447 attribute, whose value is of class \CLASSrangelistptr.
448 This attribute points to the beginning of the compilation
449 unit's contribution to the \dotdebugranges{} section.
450 References to range lists (using \DWFORMsecoffset)
451 within the compilation unit are
452 interpreted as offsets relative to this base.
456 The base address of a compilation unit is defined as the
457 value of the \DWATlowpc{} attribute, if present; otherwise,
458 it is undefined. If the base address is undefined, then any
459 DWARF entry or structure defined in terms of the base address
460 of that compilation unit is not valid.
463 \subsection{Skeleton Compilation Unit Entries}
464 \label{chap:skeletoncompilationunitentries}
465 \addtoindexx{compilation unit!skeleton}
466 \addtoindexx{skeleton compilation unit}
467 When generating a \splitDWARFobjectfile{} (see
468 Section \refersec{datarep:splitdwarfobjectfiles}), the
469 compilation unit in the \dotdebuginfo{} section is a "skeleton"
470 compilation unit with the tag \DWTAGcompileunit, which contains
471 \DWATdwoname{} and \DWATdwoid{} attributes as well as a subset of the
472 attributes of a full or partial compilation unit. In general,
473 it contains those attributes that are necessary for the consumer
474 to locate the object file where the split full compilation unit
475 can be found, and for the consumer to interpret references to
476 addresses in the program.
479 A skeleton compilation unit has no children.
481 A skeleton compilation unit has \DWATdwoname{} and
482 \DWATdwoid{} attributes:
484 \begin{enumerate}[1. ]
486 \item \livetarg{chap:DWATdwonameforunit}{}
487 A \DWATdwonameDEFN{} attribute
488 \addtoindexx{split DWARF object file name attribute}
490 null-terminated string containing the full or relative
493 (relative to the value of the \DWATcompdir{} attribute,
496 of the object file that contains the full
499 \item \livetarg{chap:DWATdwoidforunit}{}
500 A \DWATdwoidDEFN{} attribute\addtoindexx{unit identification attribute}
501 whose implementation-defined integer constant value,
502 known as the \CUsignature,
503 provides unique identification of this compilation unit
504 as well as the associated split compilation unit in the
505 object file named in the \DWATdwoname{}
506 attribute. For simplicity, the \DWATdwoidNAME{} attributes
507 in the skeleton compilation unit and the corresponding
508 split full compilation unit
509 (see Section \refersec{chap:splitfullcompilationunitentries})
510 must use the same form to encode this identification value.
512 \textit{The means of determining a \CUsignature{} does not
513 need to be similar or related to the means of determining a
518 A skeleton compilation unit may have additional
521 which are the same as for conventional compilation unit entries
524 from among the following:
526 \begin{enumerate}[1. ]
527 \addtocounter{enumi}{2}
529 Either a \DWATlowpc{} and \DWAThighpc{} pair of attributes
530 or a \DWATranges{} attribute.
534 A \DWATstmtlist{} attribute.
538 A \DWATcompdir{} attribute.
543 A \DWATuseUTFeight{} attribute.
546 \textit{This attribute applies to strings referred to by the skeleton
547 compilation unit entry itself, and strings in the associated line
549 The representation for strings in the object file referenced
550 by the \DWATdwoname{} attribute is determined by the presence
551 of a \DWATuseUTFeight{} attribute in the
553 full compilation unit
554 (see Section \refersec{chap:splitfullcompilationunitentries}).
559 A \DWATstroffsetsbase{} attribute, for indirect strings references
560 from the skeleton compilation unit.
564 A \DWATaddrbase{} attribute.
568 A \DWATrangesbase{} attribute.
573 All other attributes of a compilation unit entry (described
574 in Section \refersec{chap:fullandpartialcompilationunitentries})
575 should be placed in the split full compilation unit
576 (see \refersec{chap:splitfullcompilationunitentries}).
577 The attributes provided by the skeleton compilation
578 unit entry do not need to be repeated in the full compilation
579 unit entry, except for \DWATdwoid, which should appear in
580 both entries so that the consumer can verify that it has
581 found the correct object file.
583 \textit{The \DWATaddrbase{}, \DWATrangesbase{} and
584 \DWATstroffsetsbase{} attributes provide context that may be
585 necessary to interpret the contents
586 of the corresponding \splitDWARFobjectfile.}
588 \textit{The \DWATbasetypes{} attribute is not defined for a
589 skeleton compilation unit.}
592 \subsection{Split Full Compilation Unit Entries}
593 \label{chap:splitfullcompilationunitentries}
594 A \definition{split full compilation unit} is represented by a
595 debugging information entry with tag \DWTAGcompileunit.
596 It is very similar to a conventional full compilation unit but
597 is logically paired with a specific skeleton compilation unit while
598 being physically separate.
600 A split full compilation unit has a \DWATdwoid{} attribute:
601 \begin{enumerate}[1. ]
603 A \DWATdwoidDEFN{} attribute\addtoindexx{unit identification attribute}
604 whose implementation-defined integer constant value,
605 known as the \CUsignature,
606 provides unique identification of this compilation unit
607 as well as the associated skeleton compilation unit.
608 For simplicity, the \DWATdwoidNAME{} attributes in the
609 split compilation unit and the associated skeleton
610 compilation unit must use the same form to encode the
611 identification value.
618 A split full compilation unit may also have additional
621 which are the same as for conventional compilation unit entries
624 from among the following:
625 \begin{enumerate}[1. ]
626 \addtocounter{enumi}{1}
627 \item A \DWATname{} attribute.
630 \item A \DWATlanguage{} attribute.
633 \item A \DWATmacros{} attribute.
635 The value of this attribute is of class \CLASSmacptr{}, which is
636 an offset relative to the \dotdebugmacrodwo{} section.
639 \item A \DWATproducer{} attribute.
642 \item A \DWATidentifiercase{} attribute.
645 \item A \DWATmainsubprogram{} attribute.
648 \item A \DWATentrypc{} attribute.
653 \DWATuseUTFeight{} attribute.
658 \textit{The following attributes are not part of a
659 split full compilation unit entry but instead are inherited
660 (if present) from the corresponding skeleton compilation unit:
661 \DWATlowpc, \DWAThighpc, \DWATranges, \DWATstmtlist, \DWATcompdir,
663 \DWATstroffsetsbase, \DWATaddrbase{} and
666 \textit{The \DWATbasetypes{} attribute is not defined for a
667 split full compilation unit.}
671 \subsection{Type Unit Entries}
672 \label{chap:typeunitentries}
673 \addtoindexx{type unit}
674 \addtoindexx{type unit|see{\textit{also} compilation unit}}
675 \addtoindexx{compilation unit!\textit{see also} type unit}
676 An object file may contain any number of separate type
677 unit entries, each representing a single complete type
679 Each \addtoindex{type unit} must be uniquely identified by
680 an 8-byte signature, stored as part of the type unit, which
681 can be used to reference the type definition from debugging
682 information entries in other compilation units and type units.
684 Conventional and split type units are identical except for
685 the sections in which they are represented
686 (see \refersec{datarep:splitdwarfobjectfiles} for details).
687 \addtoindexx{conventional type unit}
688 \addtoindexx{split type unit}
690 Moreover, the \DWATstroffsetsbase{} attribute (see below) is not
691 used in a split type unit.
694 A type unit is represented by a debugging information entry
695 with the tag \DWTAGtypeunitTARG.
696 A \addtoindex{type unit entry} owns debugging
697 information entries that represent the definition of a single
698 type, plus additional debugging information entries that may
699 be necessary to include as part of the definition of the type.
702 A type unit entry may have the following attributes:
703 \begin{enumerate}[1. ]
706 \DWATlanguage{} attribute,
708 \addtoindexx{language attribute}
709 constant value is an integer code indicating the source
710 language used to define the type. The set of language names
711 and their meanings are given in Table \refersec{tab:languagenames}.
714 \item A \DWATstmtlist{} attribute\addtoindexx{statement list attribute}
715 whose value of class \CLASSlineptr{} points to the line number
716 information for this type unit.
718 \textit{Because type units do not describe any code, they
719 do not actually need a line number table, but the line number
720 headers contain a list of directories and file names that
721 may be referenced by the \DWATdeclfile{} attribute of the
722 type or part of its description.}
724 \textit{In an object file with a conventional compilation
725 unit entry, the type unit entries may refer to (share) the
726 line number table used by the compilation unit. In a type
727 unit located in a split compilation unit, the
728 \DWATstmtlistNAME{} attribute refers to a \doublequote{specialized}
729 line number table in the \dotdebuglinedwo{} section, which
730 contains only the list of directories and file names.}
732 \textit{All type unit entries in a \splitDWARFobjectfile{} may
733 (but are not required to) refer to the same
734 \addtoindex{specialized line number table}.}
736 \item A \DWATuseUTFeight{} attribute, which is a flag
737 whose presence indicates that all strings referred to by this type
738 unit entry, its children, and its associated
739 \addtoindex{specialized line number table},
740 are represented using the UTF-8 representation.
743 \DWATstroffsetsbase\addtoindexx{string offsets base attribute}
744 attribute, whose value is of class \CLASSstroffsetsptr.
745 This attribute points
746 to the first string offset of the type unit's contribution to
747 the \dotdebugstroffsets{} section. Indirect string references
748 (using \DWFORMstrx) within the type unit are interpreted
749 as indices relative to this base.
753 A \addtoindex{type unit} entry for a given type T owns a debugging
754 information entry that represents a defining declaration
755 of type T. If the type is nested within enclosing types or
756 namespaces, the debugging information entry for T is nested
757 within debugging information entries describing its containers;
758 otherwise, T is a direct child of the type unit entry.
760 A type unit entry may also own additional debugging information
761 entries that represent declarations of additional types that
762 are referenced by type T and have not themselves been placed in
763 separate type units. Like T, if an additional type U is nested
764 within enclosing types or namespaces, the debugging information
765 entry for U is nested within entries describing its containers;
766 otherwise, U is a direct child of the type unit entry.
768 The containing entries for types T and U are declarations,
769 and the outermost containing entry for any given type T or
770 U is a direct child of the type unit entry. The containing
771 entries may be shared among the additional types and between
772 T and the additional types.
776 Examples of these kinds of relationships are found in
777 Section \refersec{app:signaturecomputationexample} and
778 Section \refersec{app:declarationscompletingnondefiningdeclarations}.
783 \textit{Types are not required to be placed in type units. In general,
784 only large types such as structure, class, enumeration, and
785 union types included from header files should be considered
786 for separate type units. Base types and other small types
787 are not usually worth the overhead of placement in separate
788 type units. Types that are unlikely to be replicated, such
789 as those defined in the main source file, are also better
790 left in the main compilation unit.}
792 \section{Module, Namespace and Importing Entries}
793 \textit{Modules and namespaces provide a means to collect related
794 entities into a single entity and to manage the names of
797 \subsection{Module Entries}
798 \label{chap:moduleentries}
799 \textit{Several languages have the concept of a \doublequote{module.}
800 \addtoindexx{Modula-2}
801 A Modula\dash 2 definition module
802 \addtoindexx{Modula-2!definition module}
803 may be represented by a module
805 \addtoindex{declaration attribute}
806 (\DWATdeclaration). A
807 \addtoindex{Fortran 90} module
808 \addtoindexx{Fortran!module (Fortran 90)}
809 may also be represented by a module entry
810 (but no declaration attribute is warranted because \addtoindex{Fortran}
811 has no concept of a corresponding module body).}
813 A module is represented by a debugging information entry
815 tag \DWTAGmoduleTARG.
816 Module entries may own other
817 debugging information entries describing program entities
818 whose declaration scopes end at the end of the module itself.
820 If the module has a name, the module entry has a
821 \DWATname{} attribute
822 \addtoindexx{name attribute}
823 whose value is a null\dash terminated string containing
827 The \addtoindex{module entry} may have either a
831 \addtoindexx{high PC attribute}
833 \addtoindexx{low PC attribute}
835 \DWATranges{} attribute
836 \addtoindexx{ranges attribute}
837 whose values encode the contiguous or non-contiguous address
838 ranges, respectively, of the machine instructions generated for
839 the module initialization
840 code\hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}{}
841 (see Section \refersec{chap:codeaddressesandranges}).
843 \addtoindexx{entry PC attribute!for module initialization}
844 \DWATentrypc{} attribute whose value is the address of
845 the first executable instruction of that initialization code
846 (see Section \refersec{chap:entryaddress}).
849 If\hypertarget{chap:DWATprioritymodulepriority}{}
850 the module has been assigned a priority, it may have a
851 \addtoindexx{priority attribute}
852 \DWATpriorityDEFN{} attribute.
853 The value of this attribute is a
854 reference to another debugging information entry describing
855 a variable with a constant value. The value of this variable
856 is the actual constant value of the module\textquoteright s priority,
857 represented as it would be on the target architecture.
859 \subsection{Namespace Entries}
860 \label{chap:namespaceentries}
861 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
862 \addtoindexx{namespace (C++)}
863 implement name hiding, so that names of unrelated things
864 do not accidentally clash in the
865 \addtoindex{global namespace} when an
866 application is linked together.}
868 A namespace is represented by a debugging information entry
869 with the tag \DWTAGnamespaceTARG. A namespace extension
870 is\hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{}
871 represented by a \DWTAGnamespaceNAME{} entry with a
872 \DWATextensionDEFN{}\addtoindexx{extension attribute}
873 attribute referring to the previous extension, or if there
874 is no previous extension, to the original
875 \DWTAGnamespaceNAME{}
876 entry. A namespace extension entry does not need to duplicate
877 information in a previous extension entry of the namespace
878 nor need it duplicate information in the original namespace
879 entry. (Thus, for a namespace with a name,
880 a \DWATname{} attribute
881 \addtoindexx{name attribute}
882 need only be attached directly to the original
883 \DWTAGnamespaceNAME{} entry.)
886 Namespace and namespace extension entries may own
887 \addtoindexx{namespace extension entry}
889 \addtoindexx{namespace declaration entry}
890 debugging information entries describing program entities
891 whose declarations occur in the namespace.
895 A namespace may have a
896 \DWATexportsymbolsDEFN{}\livetarg{chap:DWATexportsymbolsofnamespace}{}
897 attribute\addtoindexx{export symbols attribute}
898 \addtoindexx{inline namespace|see{\textit{also} export symbols attribute}}
901 is a \CLASSflag{} which
903 indicates that all member names defined within the
904 namespace may be referenced as if they were defined within
905 the containing namespace.
907 \textit{This may be used to describe an \addtoindex{inline namespace} in \addtoindex{C++}}.
909 If a type, variable, or function declared in a namespace is
910 defined outside of the body of the namespace declaration,
911 that type, variable, or function definition entry has a
912 \DWATspecification{} attribute
913 \addtoindexx{specification attribute}
914 whose value is a \livelink{chap:classreference}{reference} to the
915 debugging information entry representing the declaration of
916 the type, variable or function. Type, variable, or function
918 \DWATspecification{} attribute
919 \addtoindexx{specification attribute}
921 to duplicate information provided by the declaration entry
922 referenced by the specification attribute.
924 \textit{The \addtoindex{C++} \addtoindex{global namespace}
926 \addtoindexx{global namespace|see{namespace (C++), global}}
928 \addtoindexx{namespace (C++)!global}
930 \texttt{::f}, for example) is not explicitly represented in
931 DWARF with a namespace entry (thus mirroring the situation
932 in \addtoindex{C++} source).
933 Global items may be simply declared with no
934 reference to a namespace.}
936 \textit{The \addtoindex{C++}
937 compilation unit specific \doublequote{unnamed namespace} may
938 \addtoindexx{namespace (C++)!unnamed}
939 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
940 be represented by a namespace entry with no name attribute in
941 the original namespace declaration entry (and therefore no name
942 attribute in any namespace extension entry of this namespace).
945 \textit{A compiler emitting namespace information may choose to
946 explicitly represent namespace extensions, or to represent the
947 final namespace declaration of a compilation unit; this is a
948 quality-of-implementation issue and no specific requirements
949 are given here. If only the final namespace is represented,
950 \addtoindexx{namespace (C++)!using declaration}
951 it is impossible for a debugger to interpret using declaration
952 references in exactly the manner defined by the
953 \addtoindex{C++} language.
958 \textit{For \addtoindex{C++} namespace examples,
959 see Appendix \refersec{app:namespaceexamples}.}
963 \subsection{Imported (or Renamed) Declaration Entries}
964 \label{chap:importedorrenameddeclarationentries}
965 \textit{Some languages support the concept of importing into or making
966 accessible in a given unit
968 certain declarations that occur
971 module or scope. An imported declaration may sometimes be
975 An imported declaration is represented by one or
976 \addtoindexx{imported declaration entry}
977 more debugging information entries with the
978 tag \DWTAGimporteddeclarationTARG.
979 When\hypertarget{chap:DWATimportimporteddeclaration}{}
980 an overloaded entity is imported, there is one imported
981 declaration entry for each overloading.
982 Each imported declaration entry has a
983 \DWATimportDEFN{} attribute,\addtoindexx{import attribute}
984 whose value is a \livelink{chap:classreference}{reference} to the
985 debugging information entry representing the declaration that
988 An imported declaration may also have a \DWATname{}
989 attribute\addtoindexx{name attribute}
990 whose value is a null-terminated string containing the
994 imported entity is to be known in the context of the imported
995 declaration entry (which may be different than the name of
996 the entity being imported). If no name is present, then the
997 name by which the entity is to be known is the same as the
998 name of the entity being imported.
1000 An imported declaration entry with a name attribute may be
1001 used as a general means to rename or provide an alias for
1002 \addtoindexx{alias declaration|see{imported declaration entry}}
1003 an entity, regardless of the context in which the importing
1004 declaration or the imported entity occurs.
1006 \textit{A \addtoindex{C++}
1007 namespace alias\hypertarget{chap:DWATimportnamespacealias}{}
1008 may be represented by an imported declaration entry
1009 \addtoindexx{namespace (C++)!alias}
1010 with a name attribute whose value is
1011 a null-terminated string containing the alias name
1013 and a \DWATimportDEFN{} attribute
1014 whose value is a \livelink{chap:classreference}{reference} to the
1015 applicable original namespace or namespace extension entry.}
1017 \textit{A \addtoindex{C++} using declaration may be represented
1019 imported\hypertarget{chap:DWATimportnamespaceusingdeclaration}{}
1020 \addtoindexx{namespace (C++)!using declaration}
1021 declaration entries. When the using declaration
1022 refers to an overloaded function, there is one imported
1023 declaration entry corresponding to each overloading. Each
1024 imported declaration entry has no name attribute but it does
1025 have a \DWATimportDEFN{} attribute that refers to the entry for the
1026 entity being imported. (\addtoindex{C++}
1027 provides no means to \doublequote{rename}
1028 an imported entity, other than a namespace).}
1031 \textit{A \addtoindex{Fortran} use statement
1032 \addtoindexx{Fortran!use statement}
1033 \addtoindexx{use statement|see {Fortran, use statement}}
1034 with an \doublequote{only list} may be
1035 represented by a series of imported declaration entries,
1036 one (or more) for each entity that is imported. An entity
1037 \addtoindexx{renamed declaration|see{imported declaration entry}}
1038 that is renamed in the importing context may be represented
1039 by an imported declaration entry with a name attribute that
1040 specifies the new local name.
1043 \subsection{Imported Module Entries}
1044 \label{chap:importedmoduleentries}
1046 \textit{Some languages support the concept of importing into or making
1047 accessible in a given unit all of the declarations contained
1048 within a separate module or namespace.
1051 An imported module declaration is represented by a debugging
1052 information entry with
1053 \addtoindexx{imported module attribute}
1055 \addtoindexx{imported module entry}
1056 tag \DWTAGimportedmoduleTARG.
1058 imported module entry contains a
1059 \DWATimport{} attribute
1060 \addtoindexx{import attribute}
1061 whose value is a \livelink{chap:classreference}{reference}
1062 to the module or namespace entry
1063 containing the definition and/or declaration entries for
1064 the entities that are to be imported into the context of the
1065 imported module entry.
1067 An imported module declaration may own a set of imported
1068 declaration entries, each of which refers to an entry in the
1069 module whose corresponding entity is to be known in the context
1070 of the imported module declaration by a name other than its
1071 name in that module. Any entity in the module that is not
1072 renamed in this way is known in the context of the imported
1073 module entry by the same name as it is declared in the module.
1075 \textit{A \addtoindex{C++} using directive
1076 \addtoindexx{namespace (C++)!using directive}
1077 \addtoindexx{using directive|see {namespace (C++), using directive}}
1078 may be represented by an imported
1079 module\hypertarget{chap:DWATimportnamespaceusingdirective}{}
1080 entry, with a \DWATimportDEFN{} attribute referring to the namespace
1081 entry of the appropriate extension of the namespace (which
1082 might be the original namespace entry) and no owned entries.
1085 \textit{A \addtoindex{Fortran} use statement
1086 \addtoindexx{Fortran!use statement}
1087 with a \doublequote{rename list} may be
1088 represented by an imported module entry with an import
1089 attribute referring to the module and owned entries
1090 corresponding to those entities that are renamed as part of
1094 \textit{A \addtoindex{Fortran} use statement
1095 \addtoindexx{Fortran!use statement}
1096 with neither a \doublequote{rename list} nor
1097 an \doublequote{only list} may be represented by an imported module
1098 entry with an import attribute referring to the module and
1099 no owned child entries.
1102 \textit{A use statement with an \doublequote{only list} is represented by a
1103 series of individual imported declaration entries as described
1104 in Section \refersec{chap:importedorrenameddeclarationentries}.
1108 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
1109 \addtoindexx{Fortran!use statement}
1110 itself imported by a use statement without an explicit mention
1111 may be represented by an imported declaration entry that refers
1112 to the original debugging information entry. For example, given
1129 \textit{the imported declaration entry for Q within module C refers
1130 directly to the variable declaration entry for X in module A
1131 because there is no explicit representation for X in module B.
1134 \textit{A similar situation arises for a \addtoindex{C++} using declaration
1135 \addtoindexx{namespace (C++)!using declaration}
1136 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
1137 that imports an entity in terms of a namespace alias. See
1138 Appendix \refersec{app:namespaceexamples}
1142 \subsection{Imported Unit Entries}
1143 \label{chap:importedunitentries}
1144 \hypertarget{chap:DWATimportimportedunit}{}
1145 The place where a normal or partial compilation unit is imported is
1146 represented by a debugging information entry with the
1147 \addtoindexx{imported unit entry}
1148 tag \DWTAGimportedunitTARG.
1149 An imported unit entry contains a
1150 \DWATimportDEFN{} attribute\addtoindexx{import attribute}
1151 whose value is a \livelink{chap:classreference}{reference} to the
1152 normal or partial compilation unit whose declarations logically
1153 belong at the place of the imported unit entry.
1155 \textit{An imported unit entry does not necessarily correspond to
1156 any entity or construct in the source program. It is merely
1157 \doublequote{glue} used to relate a partial unit, or a compilation
1158 unit used as a partial unit, to a place in some other
1161 \section{Subroutine and Entry Point Entries}
1162 \label{chap:subroutineandentrypointentries}
1164 The following tags exist to describe
1165 debugging information entries
1166 \addtoindexx{function entry|see{subroutine entry}}
1168 \addtoindexx{subroutine entry}
1170 \addtoindexx{subprogram entry}
1172 % FIXME: is entry point entry the right index 'entry'?
1173 \addtoindexx{entry point entry}
1176 \begin{tabular}{lp{9.0cm}}
1177 \DWTAGsubprogramTARG{} & A subroutine or function \\
1178 \DWTAGinlinedsubroutine{} & A particular inlined
1179 \addtoindexx{inlined subprogram entry}
1180 instance of a subroutine or function \\
1181 \DWTAGentrypointTARG{} & An alternate entry point \\
1186 \subsection{General Subroutine and Entry Point Information}
1187 \label{chap:generalsubroutineandentrypointinformation}
1188 The subroutine or entry point entry has a \DWATname{}
1189 attribute whose value is a null-terminated string containing the
1190 subroutine or entry point name.
1192 It may also have a \DWATlinkagename{} attribute as
1193 described in Section \refersec{chap:linkagenames}.
1195 If the name of the subroutine described by an entry with the
1196 \addtoindexx{subprogram entry}
1197 tag \DWTAGsubprogram{}\hypertarget{chap:DWATexternalexternalsubroutine}{}
1198 is visible outside of its containing
1199 compilation unit, that entry has a
1200 \DWATexternalDEFN{} attribute,\addtoindexx{external attribute}
1201 which is a \livelink{chap:classflag}{flag}.
1203 \textit{Additional attributes for functions that are members of a
1204 class or structure are described in
1205 Section \refersec{chap:memberfunctionentries}.
1208 A\hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}{}
1209 subroutine entry may contain a
1210 \DWATmainsubprogramDEFN{} attribute
1211 \addtoindexx{main subprogram attribute}
1213 a \CLASSflag{} whose presence indicates that the
1214 subroutine has been identified as the starting function of
1215 the program. If more than one subprogram contains this
1217 any one of them may be the starting subroutine of the program.
1221 See also Section \refersec{chap:unitentries}) regarding the
1222 related use of this attribute to indicate that a compilation
1223 unit contains the main subroutine of a program.
1227 \subsubsection{Calling Convention Information}
1228 \hypertarget{chap:DWATcallingconventionforsubprograms}{}
1229 A subroutine entry may contain a
1230 \DWATcallingconventionDEFN{}
1231 \addtoindexx{calling convention attribute!for subprogram}
1232 attribute, whose value is an
1233 \livelink{chap:classconstant}{integer constant}. The set of
1234 \addtoindexi{calling convention codes for subroutines}{calling convention codes!for subroutines}
1235 is given in Table \refersec{tab:callingconventioncodesforsubroutines}.
1237 \begin{simplenametable}[1.4in]{Calling convention codes for subroutines}{tab:callingconventioncodesforsubroutines}
1241 \end{simplenametable}
1243 If this attribute is not present, or its value is the constant
1244 \DWCCnormalTARG, then the subroutine may be safely called by
1245 obeying the \doublequote{standard} calling conventions of the target
1246 architecture. If the value of the calling convention attribute
1247 is the constant \DWCCnocallTARG, the subroutine does not obey
1248 standard calling conventions, and it may not be safe for the
1249 debugger to call this subroutine.
1251 \textit{Note that \DWCCnormal{} is also used as a calling convention
1252 code for certain types
1253 (see Table \refersec{tab:callingconventioncodesfortypes}).}
1255 If the semantics of the language of the compilation unit
1256 containing the subroutine entry distinguishes between ordinary
1257 subroutines and subroutines that can serve as the \doublequote{main
1258 program,} that is, subroutines that cannot be called
1259 directly according to the ordinary calling conventions,
1260 then the debugging information entry for such a subroutine
1261 may have a calling convention attribute whose value is the
1262 constant \DWCCprogramTARG.
1264 \textit{A common debugger feature is to allow the debugger user to call
1265 a subroutine within the subject program. In certain cases,
1266 however, the generated code for a subroutine will not obey
1267 the standard calling conventions for the target architecture
1268 and will therefore not be safe to call from within a debugger.}
1270 \textit{The \DWCCprogram{}
1271 value is intended to support \addtoindex{Fortran} main
1272 \addtoindexx{Fortran!main program}
1273 programs which in some implementations may not be callable
1274 or which must be invoked in a special way. It is not intended
1275 as a way of finding the entry address for the program.}
1278 \subsubsection{Miscellaneous Subprogram Properties}
1279 \textit{In \addtoindex{C}
1280 there is a difference between the types of functions
1281 declared using function prototype style declarations and
1282 those declared using non-prototype declarations.}
1284 A subroutine entry declared with a function prototype style
1285 declaration may have a
1286 \addtoindexx{prototyped attribute}
1288 \DWATprototypedDEFN{} attribute, which is
1290 The attribute indicates whether a subroutine entry point corresponds
1291 to a function declaration that includes parameter prototype information.
1296 A subprogram entry may have
1297 a\hypertarget{chap:DWATelementalelementalpropertyofasubroutine}{}
1298 \DWATelementalDEFN{} attribute,\addtoindexx{elemental attribute}
1299 which is a \livelink{chap:classflag}{flag}.
1300 The attribute indicates whether the subroutine
1301 or entry point was declared with the \doublequote{elemental} keyword
1304 A\hypertarget{chap:DWATpurepurepropertyofasubroutine}{}
1305 subprogram entry may have a
1306 \addtoindexx{pure attribute}
1307 \DWATpureDEFN{} attribute, which is
1308 a \livelink{chap:classflag}{flag}.
1309 The attribute indicates whether the subroutine was
1310 declared with the \doublequote{pure} keyword or property.
1312 A\hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}{}
1313 subprogram entry may have a
1314 \addtoindexx{recursive attribute}
1315 \DWATrecursiveDEFN{} attribute, which
1316 is a \livelink{chap:classflag}{flag}.
1317 The attribute indicates whether the subroutine
1318 or entry point was declared with the \doublequote{recursive} keyword
1321 A subprogram entry may have a
1323 \livetargi{chap:DWATnoreturnofsubprogram}{attribute}{noreturn attribute},
1324 which is a \CLASSflag. The attribute
1325 indicates whether the subprogram was declared with the \doublequote{noreturn} keyword or property
1326 indicating that the subprogram can be called, but will never return to its caller.
1329 \textit{The \addtoindex{Fortran}
1330 language allows the keywords \texttt{elemental}, \texttt{pure}
1331 and \texttt{recursive} to be included as part of the declaration of
1332 a subroutine; these attributes reflect that usage. These
1333 attributes are not relevant for languages that do not support
1334 similar keywords or syntax. In particular, the \DWATrecursiveNAME{}
1335 attribute is neither needed nor appropriate in languages such
1337 where functions support recursion by default.
1341 \subsubsection{Call Site-Related Attributes}
1342 \textit{While subprogram attributes in the
1347 information about the subprogram and
1351 entry point(s) as a whole,
1352 the following attributes provide summary information about the calls
1353 that occur within a subprogram.}
1355 A subroutine entry may have
1357 \DWATcallalltailcalls,
1358 \DWATcallallcalls{} and/or \DWATcallallsourcecalls{}
1360 attributes, each of which is a
1361 \livelink{chap:classflag}{flag}.
1362 \addtoindexx{call site summary information}
1363 \addtoindexx{subroutine call site summary attributes}
1364 These flags indicate the completeness of the call site
1365 information provided by call site entries (see
1366 Section \refersec{chap:callsiteentries}) within the subprogram.
1368 The \DWATcallalltailcallsDEFN{}
1369 \livetargi{chap:DWATcallalltailcallsofasubprogram}{attribute}{all tail calls summary attribute}
1370 indicates that every tail call
1371 that occurs in the code for the subprogram is described by a
1372 \DWTAGcallsite{} entry.
1373 (There may or may not be other non-tail calls to some of the same
1374 target subprograms.)
1376 The \DWATcallallcallsDEFN{}
1377 \livetargi{chap:DWATcallallcallsofasubprogram}{attribute}{all calls summary attribute}
1378 indicates that every non-inlined call
1379 (either a tail call or a normal call) that occurs in the code for the subprogram
1380 is described by a \DWTAGcallsite{} entry.
1382 The \DWATcallallsourcecallsDEFN{}
1383 \livetargi{chap:DWATcallallsourcecallsofasubprogram}{attribute}{all source calls summary attribute}
1384 indicates that every call that occurs in the
1385 code for the subprogram, including every call inlined into it, is described by either a
1386 \DWTAGcallsite{} entry or a \DWTAGinlinedsubroutine{} entry; further, any call
1387 that is optimized out is nonetheless also described using a \DWTAGcallsite{} entry
1388 that has neither a \DWATcallpc{} nor \DWATcallreturnpc{} attribute.
1390 \textit{The \DWATcallallsourcecallsNAME{} attribute is intended for debugging
1391 information format consumers that
1399 the \DWATcallallsourcecalls{} attribute is present then the
1400 \DWATcallallcalls{} and \DWATcallalltailcalls{} attributes are
1401 also implicitly present. Similarly, if the
1402 \DWATcallallcalls{} attribute is present then the \DWATcallalltailcalls{}
1403 attribute is implicitly present.
1407 \subsection{Subroutine and Entry Point Return Types}
1408 \label{chap:subroutineandentrypointreturntypes}
1410 If\hypertarget{chap:DWATtypetypeofsubroutinereturn}{}
1411 the subroutine or entry point
1412 \addtoindexx{return type of subroutine}
1413 is a function that returns a
1414 value, then its debugging information entry has
1415 \addtoindexx{type attribute}
1416 a \DWATtypeDEFN{} attribute
1417 to denote the type returned by that function.
1419 \textit{Debugging information entries for
1420 \addtoindex{C} void functions should
1421 not have an attribute for the return type. }
1423 \textit{Debugging information entries for declarations of \addtoindex{C++}
1424 member functions with an
1425 \autoreturntype{} specifier should use an unspecified type entry (see
1426 Section \refersec{chap:unspecifiedtypeentries}).
1427 The debugging information entry for the corresponding definition
1428 should provide the deduced return type. This practice causes the description of
1429 the containing class to be consistent across compilation units, allowing the class
1430 declaration to be placed into a separate type unit if desired.}
1433 \subsection{Subroutine and Entry Point Locations}
1434 \label{chap:subroutineandentrypointlocations}
1436 A subroutine entry may have either a \DWATlowpc{} and
1437 \DWAThighpc{} pair of attributes or a \DWATranges{} attribute
1438 \addtoindexx{ranges attribute}
1440 \addtoindexx{high PC attribute}
1442 \addtoindexx{low PC attribute}
1443 encode the contiguous or non-contiguous address
1444 ranges, respectively, of the machine instructions generated
1445 for the subroutine (see
1446 Section \refersec{chap:codeaddressesandranges}).
1448 A\hypertarget{chap:DWATentrypcentryaddressofsubprogram}{}
1449 subroutine entry may also have a
1450 \addtoindexx{entry PC attribute!for subroutine}
1451 \DWATentrypc{} attribute
1452 whose value is the address of the first executable instruction
1453 of the subroutine (see
1454 Section \refersec{chap:entryaddress}).
1456 An entry point has a \DWATlowpc{} attribute whose value is the
1457 relocated address of the first machine instruction generated
1458 for the entry point.
1461 %\textit{While the \DWATentrypc{} attribute
1462 %\addtoindexx{entry pc attribute!for subroutine}
1463 %might also seem appropriate for this purpose, historically the
1464 %\DWATlowpc{} attribute was used before the
1465 %\DWATentrypc{} was introduced (in
1466 %\addtoindex{DWARF Version 3}).
1467 %There is insufficient reason to change this.}
1469 Subroutines and entry points may also have
1470 \DWATsegment{}\hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}{}
1471 \addtoindexx{segment attribute} and
1472 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
1473 attributes, as appropriate, to specify
1474 which segments the code for the subroutine resides in and
1475 the addressing mode to be used in calling that subroutine.
1477 A subroutine entry representing a subroutine declaration
1478 that is not also a definition does not have code address or
1482 \subsection{Declarations Owned by Subroutines and Entry Points}
1483 \label{chap:declarationsownedbysubroutinesandentrypoints}
1484 \addtoindexx{subroutine formal parameters}
1485 The declarations enclosed by a subroutine or entry point are
1486 represented by debugging information entries that are owned
1487 by the subroutine or entry point entry. Entries representing
1488 \addtoindexx{formal parameter}
1489 the formal parameters of the subroutine or entry point appear
1490 in the same order as the corresponding declarations in the
1494 \textit{There is no ordering requirement for entries for declarations
1495 other than formal parameters. The formal parameter
1496 entries may be interspersed with other entries used by formal
1497 parameter entries, such as type entries.}
1499 The unspecified (sometimes called \doublequote{varying})
1500 parameters of a subroutine parameter list are
1501 represented by a debugging information
1502 entry\addtoindexx{unspecified parameters entry}
1503 with the tag \DWTAGunspecifiedparametersTARG.
1506 The entry for a subroutine that includes a
1507 \addtoindex{Fortran}
1508 \addtoindexx{Fortran!common block}
1509 \livelink{chap:fortrancommonblock}{common}
1510 \livelink{chap:commonblockentry}{block}
1511 \addtoindexx{common block|see{Fortran common block}}
1512 has a child entry with the
1513 tag \DWTAGcommoninclusionTARG.
1514 The\hypertarget{chap:commonreferencecommonblockusage}{}
1515 common inclusion entry has a
1516 \DWATcommonreferenceDEFN{} attribute
1517 \addtoindexx{common block reference attribute}
1518 whose value is a \livelink{chap:classreference}{reference}
1519 to the debugging information entry
1520 for the common \nolink{block} being included
1521 (see Section \refersec{chap:commonblockentries}).
1523 \subsection{Low-Level Information}
1524 \label{chap:lowlevelinformation}
1526 A\hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{}
1527 subroutine or entry point entry may have a
1528 \addtoindexx{return address attribute}
1529 \DWATreturnaddrDEFN{}
1530 attribute, whose value is a location description. The location
1531 specified is the place where the return address for the
1532 subroutine or entry point is stored.
1534 A\hypertarget{chap:DWATframebasesubroutineframebaseaddress}{}
1535 subroutine or entry point entry may also have a
1536 \addtoindexx{frame base attribute}
1537 \DWATframebaseDEFN{} attribute, whose value is a location
1538 description that describes the \doublequote{frame base} for the
1539 subroutine or entry point. If the location description is
1540 a simple register location description, the given register
1541 contains the frame base address. If the location description is
1542 a DWARF expression, the result of evaluating that expression
1543 is the frame base address. Finally, for a
1544 \addtoindex{location list},
1545 this interpretation applies to each location description
1546 contained in the list of \addtoindex{location list} entries.
1548 \textit{The use of one of the \DWOPregn{}
1549 operations in this context is equivalent to using
1550 \DWOPbregn(0) but more
1551 compact. However, these are not equivalent in general.}
1554 \textit{The frame base for a subprogram is typically an address
1555 relative to the first unit of storage allocated for the
1556 subprogram\textquoteright s stack frame. The \DWATframebase{} attribute
1557 can be used in several ways:}
1558 \begin{enumerate}[1. ]
1559 \item \textit{In subprograms that need
1560 \addtoindexx{location list}
1561 location lists to locate local
1562 variables, the \DWATframebase{} can hold the needed location
1563 list, while all variables\textquoteright\ location descriptions can be
1564 simpler ones involving the frame base.}
1566 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1567 within nested routines.
1568 (See also \DWATstaticlink, below)}
1572 \textit{Some languages support nested subroutines. In such languages,
1573 it is possible to reference the local variables of an
1574 outer subroutine from within an inner subroutine. The
1575 \DWATstaticlink{} and \DWATframebase{} attributes allow
1576 debuggers to support this same kind of referencing.}
1578 If\hypertarget{chap:DWATstaticlinklocationofuplevelframe}{}
1579 a subroutine or entry point is nested, it may have a
1580 \addtoindexx{address!uplevel|see {static link attribute}}
1581 \addtoindexx{uplevel address|see {static link attribute}}
1582 \DWATstaticlinkDEFN{} attribute, whose value is a location
1583 description that computes the frame base of the relevant
1584 instance of the subroutine that immediately encloses the
1585 subroutine or entry point.
1587 In the context of supporting nested subroutines, the
1588 \DWATframebase{} attribute value should obey the following
1591 \begin{enumerate}[1. ]
1592 \item It should compute a value that does not change during the
1593 life of the subprogram, and
1595 \item The computed value should be unique among instances of
1596 the same subroutine. (For typical \DWATframebase{} use, this
1597 means that a recursive subroutine\textquoteright s stack frame must have
1601 \textit{If a debugger is attempting to resolve an up\dash level reference
1602 to a variable, it uses the nesting structure of DWARF to
1603 determine which subroutine is the lexical parent and the
1604 \DWATstaticlink{} value to identify the appropriate active
1605 frame of the parent. It can then attempt to find the reference
1606 within the context of the parent.}
1610 \subsection{Types Thrown by Exceptions}
1611 \label{chap:typesthrownbyexceptions}
1613 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1614 it may validly throw.}
1616 If a subroutine explicitly declares that it may throw
1617 \addtoindexx{exception thrown|see{thrown type entry}}
1619 \addtoindexx{thrown exception|see{thrown type entry}}
1620 exception of one or more types, each such type is
1621 represented by a debugging information entry with
1622 \addtoindexx{thrown type entry}
1624 \DWTAGthrowntypeTARG.
1625 Each such entry is a child of the entry
1626 representing the subroutine that may throw this type. Each
1627 thrown type entry contains
1628 \addtoindexx{type attribute}
1629 a \DWATtype{} attribute, whose
1630 value is a \livelink{chap:classreference}{reference}
1631 to an entry describing the type of the
1632 exception that may be thrown.
1634 \subsection{Function Template Instantiations}
1635 \label{chap:functiontemplateinstantiations}
1637 \textit{In \addtoindex{C++}, a function template is a generic definition of
1638 a function that is instantiated differently for calls with
1639 values of different types. DWARF does not represent the generic
1640 template definition, but does represent each instantiation.}
1643 A \addtoindex{function template instantiation}\addtoindexx{template instantiation!function}
1644 is represented by a debugging information entry with the
1645 \addtoindexx{subprogram entry!use for template instantiation}
1646 tag \DWTAGsubprogram.
1648 exceptions, such an entry will contain the same attributes and
1649 will have the same types of child entries as would an entry
1650 for a subroutine defined explicitly using the instantiation
1651 types and values. The exceptions are:
1653 \begin{enumerate}[1. ]
1654 \item Template parameters are described and referenced as specified in
1655 Section \refersec{chap:templateparameters}.
1658 \item If the compiler has generated a
1663 to hold the template instantiation and that compilation unit
1664 has a different name from the compilation unit containing
1665 the template definition, the name attribute for the debugging
1666 information entry representing that compilation unit is empty
1669 \item If the subprogram entry representing the template
1670 instantiation or any of its child entries contain declaration
1671 coordinate attributes, those attributes refer to the source
1672 for the template definition, not to any source generated
1673 artificially by the compiler for this instantiation.
1678 \subsection{Inlinable and Inlined Subroutines}
1679 \label{chap:inlinedsubroutines}
1680 A declaration or a definition of an inlinable subroutine
1681 is represented by a debugging information entry with the
1682 tag \DWTAGsubprogram.
1683 The entry for a subroutine
1684 \addtoindexx{subprogram entry!use in inlined subprogram}
1685 that is\hypertarget{chap:DWATinlineinlinedsubroutine}{}
1686 explicitly declared to be available for inline expansion or
1687 that was expanded inline implicitly by the compiler has a
1688 \addtoindexx{inline attribute}
1689 \DWATinlineDEFN{} attribute whose value is an
1690 \livelink{chap:classconstant}{integer constant}. The
1691 set of values for the \DWATinline{} attribute is given in
1692 Table \refersec{tab:inlinecodes}.
1696 \caption{Inline codes}
1697 \label{tab:inlinecodes}
1698 \begin{tabular}{l|P{8cm}}
1700 Name&Meaning\\ \hline
1701 \DWINLnotinlinedTARG{} & Not declared inline nor inlined by the
1702 \mbox{compiler} (equivalent to the absence of the
1703 containing \DWATinline{} attribute) \\
1704 \DWINLinlinedTARG{} & Not declared inline but inlined by the \mbox{compiler} \\
1705 \DWINLdeclarednotinlinedTARG{} & Declared inline but
1706 not inlined by the \mbox{compiler} \\
1707 \DWINLdeclaredinlinedTARG{} & Declared inline and inlined by the
1713 \textit{In \addtoindex{C++}, a function or a constructor declared with
1714 \addttindex{constexpr} is implicitly declared inline. The abstract
1718 Section \refersec{chap:abstractinstances})
1720 is represented by a debugging information
1721 entry with the tag \DWTAGsubprogram. Such an entry has a
1722 \DWATinline{} attribute whose value is \DWINLinlined.}
1725 \subsubsection{Abstract Instances}
1726 \label{chap:abstractinstances}
1727 Any subroutine entry that contains a
1728 \DWATinlineDEFN{} attribute\addtoindexx{inline attribute}
1729 whose value is other than
1733 \definition{abstract instance root}.
1735 \addtoindexx{abstract instance!root}
1736 \hypertarget{chap:DWATinlineabstracttinstance}{}
1737 Any debugging information entry that is owned (either
1738 directly or indirectly) by an abstract instance root
1741 \definition{abstract instance entry.}\addtoindexx{abstract instance!entry}
1743 Any set of abstract instance entries that are all
1744 children (either directly or indirectly) of some abstract
1745 instance root, together with the root itself, is known as an
1747 \definition{abstract instance tree.}\addtoindexx{abstract instance!tree}
1749 However, in the case where an abstract instance tree is
1750 nested within another abstract instance tree, the entries in the
1751 \addtoindex{nested abstract instance}
1752 tree are not considered to be entries in the outer abstract
1755 Each abstract instance root is either part of a larger
1756 \addtoindexx{abstract instance!root}
1757 tree (which gives a context for the root) or
1758 \addtoindexx{specification attribute}
1760 \DWATspecification{}
1761 to refer to the declaration in context.
1763 \textit{For example, in \addtoindex{C++} the context might be a namespace
1764 declaration or a class declaration.}
1766 \textit{Abstract instance trees are defined so that no entry is part
1767 of more than one abstract instance tree.
1773 and children in an abstract instance are shared
1774 by all concrete instances (see Section \refersec{chap:concreteinstances}).
1777 A debugging information entry that is a member of an abstract
1778 instance tree should not contain any attributes which describe
1779 aspects of the subroutine which vary between distinct inlined
1780 expansions or distinct out-of-line expansions. For example,
1781 \addtoindexx{entry pc attribute!and abstract instance}
1792 \addtoindexx{location attribute!and abstract instance}
1794 \addtoindexx{ranges attribute!and abstract instance}
1796 \addtoindexx{high PC attribute!and abstract instance}
1798 \addtoindexx{low PC attribute!and abstract instance}
1800 \addtoindexx{segment attribute!and abstract instance}
1802 \addtoindexx{return address attribute!and abstract instance}
1804 \addtoindexx{segment attribute!and abstract instance}
1806 \addtoindexx{start scope attribute!and abstract instance}
1810 \textit{It would not make sense normally to put these attributes into
1811 abstract instance entries since such entries do not represent
1812 actual (concrete) instances and thus do not actually exist at
1813 run\dash time. However,
1814 see Appendix \refersec{app:inlineouteronenormalinner}
1815 for a contrary example.}
1817 The rules for the relative location of entries belonging to
1818 abstract instance trees are exactly the same as for other
1819 similar types of entries that are not abstract. Specifically,
1820 the rule that requires that an entry representing a declaration
1821 be a direct child of the entry representing the scope of the
1822 declaration applies equally to both abstract and non-abstract
1823 entries. Also, the ordering rules for formal parameter entries,
1824 member entries, and so on, all apply regardless of whether
1825 or not a given entry is abstract.
1829 \subsubsection{Concrete Instances}
1831 \label{chap:concreteinstances}
1833 Each inline expansion of a subroutine is represented
1834 by a debugging information entry with the
1835 tag \DWTAGinlinedsubroutineTARG.
1836 Each such entry should be a direct
1837 child of the entry that represents the scope within which
1838 the inlining occurs.
1841 Each inlined subroutine entry may have either a
1843 and \DWAThighpc{} pair
1845 \addtoindexx{high PC attribute}
1847 \addtoindexx{low PC attribute}
1849 \addtoindexx{ranges attribute}
1852 attribute whose values encode the contiguous or non-contiguous
1853 address ranges, respectively, of the machine instructions
1854 generated for the inlined subroutine (see
1855 Section \referfol{chap:codeaddressesandranges}).
1856 An\hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}{}
1857 inlined subroutine entry may
1858 \addtoindexx{inlined subprogram entry!in concrete instance}
1860 \addtoindexx{inlined subprogram entry}
1862 \addtoindexx{entry PC attribute!for inlined subprogram}
1865 attribute, representing the first executable instruction of
1866 the inline expansion (see
1867 Section \refersec{chap:entryaddress}).
1869 % Positions of the 3 targets here is a bit arbitrary.
1870 An inlined\hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{}
1871 subroutine\hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{}
1872 entry\hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{}
1873 may also have \DWATcallfileDEFN,
1874 \DWATcalllineDEFN{} and \DWATcallcolumnDEFN{} attributes,
1875 \addtoindexx{inlined call location attributes}
1877 value is an \livelink{chap:classconstant}{integer constant}.
1878 These attributes represent the
1879 source file, source line number, and source column number,
1880 respectively, of the first character of the statement or
1881 expression that caused the inline expansion. The call file,
1882 call line, and call column attributes are interpreted in
1883 the same way as the declaration file, declaration line, and
1884 declaration column attributes, respectively (see
1885 Section \refersec{chap:declarationcoordinates}).
1887 \textit{The call file, call line and call column coordinates do not
1888 describe the coordinates of the subroutine declaration that
1889 was inlined, rather they describe the coordinates of the call.
1892 An inlined subroutine entry may have
1893 a\hypertarget{chap:DWATconstexprcompiletimeconstantfunction}{}
1894 \DWATconstexprDEFN{} attribute,\addtoindexx{constant expression attribute}
1895 which is a \livelink{chap:classflag}{flag}
1896 whose presence indicates that the
1897 subroutine has been evaluated as a compile\dash time constant. Such
1898 an entry may also have a \DWATconstvalue{} attribute,
1899 whose value may be of any form that is appropriate for the
1900 representation of the subroutine's return value. The value of
1901 this attribute is the actual return value of the subroutine,
1902 represented as it would be on the target architecture.
1904 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1905 \addttindex{constexpr}
1906 is called with constant expressions, then the corresponding
1907 concrete inlined instance has a
1908 \DWATconstexpr{} attribute,
1909 as well as a \DWATconstvalue{} attribute whose value represents
1910 the actual return value of the concrete inlined instance.}
1912 Any debugging information entry that is owned (either
1913 directly or indirectly) by a debugging information entry
1914 with the tag \DWTAGinlinedsubroutine{} is referred to as a
1915 \doublequote{concrete inlined instance entry.} Any entry that has
1917 \DWTAGinlinedsubroutine{}
1918 is known as a \doublequote{concrete inlined instance root.}
1919 Any set of concrete inlined instance
1920 entries that are all children (either directly or indirectly)
1921 of some concrete inlined instance root, together with the root
1922 itself, is known as a \doublequote{concrete inlined instance tree.}
1923 However, in the case where a concrete inlined instance tree
1924 is nested within another concrete instance tree, the entries
1925 in the \addtoindex{nested concrete inline instance} tree
1926 are not considered to
1927 be entries in the outer concrete instance tree.
1930 \textit{Concrete inlined instance trees are defined so that no entry
1931 is part of more than one concrete inlined instance tree. This
1932 simplifies later descriptions.}
1934 Each concrete inlined instance tree is uniquely associated
1935 with one (and only one) abstract instance tree.
1937 \textit{Note, however, that the reverse is not true. Any given abstract
1938 instance tree may be associated with several different concrete
1939 inlined instance trees, or may even be associated with zero
1940 concrete inlined instance trees.}
1942 Concrete inlined instance entries may omit attributes that
1943 are not specific to the concrete instance (but present in
1944 the abstract instance) and need include only attributes that
1945 are specific to the concrete instance (but omitted in the
1946 abstract instance). In place of these omitted attributes,
1947 each\hypertarget{chap:DWATabstractorigininlineinstance}{}
1948 concrete inlined instance entry has a
1949 \addtoindexx{abstract origin attribute}
1950 \DWATabstractoriginDEFN{}
1951 attribute that may be used to obtain the missing information
1952 (indirectly) from the associated abstract instance entry. The
1953 value of the abstract origin attribute is a reference to the
1954 associated abstract instance entry.
1956 If an entry within a concrete inlined instance tree contains
1957 attributes describing the
1958 \addtoindexx{declaration coordinates!in concrete instance}
1959 \livelink{chap:declarationcoordinates}{declaration coordinates}
1960 of that entry, then those attributes should refer to the file, line
1961 and column of the original declaration of the subroutine,
1962 not to the point at which it was inlined. As a consequence,
1963 they may usually be omitted from any entry that has an abstract
1967 For each pair of entries that are associated via a
1968 \addtoindexx{abstract origin attribute}
1969 \DWATabstractorigin{} attribute, both members of the pair
1970 have the same tag. So, for example, an entry with the tag
1971 \DWTAGvariable{} can only be associated with another entry
1972 that also has the tag \DWTAGvariable. The only exception
1973 to this rule is that the root of a concrete instance tree
1974 (which must always have the tag \DWTAGinlinedsubroutine)
1975 can only be associated with the root of its associated abstract
1976 instance tree (which must have the tag \DWTAGsubprogram).
1979 In general, the structure and content of any given concrete
1980 inlined instance tree will be closely analogous to the
1981 structure and content of its associated abstract instance
1982 tree. There are a few exceptions:
1984 \begin{enumerate}[1. ]
1985 \item An entry in the concrete instance tree may be omitted if
1987 \addtoindexx{abstract origin attribute}
1988 \DWATabstractorigin{} attribute and either
1989 has no children, or its children are omitted. Such entries
1990 would provide no useful information. In C\dash like languages,
1991 such entries frequently include types, including structure,
1992 union, class, and interface types; and members of types. If any
1993 entry within a concrete inlined instance tree needs to refer
1994 to an entity declared within the scope of the relevant inlined
1995 subroutine and for which no concrete instance entry exists,
1996 the reference should refer to the abstract instance entry.
1999 \item Entries in the concrete instance tree which are associated
2000 with entries in the abstract instance tree such that neither
2001 has a \DWATname{} attribute,
2002 \addtoindexx{name attribute}
2003 and neither is referenced by
2004 any other debugging information entry, may be omitted. This
2005 may happen for debugging information entries in the abstract
2006 instance trees that became unnecessary in the concrete instance
2007 tree because of additional information available there. For
2008 example, an anonymous variable might have been created and
2009 described in the abstract instance tree, but because of
2010 the actual parameters for a particular inlined expansion,
2011 it could be described as a constant value without the need
2012 for that separate debugging information entry.
2015 \item A concrete instance tree may contain entries which do
2016 not correspond to entries in the abstract instance tree
2017 to describe new entities that are specific to a particular
2018 inlined expansion. In that case, they will not have associated
2019 entries in the abstract instance tree, should not contain
2020 \addtoindexx{abstract origin attribute}
2021 \DWATabstractorigin{} attributes, and must contain all their
2022 own attributes directly. This allows an abstract instance tree
2023 to omit debugging information entries for anonymous entities
2024 that are unlikely to be needed in most inlined expansions. In
2025 any expansion which deviates from that expectation, the
2026 entries can be described in its concrete inlined instance tree.
2030 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
2031 \label{chap:outoflineinstancesofinlinedsubroutines}
2032 Under some conditions, compilers may need to generate concrete
2033 executable instances of inlined subroutines other than at
2034 points where those subroutines are actually called. Such
2035 concrete instances of inlined subroutines are referred to as
2036 \doublequote{concrete out\dash of\dash line instances.}
2038 \textit{In \addtoindex{C++}, for example,
2039 taking the address of a function declared
2040 to be inline can necessitate the generation of a concrete
2041 out\dash of\dash line instance of the given function.}
2043 The DWARF representation of a concrete out-of-line instance
2044 of an inlined subroutine is essentially the same as for a
2045 concrete inlined instance of that subroutine (as described in
2046 the preceding section). The representation of such a concrete
2047 % It is critical that the hypertarget and livelink be
2048 % separated to avoid problems with latex.
2050 \addtoindexx{abstract origin attribute}
2052 \hypertarget{chap:DWATabstractoriginoutoflineinstance}{}
2054 \DWATabstractoriginDEFN{}
2055 attributes in exactly the same way as they are used for
2056 a concrete inlined instance (that is, as references to
2057 corresponding entries within the associated abstract instance
2060 The differences between the DWARF representation of a
2061 concrete out\dash of\dash line instance of a given subroutine and the
2062 representation of a concrete inlined instance of that same
2063 subroutine are as follows:
2064 \begin{enumerate}[1. ]
2065 \item The root entry for a concrete out\dash of\dash line instance
2066 of a given inlined subroutine has the same tag as does its
2067 associated (abstract) inlined subroutine entry (that is, tag
2068 \DWTAGsubprogram{} rather than \DWTAGinlinedsubroutine).
2070 \item The root entry for a concrete out\dash of\dash line instance tree
2071 is normally owned by the same parent entry that also owns
2072 the root entry of the associated abstract instance. However,
2073 it is not required that the abstract and out\dash of\dash line instance
2074 trees be owned by the same parent entry.
2078 \subsubsection{Nested Inlined Subroutines}
2079 \label{nestedinlinedsubroutines}
2080 Some languages and compilers may permit the logical nesting of
2081 a subroutine within another subroutine, and may permit either
2082 the outer or the nested subroutine, or both, to be inlined.
2084 For a non-inlined subroutine nested within an inlined
2085 subroutine, the nested subroutine is described normally in
2086 both the abstract and concrete inlined instance trees for
2087 the outer subroutine. All rules pertaining to the abstract
2088 and concrete instance trees for the outer subroutine apply
2089 also to the abstract and concrete instance entries for the
2093 For an inlined subroutine nested within another inlined
2094 subroutine, the following rules apply to their abstract and
2095 \addtoindexx{abstract instance!nested}
2096 \addtoindexx{concrete instance!nested}
2097 concrete instance trees:
2099 \begin{enumerate}[1. ]
2100 \item The abstract instance tree for the nested subroutine is
2101 described within the abstract instance tree for the outer
2102 subroutine according to the rules in
2103 Section \refersec{chap:abstractinstances}, and
2104 without regard to the fact that it is within an outer abstract
2107 \item Any abstract instance tree for a nested subroutine is
2108 always omitted within the concrete instance tree for an
2111 \item A concrete instance tree for a nested subroutine is
2112 always omitted within the abstract instance tree for an
2115 \item The concrete instance tree for any inlined or
2116 \addtoindexx{out-of-line instance}
2118 \addtoindexx{out-of-line instance|see{\textit{also} concrete out-of-line instance}}
2119 expansion of the nested subroutine is described within a
2120 concrete instance tree for the outer subroutine according
2122 Sections \refersec{chap:concreteinstances} or
2123 \referfol{chap:outoflineinstancesofinlinedsubroutines}
2125 and without regard to the fact that it is within an outer
2126 concrete instance tree.
2131 See Appendix \refersec{app:inliningexamples}
2132 for discussion and examples.
2136 \subsection{Trampolines}
2137 \label{chap:trampolines}
2139 \textit{A trampoline is a compiler\dash generated subroutine that serves
2140 as\hypertarget{chap:DWATtrampolinetargetsubroutine}{}
2141 an intermediary in making a call to another subroutine. It may
2142 adjust parameters and/or the result (if any) as appropriate
2143 to the combined calling and called execution contexts.}
2145 A trampoline is represented by a debugging information entry
2146 \addtoindexx{trampoline (subprogram) entry}
2147 with the tag \DWTAGsubprogram{} or \DWTAGinlinedsubroutine{}
2149 \addtoindexx{trampoline attribute}
2150 a \DWATtrampolineDEFN{} attribute.
2152 attribute indicates the target subroutine of the trampoline,
2153 that is, the subroutine to which the trampoline passes
2154 control. (A trampoline entry may but need not also have a
2155 \DWATartificial{} attribute.)
2158 The value of the trampoline attribute may be represented
2159 using any of the following forms:
2163 \item If the value is of class \CLASSreference{}, then the value
2164 specifies the debugging information entry of the target
2167 \item If the value is of class \CLASSaddress{}, then the value is
2168 the relocated address of the target subprogram.
2171 \item If the value is of class \CLASSstring{}, then the value is the
2172 (possibly mangled) \addtoindexx{mangled names}
2173 name of the target subprogram.
2175 \item If the value is of class \CLASSflag, then the value true
2176 indicates that the containing subroutine is a trampoline but
2177 that the target subroutine is not known.
2181 The target subprogram may itself be a trampoline. (A sequence
2182 of trampolines necessarily ends with a non-trampoline
2185 \textit{In \addtoindex{C++}, trampolines may be used to implement
2186 derived virtual member functions; such trampolines typically
2188 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2189 in the course of passing control.
2190 Other languages and environments may use trampolines in a manner
2191 sometimes known as transfer functions or transfer vectors.}
2193 \textit{Trampolines may sometimes pass control to the target
2194 subprogram using a branch or jump instruction instead of a
2195 call instruction, thereby leaving no trace of their existence
2196 in the subsequent execution context. }
2198 \textit{This attribute helps make it feasible for a debugger to arrange
2199 that stepping into a trampoline or setting a breakpoint in
2200 a trampoline will result in stepping into or setting the
2201 breakpoint in the target subroutine instead. This helps to
2202 hide the compiler generated subprogram from the user. }
2207 \section{Call Site Entries}
2209 \label{chap:callsiteentries}
2211 A call site entry provides a way to represent the
2213 call graph of a program in the debugging information. It also provides
2214 information about how parameters are passed so that they may be more
2215 easily accessed by a debugger. Together with the \DWOPentryvalue{} opcode,
2216 call site entries can be also useful for computing values of variables
2217 and expressions where some value is no longer present in the current
2218 subroutine's registers or local stack frame, but it is known that the
2219 values are equal to some parameter passed to the function.
2220 The consumer can then use unwind information to find the caller and
2224 call site information and then
2225 compute the value passed in a particular parameter.}
2227 A call site is represented by a debugging information entry with the tag
2228 \DWTAGcallsiteTARG{}\addtoindexx{call site entry}.
2229 The entry for a call site is owned by the innermost
2230 debugging information entry representing the scope within which the
2231 call is present in the source program.
2234 \textit{A scope entry (for example,
2236 a lexical block) that would not
2237 otherwise be present in the debugging information of a subroutine
2238 need not be introduced solely to represent the immediately containing scope
2241 A source call can be compiled into different types of machine code:
2244 A \textit{normal call} uses a call-like instruction which transfers
2245 control to the start of some subprogram and leaves the call site
2246 location address somewhere where unwind information can find it.
2248 A \textit{tail call} uses a jump-like instruction which
2249 transfers control to the start of some subprogram, but the call site location
2250 address is not preserved (and thus not available using the unwind information).
2252 A \textit{tail recursion call} is a call
2253 to the current subroutine which is compiled as a jump
2257 the current subroutine.
2260 An \textit{inline (or inlined) call} is a call to an inlined subprogram,
2261 where at least one instruction has the location of the inlined subprogram
2262 or any of its blocks or inlined subprograms.
2266 There are also different types of \doublequote{optimized out} calls:
2269 An \textit{optimized out (normal) call} is a call that is in unreachable code that
2270 has not been emitted (such as, for example, the call to \texttt{foo} in
2271 \texttt{if (0) foo();}).
2273 An \textit{optimized out inline call}
2274 is a call to an inlined subprogram which either did not expand to any instructions
2275 or only parts of instructions belong to it and for debug information purposes those
2276 instructions are given a location in the caller.
2279 \DWTAGcallsite{} entries describe normal and tail calls but not tail recursion calls,
2280 while \DWTAGinlinedsubroutine{} entries describe inlined calls
2281 (see Section \refersec{chap:inlinedsubroutines}).
2287 a \DWATcallreturnpcDEFN{}\addtoindexx{call site return pc attribute}
2288 \livetargi{chap:DWATcallreturnpcofcallsite}{attribute}{call return pc attribute}
2289 which is the return address after the call.
2290 The value of this attribute corresponds to the return address computed by
2291 call frame information in the called subprogram
2292 (see Section \refersec{datarep:callframeinformation}).
2294 \textit{On many architectures the return address is the address immediately following the
2295 call instruction, but on architectures with delay slots it might
2296 be an address after the delay slot of the call.}
2298 The call site entry may have a
2299 \DWATcallpcDEFN{}\addtoindexx{call pc attribute}
2300 \livetargi{chap:DWATcallpcofcallsite}{attribute}{call pc attribute} which is the
2301 address of the call instruction.
2303 If the call site entry corresponds to a tail call, it has the
2304 \DWATcalltailcallDEFN{}\addtoindexx{call tail call attribute}
2305 \livetargi{chap:DWATcalltailcallofcallsite}{attribute}{call tail call attribute},
2306 which is a \CLASSflag.
2308 The call site entry may have a
2309 \DWATcalloriginDEFN{}\addtoindexx{call origin attribute}
2310 \livetargi{chap:DWATcalloriginofcallsite}{attribute}{call origin attribute}
2311 which is a \CLASSreference. For direct calls or jumps where the called
2312 subprogram is known it is a reference to the called subprogram's debugging
2313 information entry. For indirect calls it may be a reference to a
2314 \DWTAGvariable{}, \DWTAGformalparameter{} or \DWTAGmember{} entry representing
2315 the subroutine pointer that is called.
2318 The call site may have a
2319 \DWATcalltargetDEFN{}\addtoindexx{call target attribute}
2320 \livetargi{chap:DWATcalltargetofcallsite}{attribute}{call target attribute} which is
2321 a DWARF expression. For indirect calls or jumps where it is unknown at
2322 compile time which subprogram will be called the expression computes the
2323 address of the subprogram that will be called. The DWARF expression should
2324 not use register or memory locations that might be clobbered by the call.
2327 The call site entry may have a
2328 \DWATcalltargetclobberedDEFN{}\addtoindexx{call target clobbered attribute}
2329 \livetargi{chap:DWATcalltargetclobberedofcallsite}{attribute}{call target clobbered attribute}
2330 which is a DWARF expression. For indirect calls or jumps where the
2331 address is not computable without use of registers or memory locations that
2332 might be clobbered by the call the \DWATcalltargetclobberedNAME{}
2333 attribute is used instead of the \DWATcalltarget{} attribute.
2337 expression of a call target clobbered attribute may only be valid
2338 at the time the call or call-like transfer of control is executed.
2342 The call site entry may have a
2343 \DWATtypeDEFN{}\addtoindexx{call type attribute}
2344 \livetargi{chap:DWATtypeofcallsite}{attribute}{type attribute!of call site entry}
2345 referencing a debugging information entry for the type of the called function.
2347 \textit{When \DWATcallorigin{} is present, \DWATtypeNAME{} is usually omitted.}
2349 The call site entry may have
2350 \DWATcallfileDEFN{}\addtoindexx{call file attribute},
2351 \DWATcalllineDEFN{}\addtoindexx{call line attribute} and
2352 \DWATcallcolumnDEFN{}\addtoindexx{call column attribute}
2353 \livetargi{chap:DWATcallfileofcallsite}{attributes,}{call file attribute!of call site entry}
2354 \livetargi{chap:DWATcalllineofcallsite}{}{call line attribute!of call site entry}
2355 \livetargi{chap:DWATcallcolumnofcallsite}{}{call column attribute!of call site entry}
2356 each of whose value is an integer constant.
2357 These attributes represent the source file, source line number, and source
2358 column number, respectively, of the first character of the call statement or
2359 expression. The call file, call line, and call column attributes are
2360 interpreted in the same way as the declaration file, declaration
2361 line, and declaration column attributes, respectively
2362 (see Section \refersec{chap:declarationcoordinates}).
2364 \textit{The call file, call line and call column coordinates do not describe the
2365 coordinates of the subroutine declaration that was called, rather they describe
2366 the coordinates of the call.}
2369 The call site entry may own
2370 \DWTAGcallsiteparameterTARG{}\index{call site parameter entry}
2371 debugging information entries representing the parameters passed to the call.
2372 Each such entry has a \DWATlocation{} attribute which is a location expression.
2373 This location expression describes where the parameter is passed
2374 (usually either some register, or a memory location expressible as the
2375 contents of the stack register plus some offset).
2378 Each \DWTAGcallsiteparameter{} entry may have a
2379 \DWATcallvalueDEFN{}\addtoindexx{call value attribute}
2380 \livetargi{chap:DWATcallvalueofcallparameter}{attribute}{call value attribute}
2381 which is a DWARF expression
2383 which when evaluated yields the value of the parameter at the time of the call.
2386 \textit{The expression should not use registers or memory
2387 locations that might be clobbered by the call, as it might be evaluated after
2388 unwinding from the called function back to the caller. If it is not
2389 possible to avoid registers or memory locations that might be clobbered by
2390 the call in the expression, then the \DWATcallvalueNAME{} attribute should
2393 \textit{The reason for the restriction is that the value of the parameter may be
2394 needed in the midst of the callee, where the call clobbered registers or
2395 memory might be already clobbered, and if the consumer is not assured by
2396 the producer it can safely use those values, the consumer can not safely
2397 use the values at all.}
2399 For parameters passed by reference, where the code passes a pointer to
2400 a location which contains the parameter, or for reference type parameters,
2401 the \DWTAGcallsiteparameter{} entry may also have
2405 \DWATcalldatalocationNAME{}\addtoindexx{call data location attribute}
2406 \livetargi{chap:DWATcalldatalocationofcallparameter}{attribute}{call data location attribute}
2407 whose value is a location expression and a
2408 \DWATcalldatavalueNAME{}\addtoindexx{call data value attribute}
2409 \livetargi{chap:DWATcalldatavalueofcallparameter}{attribute}{call data value attribute}
2410 whose value is a DWARF expression. The \DWATcalldatalocationDEFN{} attribute
2411 \addtoindexx{call data location attribute}
2412 describes where the referenced value lives during the call. If it is just
2413 \DWOPpushobjectaddress{}, it may be left out. The
2414 \DWATcalldatavalueNAME{} attribute describes the value in that location.
2415 The expression should not use registers or memory
2416 locations that might be clobbered by the call, as it might be evaluated after
2417 unwinding from the called function back to the caller.
2420 Each call site parameter entry may also have a
2421 \DWATcallparameterDEFN{}\addtoindexx{call parameter attribute}
2422 \livetargi{chap:DWATcallparameterofcallparameter}{attribute}{call parameter attribute}
2423 which contains a reference to a \DWTAGformalparameter{} entry,
2424 \DWATtype{} attribute referencing the type of the parameter or
2425 \DWATname{} attribute describing the parameter's name.
2429 using call site entries and related attributes are found in
2430 Appendix \refersec{app:callsiteexamples}.
2435 \section{Lexical Block Entries}
2436 \label{chap:lexicalblockentries}
2439 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
2441 \addtoindexx{lexical block}
2442 a bracketed sequence of source statements
2443 that may contain any number of declarations. In some languages
2444 (including \addtoindex{C} and \addtoindex{C++}),
2445 \nolink{blocks} can be nested within other
2446 \nolink{blocks} to any depth.}
2448 % We do not need to link to the preceding paragraph.
2449 A lexical \nolink{block} is represented by a debugging information
2451 tag \DWTAGlexicalblockTARG.
2453 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
2455 either a \DWATlowpc{} and
2456 \DWAThighpc{} pair of
2458 \addtoindexx{high PC attribute}
2460 \addtoindexx{low PC attribute}
2462 \DWATranges{} attribute
2463 \addtoindexx{ranges attribute}
2464 whose values encode the contiguous or non-contiguous address
2465 ranges, respectively, of the machine instructions generated
2466 for the lexical \nolink{block}
2467 (see Section \refersec{chap:codeaddressesandranges}).
2469 A\hypertarget{chap:DWATentrypcoflexicalblock}{}
2470 lexical block entry may also have a
2471 \addtoindexx{entry PC attribute!for lexical block}
2472 \DWATentrypc{} attribute
2473 whose value is the address of the first executable instruction
2474 of the lexical block (see
2475 Section \refersec{chap:entryaddress}).
2477 If a name has been given to the lexical \nolink{block}
2478 in the source program, then the corresponding
2479 lexical \nolink{block} entry has a
2480 \DWATname{} attribute whose
2481 \addtoindexx{name attribute}
2482 value is a null-terminated string
2483 containing the name of the lexical \nolink{block}.
2486 \textit{This is not the same as a \addtoindex{C} or
2487 \addtoindex{C++} label (see
2489 Section \refersec{chap:labelentries}).
2493 The lexical \nolink{block} entry owns debugging
2494 information entries that describe the declarations
2495 within that lexical \nolink{block}. There is
2496 one such debugging information entry for each local declaration
2497 of an identifier or inner lexical \nolink{block}.
2500 \section{Label Entries}
2501 \label{chap:labelentries}
2502 \textit{A label is a way of identifying a source
2506 A labeled statement is usually the target of one or more
2507 \doublequote{go to} statements.
2511 A label is represented by a debugging information entry with
2512 \addtoindexx{label entry}
2513 the tag \DWTAGlabelTARG.
2514 The entry for a label should be owned by
2515 the debugging information entry representing the scope within
2516 which the name of the label could be legally referenced within
2519 The label entry has a \DWATlowpc{} attribute whose value
2522 address of the first
2524 executable instruction for the location
2526 identified by the label in
2527 the source program. The label entry also has a
2528 \DWATname{} attribute
2529 \addtoindexx{name attribute}
2530 whose value is a null-terminated string containing
2531 the name of the label.
2535 \section{With Statement Entries}
2536 \label{chap:withstatemententries}
2538 \textit{Both \addtoindex{Pascal} and
2539 \addtoindexx{Modula-2}
2540 Modula-2 support the concept of a \doublequote{with}
2541 statement. The with statement specifies a sequence of
2542 executable statements within which the fields of a record
2543 variable may be referenced, unqualified by the name of the
2546 A with statement is represented by a
2547 \addtoindexi{debugging information entry}{with statement entry}
2548 with the tag \DWTAGwithstmtTARG.
2550 A with statement entry may have either a
2552 \DWAThighpc{} pair of attributes
2553 \addtoindexx{low PC attribute}
2554 \addtoindexx{high PC attribute}
2556 \DWATranges{} attribute
2557 \addtoindexx{ranges attribute}
2558 whose values encode the contiguous or non-contiguous address
2559 ranges, respectively, of the machine instructions generated
2560 for the with statement
2561 (see Section \refersec{chap:codeaddressesandranges}).
2563 A\hypertarget{chap:DWATentrypcofwithstmt}{}
2564 with statement entry may also have a
2565 \addtoindexx{entry PC attribute!for with statement}
2566 \DWATentrypc{} attribute
2567 whose value is the address of the first executable instruction
2568 of the with statement (see
2569 Section \refersec{chap:entryaddress}).
2572 The with statement entry has a
2573 \addtoindexx{type attribute}
2574 \DWATtype{} attribute, denoting
2575 the type of record whose fields may be referenced without full
2576 qualification within the body of the statement. It also has
2577 \addtoindexx{location attribute}
2578 a \DWATlocation{} attribute, describing how to find the base
2579 address of the record object referenced within the body of
2583 \section{Try and Catch Block Entries}
2584 \label{chap:tryandcatchblockentries}
2585 \livetarg{chap:tryandcatchblockentries}{}
2586 \textit{In \addtoindex{C++}, a \livelink{chap:lexicalblock}{lexical block} may be
2587 designated as a \doublequote{catch \nolink{block}.}
2588 A catch \nolink{block} is an exception handler that
2589 handles exceptions thrown by an immediately preceding
2590 \doublequote{try \nolink{block}.}
2591 A catch \nolink{block}
2592 designates the type of the exception that it can handle.}
2594 A \livetarg{chap:tryblock}{try block} is represented
2595 by a debugging information entry
2596 \addtoindexx{try block entry}
2597 with the tag \DWTAGtryblockTARG.
2598 A \livetarg{chap:catchblock}{catch block} is represented by
2599 a debugging information entry
2600 \addtoindexx{catch block entry}
2601 with the tag \DWTAGcatchblockTARG.
2603 Both try and catch \nolink{block} entries may have either a
2605 \DWAThighpc{} pair of attributes
2606 \addtoindexx{low PC attribute}
2607 \addtoindexx{high PC attribute}
2609 \DWATranges{} attribute
2610 \addtoindexx{ranges attribute}
2611 whose values encode the contiguous
2612 or non-contiguous address ranges, respectively, of the
2613 machine instructions generated for the \nolink{block}
2614 (see Section \refersec{chap:codeaddressesandranges}).
2616 A\hypertarget{chap:DWATentrypcoftryblock}{}
2617 try or catch\hypertarget{chap:DWATentrypcofcatchblock}{}
2618 block entry may also have a
2619 \addtoindexx{entry PC attribute!for try block}
2620 \addtoindexx{entry PC attribute!for catch block}
2621 \DWATentrypc{} attribute
2622 whose value is the address of the first executable instruction
2623 of the try or catch block
2624 (see Section \refersec{chap:entryaddress}).
2627 Catch \nolink{block} entries have at least one child entry,
2628 an entry representing the type of exception accepted by
2629 that catch \nolink{block}.
2630 This child entry has one of the tags
2631 \DWTAGformalparameter{}\addtoindexx{formal parameter entry!in catch block}
2633 \DWTAGunspecifiedparameters{},
2634 \addtoindexx{unspecified parameters entry!in catch block}
2635 and will have the same form as other parameter entries.
2637 The siblings immediately following a try \nolink{block}
2638 entry are its corresponding catch \nolink{block} entries.
2642 \section{Declarations with Reduced Scope}
2643 \label{declarationswithreducedscope}
2644 \hypertarget{chap:DWATstartscopeofdeclaration}{}
2645 Any debugging information entry for a declaration
2646 (including objects, subprograms, types and modules) whose scope
2647 has an address range that is a subset of the address range for
2648 the lexical scope most closely enclosing the declared entity
2650 \DWATstartscopeDEFN{}\addtoindexx{start scope attribute}
2651 attribute to specify that reduced range of addresses.
2653 There are two cases:
2654 \begin{enumerate}[1. ]
2655 \item If the address range for the scope of the entry
2656 includes all of addresses for the containing scope except
2657 for a contiguous sequence of bytes at the beginning of the
2658 address range for the containing scope, then the address is
2659 specified using a value of class \CLASSconstant.
2661 \begin{enumerate}[a) ]
2662 \item If the address
2663 range of the containing scope is contiguous, the value of
2664 this attribute is the offset in bytes of the beginning of
2665 the address range for the scope of the object from the low
2666 PC value of the debugging information entry that defines
2667 that containing scope.
2668 \item If the address range of the containing
2669 scope is non-contiguous
2670 (see \refersec{chap:noncontiguousaddressranges})
2671 the value of this attribute is the offset in bytes of the
2672 beginning of the address range for the scope of the entity
2673 from the beginning of the first \addtoindex{range list} entry
2674 for the containing scope that is not a base selection entry,
2675 a default selection entry or an end-of-list entry.
2679 \item Otherwise, the set of addresses for the scope of the
2680 entity is specified using a value of class \CLASSrangelistptr{}.
2681 This value indicates the beginning of a \addtoindex{range list}
2682 (see Section \refersec{chap:noncontiguousaddressranges}).
2685 \textit{For example, the scope of a variable may begin somewhere
2686 in the midst of a lexical \livelink{chap:lexicalblock}{block} in a
2687 language that allows executable code in a
2688 \nolink{block} before a variable declaration, or where one declaration
2689 containing initialization code may change the scope of a
2690 subsequent declaration. Consider the following example \addtoindex{C} code:}
2703 \textit{\addtoindex{C} scoping rules require that the value of the
2704 variable \texttt{x} assigned to the variable \texttt{f} in the
2705 initialization sequence is the value of the global variable \texttt{x},
2706 rather than the local \texttt{x}, because the scope of the local variable
2707 \texttt{x} only starts after the full declarator for the local \texttt{x}.}
2709 \textit{Due to optimization, the scope of an object may be
2710 non-contiguous and require use of a \addtoindex{range list} even when
2711 the containing scope is contiguous. Conversely, the scope of
2712 an object may not require its own \addtoindex{range list} even when the
2713 containing scope is non-contiguous.}