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 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.
76 These object files are not processed by a linker; thus,
77 split units do not depend on underlying object file relocations.}
79 \textit{Either a full compilation unit or a partial compilation
80 unit may be logically incorporated into another compilation unit
81 using an \addtoindex{imported unit entry}
82 (see Section \refersec{chap:importedunitentries}).}
85 combined split and partial
86 compilation unit kind is not defined.}
88 \textit{In the remainder of this document, the word
89 \doublequote{compilation} in the phrase \doublequote{compilation unit}
90 is generally omitted, unless it is deemed needed for clarity
93 \subsection{Full and Partial Compilation Unit Entries}
94 \label{chap:fullandpartialcompilationunitentries}
95 A \addtoindex{full compilation unit}\addtoindexx{compilation unit!full}
96 is represented by a debugging information entry with the tag
97 \DWTAGcompileunitTARG.
98 A \addtoindex{partial compilation unit}\addtoindexx{compilation unit!partial}
99 is represented by a debugging information entry with the tag
100 \DWTAGpartialunitTARG.
103 In a simple compilation, a single compilation unit with
105 \DWTAGcompileunit{} represents a complete object file
107 \DWTAGpartialunit{} (as well as tag \DWTAGtypeunit) is not used.
109 employing the DWARF space compression and duplicate elimination
111 Appendix \refersec{app:usingcompilationunits},
112 multiple compilation units using
115 \DWTAGpartialunit{} and/or
117 are used to represent portions of an object file.
119 \textit{A full compilation unit typically represents the text and
120 data contributed to an executable by a single relocatable
121 object file. It may be derived from several source files,
122 including pre-processed header files.
123 A \addtoindex{partial compilation unit} typically represents a part
124 of the text and data of a relocatable object file, in a manner that
125 can potentially be shared with the results of other compilations
126 to save space. It may be derived from an \doublequote{include file,}
127 template instantiation, or other implementation-dependent
128 portion of a compilation. A full compilation unit can also
129 function in a manner similar to a partial compilation unit
131 See Appendix \refersec{app:dwarfcompressionandduplicateeliminationinformative}
132 for discussion of related compression techniques.}
134 A compilation unit entry owns debugging information
135 entries that represent all or part of the declarations
136 made in the corresponding compilation. In the case of a
137 partial compilation unit, the containing scope of its owned
138 declarations is indicated by imported unit entries in one
139 or more other compilation unit entries that refer to that
140 partial compilation unit (see
141 Section \refersec{chap:importedunitentries}).
143 Compilation unit entries may have the following
145 \begin{enumerate}[1. ]
146 \item Either a \DWATlowpc{} and
147 \DWAThighpc{} pair of
148 \addtoindexx{high PC attribute}
150 \addtoindexx{low PC attribute}
152 \addtoindexx{ranges attribute}
154 \DWATranges{} attribute
155 \addtoindexx{ranges attribute}
157 \addtoindexx{discontiguous address ranges|see{non-contiguous address ranges}}
159 non-contiguous address ranges, respectively,
160 of the machine instructions generated for the compilation
161 unit (see Section \refersec{chap:codeaddressesandranges}).
163 A \DWATlowpc{} attribute
164 may also be specified in combination
165 \addtoindexx{ranges attribute}
167 \DWATranges{} to specify the
168 \addtoindexx{ranges attribute}
169 default base address for use in
170 \addtoindexx{location list}
171 location lists (see Section
172 \refersec{chap:locationlists}) and range lists
173 \addtoindexx{range list}
174 (see Section \refersec{chap:noncontiguousaddressranges}).
176 \item \hypertarget{chap:DWATnamepathnameofcompilationsource}{}
177 A \DWATnameDEFN{} attribute \addtoindexx{name attribute}
178 whose value is a null-terminated string
179 containing the full or relative path name
180 (relative to the value of the \DWATcompdir{} attribute,
181 see below) of the primary
182 source file from which the compilation unit was derived.
184 \item \hypertarget{chap:DWATlanguageprogramminglanguage}{}
185 A \DWATlanguageDEFN{} attribute\addtoindexx{language attribute}
186 whose constant value is an integer code
187 indicating the source language of the compilation
188 unit. The set of language names and their meanings are given
189 in Table \refersec{tab:languagenames}.
192 \setlength{\extrarowheight}{0.1cm}
193 \begin{longtable}{l|l}
194 \caption{Language names} \label{tab:languagenames} \\
195 \hline \bfseries Language name & \bfseries Meaning \\ \hline
197 \bfseries Language name & \bfseries Meaning \\ \hline
199 \hline \emph{Continued on next page}
202 \addtoindexx{ISO-defined language names}
203 \DWLANGAdaeightythreeTARG{} \dag & ISO Ada:1983 \addtoindexx{Ada:1983 (ISO)} \\
204 \DWLANGAdaninetyfiveTARG{} \dag & ISO Ada:1995 \addtoindexx{Ada:1995 (ISO)} \\
205 \DWLANGCTARG & Non-standardized C, such as K\&R \addtoindexx{C!non-standard}\\
206 \DWLANGCeightynineTARG & ISO C:1989 \addtoindexx{C:1989 (ISO)} \\
207 \DWLANGCninetynineTARG & ISO C:1999 \addtoindexx{C:1999 (ISO)} \\
208 \DWLANGCelevenTARG & ISO C:2011 \addtoindexx{C:2011 (ISO)} \\
209 \DWLANGCplusplusTARG & ISO C++98 \addtoindexx{C++98 (ISO)} \\
210 \DWLANGCpluspluszerothreeTARG & ISO C++03 \addtoindexx{C++03 (ISO)} \\
211 \DWLANGCpluspluselevenTARG & ISO C++11 \addtoindexx{C++11 (ISO)} \\
212 \DWLANGCplusplusfourteenTARG & ISO C++14 \addtoindexx{C++14 (ISO)}
214 \DWLANGCobolseventyfourTARG & ISO COBOL:1974 \addtoindexx{COBOL:1974 (ISO)} \\
215 \DWLANGCoboleightyfiveTARG & ISO COBOL:1985 \addtoindexx{COBOL:1985 (ISO)} \\
216 \DWLANGDTARG{}~\dag & D \addtoindexx{D language} \\
217 \DWLANGDylanTARG~\dag & Dylan \addtoindexx{Dylan} \\
218 \DWLANGFortranseventysevenTARG & ISO FORTRAN:1977 \addtoindexx{FORTRAN:1977 (ISO)} \\
219 \DWLANGFortranninetyTARG & ISO Fortran:1990 \addtoindexx{Fortran:1990 (ISO)} \\
220 \DWLANGFortranninetyfiveTARG & ISO Fortran:1995 \addtoindexx{Fortran:1995 (ISO)} \\
221 \DWLANGFortranzerothreeTARG & ISO Fortran:2004 \addtoindexx{Fortran:2004 (ISO)} \\
222 \DWLANGFortranzeroeightTARG & ISO Fortran:2010 \addtoindexx{Fortran:2010 (ISO)} \\
223 \DWLANGGoTARG{}~\dag & \addtoindex{Go} \\
224 \DWLANGHaskellTARG{} \dag & \addtoindex{Haskell} \\
225 \DWLANGJavaTARG{} & \addtoindex{Java}\\
226 \DWLANGJuliaTARG{}~\dag & \addtoindex{Julia} \\
227 \DWLANGModulatwoTARG & ISO Modula\dash 2:1996 \addtoindexx{Modula-2:1996 (ISO)} \\
228 \DWLANGModulathreeTARG & \addtoindex{Modula-3} \\
229 \DWLANGObjCTARG{} & \addtoindex{Objective C} \\
230 \DWLANGObjCplusplusTARG{} & \addtoindex{Objective C++} \\
231 \DWLANGOCamlTARG{}~\dag & \addtoindex{OCaml}\index{Objective Caml|see{OCaml}} \\
232 \DWLANGOpenCLTARG{}~\dag & \addtoindex{OpenCL} \\
233 \DWLANGPascaleightythreeTARG & ISO Pascal:1983 \addtoindexx{Pascal:1983 (ISO)} \\
234 \DWLANGPLITARG{}~\dag & ANSI PL/I:1976 \addtoindexx{PL/I:1976 (ANSI)} \\
235 \DWLANGPythonTARG{}~\dag & \addtoindex{Python} \\
236 \DWLANGRenderScriptTARG~\dag & \addtoindex{RenderScript Kernal Language}
238 \DWLANGRustTARG{}~\dag & \addtoindex{Rust} \\
240 & \addtoindex{Swift} \\
241 \DWLANGUPCTARG{} & UPC (Unified Parallel C) \addtoindexx{UPC}
242 \index{Unified Parallel C|see{UPC}} \\
244 \dag \ \ \textit{Support for these languages is limited}& \\
249 \item \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}{}
250 A \DWATstmtlistDEFN{}\addtoindexx{statement list attribute}
251 attribute whose value is a
252 \addtoindexx{section offset!in statement list attribute}
253 section offset to the line number information for this compilation
256 This information is placed in a separate object file
257 section from the debugging information entries themselves. The
258 value of the statement list attribute is the offset in the
259 \dotdebugline{} section of the first byte of the line number
260 information for this compilation unit
261 (see Section \refersec{chap:linenumberinformation}).
263 \item A \DWATmacrosDEFN{}\hypertarget{chap:DWATmacrosmacroinformation}{}
265 \addtoindexx{macro information attribute}
267 \addtoindexx{section offset!in macro information attribute}
268 section offset to the macro information for this compilation unit.
270 This information is placed in a separate object file section
271 from the debugging information entries themselves. The
272 value of the macro information attribute is the offset in
273 the \dotdebugmacro{} section of the first byte of the macro
274 information for this compilation unit
275 (see Section \refersec{chap:macroinformation}).
277 \textit{The \DWATmacrosNAME{} attribute is new in \DWARFVersionV,
279 \DWATmacroinfoDEFN{} attribute of earlier DWARF versions.
280 \livetarg{chap:DWATmacroinfomacroinformation}{}
281 While \DWATmacrosNAME{} and \DWATmacroinfoNAME{} attributes cannot both occur in the same
282 compilation unit, both may be found in the set of units that make up an executable
283 or shared object file. The two attributes have distinct encodings to facilitate such
287 \item \hypertarget{chap:DWATcompdircompilationdirectory}{}
288 A \DWATcompdirDEFN{} attribute\addtoindexx{compilation directory attribute}
290 null-terminated string containing the current working directory
291 of the compilation command that produced this compilation
292 unit in whatever form makes sense for the host system.
294 \item \hypertarget{chap:DWATproducercompileridentification}{}
295 A \DWATproducerDEFN{} attribute\addtoindexx{producer attribute}
296 whose value is a null-terminated string containing
297 information about the compiler
298 that produced the compilation unit. The actual contents of
299 the string will be specific to each producer, but should
300 begin with the name of the compiler vendor or some other
301 identifying character sequence that should avoid confusion
302 with other producer values.
305 \item \hypertarget{chap:DWATidentifiercaseidentifiercaserule}{}
306 A \DWATidentifiercaseDEFN{} attribute
307 \addtoindexx{identifier case attribute} whose integer
308 constant value is a code describing the treatment
309 of identifiers within this compilation unit. The
310 set of identifier case codes is given in
311 Table \refersec{tab:identifiercasecodes}.
313 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
314 \DWIDcasesensitive{} \\
317 \DWIDcaseinsensitive{} \\
318 \end{simplenametable}
320 \DWIDcasesensitiveTARG{} is the default for all compilation units
321 that do not have this attribute. It indicates that names given
322 as the values of \DWATname{} attributes
323 \addtoindexx{name attribute}
324 in debugging information
325 entries for the compilation unit reflect the names as they
326 appear in the source program. The debugger should be sensitive
327 to the case of \addtoindex{identifier names} when doing identifier
331 \DWIDupcaseTARG{} means that the
332 producer of the debugging
333 information for this compilation unit converted all source
334 names to upper case. The values of the name attributes may not
335 reflect the names as they appear in the source program. The
336 debugger should convert all names to upper case when doing
339 \DWIDdowncaseTARG{} means that
340 the producer of the debugging
341 information for this compilation unit converted all source
342 names to lower case. The values of the name attributes may not
343 reflect the names as they appear in the source program. The
344 debugger should convert all names to lower case when doing
348 \DWIDcaseinsensitiveTARG{} means that the values of the name
349 attributes reflect the names as they appear in the source
350 program but that a case insensitive lookup should be used to
354 \item \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{}
355 A \DWATbasetypesDEFN{} attribute\addtoindexx{base types attribute}
356 whose value is a \livelink{chap:classreference}{reference}.
357 This attribute points to a debugging information entry
358 representing another compilation unit. It may be used
359 to specify the compilation unit containing the base type
360 entries used by entries in the current compilation unit
361 (see Section \refersec{chap:basetypeentries}).
364 \textit{This attribute provides a consumer a way to find the definition
365 of base types for a compilation unit that does not itself
366 contain such definitions. This allows a consumer, for example,
367 to interpret a type conversion to a base type correctly.}
369 \item \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}{}
370 A \DWATuseUTFeightDEFN{} attribute,
371 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
372 which is a \livelink{chap:classflag}{flag} whose
373 presence indicates that all strings (such as the names of
374 declared entities in the source program, or filenames in the line number table)
375 are represented using the UTF-8 representation.
379 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{}
380 A \DWATmainsubprogramDEFN{} attribute,\addtoindexx{main subprogram attribute}
381 which is a \livelink{chap:classflag}{flag},
382 whose presence indicates that the compilation unit contains a
383 subprogram that has been identified as the starting
384 subprogram of the program. If more than one compilation unit contains
385 this \nolink{flag}, any one of them may contain the starting
388 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
390 to specify and provide a user-specified name for the main
391 subroutine of a program.
392 \addtoindex{C} uses the name \doublequote{main} to identify
393 the main subprogram of a program. Some other languages provide
394 similar or other means to identify the main subprogram of
395 a program. The \DWATmainsubprogram{} attribute may also be used to
396 identify such subprograms (see
397 Section \refersec{chap:generalsubroutineandentrypointinformation}).}
400 \hypertarget{chap:DWATentrypcofcompileunit}{}
401 \hypertarget{chap:DWATentrypcofpartialunit}{}
402 A \DWATentrypc{} attribute whose value is the address of the first
403 \addtoindexx{entry pc attribute}
404 executable instruction of the unit (see
405 Section \refersec{chap:entryaddress}).
408 \item \hypertarget{chap:DWATstroffsetbaseforindirectstringtable}{}
409 A \DWATstroffsetsbaseDEFN\addtoindexx{string offset base attribute}
410 attribute, whose value is of class \CLASSstroffsetsptr.
411 This attribute points to the first string
412 offset of the compilation unit's contribution to the
413 \dotdebugstroffsets{} (or \dotdebugstroffsetsdwo{}) section.
414 Indirect string references
415 (using \DWFORMstrx) within the compilation unit are
416 interpreted as indices relative to this base.
419 \item \hypertarget{chap:DWATaddrbaseforaddresstable}{}
420 A \DWATaddrbaseDEFN\addtoindexx{address table base attribute}
421 attribute, whose value is of class \CLASSaddrptr.
422 This attribute points to the beginning of the compilation
423 unit's contribution to the \dotdebugaddr{} section.
424 Indirect references (using \DWFORMaddrx, \DWOPaddrx,
425 \DWOPconstx, \DWLLEbaseaddressselectionentry{},
426 \DWLLEstartendentry{} or \DWLLEstartlengthentry)
427 within the compilation unit are interpreted as indices
428 relative to this base.
431 \item \hypertarget{chap:DWATrangesbaseforrangelists}{}
432 A \DWATrangesbaseDEFN\addtoindexx{ranges table base attribute}
433 attribute, whose value is of class \CLASSrangelistptr.
434 This attribute points to the beginning of the compilation
435 unit's contribution to the \dotdebugranges{} section.
436 References to range lists (using \DWFORMsecoffset)
437 within the compilation unit are
438 interpreted as offsets relative to this base.
442 The base address of a compilation unit is defined as the
443 value of the \DWATlowpc{} attribute, if present; otherwise,
444 it is undefined. If the base address is undefined, then any
445 DWARF entry or structure defined in terms of the base address
446 of that compilation unit is not valid.
449 \subsection{Skeleton Compilation Unit Entries}
450 \label{chap:skeletoncompilationunitentries}
451 \addtoindexx{compilation unit!skeleton}
452 \addtoindexx{skeleton compilation unit}
453 When generating a \splitDWARFobjectfile{} (see
454 Section \refersec{datarep:splitdwarfobjectfiles}), the
455 compilation unit in the \dotdebuginfo{} section is a "skeleton"
456 compilation unit with the tag
457 \DWTAGskeletonunitTARG, which contains a
458 \DWATdwoname{} attribute as well as a subset of the
459 attributes of a full or partial compilation unit. In general,
460 it contains those attributes that are necessary for the consumer
461 to locate the object file where the split full compilation unit
462 can be found, and for the consumer to interpret references to
463 addresses in the program.
466 A skeleton compilation unit has no children.
468 A skeleton compilation unit has a \DWATdwoname{} attribute:
470 \begin{enumerate}[1. ]
472 \item \livetarg{chap:DWATdwonameforunit}{}
473 A \DWATdwonameDEFN{} attribute
474 \addtoindexx{split DWARF object file name attribute}
476 null-terminated string containing the full or relative
477 path name (relative to the value of the \DWATcompdir{} attribute,
478 see below) of the object file that contains the full
481 The value in the \HFNdwoid{} field of the unit header for
482 this unit is the same as the value in the \HFNdwoid{} field
483 of the unit header of the corresponding full compilation
484 unit (see Section \refersec{datarep:unitheaders}).
486 \textit{The means of determining a compilation unit ID does
487 not need to be similar or related to the means of
488 determining a \TUsignature. However, it should
489 be suitable for detecting file version skew or other
490 kinds of mismatched files and for looking up a full
491 split unit in a DWARF package file
492 (see Section \refersec{datarep:dwarfpackagefiles}).}
496 A skeleton compilation unit may have additional attributes,
497 which are the same as for conventional compilation unit entries
498 except as noted, from among the following:
499 \begin{enumerate}[1. ]
500 \addtocounter{enumi}{1}
501 \item Either a \DWATlowpc{} and \DWAThighpc{} pair of attributes
502 or a \DWATranges{} attribute.
503 \item A \DWATstmtlist{} attribute.
504 \item A \DWATcompdir{} attribute.
507 \item A \DWATuseUTFeight{} attribute.
509 \textit{This attribute applies to strings referred to by the skeleton
510 compilation unit entry itself, and strings in the associated line
512 The representation for strings in the object file referenced
513 by the \DWATdwoname{} attribute is determined by the presence
514 of a \DWATuseUTFeight{} attribute in the full compilation unit
515 (see Section \refersec{chap:splitfullcompilationunitentries}).}
517 \item A \DWATstroffsetsbase{} attribute, for indirect strings references
518 from the skeleton compilation unit.
519 \item A \DWATaddrbase{} attribute.
520 \item A \DWATrangesbase{} attribute.
524 All other attributes of a compilation unit entry (described
525 in Section \refersec{chap:fullandpartialcompilationunitentries})
526 should be placed in the split full compilation unit
527 (see \refersec{chap:splitfullcompilationunitentries}).
528 The attributes provided by the skeleton compilation
529 unit entry do not need to be repeated in the full compilation
532 \textit{The \DWATaddrbase{}, \DWATrangesbase{} and
533 \DWATstroffsetsbase{} attributes provide context that may be
534 necessary to interpret the contents
535 of the corresponding \splitDWARFobjectfile.}
537 \textit{The \DWATbasetypes{} attribute is not defined for a
538 skeleton compilation unit.}
541 \subsection{Split Full Compilation Unit Entries}
542 \label{chap:splitfullcompilationunitentries}
543 A \definition{split full compilation unit} is represented by a
544 debugging information entry with tag \DWTAGcompileunit.
545 It is very similar to a conventional full compilation unit but
546 is logically paired with a specific skeleton compilation unit while
547 being physically separate.
549 A split full compilation unit
550 may have the following attributes,
551 which are the same as for conventional compilation unit entries
553 \begin{enumerate}[1. ]
554 \item A \DWATname{} attribute.
555 \item A \DWATlanguage{} attribute.
556 \item A \DWATmacros{} attribute.
557 The value of this attribute is of class \CLASSmacptr{}, which is
558 an offset relative to the \dotdebugmacrodwo{} section.
560 \item A \DWATproducer{} attribute.
561 \item A \DWATidentifiercase{} attribute.
562 \item A \DWATmainsubprogram{} attribute.
563 \item A \DWATentrypc{} attribute.
564 \item A \DWATuseUTFeight{} attribute.
568 \textit{The following attributes are not part of a
569 split full compilation unit entry but instead are inherited
570 (if present) from the corresponding skeleton compilation unit:
571 \DWATlowpc, \DWAThighpc, \DWATranges, \DWATstmtlist, \DWATcompdir,
572 \DWATstroffsetsbase, \DWATaddrbase{} and
575 \textit{The \DWATbasetypes{} attribute is not defined for a
576 split full compilation unit.}
580 \subsection{Type Unit Entries}
581 \label{chap:typeunitentries}
582 \addtoindexx{type unit}
583 \addtoindexx{type unit|see{\textit{also} compilation unit}}
584 \addtoindexx{compilation unit!\textit{see also} type unit}
585 An object file may contain any number of separate type
586 unit entries, each representing a single complete type
588 Each \addtoindex{type unit} must be uniquely identified by
589 an 8-byte signature, stored as part of the type unit, which
590 can be used to reference the type definition from debugging
591 information entries in other compilation units and type units.
593 Conventional and split type units are identical except for
594 the sections in which they are represented
595 (see \refersec{datarep:splitdwarfobjectfiles} for details).
596 \addtoindexx{conventional type unit}
597 \addtoindexx{split type unit}
598 Moreover, the \DWATstroffsetsbase{} attribute (see below) is not
599 used in a split type unit.
601 A type unit is represented by a debugging information entry
602 with the tag \DWTAGtypeunitTARG.
603 A \addtoindex{type unit entry} owns debugging
604 information entries that represent the definition of a single
605 type, plus additional debugging information entries that may
606 be necessary to include as part of the definition of the type.
609 A type unit entry may have the following attributes:
610 \begin{enumerate}[1. ]
613 \DWATlanguage{} attribute,
615 \addtoindexx{language attribute}
616 constant value is an integer code indicating the source
617 language used to define the type. The set of language names
618 and their meanings are given in Table \refersec{tab:languagenames}.
621 \item A \DWATstmtlist{} attribute\addtoindexx{statement list attribute}
622 whose value of class \CLASSlineptr{} points to the line number
623 information for this type unit.
625 \textit{Because type units do not describe any code, they
626 do not actually need a line number table, but the line number
627 headers contain a list of directories and file names that
628 may be referenced by the \DWATdeclfile{} attribute of the
629 type or part of its description.}
631 \textit{In an object file with a conventional compilation
632 unit entry, the type unit entries may refer to (share) the
633 line number table used by the compilation unit. In a type
634 unit located in a split compilation unit, the
635 \DWATstmtlistNAME{} attribute refers to a \doublequote{specialized}
636 line number table in the \dotdebuglinedwo{} section, which
637 contains only the list of directories and file names.}
639 \textit{All type unit entries in a \splitDWARFobjectfile{} may
640 (but are not required to) refer to the same
641 \addtoindex{specialized line number table}.}
643 \item A \DWATuseUTFeight{} attribute, which is a flag
644 whose presence indicates that all strings referred to by this type
645 unit entry, its children, and its associated
646 \addtoindex{specialized line number table},
647 are represented using the UTF-8 representation.
650 \DWATstroffsetsbase\addtoindexx{string offsets base attribute}
651 attribute, whose value is of class \CLASSstroffsetsptr.
652 This attribute points
653 to the first string offset of the type unit's contribution to
654 the \dotdebugstroffsets{} section. Indirect string references
655 (using \DWFORMstrx) within the type unit are interpreted
656 as indices relative to this base.
660 A \addtoindex{type unit} entry for a given type T owns a debugging
661 information entry that represents a defining declaration
662 of type T. If the type is nested within enclosing types or
663 namespaces, the debugging information entry for T is nested
664 within debugging information entries describing its containers;
665 otherwise, T is a direct child of the type unit entry.
667 A type unit entry may also own additional debugging information
668 entries that represent declarations of additional types that
669 are referenced by type T and have not themselves been placed in
670 separate type units. Like T, if an additional type U is nested
671 within enclosing types or namespaces, the debugging information
672 entry for U is nested within entries describing its containers;
673 otherwise, U is a direct child of the type unit entry.
675 The containing entries for types T and U are declarations,
676 and the outermost containing entry for any given type T or
677 U is a direct child of the type unit entry. The containing
678 entries may be shared among the additional types and between
679 T and the additional types.
681 \textit{Examples of these kinds of relationships are found in
682 Section \refersec{app:signaturecomputationexample} and
683 Section \refersec{app:declarationscompletingnondefiningdeclarations}.}
686 \textit{Types are not required to be placed in type units. In general,
687 only large types such as structure, class, enumeration, and
688 union types included from header files should be considered
689 for separate type units. Base types and other small types
690 are not usually worth the overhead of placement in separate
691 type units. Types that are unlikely to be replicated, such
692 as those defined in the main source file, are also better
693 left in the main compilation unit.}
695 \section{Module, Namespace and Importing Entries}
696 \textit{Modules and namespaces provide a means to collect related
697 entities into a single entity and to manage the names of
701 \subsection{Module Entries}
702 \label{chap:moduleentries}
703 \textit{Several languages have the concept of a \doublequote{module.}
704 \addtoindexx{Modula-2}
705 A Modula\dash 2 definition module
706 \addtoindexx{Modula-2!definition module}
707 may be represented by a module
709 \addtoindex{declaration attribute}
710 (\DWATdeclaration). A
711 \addtoindex{Fortran 90} module
712 \addtoindexx{Fortran!module (Fortran 90)}
713 may also be represented by a module entry
714 (but no declaration attribute is warranted because \addtoindex{Fortran}
715 has no concept of a corresponding module body).}
717 A module is represented by a debugging information entry
719 tag \DWTAGmoduleTARG.
720 Module entries may own other
721 debugging information entries describing program entities
722 whose declaration scopes end at the end of the module itself.
724 If the module has a name, the module entry has a
725 \DWATname{} attribute
726 \addtoindexx{name attribute}
727 whose value is a null\dash terminated string containing
730 The \addtoindex{module entry} may have either a
734 \addtoindexx{high PC attribute}
736 \addtoindexx{low PC attribute}
738 \DWATranges{} attribute
739 \addtoindexx{ranges attribute}
740 whose values encode the contiguous or non-contiguous address
741 ranges, respectively, of the machine instructions generated for
742 the module initialization
743 code\hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}{}
744 (see Section \refersec{chap:codeaddressesandranges}).
746 \addtoindexx{entry PC attribute!for module initialization}
747 \DWATentrypc{} attribute whose value is the address of
748 the first executable instruction of that initialization code
749 (see Section \refersec{chap:entryaddress}).
752 If\hypertarget{chap:DWATprioritymodulepriority}{}
753 the module has been assigned a priority, it may have a
754 \addtoindexx{priority attribute}
755 \DWATpriorityDEFN{} attribute.
756 The value of this attribute is a
757 reference to another debugging information entry describing
758 a variable with a constant value. The value of this variable
759 is the actual constant value of the module\textquoteright s priority,
760 represented as it would be on the target architecture.
762 \subsection{Namespace Entries}
763 \label{chap:namespaceentries}
764 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
765 \addtoindexx{namespace (C++)}
766 implement name hiding, so that names of unrelated things
767 do not accidentally clash in the
768 \addtoindex{global namespace} when an
769 application is linked together.}
771 A namespace is represented by a debugging information entry
772 with the tag \DWTAGnamespaceTARG. A namespace extension
773 is\hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{}
774 represented by a \DWTAGnamespaceNAME{} entry with a
775 \DWATextensionDEFN{}\addtoindexx{extension attribute}
776 attribute referring to the previous extension, or if there
777 is no previous extension, to the original
778 \DWTAGnamespaceNAME{}
779 entry. A namespace extension entry does not need to duplicate
780 information in a previous extension entry of the namespace
781 nor need it duplicate information in the original namespace
782 entry. (Thus, for a namespace with a name,
783 a \DWATname{} attribute
784 \addtoindexx{name attribute}
785 need only be attached directly to the original
786 \DWTAGnamespaceNAME{} entry.)
789 Namespace and namespace extension entries may own
790 \addtoindexx{namespace extension entry}
792 \addtoindexx{namespace declaration entry}
793 debugging information entries describing program entities
794 whose declarations occur in the namespace.
796 A namespace may have a
797 \DWATexportsymbolsDEFN{}\livetarg{chap:DWATexportsymbolsofnamespace}{}
798 attribute\addtoindexx{export symbols attribute}
799 \addtoindexx{inline namespace|see{\textit{also} export symbols attribute}}
800 which is a \CLASSflag{} which
801 indicates that all member names defined within the
802 namespace may be referenced as if they were defined within
803 the containing namespace.
805 \textit{This may be used to describe an \addtoindex{inline namespace} in \addtoindex{C++}}.
807 If a type, variable, or function declared in a namespace is
808 defined outside of the body of the namespace declaration,
809 that type, variable, or function definition entry has a
810 \DWATspecification{} attribute
811 \addtoindexx{specification attribute}
812 whose value is a \livelink{chap:classreference}{reference} to the
813 debugging information entry representing the declaration of
814 the type, variable or function. Type, variable, or function
816 \DWATspecification{} attribute
817 \addtoindexx{specification attribute}
819 to duplicate information provided by the declaration entry
820 referenced by the specification attribute.
822 \textit{The \addtoindex{C++} \addtoindex{global namespace}
824 \addtoindexx{global namespace|see{namespace (C++), global}}
826 \addtoindexx{namespace (C++)!global}
828 \texttt{::f}, for example) is not explicitly represented in
829 DWARF with a namespace entry (thus mirroring the situation
830 in \addtoindex{C++} source).
831 Global items may be simply declared with no
832 reference to a namespace.}
834 \textit{The \addtoindex{C++}
835 compilation unit specific \doublequote{unnamed namespace} may
836 \addtoindexx{namespace (C++)!unnamed}
837 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
838 be represented by a namespace entry with no name attribute in
839 the original namespace declaration entry (and therefore no name
840 attribute in any namespace extension entry of this namespace).
842 C++ states that declarations in the unnamed namespace are
843 implicitly available in the containing scope; a producer
844 should make this effect explicit with the \DWATexportsymbols{}
845 attribute, or by using a \DWTAGimportedmodule{} that is a
846 sibling of the namespace entry and references it.
850 \textit{A compiler emitting namespace information may choose to
851 explicitly represent namespace extensions, or to represent the
852 final namespace declaration of a compilation unit; this is a
853 quality-of-implementation issue and no specific requirements
854 are given here. If only the final namespace is represented,
855 \addtoindexx{namespace (C++)!using declaration}
856 it is impossible for a debugger to interpret using declaration
857 references in exactly the manner defined by the
858 \addtoindex{C++} language.}
860 \textit{For \addtoindex{C++} namespace examples,
861 see Appendix \refersec{app:namespaceexamples}.}
865 \subsection{Imported (or Renamed) Declaration Entries}
866 \label{chap:importedorrenameddeclarationentries}
868 \textit{Some languages support the concept of importing into or
869 making accessible in a given unit certain declarations that occur
870 in a different module or scope. An imported declaration may
871 sometimes be given another name.}
874 An imported declaration is represented by one or
875 \addtoindexx{imported declaration entry}
876 more debugging information entries with the
877 tag \DWTAGimporteddeclarationTARG.
878 When\hypertarget{chap:DWATimportimporteddeclaration}{}
879 an overloaded entity is imported, there is one imported
880 declaration entry for each overloading.
881 Each imported declaration entry has a
882 \DWATimportDEFN{} attribute,\addtoindexx{import attribute}
883 whose value is a \livelink{chap:classreference}{reference} to the
884 debugging information entry representing the declaration that
887 An imported declaration may also have a \DWATname{}
888 attribute\addtoindexx{name attribute}
889 whose value is a null-terminated string containing the
891 imported entity is to be known in the context of the imported
892 declaration entry (which may be different than the name of
893 the entity being imported). If no name is present, then the
894 name by which the entity is to be known is the same as the
895 name of the entity being imported.
897 An imported declaration entry with a name attribute may be
898 used as a general means to rename or provide an alias for
899 \addtoindexx{alias declaration|see{imported declaration entry}}
900 an entity, regardless of the context in which the importing
901 declaration or the imported entity occurs.
903 \textit{A \addtoindex{C++}
904 namespace alias\hypertarget{chap:DWATimportnamespacealias}{}
905 may be represented by an imported declaration entry
906 \addtoindexx{namespace (C++)!alias}
907 with a name attribute whose value is
908 a null-terminated string containing the alias name
909 and a \DWATimportDEFN{} attribute
910 whose value is a \livelink{chap:classreference}{reference} to the
911 applicable original namespace or namespace extension entry.}
913 \textit{A \addtoindex{C++} using declaration may be represented
915 imported\hypertarget{chap:DWATimportnamespaceusingdeclaration}{}
916 \addtoindexx{namespace (C++)!using declaration}
917 declaration entries. When the using declaration
918 refers to an overloaded function, there is one imported
919 declaration entry corresponding to each overloading. Each
920 imported declaration entry has no name attribute but it does
921 have a \DWATimportDEFN{} attribute that refers to the entry for the
922 entity being imported. (\addtoindex{C++}
923 provides no means to \doublequote{rename}
924 an imported entity, other than a namespace).}
927 \textit{A \addtoindex{Fortran} use statement
928 \addtoindexx{Fortran!use statement}
929 \addtoindexx{use statement|see {Fortran, use statement}}
930 with an \doublequote{only list} may be
931 represented by a series of imported declaration entries,
932 one (or more) for each entity that is imported. An entity
933 \addtoindexx{renamed declaration|see{imported declaration entry}}
934 that is renamed in the importing context may be represented
935 by an imported declaration entry with a name attribute that
936 specifies the new local name.
939 \subsection{Imported Module Entries}
940 \label{chap:importedmoduleentries}
942 \textit{Some languages support the concept of importing into or making
943 accessible in a given unit all of the declarations contained
944 within a separate module or namespace.
947 An imported module declaration is represented by a debugging
948 information entry with
949 \addtoindexx{imported module attribute}
951 \addtoindexx{imported module entry}
952 tag \DWTAGimportedmoduleTARG.
954 imported module entry contains a
955 \DWATimport{} attribute
956 \addtoindexx{import attribute}
957 whose value is a \livelink{chap:classreference}{reference}
958 to the module or namespace entry
959 containing the definition and/or declaration entries for
960 the entities that are to be imported into the context of the
961 imported module entry.
963 An imported module declaration may own a set of imported
964 declaration entries, each of which refers to an entry in the
965 module whose corresponding entity is to be known in the context
966 of the imported module declaration by a name other than its
967 name in that module. Any entity in the module that is not
968 renamed in this way is known in the context of the imported
969 module entry by the same name as it is declared in the module.
971 \textit{A \addtoindex{C++} using directive
972 \addtoindexx{namespace (C++)!using directive}
973 \addtoindexx{using directive|see {namespace (C++), using directive}}
974 may be represented by an imported
975 module\hypertarget{chap:DWATimportnamespaceusingdirective}{}
976 entry, with a \DWATimportDEFN{} attribute referring to the namespace
977 entry of the appropriate extension of the namespace (which
978 might be the original namespace entry) and no owned entries.
981 \textit{A \addtoindex{Fortran} use statement
982 \addtoindexx{Fortran!use statement}
983 with a \doublequote{rename list} may be
984 represented by an imported module entry with an import
985 attribute referring to the module and owned entries
986 corresponding to those entities that are renamed as part of
990 \textit{A \addtoindex{Fortran} use statement
991 \addtoindexx{Fortran!use statement}
992 with neither a \doublequote{rename list} nor
993 an \doublequote{only list} may be represented by an imported module
994 entry with an import attribute referring to the module and
995 no owned child entries.
998 \textit{A use statement with an \doublequote{only list} is represented by a
999 series of individual imported declaration entries as described
1000 in Section \refersec{chap:importedorrenameddeclarationentries}.
1004 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
1005 \addtoindexx{Fortran!use statement}
1006 itself imported by a use statement without an explicit mention
1007 may be represented by an imported declaration entry that refers
1008 to the original debugging information entry. For example, given
1025 \textit{the imported declaration entry for Q within module C refers
1026 directly to the variable declaration entry for X in module A
1027 because there is no explicit representation for X in module B.
1030 \textit{A similar situation arises for a \addtoindex{C++} using declaration
1031 \addtoindexx{namespace (C++)!using declaration}
1032 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
1033 that imports an entity in terms of a namespace alias. See
1034 Appendix \refersec{app:namespaceexamples}
1038 \subsection{Imported Unit Entries}
1039 \label{chap:importedunitentries}
1040 \hypertarget{chap:DWATimportimportedunit}{}
1041 The place where a normal or partial compilation unit is imported is
1042 represented by a debugging information entry with the
1043 \addtoindexx{imported unit entry}
1044 tag \DWTAGimportedunitTARG.
1045 An imported unit entry contains a
1046 \DWATimportDEFN{} attribute\addtoindexx{import attribute}
1047 whose value is a \livelink{chap:classreference}{reference} to the
1048 normal or partial compilation unit whose declarations logically
1049 belong at the place of the imported unit entry.
1051 \textit{An imported unit entry does not necessarily correspond to
1052 any entity or construct in the source program. It is merely
1053 \doublequote{glue} used to relate a partial unit, or a compilation
1054 unit used as a partial unit, to a place in some other
1057 \section{Subroutine and Entry Point Entries}
1058 \label{chap:subroutineandentrypointentries}
1060 The following tags exist to describe
1061 debugging information entries
1062 \addtoindexx{function entry|see{subroutine entry}}
1064 \addtoindexx{subroutine entry}
1066 \addtoindexx{subprogram entry}
1068 % FIXME: is entry point entry the right index 'entry'?
1069 \addtoindexx{entry point entry}
1072 \begin{tabular}{lp{9.0cm}}
1073 \DWTAGsubprogramTARG{} & A subroutine or function \\
1074 \DWTAGinlinedsubroutine{} & A particular inlined
1075 \addtoindexx{inlined subprogram entry}
1076 instance of a subroutine or function \\
1077 \DWTAGentrypointTARG{} & An alternate entry point \\
1082 \subsection{General Subroutine and Entry Point Information}
1083 \label{chap:generalsubroutineandentrypointinformation}
1084 The subroutine or entry point entry has a \DWATname{}
1085 attribute whose value is a null-terminated string containing the
1086 subroutine or entry point name.
1087 It may also have a \DWATlinkagename{} attribute as
1088 described in Section \refersec{chap:linkagenames}.
1090 If the name of the subroutine described by an entry with the
1091 \addtoindexx{subprogram entry}
1092 tag \DWTAGsubprogram{}\hypertarget{chap:DWATexternalexternalsubroutine}{}
1093 is visible outside of its containing
1094 compilation unit, that entry has a
1095 \DWATexternalDEFN{} attribute,\addtoindexx{external attribute}
1096 which is a \livelink{chap:classflag}{flag}.
1098 \textit{Additional attributes for functions that are members of a
1099 class or structure are described in
1100 Section \refersec{chap:memberfunctionentries}.
1103 A\hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}{}
1104 subroutine entry may contain a
1105 \DWATmainsubprogramDEFN{} attribute
1106 \addtoindexx{main subprogram attribute}
1108 a \CLASSflag{} whose presence indicates that the
1109 subroutine has been identified as the starting function of
1110 the program. If more than one subprogram contains this
1112 any one of them may be the starting subroutine of the program.
1114 \textit{See also Section \refersec{chap:unitentries}) regarding the
1115 related use of this attribute to indicate that a compilation
1116 unit contains the main subroutine of a program.}
1118 \subsubsection{Calling Convention Information}
1119 \hypertarget{chap:DWATcallingconventionforsubprograms}{}
1120 A subroutine entry may contain a
1121 \DWATcallingconventionDEFN{}
1122 \addtoindexx{calling convention attribute!for subprogram}
1123 attribute, whose value is an
1124 \livelink{chap:classconstant}{integer constant}. The set of
1125 \addtoindexi{calling convention codes for subroutines}{calling convention codes!for subroutines}
1126 is given in Table \refersec{tab:callingconventioncodesforsubroutines}.
1128 \begin{simplenametable}[1.4in]{Calling convention codes for subroutines}{tab:callingconventioncodesforsubroutines}
1132 \end{simplenametable}
1134 If this attribute is not present, or its value is the constant
1135 \DWCCnormalTARG, then the subroutine may be safely called by
1136 obeying the \doublequote{standard} calling conventions of the target
1137 architecture. If the value of the calling convention attribute
1138 is the constant \DWCCnocallTARG, the subroutine does not obey
1139 standard calling conventions, and it may not be safe for the
1140 debugger to call this subroutine.
1142 \textit{Note that \DWCCnormal{} is also used as a calling convention
1143 code for certain types
1144 (see Table \refersec{tab:callingconventioncodesfortypes}).}
1146 If the semantics of the language of the compilation unit
1147 containing the subroutine entry distinguishes between ordinary
1148 subroutines and subroutines that can serve as the \doublequote{main
1149 program,} that is, subroutines that cannot be called
1150 directly according to the ordinary calling conventions,
1151 then the debugging information entry for such a subroutine
1152 may have a calling convention attribute whose value is the
1153 constant \DWCCprogramTARG.
1155 \textit{A common debugger feature is to allow the debugger user to call
1156 a subroutine within the subject program. In certain cases,
1157 however, the generated code for a subroutine will not obey
1158 the standard calling conventions for the target architecture
1159 and will therefore not be safe to call from within a debugger.}
1161 \textit{The \DWCCprogram{}
1162 value is intended to support \addtoindex{Fortran} main
1163 \addtoindexx{Fortran!main program}
1164 programs which in some implementations may not be callable
1165 or which must be invoked in a special way. It is not intended
1166 as a way of finding the entry address for the program.}
1169 \subsubsection{Miscellaneous Subprogram Properties}
1170 \textit{In \addtoindex{C}
1171 there is a difference between the types of functions
1172 declared using function prototype style declarations and
1173 those declared using non-prototype declarations.}
1175 A subroutine entry declared with a function prototype style
1176 declaration may have a
1177 \addtoindexx{prototyped attribute}
1178 \DWATprototypedDEFN{} attribute, which is
1180 The attribute indicates whether a subroutine entry point corresponds
1181 to a function declaration that includes parameter prototype information.
1183 A subprogram entry may have
1184 a\hypertarget{chap:DWATelementalelementalpropertyofasubroutine}{}
1185 \DWATelementalDEFN{} attribute,\addtoindexx{elemental attribute}
1186 which is a \livelink{chap:classflag}{flag}.
1187 The attribute indicates whether the subroutine
1188 or entry point was declared with the \doublequote{elemental} keyword
1191 A\hypertarget{chap:DWATpurepurepropertyofasubroutine}{}
1192 subprogram entry may have a
1193 \addtoindexx{pure attribute}
1194 \DWATpureDEFN{} attribute, which is
1195 a \livelink{chap:classflag}{flag}.
1196 The attribute indicates whether the subroutine was
1197 declared with the \doublequote{pure} keyword or property.
1199 A\hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}{}
1200 subprogram entry may have a
1201 \addtoindexx{recursive attribute}
1202 \DWATrecursiveDEFN{} attribute, which
1203 is a \livelink{chap:classflag}{flag}.
1204 The attribute indicates whether the subroutine
1205 or entry point was declared with the \doublequote{recursive} keyword
1208 A subprogram entry may have a
1210 \livetargi{chap:DWATnoreturnofsubprogram}{attribute}{noreturn attribute},
1211 which is a \CLASSflag. The attribute
1212 indicates whether the subprogram was declared with the \doublequote{noreturn} keyword or property
1213 indicating that the subprogram can be called, but will never return to its caller.
1215 \textit{The \addtoindex{Fortran}
1216 language allows the keywords \texttt{elemental}, \texttt{pure}
1217 and \texttt{recursive} to be included as part of the declaration of
1218 a subroutine; these attributes reflect that usage. These
1219 attributes are not relevant for languages that do not support
1220 similar keywords or syntax. In particular, the \DWATrecursiveNAME{}
1221 attribute is neither needed nor appropriate in languages such
1222 as \addtoindex{C} where functions support recursion by default.}
1225 \subsubsection{Call Site-Related Attributes}
1226 \textit{While subprogram attributes in the previous section provide
1227 information about the subprogram and its entry point(s) as a whole,
1228 the following attributes provide summary information about the calls
1229 that occur within a subprogram.}
1231 A subroutine entry may have \DWATcallalltailcalls,
1232 \DWATcallallcalls{} and/or \DWATcallallsourcecalls{}
1233 attributes, each of which is a \CLASSflag.
1234 \addtoindexx{call site summary information}
1235 \addtoindexx{subroutine call site summary attributes}
1236 These flags indicate the completeness of the call site
1237 information provided by call site entries (see
1238 Section \refersec{chap:callsiteentries}) within the subprogram.
1240 The \DWATcallalltailcallsDEFN{}
1241 \livetargi{chap:DWATcallalltailcallsofasubprogram}{attribute}{all tail calls summary attribute}
1242 indicates that every tail call
1243 that occurs in the code for the subprogram is described by a
1244 \DWTAGcallsite{} entry.
1245 (There may or may not be other non-tail calls to some of the same
1246 target subprograms.)
1248 The \DWATcallallcallsDEFN{}
1249 \livetargi{chap:DWATcallallcallsofasubprogram}{attribute}{all calls summary attribute}
1250 indicates that every non-inlined call
1251 (either a tail call or a normal call) that occurs in the code for the subprogram
1252 is described by a \DWTAGcallsite{} entry.
1254 The \DWATcallallsourcecallsDEFN{}
1255 \livetargi{chap:DWATcallallsourcecallsofasubprogram}{attribute}{all source calls summary attribute}
1256 indicates that every call that occurs in the
1257 code for the subprogram, including every call inlined into it, is described by either a
1258 \DWTAGcallsite{} entry or a \DWTAGinlinedsubroutine{} entry; further, any call
1259 that is optimized out is nonetheless also described using a \DWTAGcallsite{} entry
1260 that has neither a \DWATcallpc{} nor \DWATcallreturnpc{} attribute.
1262 \textit{The \DWATcallallsourcecallsNAME{} attribute is intended for debugging
1263 information format consumers that analyze call graphs.}
1265 If the the \DWATcallallsourcecalls{} attribute is present then the
1266 \DWATcallallcalls{} and \DWATcallalltailcalls{} attributes are
1267 also implicitly present. Similarly, if the
1268 \DWATcallallcalls{} attribute is present then the \DWATcallalltailcalls{}
1269 attribute is implicitly present.
1272 \subsection{Subroutine and Entry Point Return Types}
1273 \label{chap:subroutineandentrypointreturntypes}
1275 If\hypertarget{chap:DWATtypetypeofsubroutinereturn}{}
1276 the subroutine or entry point
1277 \addtoindexx{return type of subroutine}
1278 is a function that returns a
1279 value, then its debugging information entry has
1280 \addtoindexx{type attribute}
1281 a \DWATtypeDEFN{} attribute
1282 to denote the type returned by that function.
1284 \textit{Debugging information entries for
1285 \addtoindex{C} void functions should
1286 not have an attribute for the return type. }
1288 \textit{Debugging information entries for declarations of \addtoindex{C++}
1289 member functions with an
1290 \autoreturntype{} specifier should use an unspecified type entry (see
1291 Section \refersec{chap:unspecifiedtypeentries}).
1292 The debugging information entry for the corresponding definition
1293 should provide the deduced return type. This practice causes the description of
1294 the containing class to be consistent across compilation units, allowing the class
1295 declaration to be placed into a separate type unit if desired.}
1298 \subsection{Subroutine and Entry Point Locations}
1299 \label{chap:subroutineandentrypointlocations}
1301 A subroutine entry may have either a \DWATlowpc{} and
1302 \DWAThighpc{} pair of attributes or a \DWATranges{} attribute
1303 \addtoindexx{ranges attribute}
1305 \addtoindexx{high PC attribute}
1307 \addtoindexx{low PC attribute}
1308 encode the contiguous or non-contiguous address
1309 ranges, respectively, of the machine instructions generated
1310 for the subroutine (see
1311 Section \refersec{chap:codeaddressesandranges}).
1313 A\hypertarget{chap:DWATentrypcentryaddressofsubprogram}{}
1314 subroutine entry may also have a
1315 \addtoindexx{entry PC attribute!for subroutine}
1316 \DWATentrypc{} attribute
1317 whose value is the address of the first executable instruction
1318 of the subroutine (see
1319 Section \refersec{chap:entryaddress}).
1321 An entry point has a \DWATlowpc{} attribute whose value is the
1322 relocated address of the first machine instruction generated
1323 for the entry point.
1326 %\textit{While the \DWATentrypc{} attribute
1327 %\addtoindexx{entry pc attribute!for subroutine}
1328 %might also seem appropriate for this purpose, historically the
1329 %\DWATlowpc{} attribute was used before the
1330 %\DWATentrypc{} was introduced (in
1331 %\addtoindex{DWARF Version 3}).
1332 %There is insufficient reason to change this.}
1334 Subroutines and entry points may also have
1335 \DWATsegment{}\hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}{}
1336 \addtoindexx{segment attribute} and
1337 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
1338 attributes, as appropriate, to specify
1339 which segments the code for the subroutine resides in and
1340 the addressing mode to be used in calling that subroutine.
1342 A subroutine entry representing a subroutine declaration
1343 that is not also a definition does not have code address or
1347 \subsection{Declarations Owned by Subroutines and Entry Points}
1348 \label{chap:declarationsownedbysubroutinesandentrypoints}
1349 \addtoindexx{subroutine formal parameters}
1350 The declarations enclosed by a subroutine or entry point are
1351 represented by debugging information entries that are owned
1352 by the subroutine or entry point entry. Entries representing
1353 \addtoindexx{formal parameter}
1354 the formal parameters of the subroutine or entry point appear
1355 in the same order as the corresponding declarations in the
1359 \textit{There is no ordering requirement for entries for declarations
1360 other than formal parameters. The formal parameter
1361 entries may be interspersed with other entries used by formal
1362 parameter entries, such as type entries.}
1364 The unspecified (sometimes called \doublequote{varying})
1365 parameters of a subroutine parameter list are
1366 represented by a debugging information
1367 entry\addtoindexx{unspecified parameters entry}
1368 with the tag \DWTAGunspecifiedparametersTARG.
1371 The entry for a subroutine that includes a
1372 \addtoindex{Fortran}
1373 \addtoindexx{Fortran!common block}
1374 \livelink{chap:fortrancommonblock}{common}
1375 \livelink{chap:commonblockentry}{block}
1376 \addtoindexx{common block|see{Fortran common block}}
1377 has a child entry with the
1378 tag \DWTAGcommoninclusionTARG.
1379 The\hypertarget{chap:commonreferencecommonblockusage}{}
1380 common inclusion entry has a
1381 \DWATcommonreferenceDEFN{} attribute
1382 \addtoindexx{common block reference attribute}
1383 whose value is a \livelink{chap:classreference}{reference}
1384 to the debugging information entry
1385 for the common \nolink{block} being included
1386 (see Section \refersec{chap:commonblockentries}).
1388 \subsection{Low-Level Information}
1389 \label{chap:lowlevelinformation}
1391 A\hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{}
1392 subroutine or entry point entry may have a
1393 \addtoindexx{return address attribute}
1394 \DWATreturnaddrDEFN{}
1395 attribute, whose value is a location description. The location
1396 specified is the place where the return address for the
1397 subroutine or entry point is stored.
1399 A\hypertarget{chap:DWATframebasesubroutineframebaseaddress}{}
1400 subroutine or entry point entry may also have a
1401 \addtoindexx{frame base attribute}
1402 \DWATframebaseDEFN{} attribute, whose value is a location
1403 description that describes the \doublequote{frame base} for the
1404 subroutine or entry point. If the location description is
1405 a simple register location description, the given register
1406 contains the frame base address. If the location description is
1407 a DWARF expression, the result of evaluating that expression
1408 is the frame base address. Finally, for a
1409 \addtoindex{location list},
1410 this interpretation applies to each location description
1411 contained in the list of \addtoindex{location list} entries.
1413 \textit{The use of one of the \DWOPregn{}
1414 operations in this context is equivalent to using
1415 \DWOPbregn(0) but more
1416 compact. However, these are not equivalent in general.}
1419 \textit{The frame base for a subprogram is typically an address
1420 relative to the first unit of storage allocated for the
1421 subprogram\textquoteright s stack frame. The \DWATframebase{} attribute
1422 can be used in several ways:}
1423 \begin{enumerate}[1. ]
1424 \item \textit{In subprograms that need
1425 \addtoindexx{location list}
1426 location lists to locate local
1427 variables, the \DWATframebase{} can hold the needed location
1428 list, while all variables\textquoteright\ location descriptions can be
1429 simpler ones involving the frame base.}
1431 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1432 within nested routines.
1433 (See also \DWATstaticlink, below)}
1437 \textit{Some languages support nested subroutines. In such languages,
1438 it is possible to reference the local variables of an
1439 outer subroutine from within an inner subroutine. The
1440 \DWATstaticlink{} and \DWATframebase{} attributes allow
1441 debuggers to support this same kind of referencing.}
1443 If\hypertarget{chap:DWATstaticlinklocationofuplevelframe}{}
1444 a subroutine or entry point is nested, it may have a
1445 \addtoindexx{address!uplevel|see {static link attribute}}
1446 \addtoindexx{uplevel address|see {static link attribute}}
1447 \DWATstaticlinkDEFN{} attribute, whose value is a location
1448 description that computes the frame base of the relevant
1449 instance of the subroutine that immediately encloses the
1450 subroutine or entry point.
1452 In the context of supporting nested subroutines, the
1453 \DWATframebase{} attribute value should obey the following
1456 \begin{enumerate}[1. ]
1457 \item It should compute a value that does not change during the
1458 life of the subprogram, and
1460 \item The computed value should be unique among instances of
1461 the same subroutine. (For typical \DWATframebase{} use, this
1462 means that a recursive subroutine\textquoteright s stack frame must have
1466 \textit{If a debugger is attempting to resolve an up\dash level reference
1467 to a variable, it uses the nesting structure of DWARF to
1468 determine which subroutine is the lexical parent and the
1469 \DWATstaticlink{} value to identify the appropriate active
1470 frame of the parent. It can then attempt to find the reference
1471 within the context of the parent.}
1475 \subsection{Types Thrown by Exceptions}
1476 \label{chap:typesthrownbyexceptions}
1478 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1479 it may validly throw.}
1481 If a subroutine explicitly declares that it may throw
1482 \addtoindexx{exception thrown|see{thrown type entry}}
1484 \addtoindexx{thrown exception|see{thrown type entry}}
1485 exception of one or more types, each such type is
1486 represented by a debugging information entry with
1487 \addtoindexx{thrown type entry}
1489 \DWTAGthrowntypeTARG.
1490 Each such entry is a child of the entry
1491 representing the subroutine that may throw this type. Each
1492 thrown type entry contains
1493 \addtoindexx{type attribute}
1494 a \DWATtype{} attribute, whose
1495 value is a \livelink{chap:classreference}{reference}
1496 to an entry describing the type of the
1497 exception that may be thrown.
1499 \subsection{Function Template Instantiations}
1500 \label{chap:functiontemplateinstantiations}
1502 \textit{In \addtoindex{C++}, a function template is a generic definition of
1503 a function that is instantiated differently for calls with
1504 values of different types. DWARF does not represent the generic
1505 template definition, but does represent each instantiation.}
1508 A \addtoindex{function template instantiation}\addtoindexx{template instantiation!function}
1509 is represented by a debugging information entry with the
1510 \addtoindexx{subprogram entry!use for template instantiation}
1511 tag \DWTAGsubprogram.
1513 exceptions, such an entry will contain the same attributes and
1514 will have the same types of child entries as would an entry
1515 for a subroutine defined explicitly using the instantiation
1516 types and values. The exceptions are:
1518 \begin{enumerate}[1. ]
1519 \item Template parameters are described and referenced as specified in
1520 Section \refersec{chap:templateparameters}.
1523 \item If the compiler has generated a separate compilation unit
1524 to hold the template instantiation and that compilation unit
1525 has a different name from the compilation unit containing
1526 the template definition, the name attribute for the debugging
1527 information entry representing that compilation unit is empty
1530 \item If the subprogram entry representing the template
1531 instantiation or any of its child entries contain declaration
1532 coordinate attributes, those attributes refer to the source
1533 for the template definition, not to any source generated
1534 artificially by the compiler for this instantiation.
1539 \subsection{Inlinable and Inlined Subroutines}
1540 \label{chap:inlinedsubroutines}
1541 A declaration or a definition of an inlinable subroutine
1542 is represented by a debugging information entry with the
1543 tag \DWTAGsubprogram.
1544 The entry for a subroutine
1545 \addtoindexx{subprogram entry!use in inlined subprogram}
1546 that is\hypertarget{chap:DWATinlineinlinedsubroutine}{}
1547 explicitly declared to be available for inline expansion or
1548 that was expanded inline implicitly by the compiler has a
1549 \addtoindexx{inline attribute}
1550 \DWATinlineDEFN{} attribute whose value is an
1551 \livelink{chap:classconstant}{integer constant}. The
1552 set of values for the \DWATinline{} attribute is given in
1553 Table \refersec{tab:inlinecodes}.
1557 \caption{Inline codes}
1558 \label{tab:inlinecodes}
1559 \begin{tabular}{l|P{8cm}}
1561 Name&Meaning\\ \hline
1562 \DWINLnotinlinedTARG{} & Not declared inline nor inlined by the
1563 \mbox{compiler} (equivalent to the absence of the
1564 containing \DWATinline{} attribute) \\
1565 \DWINLinlinedTARG{} & Not declared inline but inlined by the \mbox{compiler} \\
1566 \DWINLdeclarednotinlinedTARG{} & Declared inline but
1567 not inlined by the \mbox{compiler} \\
1568 \DWINLdeclaredinlinedTARG{} & Declared inline and inlined by the
1574 \textit{In \addtoindex{C++}, a function or a constructor declared with
1575 \addttindex{constexpr} is implicitly declared inline. The abstract
1576 instance (see Section \refersec{chap:abstractinstances})
1577 is represented by a debugging information
1578 entry with the tag \DWTAGsubprogram. Such an entry has a
1579 \DWATinline{} attribute whose value is \DWINLinlined.}
1582 \subsubsection{Abstract Instances}
1583 \label{chap:abstractinstances}
1584 Any subroutine entry that contains a
1585 \DWATinlineDEFN{} attribute\addtoindexx{inline attribute}
1586 whose value is other than
1588 is known as an \definition{abstract instance root}.
1589 \addtoindexx{abstract instance!root}
1590 \hypertarget{chap:DWATinlineabstracttinstance}{}
1591 Any debugging information entry that is owned (either
1592 directly or indirectly) by an abstract instance root
1594 \definition{abstract instance entry.}\addtoindexx{abstract instance!entry}
1595 Any set of abstract instance entries that are all
1596 children (either directly or indirectly) of some abstract
1597 instance root, together with the root itself, is known as an
1598 \definition{abstract instance tree.}\addtoindexx{abstract instance!tree}
1599 However, in the case where an abstract instance tree is
1600 nested within another abstract instance tree, the entries in the
1601 \addtoindex{nested abstract instance}
1602 tree are not considered to be entries in the outer abstract
1606 Each abstract instance root is either part of a larger
1607 \addtoindexx{abstract instance!root}
1608 tree (which gives a context for the root) or
1609 \addtoindexx{specification attribute}
1611 \DWATspecification{}
1612 to refer to the declaration in context.
1614 \textit{For example, in \addtoindex{C++} the context might be a namespace
1615 declaration or a class declaration.}
1617 \textit{Abstract instance trees are defined so that no entry is part
1618 of more than one abstract instance tree.}
1620 Attributes and children in an abstract instance are shared
1621 by all concrete instances (see Section \refersec{chap:concreteinstances}).
1623 A debugging information entry that is a member of an abstract
1624 instance tree should not contain any attributes which describe
1625 aspects of the subroutine which vary between distinct inlined
1626 expansions or distinct out-of-line expansions. For example,
1627 \addtoindexx{entry pc attribute!and abstract instance}
1638 \addtoindexx{location attribute!and abstract instance}
1640 \addtoindexx{ranges attribute!and abstract instance}
1642 \addtoindexx{high PC attribute!and abstract instance}
1644 \addtoindexx{low PC attribute!and abstract instance}
1646 \addtoindexx{segment attribute!and abstract instance}
1648 \addtoindexx{return address attribute!and abstract instance}
1650 \addtoindexx{segment attribute!and abstract instance}
1652 \addtoindexx{start scope attribute!and abstract instance}
1656 \textit{It would not make sense normally to put these attributes into
1657 abstract instance entries since such entries do not represent
1658 actual (concrete) instances and thus do not actually exist at
1659 run\dash time. However,
1660 see Appendix \refersec{app:inlineouteronenormalinner}
1661 for a contrary example.}
1663 The rules for the relative location of entries belonging to
1664 abstract instance trees are exactly the same as for other
1665 similar types of entries that are not abstract. Specifically,
1666 the rule that requires that an entry representing a declaration
1667 be a direct child of the entry representing the scope of the
1668 declaration applies equally to both abstract and non-abstract
1669 entries. Also, the ordering rules for formal parameter entries,
1670 member entries, and so on, all apply regardless of whether
1671 or not a given entry is abstract.
1674 \subsubsection{Concrete Instances}
1675 \label{chap:concreteinstances}
1677 Each inline expansion of a subroutine is represented
1678 by a debugging information entry with the
1679 tag \DWTAGinlinedsubroutineTARG.
1680 Each such entry should be a direct
1681 child of the entry that represents the scope within which
1682 the inlining occurs.
1685 Each inlined subroutine entry may have either a
1687 and \DWAThighpc{} pair of attributes
1688 \addtoindexx{high PC attribute}
1689 \addtoindexx{low PC attribute}
1690 or a \DWATranges{}\addtoindexx{ranges attribute}
1691 attribute whose values encode the contiguous or non-contiguous
1692 address ranges, respectively, of the machine instructions
1693 generated for the inlined subroutine (see
1694 Section \referfol{chap:codeaddressesandranges}).
1695 An\hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}{}
1696 inlined subroutine entry may
1697 \addtoindexx{inlined subprogram entry!in concrete instance}
1699 \addtoindexx{inlined subprogram entry}
1701 \addtoindexx{entry PC attribute!for inlined subprogram}
1704 attribute, representing the first executable instruction of
1705 the inline expansion (see
1706 Section \refersec{chap:entryaddress}).
1708 % Positions of the 3 targets here is a bit arbitrary.
1709 An inlined\hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{}
1710 subroutine\hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{}
1711 entry\hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{}
1712 may also have \DWATcallfileDEFN,
1713 \DWATcalllineDEFN{} and \DWATcallcolumnDEFN{} attributes,
1714 \addtoindexx{inlined call location attributes}
1716 value is an \livelink{chap:classconstant}{integer constant}.
1717 These attributes represent the
1718 source file, source line number, and source column number,
1719 respectively, of the first character of the statement or
1720 expression that caused the inline expansion. The call file,
1721 call line, and call column attributes are interpreted in
1722 the same way as the declaration file, declaration line, and
1723 declaration column attributes, respectively (see
1724 Section \refersec{chap:declarationcoordinates}).
1726 \textit{The call file, call line and call column coordinates do not
1727 describe the coordinates of the subroutine declaration that
1728 was inlined, rather they describe the coordinates of the call.
1731 An inlined subroutine entry may have
1732 a\hypertarget{chap:DWATconstexprcompiletimeconstantfunction}{}
1733 \DWATconstexprDEFN{} attribute,\addtoindexx{constant expression attribute}
1734 which is a \livelink{chap:classflag}{flag}
1735 whose presence indicates that the
1736 subroutine has been evaluated as a compile\dash time constant. Such
1737 an entry may also have a \DWATconstvalue{} attribute,
1738 whose value may be of any form that is appropriate for the
1739 representation of the subroutine's return value. The value of
1740 this attribute is the actual return value of the subroutine,
1741 represented as it would be on the target architecture.
1743 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1744 \addttindex{constexpr}
1745 is called with constant expressions, then the corresponding
1746 concrete inlined instance has a
1747 \DWATconstexpr{} attribute,
1748 as well as a \DWATconstvalue{} attribute whose value represents
1749 the actual return value of the concrete inlined instance.}
1751 Any debugging information entry that is owned (either
1752 directly or indirectly) by a debugging information entry
1753 with the tag \DWTAGinlinedsubroutine{} is referred to as a
1754 \doublequote{concrete inlined instance entry.} Any entry that has
1756 \DWTAGinlinedsubroutine{}
1757 is known as a \doublequote{concrete inlined instance root.}
1758 Any set of concrete inlined instance
1759 entries that are all children (either directly or indirectly)
1760 of some concrete inlined instance root, together with the root
1761 itself, is known as a \doublequote{concrete inlined instance tree.}
1762 However, in the case where a concrete inlined instance tree
1763 is nested within another concrete instance tree, the entries
1764 in the \addtoindex{nested concrete inline instance} tree
1765 are not considered to
1766 be entries in the outer concrete instance tree.
1769 \textit{Concrete inlined instance trees are defined so that no entry
1770 is part of more than one concrete inlined instance tree. This
1771 simplifies later descriptions.}
1773 Each concrete inlined instance tree is uniquely associated
1774 with one (and only one) abstract instance tree.
1776 \textit{Note, however, that the reverse is not true. Any given abstract
1777 instance tree may be associated with several different concrete
1778 inlined instance trees, or may even be associated with zero
1779 concrete inlined instance trees.}
1781 Concrete inlined instance entries may omit attributes that
1782 are not specific to the concrete instance (but present in
1783 the abstract instance) and need include only attributes that
1784 are specific to the concrete instance (but omitted in the
1785 abstract instance). In place of these omitted attributes,
1786 each\hypertarget{chap:DWATabstractorigininlineinstance}{}
1787 concrete inlined instance entry has a
1788 \addtoindexx{abstract origin attribute}
1789 \DWATabstractoriginDEFN{}
1790 attribute that may be used to obtain the missing information
1791 (indirectly) from the associated abstract instance entry. The
1792 value of the abstract origin attribute is a reference to the
1793 associated abstract instance entry.
1795 If an entry within a concrete inlined instance tree contains
1796 attributes describing the
1797 \addtoindexx{declaration coordinates!in concrete instance}
1798 \livelink{chap:declarationcoordinates}{declaration coordinates}
1799 of that entry, then those attributes should refer to the file, line
1800 and column of the original declaration of the subroutine,
1801 not to the point at which it was inlined. As a consequence,
1802 they may usually be omitted from any entry that has an abstract
1806 For each pair of entries that are associated via a
1807 \addtoindexx{abstract origin attribute}
1808 \DWATabstractorigin{} attribute, both members of the pair
1809 have the same tag. So, for example, an entry with the tag
1810 \DWTAGvariable{} can only be associated with another entry
1811 that also has the tag \DWTAGvariable. The only exception
1812 to this rule is that the root of a concrete instance tree
1813 (which must always have the tag \DWTAGinlinedsubroutine)
1814 can only be associated with the root of its associated abstract
1815 instance tree (which must have the tag \DWTAGsubprogram).
1818 In general, the structure and content of any given concrete
1819 inlined instance tree will be closely analogous to the
1820 structure and content of its associated abstract instance
1821 tree. There are a few exceptions:
1823 \begin{enumerate}[1. ]
1824 \item An entry in the concrete instance tree may be omitted if
1826 \addtoindexx{abstract origin attribute}
1827 \DWATabstractorigin{} attribute and either
1828 has no children, or its children are omitted. Such entries
1829 would provide no useful information. In C\dash like languages,
1830 such entries frequently include types, including structure,
1831 union, class, and interface types; and members of types. If any
1832 entry within a concrete inlined instance tree needs to refer
1833 to an entity declared within the scope of the relevant inlined
1834 subroutine and for which no concrete instance entry exists,
1835 the reference should refer to the abstract instance entry.
1838 \item Entries in the concrete instance tree which are associated
1839 with entries in the abstract instance tree such that neither
1840 has a \DWATname{} attribute,
1841 \addtoindexx{name attribute}
1842 and neither is referenced by
1843 any other debugging information entry, may be omitted. This
1844 may happen for debugging information entries in the abstract
1845 instance trees that became unnecessary in the concrete instance
1846 tree because of additional information available there. For
1847 example, an anonymous variable might have been created and
1848 described in the abstract instance tree, but because of
1849 the actual parameters for a particular inlined expansion,
1850 it could be described as a constant value without the need
1851 for that separate debugging information entry.
1854 \item A concrete instance tree may contain entries which do
1855 not correspond to entries in the abstract instance tree
1856 to describe new entities that are specific to a particular
1857 inlined expansion. In that case, they will not have associated
1858 entries in the abstract instance tree, should not contain
1859 \addtoindexx{abstract origin attribute}
1860 \DWATabstractorigin{} attributes, and must contain all their
1861 own attributes directly. This allows an abstract instance tree
1862 to omit debugging information entries for anonymous entities
1863 that are unlikely to be needed in most inlined expansions. In
1864 any expansion which deviates from that expectation, the
1865 entries can be described in its concrete inlined instance tree.
1869 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1870 \label{chap:outoflineinstancesofinlinedsubroutines}
1871 Under some conditions, compilers may need to generate concrete
1872 executable instances of inlined subroutines other than at
1873 points where those subroutines are actually called. Such
1874 concrete instances of inlined subroutines are referred to as
1875 \doublequote{concrete out\dash of\dash line instances.}
1877 \textit{In \addtoindex{C++}, for example,
1878 taking the address of a function declared
1879 to be inline can necessitate the generation of a concrete
1880 out\dash of\dash line instance of the given function.}
1882 The DWARF representation of a concrete out-of-line instance
1883 of an inlined subroutine is essentially the same as for a
1884 concrete inlined instance of that subroutine (as described in
1885 the preceding section). The representation of such a concrete
1886 % It is critical that the hypertarget and livelink be
1887 % separated to avoid problems with latex.
1889 \addtoindexx{abstract origin attribute}
1891 \hypertarget{chap:DWATabstractoriginoutoflineinstance}{}
1893 \DWATabstractoriginDEFN{}
1894 attributes in exactly the same way as they are used for
1895 a concrete inlined instance (that is, as references to
1896 corresponding entries within the associated abstract instance
1899 The differences between the DWARF representation of a
1900 concrete out\dash of\dash line instance of a given subroutine and the
1901 representation of a concrete inlined instance of that same
1902 subroutine are as follows:
1903 \begin{enumerate}[1. ]
1904 \item The root entry for a concrete out\dash of\dash line instance
1905 of a given inlined subroutine has the same tag as does its
1906 associated (abstract) inlined subroutine entry (that is, tag
1907 \DWTAGsubprogram{} rather than \DWTAGinlinedsubroutine).
1909 \item The root entry for a concrete out\dash of\dash line instance tree
1910 is normally owned by the same parent entry that also owns
1911 the root entry of the associated abstract instance. However,
1912 it is not required that the abstract and out\dash of\dash line instance
1913 trees be owned by the same parent entry.
1917 \subsubsection{Nested Inlined Subroutines}
1918 \label{nestedinlinedsubroutines}
1919 Some languages and compilers may permit the logical nesting of
1920 a subroutine within another subroutine, and may permit either
1921 the outer or the nested subroutine, or both, to be inlined.
1923 For a non-inlined subroutine nested within an inlined
1924 subroutine, the nested subroutine is described normally in
1925 both the abstract and concrete inlined instance trees for
1926 the outer subroutine. All rules pertaining to the abstract
1927 and concrete instance trees for the outer subroutine apply
1928 also to the abstract and concrete instance entries for the
1932 For an inlined subroutine nested within another inlined
1933 subroutine, the following rules apply to their abstract and
1934 \addtoindexx{abstract instance!nested}
1935 \addtoindexx{concrete instance!nested}
1936 concrete instance trees:
1938 \begin{enumerate}[1. ]
1939 \item The abstract instance tree for the nested subroutine is
1940 described within the abstract instance tree for the outer
1941 subroutine according to the rules in
1942 Section \refersec{chap:abstractinstances}, and
1943 without regard to the fact that it is within an outer abstract
1946 \item Any abstract instance tree for a nested subroutine is
1947 always omitted within the concrete instance tree for an
1950 \item A concrete instance tree for a nested subroutine is
1951 always omitted within the abstract instance tree for an
1954 \item The concrete instance tree for any inlined or
1955 \addtoindexx{out-of-line instance}
1957 \addtoindexx{out-of-line instance|see{\textit{also} concrete out-of-line instance}}
1958 expansion of the nested subroutine is described within a
1959 concrete instance tree for the outer subroutine according
1961 Sections \refersec{chap:concreteinstances} or
1962 \referfol{chap:outoflineinstancesofinlinedsubroutines}
1964 and without regard to the fact that it is within an outer
1965 concrete instance tree.
1968 \textit{See Appendix \refersec{app:inliningexamples}
1969 for discussion and examples.}
1971 \subsection{Trampolines}
1972 \label{chap:trampolines}
1974 \textit{A trampoline is a compiler\dash generated subroutine that serves
1975 as\hypertarget{chap:DWATtrampolinetargetsubroutine}{}
1976 an intermediary in making a call to another subroutine. It may
1977 adjust parameters and/or the result (if any) as appropriate
1978 to the combined calling and called execution contexts.}
1980 A trampoline is represented by a debugging information entry
1981 \addtoindexx{trampoline (subprogram) entry}
1982 with the tag \DWTAGsubprogram{} or \DWTAGinlinedsubroutine{}
1984 \addtoindexx{trampoline attribute}
1985 a \DWATtrampolineDEFN{} attribute.
1987 attribute indicates the target subroutine of the trampoline,
1988 that is, the subroutine to which the trampoline passes
1989 control. (A trampoline entry may but need not also have a
1990 \DWATartificial{} attribute.)
1993 The value of the trampoline attribute may be represented
1994 using any of the following forms:
1997 \item If the value is of class \CLASSreference{}, then the value
1998 specifies the debugging information entry of the target
2001 \item If the value is of class \CLASSaddress{}, then the value is
2002 the relocated address of the target subprogram.
2005 \item If the value is of class \CLASSstring{}, then the value is the
2006 (possibly mangled) \addtoindexx{mangled names}
2007 name of the target subprogram.
2009 \item If the value is of class \CLASSflag, then the value true
2010 indicates that the containing subroutine is a trampoline but
2011 that the target subroutine is not known.
2015 The target subprogram may itself be a trampoline. (A sequence
2016 of trampolines necessarily ends with a non-trampoline
2019 \textit{In \addtoindex{C++}, trampolines may be used to implement
2020 derived virtual member functions; such trampolines typically
2022 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2023 in the course of passing control.
2024 Other languages and environments may use trampolines in a manner
2025 sometimes known as transfer functions or transfer vectors.}
2027 \textit{Trampolines may sometimes pass control to the target
2028 subprogram using a branch or jump instruction instead of a
2029 call instruction, thereby leaving no trace of their existence
2030 in the subsequent execution context. }
2032 \textit{This attribute helps make it feasible for a debugger to arrange
2033 that stepping into a trampoline or setting a breakpoint in
2034 a trampoline will result in stepping into or setting the
2035 breakpoint in the target subroutine instead. This helps to
2036 hide the compiler generated subprogram from the user. }
2038 \section{Call Site Entries and Parameters}
2039 \label{chap:callsiteentriesandparameters}
2041 A call site entry describes a call from one subprogram to another in the
2042 source program. It provides information about the actual parameters of
2043 the call so that they may be more easily accessed by a debugger. When
2044 used together with call frame information
2045 (see Section \refersec{chap:callframeinformation}),
2046 call site entries can be useful for computing the value of an actual parameter
2047 passed by a caller, even when the location description for the callee's
2048 corresponding formal parameter does not provide a current location for
2049 the formal parameter.}
2051 \textit{The DWARF expression for computing the value of an actual parameter at
2052 a call site may refer to registers or memory locations. The expression
2053 assumes these contain the values they would have at the point where the
2054 call is executed. After the called subprogram has been entered, these
2055 registers and memory locations might have been modified. In order to
2056 recover the values that existed at the point of the call (to allow
2057 evaluation of the DWARF expression for the actual parameter), a debugger
2058 may virtually unwind the subprogram activation
2059 (see Section \refersec{chap:callframeinformation}). Any
2060 register or memory location that cannot be recovered is referred to as
2061 "clobbered by the call."}
2063 A source call can be compiled into different types of machine code:
2066 A \textit{normal call} uses a call-like instruction which transfers
2067 control to the start of some subprogram and preserves the call site
2068 location for use by the callee.
2071 A \textit{tail call} uses a jump-like instruction which
2072 transfers control to the start of some subprogram, but
2073 there is no call site location address to preserve
2074 (and thus none is available using the
2075 virtual unwind information).
2078 A \textit{tail recursion call} is a call
2079 to the current subroutine which is compiled as a jump
2080 to the current subroutine.
2084 An \textit{inline (or inlined) call} is a call to an inlined subprogram,
2085 where at least one instruction has the location of the inlined subprogram
2086 or any of its blocks or inlined subprograms.
2090 There are also different types of \doublequote{optimized out} calls:
2093 An \textit{optimized out (normal) call} is a call that is in unreachable code that
2094 has not been emitted (such as, for example, the call to \texttt{foo} in
2095 \texttt{if (0) foo();}).
2097 An \textit{optimized out inline call}
2098 is a call to an inlined subprogram which either did not expand to any instructions
2099 or only parts of instructions belong to it and for debug information purposes those
2100 instructions are given a location in the caller.
2103 \DWTAGcallsite{} entries describe normal and tail calls but not tail recursion calls,
2104 while \DWTAGinlinedsubroutine{} entries describe inlined calls
2105 (see Section \refersec{chap:inlinedsubroutines}).
2106 Call site entries cannot describe tail recursion or optimized out calls.
2108 \subsection{Call Site Entries}
2109 \label{chap:callsiteentries}
2110 A call site is represented by a debugging information entry with the tag
2111 \DWTAGcallsiteTARG{}\addtoindexx{call site entry}.
2112 The entry for a call site is owned by the innermost
2113 debugging information entry representing the scope within which the
2114 call is present in the source program.
2117 \textit{A scope entry (for example, a lexical block) that would not
2118 otherwise be present in the debugging information of a subroutine
2119 need not be introduced solely to represent the immediately containing scope
2122 The call site entry may have a
2123 \DWATcallreturnpcDEFN{}\addtoindexx{call site return pc attribute}
2124 \livetargi{chap:DWATcallreturnpcofcallsite}{attribute}{call return pc attribute}
2125 which is the return address after the call.
2126 The value of this attribute corresponds to the return address
2127 computed by call frame information in the called subprogram
2128 (see Section \refersec{datarep:callframeinformation}).
2130 \textit{On many architectures the return address is the
2131 address immediately following the call instruction, but
2132 on architectures with delay slots it might
2133 be an address after the delay slot of the call.}
2135 The call site entry may have a
2136 \DWATcallpcDEFN{}\addtoindexx{call pc attribute}
2137 \livetargi{chap:DWATcallpcofcallsite}{attribute}{call pc attribute}
2138 which is the address of the
2139 call-like instruction for a normal call or the jump-like
2140 instruction for a tail call.
2142 If the call site entry corresponds to a tail call, it has the
2143 \DWATcalltailcallDEFN{}\addtoindexx{call tail call attribute}
2144 \livetargi{chap:DWATcalltailcallofcallsite}{attribute}{call tail call attribute},
2145 which is a \CLASSflag.
2147 The call site entry may have a
2148 \DWATcalloriginDEFN{}\addtoindexx{call origin attribute}
2149 \livetargi{chap:DWATcalloriginofcallsite}{attribute}{call origin attribute}
2150 which is a \CLASSreference. For direct calls or jumps where the called
2151 subprogram is known it is a reference to the called subprogram's debugging
2152 information entry. For indirect calls it may be a reference to a
2153 \DWTAGvariable{}, \DWTAGformalparameter{} or \DWTAGmember{} entry representing
2154 the subroutine pointer that is called.
2157 The call site may have a
2158 \DWATcalltargetDEFN{}\addtoindexx{call target attribute}
2159 \livetargi{chap:DWATcalltargetofcallsite}{attribute}{call target attribute} which is
2160 a DWARF expression. For indirect calls or jumps where it is unknown at
2161 compile time which subprogram will be called the expression computes the
2162 address of the subprogram that will be called. The DWARF expression should
2163 not use register or memory locations that might be clobbered by the call.
2166 The call site entry may have a
2167 \DWATcalltargetclobberedDEFN{}\addtoindexx{call target clobbered attribute}
2168 \livetargi{chap:DWATcalltargetclobberedofcallsite}{attribute}{call target clobbered attribute}
2169 which is a DWARF expression. For indirect calls or jumps where the
2170 address is not computable without use of registers or memory locations that
2171 might be clobbered by the call the \DWATcalltargetclobberedNAME{}
2172 attribute is used instead of the \DWATcalltarget{} attribute.
2174 \textit{The expression of a call target clobbered attribute may only be
2175 valid at the time the call or call-like transfer of control is executed.}
2177 The call site entry may have a \DWATtypeDEFN{}\addtoindexx{call type attribute}
2178 \livetargi{chap:DWATtypeofcallsite}{attribute}{type attribute!of call site entry}
2179 referencing a debugging information entry for the type of the called function.
2181 \textit{When \DWATcallorigin{} is present, \DWATtypeNAME{} is usually omitted.}
2183 The call site entry may have
2184 \DWATcallfileDEFN{}\addtoindexx{call file attribute},
2185 \DWATcalllineDEFN{}\addtoindexx{call line attribute} and
2186 \DWATcallcolumnDEFN{}\addtoindexx{call column attribute}
2187 \livetargi{chap:DWATcallfileofcallsite}{attributes,}{call file attribute!of call site entry}
2188 \livetargi{chap:DWATcalllineofcallsite}{}{call line attribute!of call site entry}
2189 \livetargi{chap:DWATcallcolumnofcallsite}{}{call column attribute!of call site entry}
2190 each of whose value is an integer constant.
2191 These attributes represent the source file, source line number, and source
2192 column number, respectively, of the first character of the call statement or
2193 expression. The call file, call line, and call column attributes are
2194 interpreted in the same way as the declaration file, declaration
2195 line, and declaration column attributes, respectively
2196 (see Section \refersec{chap:declarationcoordinates}).
2198 \textit{The call file, call line and call column coordinates do
2199 not describe the coordinates of the subroutine declaration that
2200 was called, rather they describe the coordinates of the call.}
2203 \subsection{Call Site Parameters}
2204 \label{chap:callsiteparameters}
2205 The call site entry may own
2206 \DWTAGcallsiteparameterTARG{}\index{call site parameter entry}
2207 debugging information entries representing the parameters passed
2209 Call site parameter entries occur in the same order as the
2210 corresponding parameters in the source.
2211 Each such entry has a \DWATlocation{} attribute which is a location
2212 description. This location description
2213 describes where the parameter is passed
2214 (usually either some register, or a memory location expressible as
2215 the contents of the stack register plus some offset).
2218 Each \DWTAGcallsiteparameter{} entry may have a
2219 \DWATcallvalueDEFN{}\addtoindexx{call value attribute}
2220 \livetargi{chap:DWATcallvalueofcallparameter}{attribute}{call value attribute}
2221 which is a DWARF expression
2222 which when evaluated yields the value of the parameter at the time of the call.
2224 \textit{The expression should not use registers or memory
2225 locations that might be clobbered by the call, as it might be evaluated after
2226 virtually unwinding from the called function back to the caller. If it is not
2227 possible to avoid registers or memory locations that might be clobbered by
2228 the call in the expression, then the \DWATcallvalueNAME{} attribute should
2231 \textit{The reason for the restriction is that the value of the parameter may be
2232 needed in the midst of the callee, where the call clobbered registers or
2233 memory might be already clobbered, and if the consumer is not assured by
2234 the producer it can safely use those values, the consumer can not safely
2235 use the values at all.}
2237 For parameters passed by reference, where the code passes a pointer to
2238 a location which contains the parameter, or for reference type parameters,
2239 the \DWTAGcallsiteparameter{} entry may also have a
2240 \DWATcalldatalocationDEFN{}\addtoindexx{call data location attribute}
2241 \livetargi{chap:DWATcalldatalocationofcallparameter}{attribute}{call data location attribute}
2242 whose value is a location description and a
2243 \DWATcalldatavalueDEFN{}\addtoindexx{call data value attribute}
2244 \livetargi{chap:DWATcalldatavalueofcallparameter}{attribute}{call data value attribute}
2245 whose value is a DWARF expression. The \DWATcalldatalocationNAME{} attribute
2246 \addtoindexx{call data location attribute}
2247 describes where the referenced value lives during the call. If it is just
2248 \DWOPpushobjectaddress{}, it may be left out. The
2249 \DWATcalldatavalueNAME{} attribute describes the value in that location.
2250 The expression should not use registers or memory
2251 locations that might be clobbered by the call, as it might be evaluated after
2252 virtually unwinding from the called function back to the caller.
2255 Each call site parameter entry may also have a
2256 \DWATcallparameterDEFN{}\addtoindexx{call parameter attribute}
2257 \livetargi{chap:DWATcallparameterofcallparameter}{attribute}{call parameter attribute}
2258 which contains a reference to a \DWTAGformalparameter{} entry,
2259 \DWATtype{} attribute referencing the type of the parameter or
2260 \DWATname{} attribute describing the parameter's name.
2262 \textit{Examples using call site entries and related attributes are
2263 found in Appendix \refersec{app:callsiteexamples}.}
2266 \section{Lexical Block Entries}
2267 \label{chap:lexicalblockentries}
2270 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
2272 \addtoindexx{lexical block}
2273 a bracketed sequence of source statements
2274 that may contain any number of declarations. In some languages
2275 (including \addtoindex{C} and \addtoindex{C++}),
2276 \nolink{blocks} can be nested within other
2277 \nolink{blocks} to any depth.}
2279 % We do not need to link to the preceding paragraph.
2280 A lexical \nolink{block} is represented by a debugging information
2282 tag \DWTAGlexicalblockTARG.
2284 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
2286 either a \DWATlowpc{} and
2287 \DWAThighpc{} pair of
2289 \addtoindexx{high PC attribute}
2291 \addtoindexx{low PC attribute}
2293 \DWATranges{} attribute
2294 \addtoindexx{ranges attribute}
2295 whose values encode the contiguous or non-contiguous address
2296 ranges, respectively, of the machine instructions generated
2297 for the lexical \nolink{block}
2298 (see Section \refersec{chap:codeaddressesandranges}).
2300 A\hypertarget{chap:DWATentrypcoflexicalblock}{}
2301 lexical block entry may also have a
2302 \addtoindexx{entry PC attribute!for lexical block}
2303 \DWATentrypc{} attribute
2304 whose value is the address of the first executable instruction
2305 of the lexical block (see
2306 Section \refersec{chap:entryaddress}).
2308 If a name has been given to the lexical \nolink{block}
2309 in the source program, then the corresponding
2310 lexical \nolink{block} entry has a
2311 \DWATname{} attribute whose
2312 \addtoindexx{name attribute}
2313 value is a null-terminated string
2314 containing the name of the lexical \nolink{block}.
2316 \textit{This is not the same as a \addtoindex{C} or
2317 \addtoindex{C++} label (see Section \refersec{chap:labelentries}).}
2319 The lexical \nolink{block} entry owns debugging
2320 information entries that describe the declarations
2321 within that lexical \nolink{block}. There is
2322 one such debugging information entry for each local declaration
2323 of an identifier or inner lexical \nolink{block}.
2326 \section{Label Entries}
2327 \label{chap:labelentries}
2328 \textit{A label is a way of identifying a source location.
2329 A labeled statement is usually the target of one or more
2330 \doublequote{go to} statements.}
2333 A label is represented by a debugging information entry with
2334 \addtoindexx{label entry}
2335 the tag \DWTAGlabelTARG.
2336 The entry for a label should be owned by
2337 the debugging information entry representing the scope within
2338 which the name of the label could be legally referenced within
2341 The label entry has a \DWATlowpc{} attribute whose value
2342 is the address of the first executable instruction for the
2343 location identified by the label in
2344 the source program. The label entry also has a
2345 \DWATname{} attribute
2346 \addtoindexx{name attribute}
2347 whose value is a null-terminated string containing
2348 the name of the label.
2351 \section{With Statement Entries}
2352 \label{chap:withstatemententries}
2354 \textit{Both \addtoindex{Pascal} and
2355 \addtoindexx{Modula-2}
2356 Modula-2 support the concept of a \doublequote{with}
2357 statement. The with statement specifies a sequence of
2358 executable statements within which the fields of a record
2359 variable may be referenced, unqualified by the name of the
2362 A with statement is represented by a
2363 \addtoindexi{debugging information entry}{with statement entry}
2364 with the tag \DWTAGwithstmtTARG.
2366 A with statement entry may have either a
2368 \DWAThighpc{} pair of attributes
2369 \addtoindexx{low PC attribute}
2370 \addtoindexx{high PC attribute}
2372 \DWATranges{} attribute
2373 \addtoindexx{ranges attribute}
2374 whose values encode the contiguous or non-contiguous address
2375 ranges, respectively, of the machine instructions generated
2376 for the with statement
2377 (see Section \refersec{chap:codeaddressesandranges}).
2379 A\hypertarget{chap:DWATentrypcofwithstmt}{}
2380 with statement entry may also have a
2381 \addtoindexx{entry PC attribute!for with statement}
2382 \DWATentrypc{} attribute
2383 whose value is the address of the first executable instruction
2384 of the with statement (see
2385 Section \refersec{chap:entryaddress}).
2388 The with statement entry has a
2389 \addtoindexx{type attribute}
2390 \DWATtype{} attribute, denoting
2391 the type of record whose fields may be referenced without full
2392 qualification within the body of the statement. It also has
2393 \addtoindexx{location attribute}
2394 a \DWATlocation{} attribute, describing how to find the base
2395 address of the record object referenced within the body of
2399 \section{Try and Catch Block Entries}
2400 \label{chap:tryandcatchblockentries}
2401 \livetarg{chap:tryandcatchblockentries}{}
2402 \textit{In \addtoindex{C++}, a \livelink{chap:lexicalblock}{lexical block} may be
2403 designated as a \doublequote{catch \nolink{block}.}
2404 A catch \nolink{block} is an exception handler that
2405 handles exceptions thrown by an immediately preceding
2406 \doublequote{try \nolink{block}.}
2407 A catch \nolink{block}
2408 designates the type of the exception that it can handle.}
2410 A \livetarg{chap:tryblock}{try block} is represented
2411 by a debugging information entry
2412 \addtoindexx{try block entry}
2413 with the tag \DWTAGtryblockTARG.
2414 A \livetarg{chap:catchblock}{catch block} is represented by
2415 a debugging information entry
2416 \addtoindexx{catch block entry}
2417 with the tag \DWTAGcatchblockTARG.
2419 Both try and catch \nolink{block} entries may have either a
2421 \DWAThighpc{} pair of attributes
2422 \addtoindexx{low PC attribute}
2423 \addtoindexx{high PC attribute}
2425 \DWATranges{} attribute
2426 \addtoindexx{ranges attribute}
2427 whose values encode the contiguous
2428 or non-contiguous address ranges, respectively, of the
2429 machine instructions generated for the \nolink{block}
2430 (see Section \refersec{chap:codeaddressesandranges}).
2432 A\hypertarget{chap:DWATentrypcoftryblock}{}
2433 try or catch\hypertarget{chap:DWATentrypcofcatchblock}{}
2434 block entry may also have a
2435 \addtoindexx{entry PC attribute!for try block}
2436 \addtoindexx{entry PC attribute!for catch block}
2437 \DWATentrypc{} attribute
2438 whose value is the address of the first executable instruction
2439 of the try or catch block
2440 (see Section \refersec{chap:entryaddress}).
2443 Catch \nolink{block} entries have at least one child entry,
2444 an entry representing the type of exception accepted by
2445 that catch \nolink{block}.
2446 This child entry has one of the tags
2447 \DWTAGformalparameter{}\addtoindexx{formal parameter entry!in catch block}
2449 \DWTAGunspecifiedparameters{},
2450 \addtoindexx{unspecified parameters entry!in catch block}
2451 and will have the same form as other parameter entries.
2453 The siblings immediately following a try \nolink{block}
2454 entry are its corresponding catch \nolink{block} entries.
2457 \section{Declarations with Reduced Scope}
2458 \label{declarationswithreducedscope}
2459 \hypertarget{chap:DWATstartscopeofdeclaration}{}
2460 Any debugging information entry for a declaration
2461 (including objects, subprograms, types and modules) whose scope
2462 has an address range that is a subset of the address range for
2463 the lexical scope most closely enclosing the declared entity
2465 \DWATstartscopeDEFN{}\addtoindexx{start scope attribute}
2466 attribute to specify that reduced range of addresses.
2468 There are two cases:
2469 \begin{enumerate}[1. ]
2470 \item If the address range for the scope of the entry
2471 includes all of addresses for the containing scope except
2472 for a contiguous sequence of bytes at the beginning of the
2473 address range for the containing scope, then the address is
2474 specified using a value of class \CLASSconstant.
2476 \begin{enumerate}[a) ]
2477 \item If the address
2478 range of the containing scope is contiguous, the value of
2479 this attribute is the offset in bytes of the beginning of
2480 the address range for the scope of the object from the low
2481 PC value of the debugging information entry that defines
2482 that containing scope.
2483 \item If the address range of the containing
2484 scope is non-contiguous
2485 (see \refersec{chap:noncontiguousaddressranges})
2486 the value of this attribute is the offset in bytes of the
2487 beginning of the address range for the scope of the entity
2488 from the beginning of the first \addtoindex{range list} entry
2489 for the containing scope that is not a base selection entry,
2490 a default selection entry or an end-of-list entry.
2494 \item Otherwise, the set of addresses for the scope of the
2495 entity is specified using a value of class \CLASSrangelistptr{}.
2496 This value indicates the beginning of a \addtoindex{range list}
2497 (see Section \refersec{chap:noncontiguousaddressranges}).
2500 \textit{For example, the scope of a variable may begin somewhere
2501 in the midst of a lexical \livelink{chap:lexicalblock}{block} in a
2502 language that allows executable code in a
2503 \nolink{block} before a variable declaration, or where one declaration
2504 containing initialization code may change the scope of a
2505 subsequent declaration.}
2508 \textit{Consider the following example \addtoindex{C} code:}
2520 \textit{\addtoindex{C} scoping rules require that the value of the
2521 variable \texttt{x} assigned to the variable \texttt{f} in the
2522 initialization sequence is the value of the global variable \texttt{x},
2523 rather than the local \texttt{x}, because the scope of the local variable
2524 \texttt{x} only starts after the full declarator for the local \texttt{x}.}
2526 \textit{Due to optimization, the scope of an object may be
2527 non-contiguous and require use of a \addtoindex{range list} even when
2528 the containing scope is contiguous. Conversely, the scope of
2529 an object may not require its own \addtoindex{range list} even when the
2530 containing scope is non-contiguous.}