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} \\
237 \DWLANGRenderScriptTARG~\dag & \addtoindex{RenderScript Kernal Language}
240 \DWLANGRustTARG{}~\dag & \addtoindex{Rust} \\
242 & \addtoindex{Swift} \\
243 \DWLANGUPCTARG{} & UPC (Unified Parallel C) \addtoindexx{UPC}
244 \index{Unified Parallel C|see{UPC}} \\
246 \dag \ \ \textit{Support for these languages is limited}& \\
251 \item \hypertarget{chap:DWATstmtlistlinenumberinformationforunit}{}
252 A \DWATstmtlistDEFN{}\addtoindexx{statement list attribute}
253 attribute whose value is a
254 \addtoindexx{section offset!in statement list attribute}
255 section offset to the line number information for this compilation
258 This information is placed in a separate object file
259 section from the debugging information entries themselves. The
260 value of the statement list attribute is the offset in the
261 \dotdebugline{} section of the first byte of the line number
262 information for this compilation unit
263 (see Section \refersec{chap:linenumberinformation}).
265 \item A \DWATmacrosDEFN{}\hypertarget{chap:DWATmacrosmacroinformation}{}
267 \addtoindexx{macro information attribute}
269 \addtoindexx{section offset!in macro information attribute}
270 section offset to the macro information for this compilation unit.
272 This information is placed in a separate object file section
273 from the debugging information entries themselves. The
274 value of the macro information attribute is the offset in
275 the \dotdebugmacro{} section of the first byte of the macro
276 information for this compilation unit
277 (see Section \refersec{chap:macroinformation}).
279 \textit{The \DWATmacrosNAME{} attribute is new in \DWARFVersionV,
281 \DWATmacroinfoDEFN{} attribute of earlier DWARF versions.
282 \livetarg{chap:DWATmacroinfomacroinformation}{}
283 While \DWATmacrosNAME{} and \DWATmacroinfoNAME{} attributes cannot both occur in the same
284 compilation unit, both may be found in the set of units that make up an executable
285 or shared object file. The two attributes have distinct encodings to facilitate such
289 \item \hypertarget{chap:DWATcompdircompilationdirectory}{}
290 A \DWATcompdirDEFN{} attribute\addtoindexx{compilation directory attribute}
292 null-terminated string containing the current working directory
293 of the compilation command that produced this compilation
294 unit in whatever form makes sense for the host system.
296 \item \hypertarget{chap:DWATproducercompileridentification}{}
297 A \DWATproducerDEFN{} attribute\addtoindexx{producer attribute}
298 whose value is a null-terminated string containing
299 information about the compiler
300 that produced the compilation unit. The actual contents of
301 the string will be specific to each producer, but should
302 begin with the name of the compiler vendor or some other
303 identifying character sequence that should avoid confusion
304 with other producer values.
307 \item \hypertarget{chap:DWATidentifiercaseidentifiercaserule}{}
308 A \DWATidentifiercaseDEFN{} attribute
309 \addtoindexx{identifier case attribute} whose integer
310 constant value is a code describing the treatment
311 of identifiers within this compilation unit. The
312 set of identifier case codes is given in
313 Table \refersec{tab:identifiercasecodes}.
315 \begin{simplenametable}{Identifier case codes}{tab:identifiercasecodes}
316 \DWIDcasesensitive{} \\
319 \DWIDcaseinsensitive{} \\
320 \end{simplenametable}
322 \DWIDcasesensitiveTARG{} is the default for all compilation units
323 that do not have this attribute. It indicates that names given
324 as the values of \DWATname{} attributes
325 \addtoindexx{name attribute}
326 in debugging information
327 entries for the compilation unit reflect the names as they
328 appear in the source program. The debugger should be sensitive
329 to the case of \addtoindex{identifier names} when doing identifier
333 \DWIDupcaseTARG{} means that the
334 producer of the debugging
335 information for this compilation unit converted all source
336 names to upper case. The values of the name attributes may not
337 reflect the names as they appear in the source program. The
338 debugger should convert all names to upper case when doing
341 \DWIDdowncaseTARG{} means that
342 the producer of the debugging
343 information for this compilation unit converted all source
344 names to lower case. The values of the name attributes may not
345 reflect the names as they appear in the source program. The
346 debugger should convert all names to lower case when doing
350 \DWIDcaseinsensitiveTARG{} means that the values of the name
351 attributes reflect the names as they appear in the source
352 program but that a case insensitive lookup should be used to
356 \item \hypertarget{chap:DWATbasetypesprimitivedatatypesofcompilationunit}{}
357 A \DWATbasetypesDEFN{} attribute\addtoindexx{base types attribute}
358 whose value is a \livelink{chap:classreference}{reference}.
359 This attribute points to a debugging information entry
360 representing another compilation unit. It may be used
361 to specify the compilation unit containing the base type
362 entries used by entries in the current compilation unit
363 (see Section \refersec{chap:basetypeentries}).
366 \textit{This attribute provides a consumer a way to find the definition
367 of base types for a compilation unit that does not itself
368 contain such definitions. This allows a consumer, for example,
369 to interpret a type conversion to a base type correctly.}
371 \item \hypertarget{chap:DWATuseUTF8compilationunitusesutf8strings}{}
372 A \DWATuseUTFeightDEFN{} attribute,
373 \addtoindexx{use UTF8 attribute}\addtoindexx{UTF-8}
374 which is a \livelink{chap:classflag}{flag} whose
375 presence indicates that all strings (such as the names of
376 declared entities in the source program, or filenames in the line number table)
377 are represented using the UTF-8 representation.
381 \hypertarget{chap:DWATmainsubprogramunitcontainingmainorstartingsubprogram}{}
382 A \DWATmainsubprogramDEFN{} attribute,\addtoindexx{main subprogram attribute}
383 which is a \livelink{chap:classflag}{flag},
384 whose presence indicates that the compilation unit contains a
385 subprogram that has been identified as the starting
386 subprogram of the program. If more than one compilation unit contains
387 this \nolink{flag}, any one of them may contain the starting
390 \textit{\addtoindex{Fortran} has a \addtoindex{PROGRAM statement}
392 to specify and provide a user-specified name for the main
393 subroutine of a program.
394 \addtoindex{C} uses the name \doublequote{main} to identify
395 the main subprogram of a program. Some other languages provide
396 similar or other means to identify the main subprogram of
397 a program. The \DWATmainsubprogram{} attribute may also be used to
398 identify such subprograms (see
399 Section \refersec{chap:generalsubroutineandentrypointinformation}).}
402 \hypertarget{chap:DWATentrypcofcompileunit}{}
403 \hypertarget{chap:DWATentrypcofpartialunit}{}
404 A \DWATentrypc{} attribute whose value is the address of the first
405 \addtoindexx{entry pc attribute}
406 executable instruction of the unit (see
407 Section \refersec{chap:entryaddress}).
410 \item \hypertarget{chap:DWATstroffsetbaseforindirectstringtable}{}
411 A \DWATstroffsetsbaseDEFN\addtoindexx{string offset base attribute}
412 attribute, whose value is of class \CLASSstroffsetsptr.
413 This attribute points to the first string
414 offset of the compilation unit's contribution to the
415 \dotdebugstroffsets{} (or \dotdebugstroffsetsdwo{}) section.
416 Indirect string references
417 (using \DWFORMstrx) within the compilation unit are
418 interpreted as indices relative to this base.
421 \item \hypertarget{chap:DWATaddrbaseforaddresstable}{}
422 A \DWATaddrbaseDEFN\addtoindexx{address table base attribute}
423 attribute, whose value is of class \CLASSaddrptr.
424 This attribute points to the beginning of the compilation
425 unit's contribution to the \dotdebugaddr{} section.
426 Indirect references (using \DWFORMaddrx, \DWOPaddrx,
427 \DWOPconstx, \DWLLEbaseaddressselectionentry{},
428 \DWLLEstartendentry{} or \DWLLEstartlengthentry)
429 within the compilation unit are interpreted as indices
430 relative to this base.
433 \item \hypertarget{chap:DWATrangesbaseforrangelists}{}
434 A \DWATrangesbaseDEFN\addtoindexx{ranges table base attribute}
435 attribute, whose value is of class \CLASSrangelistptr.
436 This attribute points to the beginning of the compilation
437 unit's contribution to the \dotdebugranges{} section.
438 References to range lists (using \DWFORMsecoffset)
439 within the compilation unit are
440 interpreted as offsets relative to this base.
444 The base address of a compilation unit is defined as the
445 value of the \DWATlowpc{} attribute, if present; otherwise,
446 it is undefined. If the base address is undefined, then any
447 DWARF entry or structure defined in terms of the base address
448 of that compilation unit is not valid.
451 \subsection{Skeleton Compilation Unit Entries}
452 \label{chap:skeletoncompilationunitentries}
453 \addtoindexx{compilation unit!skeleton}
454 \addtoindexx{skeleton compilation unit}
455 When generating a \splitDWARFobjectfile{} (see
456 Section \refersec{datarep:splitdwarfobjectfiles}), the
457 compilation unit in the \dotdebuginfo{} section is a "skeleton"
458 compilation unit with the tag
460 \DWTAGskeletonunitTARG, which contains a
461 \DWATdwoname{} attribute
463 as well as a subset of the
464 attributes of a full or partial compilation unit. In general,
465 it contains those attributes that are necessary for the consumer
466 to locate the object file where the split full compilation unit
467 can be found, and for the consumer to interpret references to
468 addresses in the program.
471 A skeleton compilation unit has no children.
473 A skeleton compilation unit has
475 a \DWATdwoname{} attribute:
478 \begin{enumerate}[1. ]
480 \item \livetarg{chap:DWATdwonameforunit}{}
481 A \DWATdwonameDEFN{} attribute
482 \addtoindexx{split DWARF object file name attribute}
484 null-terminated string containing the full or relative
485 path name (relative to the value of the \DWATcompdir{} attribute,
486 see below) of the object file that contains the full
490 The value in the \HFNdwoid{} field of the unit header for
491 this unit is the same as the value in the \HFNdwoid{} field
492 of the unit header of the corresponding full compilation
493 unit (see Section \refersec{datarep:unitheaders}).
495 \textit{The means of determining a compilation unit ID does
496 not need to be similar or related to the means of
497 determining a \TUsignature. However, it should
498 be suitable for detecting file version skew or other
499 kinds of mismatched files and for looking up a full
500 split unit in a DWARF package file
501 (see Section \refersec{datarep:dwarfpackagefiles}).}
506 A skeleton compilation unit may have additional attributes,
507 which are the same as for conventional compilation unit entries
508 except as noted, from among the following:
509 \begin{enumerate}[1. ]
510 \addtocounter{enumi}{1}
511 \item Either a \DWATlowpc{} and \DWAThighpc{} pair of attributes
512 or a \DWATranges{} attribute.
513 \item A \DWATstmtlist{} attribute.
514 \item A \DWATcompdir{} attribute.
517 \item A \DWATuseUTFeight{} attribute.
519 \textit{This attribute applies to strings referred to by the skeleton
520 compilation unit entry itself, and strings in the associated line
522 The representation for strings in the object file referenced
523 by the \DWATdwoname{} attribute is determined by the presence
524 of a \DWATuseUTFeight{} attribute in the full compilation unit
525 (see Section \refersec{chap:splitfullcompilationunitentries}).}
527 \item A \DWATstroffsetsbase{} attribute, for indirect strings references
528 from the skeleton compilation unit.
529 \item A \DWATaddrbase{} attribute.
530 \item A \DWATrangesbase{} attribute.
534 All other attributes of a compilation unit entry (described
535 in Section \refersec{chap:fullandpartialcompilationunitentries})
536 should be placed in the split full compilation unit
537 (see \refersec{chap:splitfullcompilationunitentries}).
538 The attributes provided by the skeleton compilation
539 unit entry do not need to be repeated in the full compilation
543 \textit{The \DWATaddrbase{}, \DWATrangesbase{} and
544 \DWATstroffsetsbase{} attributes provide context that may be
545 necessary to interpret the contents
546 of the corresponding \splitDWARFobjectfile.}
548 \textit{The \DWATbasetypes{} attribute is not defined for a
549 skeleton compilation unit.}
552 \subsection{Split Full Compilation Unit Entries}
553 \label{chap:splitfullcompilationunitentries}
554 A \definition{split full compilation unit} is represented by a
555 debugging information entry with tag \DWTAGcompileunit.
556 It is very similar to a conventional full compilation unit but
557 is logically paired with a specific skeleton compilation unit while
558 being physically separate.
560 A split full compilation unit
562 may have the following attributes,
563 which are the same as for conventional compilation unit entries
566 \begin{enumerate}[1. ]
567 \item A \DWATname{} attribute.
568 \item A \DWATlanguage{} attribute.
569 \item A \DWATmacros{} attribute.
570 The value of this attribute is of class \CLASSmacptr{}, which is
571 an offset relative to the \dotdebugmacrodwo{} section.
573 \item A \DWATproducer{} attribute.
574 \item A \DWATidentifiercase{} attribute.
575 \item A \DWATmainsubprogram{} attribute.
576 \item A \DWATentrypc{} attribute.
577 \item A \DWATuseUTFeight{} attribute.
581 \textit{The following attributes are not part of a
582 split full compilation unit entry but instead are inherited
583 (if present) from the corresponding skeleton compilation unit:
584 \DWATlowpc, \DWAThighpc, \DWATranges, \DWATstmtlist, \DWATcompdir,
585 \DWATstroffsetsbase, \DWATaddrbase{} and
588 \textit{The \DWATbasetypes{} attribute is not defined for a
589 split full compilation unit.}
593 \subsection{Type Unit Entries}
594 \label{chap:typeunitentries}
595 \addtoindexx{type unit}
596 \addtoindexx{type unit|see{\textit{also} compilation unit}}
597 \addtoindexx{compilation unit!\textit{see also} type unit}
598 An object file may contain any number of separate type
599 unit entries, each representing a single complete type
601 Each \addtoindex{type unit} must be uniquely identified by
602 an 8-byte signature, stored as part of the type unit, which
603 can be used to reference the type definition from debugging
604 information entries in other compilation units and type units.
606 Conventional and split type units are identical except for
607 the sections in which they are represented
608 (see \refersec{datarep:splitdwarfobjectfiles} for details).
609 \addtoindexx{conventional type unit}
610 \addtoindexx{split type unit}
611 Moreover, the \DWATstroffsetsbase{} attribute (see below) is not
612 used in a split type unit.
614 A type unit is represented by a debugging information entry
615 with the tag \DWTAGtypeunitTARG.
616 A \addtoindex{type unit entry} owns debugging
617 information entries that represent the definition of a single
618 type, plus additional debugging information entries that may
619 be necessary to include as part of the definition of the type.
622 A type unit entry may have the following attributes:
623 \begin{enumerate}[1. ]
626 \DWATlanguage{} attribute,
628 \addtoindexx{language attribute}
629 constant value is an integer code indicating the source
630 language used to define the type. The set of language names
631 and their meanings are given in Table \refersec{tab:languagenames}.
634 \item A \DWATstmtlist{} attribute\addtoindexx{statement list attribute}
635 whose value of class \CLASSlineptr{} points to the line number
636 information for this type unit.
638 \textit{Because type units do not describe any code, they
639 do not actually need a line number table, but the line number
640 headers contain a list of directories and file names that
641 may be referenced by the \DWATdeclfile{} attribute of the
642 type or part of its description.}
644 \textit{In an object file with a conventional compilation
645 unit entry, the type unit entries may refer to (share) the
646 line number table used by the compilation unit. In a type
647 unit located in a split compilation unit, the
648 \DWATstmtlistNAME{} attribute refers to a \doublequote{specialized}
649 line number table in the \dotdebuglinedwo{} section, which
650 contains only the list of directories and file names.}
652 \textit{All type unit entries in a \splitDWARFobjectfile{} may
653 (but are not required to) refer to the same
654 \addtoindex{specialized line number table}.}
656 \item A \DWATuseUTFeight{} attribute, which is a flag
657 whose presence indicates that all strings referred to by this type
658 unit entry, its children, and its associated
659 \addtoindex{specialized line number table},
660 are represented using the UTF-8 representation.
663 \DWATstroffsetsbase\addtoindexx{string offsets base attribute}
664 attribute, whose value is of class \CLASSstroffsetsptr.
665 This attribute points
666 to the first string offset of the type unit's contribution to
667 the \dotdebugstroffsets{} section. Indirect string references
668 (using \DWFORMstrx) within the type unit are interpreted
669 as indices relative to this base.
673 A \addtoindex{type unit} entry for a given type T owns a debugging
674 information entry that represents a defining declaration
675 of type T. If the type is nested within enclosing types or
676 namespaces, the debugging information entry for T is nested
677 within debugging information entries describing its containers;
678 otherwise, T is a direct child of the type unit entry.
680 A type unit entry may also own additional debugging information
681 entries that represent declarations of additional types that
682 are referenced by type T and have not themselves been placed in
683 separate type units. Like T, if an additional type U is nested
684 within enclosing types or namespaces, the debugging information
685 entry for U is nested within entries describing its containers;
686 otherwise, U is a direct child of the type unit entry.
688 The containing entries for types T and U are declarations,
689 and the outermost containing entry for any given type T or
690 U is a direct child of the type unit entry. The containing
691 entries may be shared among the additional types and between
692 T and the additional types.
694 \textit{Examples of these kinds of relationships are found in
695 Section \refersec{app:signaturecomputationexample} and
696 Section \refersec{app:declarationscompletingnondefiningdeclarations}.}
699 \textit{Types are not required to be placed in type units. In general,
700 only large types such as structure, class, enumeration, and
701 union types included from header files should be considered
702 for separate type units. Base types and other small types
703 are not usually worth the overhead of placement in separate
704 type units. Types that are unlikely to be replicated, such
705 as those defined in the main source file, are also better
706 left in the main compilation unit.}
708 \section{Module, Namespace and Importing Entries}
709 \textit{Modules and namespaces provide a means to collect related
710 entities into a single entity and to manage the names of
714 \subsection{Module Entries}
715 \label{chap:moduleentries}
716 \textit{Several languages have the concept of a \doublequote{module.}
717 \addtoindexx{Modula-2}
718 A Modula\dash 2 definition module
719 \addtoindexx{Modula-2!definition module}
720 may be represented by a module
722 \addtoindex{declaration attribute}
723 (\DWATdeclaration). A
724 \addtoindex{Fortran 90} module
725 \addtoindexx{Fortran!module (Fortran 90)}
726 may also be represented by a module entry
727 (but no declaration attribute is warranted because \addtoindex{Fortran}
728 has no concept of a corresponding module body).}
730 A module is represented by a debugging information entry
732 tag \DWTAGmoduleTARG.
733 Module entries may own other
734 debugging information entries describing program entities
735 whose declaration scopes end at the end of the module itself.
737 If the module has a name, the module entry has a
738 \DWATname{} attribute
739 \addtoindexx{name attribute}
740 whose value is a null\dash terminated string containing
743 The \addtoindex{module entry} may have either a
747 \addtoindexx{high PC attribute}
749 \addtoindexx{low PC attribute}
751 \DWATranges{} attribute
752 \addtoindexx{ranges attribute}
753 whose values encode the contiguous or non-contiguous address
754 ranges, respectively, of the machine instructions generated for
755 the module initialization
756 code\hypertarget{chap:DWATentrypcentryaddressofmoduleinitialization}{}
757 (see Section \refersec{chap:codeaddressesandranges}).
759 \addtoindexx{entry PC attribute!for module initialization}
760 \DWATentrypc{} attribute whose value is the address of
761 the first executable instruction of that initialization code
762 (see Section \refersec{chap:entryaddress}).
765 If\hypertarget{chap:DWATprioritymodulepriority}{}
766 the module has been assigned a priority, it may have a
767 \addtoindexx{priority attribute}
768 \DWATpriorityDEFN{} attribute.
769 The value of this attribute is a
770 reference to another debugging information entry describing
771 a variable with a constant value. The value of this variable
772 is the actual constant value of the module\textquoteright s priority,
773 represented as it would be on the target architecture.
775 \subsection{Namespace Entries}
776 \label{chap:namespaceentries}
777 \textit{\addtoindex{C++} has the notion of a namespace, which provides a way to
778 \addtoindexx{namespace (C++)}
779 implement name hiding, so that names of unrelated things
780 do not accidentally clash in the
781 \addtoindex{global namespace} when an
782 application is linked together.}
784 A namespace is represented by a debugging information entry
785 with the tag \DWTAGnamespaceTARG. A namespace extension
786 is\hypertarget{chap:DWATextensionpreviousnamespaceextensionororiginalnamespace}{}
787 represented by a \DWTAGnamespaceNAME{} entry with a
788 \DWATextensionDEFN{}\addtoindexx{extension attribute}
789 attribute referring to the previous extension, or if there
790 is no previous extension, to the original
791 \DWTAGnamespaceNAME{}
792 entry. A namespace extension entry does not need to duplicate
793 information in a previous extension entry of the namespace
794 nor need it duplicate information in the original namespace
795 entry. (Thus, for a namespace with a name,
796 a \DWATname{} attribute
797 \addtoindexx{name attribute}
798 need only be attached directly to the original
799 \DWTAGnamespaceNAME{} entry.)
802 Namespace and namespace extension entries may own
803 \addtoindexx{namespace extension entry}
805 \addtoindexx{namespace declaration entry}
806 debugging information entries describing program entities
807 whose declarations occur in the namespace.
809 A namespace may have a
810 \DWATexportsymbolsDEFN{}\livetarg{chap:DWATexportsymbolsofnamespace}{}
811 attribute\addtoindexx{export symbols attribute}
812 \addtoindexx{inline namespace|see{\textit{also} export symbols attribute}}
813 which is a \CLASSflag{} which
814 indicates that all member names defined within the
815 namespace may be referenced as if they were defined within
816 the containing namespace.
818 \textit{This may be used to describe an \addtoindex{inline namespace} in \addtoindex{C++}}.
820 If a type, variable, or function declared in a namespace is
821 defined outside of the body of the namespace declaration,
822 that type, variable, or function definition entry has a
823 \DWATspecification{} attribute
824 \addtoindexx{specification attribute}
825 whose value is a \livelink{chap:classreference}{reference} to the
826 debugging information entry representing the declaration of
827 the type, variable or function. Type, variable, or function
829 \DWATspecification{} attribute
830 \addtoindexx{specification attribute}
832 to duplicate information provided by the declaration entry
833 referenced by the specification attribute.
835 \textit{The \addtoindex{C++} \addtoindex{global namespace}
837 \addtoindexx{global namespace|see{namespace (C++), global}}
839 \addtoindexx{namespace (C++)!global}
841 \texttt{::f}, for example) is not explicitly represented in
842 DWARF with a namespace entry (thus mirroring the situation
843 in \addtoindex{C++} source).
844 Global items may be simply declared with no
845 reference to a namespace.}
847 \textit{The \addtoindex{C++}
848 compilation unit specific \doublequote{unnamed namespace} may
849 \addtoindexx{namespace (C++)!unnamed}
850 \addtoindexx{unnamed namespace|see {namespace (C++), unnamed}}
851 be represented by a namespace entry with no name attribute in
852 the original namespace declaration entry (and therefore no name
853 attribute in any namespace extension entry of this namespace).
856 \textit{A compiler emitting namespace information may choose to
857 explicitly represent namespace extensions, or to represent the
858 final namespace declaration of a compilation unit; this is a
859 quality-of-implementation issue and no specific requirements
860 are given here. If only the final namespace is represented,
861 \addtoindexx{namespace (C++)!using declaration}
862 it is impossible for a debugger to interpret using declaration
863 references in exactly the manner defined by the
864 \addtoindex{C++} language.}
866 \textit{For \addtoindex{C++} namespace examples,
867 see Appendix \refersec{app:namespaceexamples}.}
871 \subsection{Imported (or Renamed) Declaration Entries}
872 \label{chap:importedorrenameddeclarationentries}
874 \textit{Some languages support the concept of importing into or
875 making accessible in a given unit certain declarations that occur
876 in a different module or scope. An imported declaration may
877 sometimes be given another name.}
880 An imported declaration is represented by one or
881 \addtoindexx{imported declaration entry}
882 more debugging information entries with the
883 tag \DWTAGimporteddeclarationTARG.
884 When\hypertarget{chap:DWATimportimporteddeclaration}{}
885 an overloaded entity is imported, there is one imported
886 declaration entry for each overloading.
887 Each imported declaration entry has a
888 \DWATimportDEFN{} attribute,\addtoindexx{import attribute}
889 whose value is a \livelink{chap:classreference}{reference} to the
890 debugging information entry representing the declaration that
893 An imported declaration may also have a \DWATname{}
894 attribute\addtoindexx{name attribute}
895 whose value is a null-terminated string containing the
897 imported entity is to be known in the context of the imported
898 declaration entry (which may be different than the name of
899 the entity being imported). If no name is present, then the
900 name by which the entity is to be known is the same as the
901 name of the entity being imported.
903 An imported declaration entry with a name attribute may be
904 used as a general means to rename or provide an alias for
905 \addtoindexx{alias declaration|see{imported declaration entry}}
906 an entity, regardless of the context in which the importing
907 declaration or the imported entity occurs.
909 \textit{A \addtoindex{C++}
910 namespace alias\hypertarget{chap:DWATimportnamespacealias}{}
911 may be represented by an imported declaration entry
912 \addtoindexx{namespace (C++)!alias}
913 with a name attribute whose value is
914 a null-terminated string containing the alias name
915 and a \DWATimportDEFN{} attribute
916 whose value is a \livelink{chap:classreference}{reference} to the
917 applicable original namespace or namespace extension entry.}
919 \textit{A \addtoindex{C++} using declaration may be represented
921 imported\hypertarget{chap:DWATimportnamespaceusingdeclaration}{}
922 \addtoindexx{namespace (C++)!using declaration}
923 declaration entries. When the using declaration
924 refers to an overloaded function, there is one imported
925 declaration entry corresponding to each overloading. Each
926 imported declaration entry has no name attribute but it does
927 have a \DWATimportDEFN{} attribute that refers to the entry for the
928 entity being imported. (\addtoindex{C++}
929 provides no means to \doublequote{rename}
930 an imported entity, other than a namespace).}
933 \textit{A \addtoindex{Fortran} use statement
934 \addtoindexx{Fortran!use statement}
935 \addtoindexx{use statement|see {Fortran, use statement}}
936 with an \doublequote{only list} may be
937 represented by a series of imported declaration entries,
938 one (or more) for each entity that is imported. An entity
939 \addtoindexx{renamed declaration|see{imported declaration entry}}
940 that is renamed in the importing context may be represented
941 by an imported declaration entry with a name attribute that
942 specifies the new local name.
945 \subsection{Imported Module Entries}
946 \label{chap:importedmoduleentries}
948 \textit{Some languages support the concept of importing into or making
949 accessible in a given unit all of the declarations contained
950 within a separate module or namespace.
953 An imported module declaration is represented by a debugging
954 information entry with
955 \addtoindexx{imported module attribute}
957 \addtoindexx{imported module entry}
958 tag \DWTAGimportedmoduleTARG.
960 imported module entry contains a
961 \DWATimport{} attribute
962 \addtoindexx{import attribute}
963 whose value is a \livelink{chap:classreference}{reference}
964 to the module or namespace entry
965 containing the definition and/or declaration entries for
966 the entities that are to be imported into the context of the
967 imported module entry.
969 An imported module declaration may own a set of imported
970 declaration entries, each of which refers to an entry in the
971 module whose corresponding entity is to be known in the context
972 of the imported module declaration by a name other than its
973 name in that module. Any entity in the module that is not
974 renamed in this way is known in the context of the imported
975 module entry by the same name as it is declared in the module.
977 \textit{A \addtoindex{C++} using directive
978 \addtoindexx{namespace (C++)!using directive}
979 \addtoindexx{using directive|see {namespace (C++), using directive}}
980 may be represented by an imported
981 module\hypertarget{chap:DWATimportnamespaceusingdirective}{}
982 entry, with a \DWATimportDEFN{} attribute referring to the namespace
983 entry of the appropriate extension of the namespace (which
984 might be the original namespace entry) and no owned entries.
987 \textit{A \addtoindex{Fortran} use statement
988 \addtoindexx{Fortran!use statement}
989 with a \doublequote{rename list} may be
990 represented by an imported module entry with an import
991 attribute referring to the module and owned entries
992 corresponding to those entities that are renamed as part of
996 \textit{A \addtoindex{Fortran} use statement
997 \addtoindexx{Fortran!use statement}
998 with neither a \doublequote{rename list} nor
999 an \doublequote{only list} may be represented by an imported module
1000 entry with an import attribute referring to the module and
1001 no owned child entries.
1004 \textit{A use statement with an \doublequote{only list} is represented by a
1005 series of individual imported declaration entries as described
1006 in Section \refersec{chap:importedorrenameddeclarationentries}.
1010 \textit{A \addtoindex{Fortran} use statement for an entity in a module that is
1011 \addtoindexx{Fortran!use statement}
1012 itself imported by a use statement without an explicit mention
1013 may be represented by an imported declaration entry that refers
1014 to the original debugging information entry. For example, given
1031 \textit{the imported declaration entry for Q within module C refers
1032 directly to the variable declaration entry for X in module A
1033 because there is no explicit representation for X in module B.
1036 \textit{A similar situation arises for a \addtoindex{C++} using declaration
1037 \addtoindexx{namespace (C++)!using declaration}
1038 \addtoindexx{using declaration|see {namespace (C++), using declaration}}
1039 that imports an entity in terms of a namespace alias. See
1040 Appendix \refersec{app:namespaceexamples}
1044 \subsection{Imported Unit Entries}
1045 \label{chap:importedunitentries}
1046 \hypertarget{chap:DWATimportimportedunit}{}
1047 The place where a normal or partial compilation unit is imported is
1048 represented by a debugging information entry with the
1049 \addtoindexx{imported unit entry}
1050 tag \DWTAGimportedunitTARG.
1051 An imported unit entry contains a
1052 \DWATimportDEFN{} attribute\addtoindexx{import attribute}
1053 whose value is a \livelink{chap:classreference}{reference} to the
1054 normal or partial compilation unit whose declarations logically
1055 belong at the place of the imported unit entry.
1057 \textit{An imported unit entry does not necessarily correspond to
1058 any entity or construct in the source program. It is merely
1059 \doublequote{glue} used to relate a partial unit, or a compilation
1060 unit used as a partial unit, to a place in some other
1063 \section{Subroutine and Entry Point Entries}
1064 \label{chap:subroutineandentrypointentries}
1066 The following tags exist to describe
1067 debugging information entries
1068 \addtoindexx{function entry|see{subroutine entry}}
1070 \addtoindexx{subroutine entry}
1072 \addtoindexx{subprogram entry}
1074 % FIXME: is entry point entry the right index 'entry'?
1075 \addtoindexx{entry point entry}
1078 \begin{tabular}{lp{9.0cm}}
1079 \DWTAGsubprogramTARG{} & A subroutine or function \\
1080 \DWTAGinlinedsubroutine{} & A particular inlined
1081 \addtoindexx{inlined subprogram entry}
1082 instance of a subroutine or function \\
1083 \DWTAGentrypointTARG{} & An alternate entry point \\
1088 \subsection{General Subroutine and Entry Point Information}
1089 \label{chap:generalsubroutineandentrypointinformation}
1090 The subroutine or entry point entry has a \DWATname{}
1091 attribute whose value is a null-terminated string containing the
1092 subroutine or entry point name.
1093 It may also have a \DWATlinkagename{} attribute as
1094 described in Section \refersec{chap:linkagenames}.
1096 If the name of the subroutine described by an entry with the
1097 \addtoindexx{subprogram entry}
1098 tag \DWTAGsubprogram{}\hypertarget{chap:DWATexternalexternalsubroutine}{}
1099 is visible outside of its containing
1100 compilation unit, that entry has a
1101 \DWATexternalDEFN{} attribute,\addtoindexx{external attribute}
1102 which is a \livelink{chap:classflag}{flag}.
1104 \textit{Additional attributes for functions that are members of a
1105 class or structure are described in
1106 Section \refersec{chap:memberfunctionentries}.
1109 A\hypertarget{chap:DWATmainsubprogrammainorstartingsubprogram}{}
1110 subroutine entry may contain a
1111 \DWATmainsubprogramDEFN{} attribute
1112 \addtoindexx{main subprogram attribute}
1114 a \CLASSflag{} whose presence indicates that the
1115 subroutine has been identified as the starting function of
1116 the program. If more than one subprogram contains this
1118 any one of them may be the starting subroutine of the program.
1120 \textit{See also Section \refersec{chap:unitentries}) regarding the
1121 related use of this attribute to indicate that a compilation
1122 unit contains the main subroutine of a program.}
1124 \subsubsection{Calling Convention Information}
1125 \hypertarget{chap:DWATcallingconventionforsubprograms}{}
1126 A subroutine entry may contain a
1127 \DWATcallingconventionDEFN{}
1128 \addtoindexx{calling convention attribute!for subprogram}
1129 attribute, whose value is an
1130 \livelink{chap:classconstant}{integer constant}. The set of
1131 \addtoindexi{calling convention codes for subroutines}{calling convention codes!for subroutines}
1132 is given in Table \refersec{tab:callingconventioncodesforsubroutines}.
1134 \begin{simplenametable}[1.4in]{Calling convention codes for subroutines}{tab:callingconventioncodesforsubroutines}
1138 \end{simplenametable}
1140 If this attribute is not present, or its value is the constant
1141 \DWCCnormalTARG, then the subroutine may be safely called by
1142 obeying the \doublequote{standard} calling conventions of the target
1143 architecture. If the value of the calling convention attribute
1144 is the constant \DWCCnocallTARG, the subroutine does not obey
1145 standard calling conventions, and it may not be safe for the
1146 debugger to call this subroutine.
1148 \textit{Note that \DWCCnormal{} is also used as a calling convention
1149 code for certain types
1150 (see Table \refersec{tab:callingconventioncodesfortypes}).}
1152 If the semantics of the language of the compilation unit
1153 containing the subroutine entry distinguishes between ordinary
1154 subroutines and subroutines that can serve as the \doublequote{main
1155 program,} that is, subroutines that cannot be called
1156 directly according to the ordinary calling conventions,
1157 then the debugging information entry for such a subroutine
1158 may have a calling convention attribute whose value is the
1159 constant \DWCCprogramTARG.
1161 \textit{A common debugger feature is to allow the debugger user to call
1162 a subroutine within the subject program. In certain cases,
1163 however, the generated code for a subroutine will not obey
1164 the standard calling conventions for the target architecture
1165 and will therefore not be safe to call from within a debugger.}
1167 \textit{The \DWCCprogram{}
1168 value is intended to support \addtoindex{Fortran} main
1169 \addtoindexx{Fortran!main program}
1170 programs which in some implementations may not be callable
1171 or which must be invoked in a special way. It is not intended
1172 as a way of finding the entry address for the program.}
1175 \subsubsection{Miscellaneous Subprogram Properties}
1176 \textit{In \addtoindex{C}
1177 there is a difference between the types of functions
1178 declared using function prototype style declarations and
1179 those declared using non-prototype declarations.}
1181 A subroutine entry declared with a function prototype style
1182 declaration may have a
1183 \addtoindexx{prototyped attribute}
1184 \DWATprototypedDEFN{} attribute, which is
1186 The attribute indicates whether a subroutine entry point corresponds
1187 to a function declaration that includes parameter prototype information.
1189 A subprogram entry may have
1190 a\hypertarget{chap:DWATelementalelementalpropertyofasubroutine}{}
1191 \DWATelementalDEFN{} attribute,\addtoindexx{elemental attribute}
1192 which is a \livelink{chap:classflag}{flag}.
1193 The attribute indicates whether the subroutine
1194 or entry point was declared with the \doublequote{elemental} keyword
1197 A\hypertarget{chap:DWATpurepurepropertyofasubroutine}{}
1198 subprogram entry may have a
1199 \addtoindexx{pure attribute}
1200 \DWATpureDEFN{} attribute, which is
1201 a \livelink{chap:classflag}{flag}.
1202 The attribute indicates whether the subroutine was
1203 declared with the \doublequote{pure} keyword or property.
1205 A\hypertarget{chap:DWATrecursiverecursivepropertyofasubroutine}{}
1206 subprogram entry may have a
1207 \addtoindexx{recursive attribute}
1208 \DWATrecursiveDEFN{} attribute, which
1209 is a \livelink{chap:classflag}{flag}.
1210 The attribute indicates whether the subroutine
1211 or entry point was declared with the \doublequote{recursive} keyword
1214 A subprogram entry may have a
1216 \livetargi{chap:DWATnoreturnofsubprogram}{attribute}{noreturn attribute},
1217 which is a \CLASSflag. The attribute
1218 indicates whether the subprogram was declared with the \doublequote{noreturn} keyword or property
1219 indicating that the subprogram can be called, but will never return to its caller.
1221 \textit{The \addtoindex{Fortran}
1222 language allows the keywords \texttt{elemental}, \texttt{pure}
1223 and \texttt{recursive} to be included as part of the declaration of
1224 a subroutine; these attributes reflect that usage. These
1225 attributes are not relevant for languages that do not support
1226 similar keywords or syntax. In particular, the \DWATrecursiveNAME{}
1227 attribute is neither needed nor appropriate in languages such
1228 as \addtoindex{C} where functions support recursion by default.}
1231 \subsubsection{Call Site-Related Attributes}
1232 \textit{While subprogram attributes in the previous section provide
1233 information about the subprogram and its entry point(s) as a whole,
1234 the following attributes provide summary information about the calls
1235 that occur within a subprogram.}
1237 A subroutine entry may have \DWATcallalltailcalls,
1238 \DWATcallallcalls{} and/or \DWATcallallsourcecalls{}
1239 attributes, each of which is a \CLASSflag.
1240 \addtoindexx{call site summary information}
1241 \addtoindexx{subroutine call site summary attributes}
1242 These flags indicate the completeness of the call site
1243 information provided by call site entries (see
1244 Section \refersec{chap:callsiteentries}) within the subprogram.
1246 The \DWATcallalltailcallsDEFN{}
1247 \livetargi{chap:DWATcallalltailcallsofasubprogram}{attribute}{all tail calls summary attribute}
1248 indicates that every tail call
1249 that occurs in the code for the subprogram is described by a
1250 \DWTAGcallsite{} entry.
1251 (There may or may not be other non-tail calls to some of the same
1252 target subprograms.)
1254 The \DWATcallallcallsDEFN{}
1255 \livetargi{chap:DWATcallallcallsofasubprogram}{attribute}{all calls summary attribute}
1256 indicates that every non-inlined call
1257 (either a tail call or a normal call) that occurs in the code for the subprogram
1258 is described by a \DWTAGcallsite{} entry.
1260 The \DWATcallallsourcecallsDEFN{}
1261 \livetargi{chap:DWATcallallsourcecallsofasubprogram}{attribute}{all source calls summary attribute}
1262 indicates that every call that occurs in the
1263 code for the subprogram, including every call inlined into it, is described by either a
1264 \DWTAGcallsite{} entry or a \DWTAGinlinedsubroutine{} entry; further, any call
1265 that is optimized out is nonetheless also described using a \DWTAGcallsite{} entry
1266 that has neither a \DWATcallpc{} nor \DWATcallreturnpc{} attribute.
1268 \textit{The \DWATcallallsourcecallsNAME{} attribute is intended for debugging
1269 information format consumers that analyze call graphs.}
1271 If the the \DWATcallallsourcecalls{} attribute is present then the
1272 \DWATcallallcalls{} and \DWATcallalltailcalls{} attributes are
1273 also implicitly present. Similarly, if the
1274 \DWATcallallcalls{} attribute is present then the \DWATcallalltailcalls{}
1275 attribute is implicitly present.
1278 \subsection{Subroutine and Entry Point Return Types}
1279 \label{chap:subroutineandentrypointreturntypes}
1281 If\hypertarget{chap:DWATtypetypeofsubroutinereturn}{}
1282 the subroutine or entry point
1283 \addtoindexx{return type of subroutine}
1284 is a function that returns a
1285 value, then its debugging information entry has
1286 \addtoindexx{type attribute}
1287 a \DWATtypeDEFN{} attribute
1288 to denote the type returned by that function.
1290 \textit{Debugging information entries for
1291 \addtoindex{C} void functions should
1292 not have an attribute for the return type. }
1294 \textit{Debugging information entries for declarations of \addtoindex{C++}
1295 member functions with an
1296 \autoreturntype{} specifier should use an unspecified type entry (see
1297 Section \refersec{chap:unspecifiedtypeentries}).
1298 The debugging information entry for the corresponding definition
1299 should provide the deduced return type. This practice causes the description of
1300 the containing class to be consistent across compilation units, allowing the class
1301 declaration to be placed into a separate type unit if desired.}
1304 \subsection{Subroutine and Entry Point Locations}
1305 \label{chap:subroutineandentrypointlocations}
1307 A subroutine entry may have either a \DWATlowpc{} and
1308 \DWAThighpc{} pair of attributes or a \DWATranges{} attribute
1309 \addtoindexx{ranges attribute}
1311 \addtoindexx{high PC attribute}
1313 \addtoindexx{low PC attribute}
1314 encode the contiguous or non-contiguous address
1315 ranges, respectively, of the machine instructions generated
1316 for the subroutine (see
1317 Section \refersec{chap:codeaddressesandranges}).
1319 A\hypertarget{chap:DWATentrypcentryaddressofsubprogram}{}
1320 subroutine entry may also have a
1321 \addtoindexx{entry PC attribute!for subroutine}
1322 \DWATentrypc{} attribute
1323 whose value is the address of the first executable instruction
1324 of the subroutine (see
1325 Section \refersec{chap:entryaddress}).
1327 An entry point has a \DWATlowpc{} attribute whose value is the
1328 relocated address of the first machine instruction generated
1329 for the entry point.
1332 %\textit{While the \DWATentrypc{} attribute
1333 %\addtoindexx{entry pc attribute!for subroutine}
1334 %might also seem appropriate for this purpose, historically the
1335 %\DWATlowpc{} attribute was used before the
1336 %\DWATentrypc{} was introduced (in
1337 %\addtoindex{DWARF Version 3}).
1338 %There is insufficient reason to change this.}
1340 Subroutines and entry points may also have
1341 \DWATsegment{}\hypertarget{chap:DWATaddressclasssubroutineorsubroutinetype}{}
1342 \addtoindexx{segment attribute} and
1343 \DWATaddressclassDEFN{}\addtoindexx{address class attribute}
1344 attributes, as appropriate, to specify
1345 which segments the code for the subroutine resides in and
1346 the addressing mode to be used in calling that subroutine.
1348 A subroutine entry representing a subroutine declaration
1349 that is not also a definition does not have code address or
1353 \subsection{Declarations Owned by Subroutines and Entry Points}
1354 \label{chap:declarationsownedbysubroutinesandentrypoints}
1355 \addtoindexx{subroutine formal parameters}
1356 The declarations enclosed by a subroutine or entry point are
1357 represented by debugging information entries that are owned
1358 by the subroutine or entry point entry. Entries representing
1359 \addtoindexx{formal parameter}
1360 the formal parameters of the subroutine or entry point appear
1361 in the same order as the corresponding declarations in the
1365 \textit{There is no ordering requirement for entries for declarations
1366 other than formal parameters. The formal parameter
1367 entries may be interspersed with other entries used by formal
1368 parameter entries, such as type entries.}
1370 The unspecified (sometimes called \doublequote{varying})
1371 parameters of a subroutine parameter list are
1372 represented by a debugging information
1373 entry\addtoindexx{unspecified parameters entry}
1374 with the tag \DWTAGunspecifiedparametersTARG.
1377 The entry for a subroutine that includes a
1378 \addtoindex{Fortran}
1379 \addtoindexx{Fortran!common block}
1380 \livelink{chap:fortrancommonblock}{common}
1381 \livelink{chap:commonblockentry}{block}
1382 \addtoindexx{common block|see{Fortran common block}}
1383 has a child entry with the
1384 tag \DWTAGcommoninclusionTARG.
1385 The\hypertarget{chap:commonreferencecommonblockusage}{}
1386 common inclusion entry has a
1387 \DWATcommonreferenceDEFN{} attribute
1388 \addtoindexx{common block reference attribute}
1389 whose value is a \livelink{chap:classreference}{reference}
1390 to the debugging information entry
1391 for the common \nolink{block} being included
1392 (see Section \refersec{chap:commonblockentries}).
1394 \subsection{Low-Level Information}
1395 \label{chap:lowlevelinformation}
1397 A\hypertarget{chap:DWATreturnaddrsubroutinereturnaddresssavelocation}{}
1398 subroutine or entry point entry may have a
1399 \addtoindexx{return address attribute}
1400 \DWATreturnaddrDEFN{}
1401 attribute, whose value is a location description. The location
1402 specified is the place where the return address for the
1403 subroutine or entry point is stored.
1405 A\hypertarget{chap:DWATframebasesubroutineframebaseaddress}{}
1406 subroutine or entry point entry may also have a
1407 \addtoindexx{frame base attribute}
1408 \DWATframebaseDEFN{} attribute, whose value is a location
1409 description that describes the \doublequote{frame base} for the
1410 subroutine or entry point. If the location description is
1411 a simple register location description, the given register
1412 contains the frame base address. If the location description is
1413 a DWARF expression, the result of evaluating that expression
1414 is the frame base address. Finally, for a
1415 \addtoindex{location list},
1416 this interpretation applies to each location description
1417 contained in the list of \addtoindex{location list} entries.
1419 \textit{The use of one of the \DWOPregn{}
1420 operations in this context is equivalent to using
1421 \DWOPbregn(0) but more
1422 compact. However, these are not equivalent in general.}
1425 \textit{The frame base for a subprogram is typically an address
1426 relative to the first unit of storage allocated for the
1427 subprogram\textquoteright s stack frame. The \DWATframebase{} attribute
1428 can be used in several ways:}
1429 \begin{enumerate}[1. ]
1430 \item \textit{In subprograms that need
1431 \addtoindexx{location list}
1432 location lists to locate local
1433 variables, the \DWATframebase{} can hold the needed location
1434 list, while all variables\textquoteright\ location descriptions can be
1435 simpler ones involving the frame base.}
1437 \item \textit{It can be used in resolving \doublequote{up\dash level} addressing
1438 within nested routines.
1439 (See also \DWATstaticlink, below)}
1443 \textit{Some languages support nested subroutines. In such languages,
1444 it is possible to reference the local variables of an
1445 outer subroutine from within an inner subroutine. The
1446 \DWATstaticlink{} and \DWATframebase{} attributes allow
1447 debuggers to support this same kind of referencing.}
1449 If\hypertarget{chap:DWATstaticlinklocationofuplevelframe}{}
1450 a subroutine or entry point is nested, it may have a
1451 \addtoindexx{address!uplevel|see {static link attribute}}
1452 \addtoindexx{uplevel address|see {static link attribute}}
1453 \DWATstaticlinkDEFN{} attribute, whose value is a location
1454 description that computes the frame base of the relevant
1455 instance of the subroutine that immediately encloses the
1456 subroutine or entry point.
1458 In the context of supporting nested subroutines, the
1459 \DWATframebase{} attribute value should obey the following
1462 \begin{enumerate}[1. ]
1463 \item It should compute a value that does not change during the
1464 life of the subprogram, and
1466 \item The computed value should be unique among instances of
1467 the same subroutine. (For typical \DWATframebase{} use, this
1468 means that a recursive subroutine\textquoteright s stack frame must have
1472 \textit{If a debugger is attempting to resolve an up\dash level reference
1473 to a variable, it uses the nesting structure of DWARF to
1474 determine which subroutine is the lexical parent and the
1475 \DWATstaticlink{} value to identify the appropriate active
1476 frame of the parent. It can then attempt to find the reference
1477 within the context of the parent.}
1481 \subsection{Types Thrown by Exceptions}
1482 \label{chap:typesthrownbyexceptions}
1484 \textit{In \addtoindex{C++} a subroutine may declare a set of types which
1485 it may validly throw.}
1487 If a subroutine explicitly declares that it may throw
1488 \addtoindexx{exception thrown|see{thrown type entry}}
1490 \addtoindexx{thrown exception|see{thrown type entry}}
1491 exception of one or more types, each such type is
1492 represented by a debugging information entry with
1493 \addtoindexx{thrown type entry}
1495 \DWTAGthrowntypeTARG.
1496 Each such entry is a child of the entry
1497 representing the subroutine that may throw this type. Each
1498 thrown type entry contains
1499 \addtoindexx{type attribute}
1500 a \DWATtype{} attribute, whose
1501 value is a \livelink{chap:classreference}{reference}
1502 to an entry describing the type of the
1503 exception that may be thrown.
1505 \subsection{Function Template Instantiations}
1506 \label{chap:functiontemplateinstantiations}
1508 \textit{In \addtoindex{C++}, a function template is a generic definition of
1509 a function that is instantiated differently for calls with
1510 values of different types. DWARF does not represent the generic
1511 template definition, but does represent each instantiation.}
1514 A \addtoindex{function template instantiation}\addtoindexx{template instantiation!function}
1515 is represented by a debugging information entry with the
1516 \addtoindexx{subprogram entry!use for template instantiation}
1517 tag \DWTAGsubprogram.
1519 exceptions, such an entry will contain the same attributes and
1520 will have the same types of child entries as would an entry
1521 for a subroutine defined explicitly using the instantiation
1522 types and values. The exceptions are:
1524 \begin{enumerate}[1. ]
1525 \item Template parameters are described and referenced as specified in
1526 Section \refersec{chap:templateparameters}.
1529 \item If the compiler has generated a separate compilation unit
1530 to hold the template instantiation and that compilation unit
1531 has a different name from the compilation unit containing
1532 the template definition, the name attribute for the debugging
1533 information entry representing that compilation unit is empty
1536 \item If the subprogram entry representing the template
1537 instantiation or any of its child entries contain declaration
1538 coordinate attributes, those attributes refer to the source
1539 for the template definition, not to any source generated
1540 artificially by the compiler for this instantiation.
1545 \subsection{Inlinable and Inlined Subroutines}
1546 \label{chap:inlinedsubroutines}
1547 A declaration or a definition of an inlinable subroutine
1548 is represented by a debugging information entry with the
1549 tag \DWTAGsubprogram.
1550 The entry for a subroutine
1551 \addtoindexx{subprogram entry!use in inlined subprogram}
1552 that is\hypertarget{chap:DWATinlineinlinedsubroutine}{}
1553 explicitly declared to be available for inline expansion or
1554 that was expanded inline implicitly by the compiler has a
1555 \addtoindexx{inline attribute}
1556 \DWATinlineDEFN{} attribute whose value is an
1557 \livelink{chap:classconstant}{integer constant}. The
1558 set of values for the \DWATinline{} attribute is given in
1559 Table \refersec{tab:inlinecodes}.
1563 \caption{Inline codes}
1564 \label{tab:inlinecodes}
1565 \begin{tabular}{l|P{8cm}}
1567 Name&Meaning\\ \hline
1568 \DWINLnotinlinedTARG{} & Not declared inline nor inlined by the
1569 \mbox{compiler} (equivalent to the absence of the
1570 containing \DWATinline{} attribute) \\
1571 \DWINLinlinedTARG{} & Not declared inline but inlined by the \mbox{compiler} \\
1572 \DWINLdeclarednotinlinedTARG{} & Declared inline but
1573 not inlined by the \mbox{compiler} \\
1574 \DWINLdeclaredinlinedTARG{} & Declared inline and inlined by the
1580 \textit{In \addtoindex{C++}, a function or a constructor declared with
1581 \addttindex{constexpr} is implicitly declared inline. The abstract
1582 instance (see Section \refersec{chap:abstractinstances})
1583 is represented by a debugging information
1584 entry with the tag \DWTAGsubprogram. Such an entry has a
1585 \DWATinline{} attribute whose value is \DWINLinlined.}
1588 \subsubsection{Abstract Instances}
1589 \label{chap:abstractinstances}
1590 Any subroutine entry that contains a
1591 \DWATinlineDEFN{} attribute\addtoindexx{inline attribute}
1592 whose value is other than
1594 is known as an \definition{abstract instance root}.
1595 \addtoindexx{abstract instance!root}
1596 \hypertarget{chap:DWATinlineabstracttinstance}{}
1597 Any debugging information entry that is owned (either
1598 directly or indirectly) by an abstract instance root
1600 \definition{abstract instance entry.}\addtoindexx{abstract instance!entry}
1601 Any set of abstract instance entries that are all
1602 children (either directly or indirectly) of some abstract
1603 instance root, together with the root itself, is known as an
1604 \definition{abstract instance tree.}\addtoindexx{abstract instance!tree}
1605 However, in the case where an abstract instance tree is
1606 nested within another abstract instance tree, the entries in the
1607 \addtoindex{nested abstract instance}
1608 tree are not considered to be entries in the outer abstract
1612 Each abstract instance root is either part of a larger
1613 \addtoindexx{abstract instance!root}
1614 tree (which gives a context for the root) or
1615 \addtoindexx{specification attribute}
1617 \DWATspecification{}
1618 to refer to the declaration in context.
1620 \textit{For example, in \addtoindex{C++} the context might be a namespace
1621 declaration or a class declaration.}
1623 \textit{Abstract instance trees are defined so that no entry is part
1624 of more than one abstract instance tree.}
1626 Attributes and children in an abstract instance are shared
1627 by all concrete instances (see Section \refersec{chap:concreteinstances}).
1629 A debugging information entry that is a member of an abstract
1630 instance tree should not contain any attributes which describe
1631 aspects of the subroutine which vary between distinct inlined
1632 expansions or distinct out-of-line expansions. For example,
1633 \addtoindexx{entry pc attribute!and abstract instance}
1644 \addtoindexx{location attribute!and abstract instance}
1646 \addtoindexx{ranges attribute!and abstract instance}
1648 \addtoindexx{high PC attribute!and abstract instance}
1650 \addtoindexx{low PC attribute!and abstract instance}
1652 \addtoindexx{segment attribute!and abstract instance}
1654 \addtoindexx{return address attribute!and abstract instance}
1656 \addtoindexx{segment attribute!and abstract instance}
1658 \addtoindexx{start scope attribute!and abstract instance}
1662 \textit{It would not make sense normally to put these attributes into
1663 abstract instance entries since such entries do not represent
1664 actual (concrete) instances and thus do not actually exist at
1665 run\dash time. However,
1666 see Appendix \refersec{app:inlineouteronenormalinner}
1667 for a contrary example.}
1669 The rules for the relative location of entries belonging to
1670 abstract instance trees are exactly the same as for other
1671 similar types of entries that are not abstract. Specifically,
1672 the rule that requires that an entry representing a declaration
1673 be a direct child of the entry representing the scope of the
1674 declaration applies equally to both abstract and non-abstract
1675 entries. Also, the ordering rules for formal parameter entries,
1676 member entries, and so on, all apply regardless of whether
1677 or not a given entry is abstract.
1680 \subsubsection{Concrete Instances}
1681 \label{chap:concreteinstances}
1683 Each inline expansion of a subroutine is represented
1684 by a debugging information entry with the
1685 tag \DWTAGinlinedsubroutineTARG.
1686 Each such entry should be a direct
1687 child of the entry that represents the scope within which
1688 the inlining occurs.
1691 Each inlined subroutine entry may have either a
1693 and \DWAThighpc{} pair of attributes
1694 \addtoindexx{high PC attribute}
1695 \addtoindexx{low PC attribute}
1696 or a \DWATranges{}\addtoindexx{ranges attribute}
1697 attribute whose values encode the contiguous or non-contiguous
1698 address ranges, respectively, of the machine instructions
1699 generated for the inlined subroutine (see
1700 Section \referfol{chap:codeaddressesandranges}).
1701 An\hypertarget{chap:DWATentrypcentryaddressofinlinedsubprogram}{}
1702 inlined subroutine entry may
1703 \addtoindexx{inlined subprogram entry!in concrete instance}
1705 \addtoindexx{inlined subprogram entry}
1707 \addtoindexx{entry PC attribute!for inlined subprogram}
1710 attribute, representing the first executable instruction of
1711 the inline expansion (see
1712 Section \refersec{chap:entryaddress}).
1714 % Positions of the 3 targets here is a bit arbitrary.
1715 An inlined\hypertarget{chap:DWATcalllinelinenumberofinlinedsubroutinecall}{}
1716 subroutine\hypertarget{chap:DWATcallcolumncolumnpositionofinlinedsubroutinecall}{}
1717 entry\hypertarget{chap:DWATcallfilefilecontaininginlinedsubroutinecall}{}
1718 may also have \DWATcallfileDEFN,
1719 \DWATcalllineDEFN{} and \DWATcallcolumnDEFN{} attributes,
1720 \addtoindexx{inlined call location attributes}
1722 value is an \livelink{chap:classconstant}{integer constant}.
1723 These attributes represent the
1724 source file, source line number, and source column number,
1725 respectively, of the first character of the statement or
1726 expression that caused the inline expansion. The call file,
1727 call line, and call column attributes are interpreted in
1728 the same way as the declaration file, declaration line, and
1729 declaration column attributes, respectively (see
1730 Section \refersec{chap:declarationcoordinates}).
1732 \textit{The call file, call line and call column coordinates do not
1733 describe the coordinates of the subroutine declaration that
1734 was inlined, rather they describe the coordinates of the call.
1737 An inlined subroutine entry may have
1738 a\hypertarget{chap:DWATconstexprcompiletimeconstantfunction}{}
1739 \DWATconstexprDEFN{} attribute,\addtoindexx{constant expression attribute}
1740 which is a \livelink{chap:classflag}{flag}
1741 whose presence indicates that the
1742 subroutine has been evaluated as a compile\dash time constant. Such
1743 an entry may also have a \DWATconstvalue{} attribute,
1744 whose value may be of any form that is appropriate for the
1745 representation of the subroutine's return value. The value of
1746 this attribute is the actual return value of the subroutine,
1747 represented as it would be on the target architecture.
1749 \textit{In \addtoindex{C++}, if a function or a constructor declared with
1750 \addttindex{constexpr}
1751 is called with constant expressions, then the corresponding
1752 concrete inlined instance has a
1753 \DWATconstexpr{} attribute,
1754 as well as a \DWATconstvalue{} attribute whose value represents
1755 the actual return value of the concrete inlined instance.}
1757 Any debugging information entry that is owned (either
1758 directly or indirectly) by a debugging information entry
1759 with the tag \DWTAGinlinedsubroutine{} is referred to as a
1760 \doublequote{concrete inlined instance entry.} Any entry that has
1762 \DWTAGinlinedsubroutine{}
1763 is known as a \doublequote{concrete inlined instance root.}
1764 Any set of concrete inlined instance
1765 entries that are all children (either directly or indirectly)
1766 of some concrete inlined instance root, together with the root
1767 itself, is known as a \doublequote{concrete inlined instance tree.}
1768 However, in the case where a concrete inlined instance tree
1769 is nested within another concrete instance tree, the entries
1770 in the \addtoindex{nested concrete inline instance} tree
1771 are not considered to
1772 be entries in the outer concrete instance tree.
1775 \textit{Concrete inlined instance trees are defined so that no entry
1776 is part of more than one concrete inlined instance tree. This
1777 simplifies later descriptions.}
1779 Each concrete inlined instance tree is uniquely associated
1780 with one (and only one) abstract instance tree.
1782 \textit{Note, however, that the reverse is not true. Any given abstract
1783 instance tree may be associated with several different concrete
1784 inlined instance trees, or may even be associated with zero
1785 concrete inlined instance trees.}
1787 Concrete inlined instance entries may omit attributes that
1788 are not specific to the concrete instance (but present in
1789 the abstract instance) and need include only attributes that
1790 are specific to the concrete instance (but omitted in the
1791 abstract instance). In place of these omitted attributes,
1792 each\hypertarget{chap:DWATabstractorigininlineinstance}{}
1793 concrete inlined instance entry has a
1794 \addtoindexx{abstract origin attribute}
1795 \DWATabstractoriginDEFN{}
1796 attribute that may be used to obtain the missing information
1797 (indirectly) from the associated abstract instance entry. The
1798 value of the abstract origin attribute is a reference to the
1799 associated abstract instance entry.
1801 If an entry within a concrete inlined instance tree contains
1802 attributes describing the
1803 \addtoindexx{declaration coordinates!in concrete instance}
1804 \livelink{chap:declarationcoordinates}{declaration coordinates}
1805 of that entry, then those attributes should refer to the file, line
1806 and column of the original declaration of the subroutine,
1807 not to the point at which it was inlined. As a consequence,
1808 they may usually be omitted from any entry that has an abstract
1812 For each pair of entries that are associated via a
1813 \addtoindexx{abstract origin attribute}
1814 \DWATabstractorigin{} attribute, both members of the pair
1815 have the same tag. So, for example, an entry with the tag
1816 \DWTAGvariable{} can only be associated with another entry
1817 that also has the tag \DWTAGvariable. The only exception
1818 to this rule is that the root of a concrete instance tree
1819 (which must always have the tag \DWTAGinlinedsubroutine)
1820 can only be associated with the root of its associated abstract
1821 instance tree (which must have the tag \DWTAGsubprogram).
1824 In general, the structure and content of any given concrete
1825 inlined instance tree will be closely analogous to the
1826 structure and content of its associated abstract instance
1827 tree. There are a few exceptions:
1829 \begin{enumerate}[1. ]
1830 \item An entry in the concrete instance tree may be omitted if
1832 \addtoindexx{abstract origin attribute}
1833 \DWATabstractorigin{} attribute and either
1834 has no children, or its children are omitted. Such entries
1835 would provide no useful information. In C\dash like languages,
1836 such entries frequently include types, including structure,
1837 union, class, and interface types; and members of types. If any
1838 entry within a concrete inlined instance tree needs to refer
1839 to an entity declared within the scope of the relevant inlined
1840 subroutine and for which no concrete instance entry exists,
1841 the reference should refer to the abstract instance entry.
1844 \item Entries in the concrete instance tree which are associated
1845 with entries in the abstract instance tree such that neither
1846 has a \DWATname{} attribute,
1847 \addtoindexx{name attribute}
1848 and neither is referenced by
1849 any other debugging information entry, may be omitted. This
1850 may happen for debugging information entries in the abstract
1851 instance trees that became unnecessary in the concrete instance
1852 tree because of additional information available there. For
1853 example, an anonymous variable might have been created and
1854 described in the abstract instance tree, but because of
1855 the actual parameters for a particular inlined expansion,
1856 it could be described as a constant value without the need
1857 for that separate debugging information entry.
1860 \item A concrete instance tree may contain entries which do
1861 not correspond to entries in the abstract instance tree
1862 to describe new entities that are specific to a particular
1863 inlined expansion. In that case, they will not have associated
1864 entries in the abstract instance tree, should not contain
1865 \addtoindexx{abstract origin attribute}
1866 \DWATabstractorigin{} attributes, and must contain all their
1867 own attributes directly. This allows an abstract instance tree
1868 to omit debugging information entries for anonymous entities
1869 that are unlikely to be needed in most inlined expansions. In
1870 any expansion which deviates from that expectation, the
1871 entries can be described in its concrete inlined instance tree.
1875 \subsubsection{Out-of-Line Instances of Inlined Subroutines}
1876 \label{chap:outoflineinstancesofinlinedsubroutines}
1877 Under some conditions, compilers may need to generate concrete
1878 executable instances of inlined subroutines other than at
1879 points where those subroutines are actually called. Such
1880 concrete instances of inlined subroutines are referred to as
1881 \doublequote{concrete out\dash of\dash line instances.}
1883 \textit{In \addtoindex{C++}, for example,
1884 taking the address of a function declared
1885 to be inline can necessitate the generation of a concrete
1886 out\dash of\dash line instance of the given function.}
1888 The DWARF representation of a concrete out-of-line instance
1889 of an inlined subroutine is essentially the same as for a
1890 concrete inlined instance of that subroutine (as described in
1891 the preceding section). The representation of such a concrete
1892 % It is critical that the hypertarget and livelink be
1893 % separated to avoid problems with latex.
1895 \addtoindexx{abstract origin attribute}
1897 \hypertarget{chap:DWATabstractoriginoutoflineinstance}{}
1899 \DWATabstractoriginDEFN{}
1900 attributes in exactly the same way as they are used for
1901 a concrete inlined instance (that is, as references to
1902 corresponding entries within the associated abstract instance
1905 The differences between the DWARF representation of a
1906 concrete out\dash of\dash line instance of a given subroutine and the
1907 representation of a concrete inlined instance of that same
1908 subroutine are as follows:
1909 \begin{enumerate}[1. ]
1910 \item The root entry for a concrete out\dash of\dash line instance
1911 of a given inlined subroutine has the same tag as does its
1912 associated (abstract) inlined subroutine entry (that is, tag
1913 \DWTAGsubprogram{} rather than \DWTAGinlinedsubroutine).
1915 \item The root entry for a concrete out\dash of\dash line instance tree
1916 is normally owned by the same parent entry that also owns
1917 the root entry of the associated abstract instance. However,
1918 it is not required that the abstract and out\dash of\dash line instance
1919 trees be owned by the same parent entry.
1923 \subsubsection{Nested Inlined Subroutines}
1924 \label{nestedinlinedsubroutines}
1925 Some languages and compilers may permit the logical nesting of
1926 a subroutine within another subroutine, and may permit either
1927 the outer or the nested subroutine, or both, to be inlined.
1929 For a non-inlined subroutine nested within an inlined
1930 subroutine, the nested subroutine is described normally in
1931 both the abstract and concrete inlined instance trees for
1932 the outer subroutine. All rules pertaining to the abstract
1933 and concrete instance trees for the outer subroutine apply
1934 also to the abstract and concrete instance entries for the
1938 For an inlined subroutine nested within another inlined
1939 subroutine, the following rules apply to their abstract and
1940 \addtoindexx{abstract instance!nested}
1941 \addtoindexx{concrete instance!nested}
1942 concrete instance trees:
1944 \begin{enumerate}[1. ]
1945 \item The abstract instance tree for the nested subroutine is
1946 described within the abstract instance tree for the outer
1947 subroutine according to the rules in
1948 Section \refersec{chap:abstractinstances}, and
1949 without regard to the fact that it is within an outer abstract
1952 \item Any abstract instance tree for a nested subroutine is
1953 always omitted within the concrete instance tree for an
1956 \item A concrete instance tree for a nested subroutine is
1957 always omitted within the abstract instance tree for an
1960 \item The concrete instance tree for any inlined or
1961 \addtoindexx{out-of-line instance}
1963 \addtoindexx{out-of-line instance|see{\textit{also} concrete out-of-line instance}}
1964 expansion of the nested subroutine is described within a
1965 concrete instance tree for the outer subroutine according
1967 Sections \refersec{chap:concreteinstances} or
1968 \referfol{chap:outoflineinstancesofinlinedsubroutines}
1970 and without regard to the fact that it is within an outer
1971 concrete instance tree.
1974 \textit{See Appendix \refersec{app:inliningexamples}
1975 for discussion and examples.}
1977 \subsection{Trampolines}
1978 \label{chap:trampolines}
1980 \textit{A trampoline is a compiler\dash generated subroutine that serves
1981 as\hypertarget{chap:DWATtrampolinetargetsubroutine}{}
1982 an intermediary in making a call to another subroutine. It may
1983 adjust parameters and/or the result (if any) as appropriate
1984 to the combined calling and called execution contexts.}
1986 A trampoline is represented by a debugging information entry
1987 \addtoindexx{trampoline (subprogram) entry}
1988 with the tag \DWTAGsubprogram{} or \DWTAGinlinedsubroutine{}
1990 \addtoindexx{trampoline attribute}
1991 a \DWATtrampolineDEFN{} attribute.
1993 attribute indicates the target subroutine of the trampoline,
1994 that is, the subroutine to which the trampoline passes
1995 control. (A trampoline entry may but need not also have a
1996 \DWATartificial{} attribute.)
1999 The value of the trampoline attribute may be represented
2000 using any of the following forms:
2003 \item If the value is of class \CLASSreference{}, then the value
2004 specifies the debugging information entry of the target
2007 \item If the value is of class \CLASSaddress{}, then the value is
2008 the relocated address of the target subprogram.
2011 \item If the value is of class \CLASSstring{}, then the value is the
2012 (possibly mangled) \addtoindexx{mangled names}
2013 name of the target subprogram.
2015 \item If the value is of class \CLASSflag, then the value true
2016 indicates that the containing subroutine is a trampoline but
2017 that the target subroutine is not known.
2021 The target subprogram may itself be a trampoline. (A sequence
2022 of trampolines necessarily ends with a non-trampoline
2025 \textit{In \addtoindex{C++}, trampolines may be used to implement
2026 derived virtual member functions; such trampolines typically
2028 \texttt{this} parameter\index{this parameter@\texttt{this} parameter}
2029 in the course of passing control.
2030 Other languages and environments may use trampolines in a manner
2031 sometimes known as transfer functions or transfer vectors.}
2033 \textit{Trampolines may sometimes pass control to the target
2034 subprogram using a branch or jump instruction instead of a
2035 call instruction, thereby leaving no trace of their existence
2036 in the subsequent execution context. }
2038 \textit{This attribute helps make it feasible for a debugger to arrange
2039 that stepping into a trampoline or setting a breakpoint in
2040 a trampoline will result in stepping into or setting the
2041 breakpoint in the target subroutine instead. This helps to
2042 hide the compiler generated subprogram from the user. }
2044 \section{Call Site Entries and Parameters}
2045 \label{chap:callsiteentriesandparameters}
2047 A call site entry describes a call from one subprogram to another in the
2048 source program. It provides information about the actual parameters of
2049 the call so that they may be more easily accessed by a debugger. When
2050 used together with call frame information
2051 (see Section \refersec{chap:callframeinformation}),
2052 call site entries can be useful for computing the value of an actual parameter
2053 passed by a caller, even when the location description for the callee's
2054 corresponding formal parameter does not provide a current location for
2055 the formal parameter.}
2057 \textit{The DWARF expression for computing the value of an actual parameter at
2058 a call site may refer to registers or memory locations. The expression
2059 assumes these contain the values they would have at the point where the
2060 call is executed. After the called subprogram has been entered, these
2061 registers and memory locations might have been modified. In order to
2062 recover the values that existed at the point of the call (to allow
2063 evaluation of the DWARF expression for the actual parameter), a debugger
2068 the subprogram activation
2069 (see Section \refersec{chap:callframeinformation}). Any
2070 register or memory location that cannot be recovered is referred to as
2071 "clobbered by the call."}
2073 A source call can be compiled into different types of machine code:
2076 A \textit{normal call} uses a call-like instruction which transfers
2077 control to the start of some subprogram and preserves the call site
2078 location for use by the callee.
2081 A \textit{tail call} uses a jump-like instruction which
2082 transfers control to the start of some subprogram, but
2083 there is no call site location address to preserve
2084 (and thus none is available using the
2088 unwind information).
2091 A \textit{tail recursion call} is a call
2092 to the current subroutine which is compiled as a jump
2093 to the current subroutine.
2097 An \textit{inline (or inlined) call} is a call to an inlined subprogram,
2098 where at least one instruction has the location of the inlined subprogram
2099 or any of its blocks or inlined subprograms.
2103 There are also different types of \doublequote{optimized out} calls:
2106 An \textit{optimized out (normal) call} is a call that is in unreachable code that
2107 has not been emitted (such as, for example, the call to \texttt{foo} in
2108 \texttt{if (0) foo();}).
2110 An \textit{optimized out inline call}
2111 is a call to an inlined subprogram which either did not expand to any instructions
2112 or only parts of instructions belong to it and for debug information purposes those
2113 instructions are given a location in the caller.
2116 \DWTAGcallsite{} entries describe normal and tail calls but not tail recursion calls,
2117 while \DWTAGinlinedsubroutine{} entries describe inlined calls
2118 (see Section \refersec{chap:inlinedsubroutines}).
2119 Call site entries cannot describe tail recursion or optimized out calls.
2121 \subsection{Call Site Entries}
2122 \label{chap:callsiteentries}
2123 A call site is represented by a debugging information entry with the tag
2124 \DWTAGcallsiteTARG{}\addtoindexx{call site entry}.
2125 The entry for a call site is owned by the innermost
2126 debugging information entry representing the scope within which the
2127 call is present in the source program.
2130 \textit{A scope entry (for example, a lexical block) that would not
2131 otherwise be present in the debugging information of a subroutine
2132 need not be introduced solely to represent the immediately containing scope
2135 The call site entry may have a
2136 \DWATcallreturnpcDEFN{}\addtoindexx{call site return pc attribute}
2137 \livetargi{chap:DWATcallreturnpcofcallsite}{attribute}{call return pc attribute}
2138 which is the return address after the call.
2139 The value of this attribute corresponds to the return address
2140 computed by call frame information in the called subprogram
2141 (see Section \refersec{datarep:callframeinformation}).
2143 \textit{On many architectures the return address is the
2144 address immediately following the call instruction, but
2145 on architectures with delay slots it might
2146 be an address after the delay slot of the call.}
2148 The call site entry may have a
2149 \DWATcallpcDEFN{}\addtoindexx{call pc attribute}
2150 \livetargi{chap:DWATcallpcofcallsite}{attribute}{call pc attribute}
2151 which is the address of the
2152 call-like instruction for a normal call or the jump-like
2153 instruction for a tail call.
2155 If the call site entry corresponds to a tail call, it has the
2156 \DWATcalltailcallDEFN{}\addtoindexx{call tail call attribute}
2157 \livetargi{chap:DWATcalltailcallofcallsite}{attribute}{call tail call attribute},
2158 which is a \CLASSflag.
2160 The call site entry may have a
2161 \DWATcalloriginDEFN{}\addtoindexx{call origin attribute}
2162 \livetargi{chap:DWATcalloriginofcallsite}{attribute}{call origin attribute}
2163 which is a \CLASSreference. For direct calls or jumps where the called
2164 subprogram is known it is a reference to the called subprogram's debugging
2165 information entry. For indirect calls it may be a reference to a
2166 \DWTAGvariable{}, \DWTAGformalparameter{} or \DWTAGmember{} entry representing
2167 the subroutine pointer that is called.
2170 The call site may have a
2171 \DWATcalltargetDEFN{}\addtoindexx{call target attribute}
2172 \livetargi{chap:DWATcalltargetofcallsite}{attribute}{call target attribute} which is
2173 a DWARF expression. For indirect calls or jumps where it is unknown at
2174 compile time which subprogram will be called the expression computes the
2175 address of the subprogram that will be called. The DWARF expression should
2176 not use register or memory locations that might be clobbered by the call.
2179 The call site entry may have a
2180 \DWATcalltargetclobberedDEFN{}\addtoindexx{call target clobbered attribute}
2181 \livetargi{chap:DWATcalltargetclobberedofcallsite}{attribute}{call target clobbered attribute}
2182 which is a DWARF expression. For indirect calls or jumps where the
2183 address is not computable without use of registers or memory locations that
2184 might be clobbered by the call the \DWATcalltargetclobberedNAME{}
2185 attribute is used instead of the \DWATcalltarget{} attribute.
2187 \textit{The expression of a call target clobbered attribute may only be
2188 valid at the time the call or call-like transfer of control is executed.}
2190 The call site entry may have a \DWATtypeDEFN{}\addtoindexx{call type attribute}
2191 \livetargi{chap:DWATtypeofcallsite}{attribute}{type attribute!of call site entry}
2192 referencing a debugging information entry for the type of the called function.
2194 \textit{When \DWATcallorigin{} is present, \DWATtypeNAME{} is usually omitted.}
2196 The call site entry may have
2197 \DWATcallfileDEFN{}\addtoindexx{call file attribute},
2198 \DWATcalllineDEFN{}\addtoindexx{call line attribute} and
2199 \DWATcallcolumnDEFN{}\addtoindexx{call column attribute}
2200 \livetargi{chap:DWATcallfileofcallsite}{attributes,}{call file attribute!of call site entry}
2201 \livetargi{chap:DWATcalllineofcallsite}{}{call line attribute!of call site entry}
2202 \livetargi{chap:DWATcallcolumnofcallsite}{}{call column attribute!of call site entry}
2203 each of whose value is an integer constant.
2204 These attributes represent the source file, source line number, and source
2205 column number, respectively, of the first character of the call statement or
2206 expression. The call file, call line, and call column attributes are
2207 interpreted in the same way as the declaration file, declaration
2208 line, and declaration column attributes, respectively
2209 (see Section \refersec{chap:declarationcoordinates}).
2211 \textit{The call file, call line and call column coordinates do
2212 not describe the coordinates of the subroutine declaration that
2213 was called, rather they describe the coordinates of the call.}
2216 \subsection{Call Site Parameters}
2217 \label{chap:callsiteparameters}
2218 The call site entry may own
2219 \DWTAGcallsiteparameterTARG{}\index{call site parameter entry}
2220 debugging information entries representing the parameters passed
2222 Call site parameter entries occur in the same order as the
2223 corresponding parameters in the source.
2224 Each such entry has a \DWATlocation{} attribute which is a location
2225 description. This location description
2226 describes where the parameter is passed
2227 (usually either some register, or a memory location expressible as
2228 the contents of the stack register plus some offset).
2231 Each \DWTAGcallsiteparameter{} entry may have a
2232 \DWATcallvalueDEFN{}\addtoindexx{call value attribute}
2233 \livetargi{chap:DWATcallvalueofcallparameter}{attribute}{call value attribute}
2234 which is a DWARF expression
2235 which when evaluated yields the value of the parameter at the time of the call.
2237 \textit{The expression should not use registers or memory
2238 locations that might be clobbered by the call, as it might be evaluated after
2242 unwinding from the called function back to the caller. If it is not
2243 possible to avoid registers or memory locations that might be clobbered by
2244 the call in the expression, then the \DWATcallvalueNAME{} attribute should
2247 \textit{The reason for the restriction is that the value of the parameter may be
2248 needed in the midst of the callee, where the call clobbered registers or
2249 memory might be already clobbered, and if the consumer is not assured by
2250 the producer it can safely use those values, the consumer can not safely
2251 use the values at all.}
2253 For parameters passed by reference, where the code passes a pointer to
2254 a location which contains the parameter, or for reference type parameters,
2255 the \DWTAGcallsiteparameter{} entry may also have a
2256 \DWATcalldatalocationDEFN{}\addtoindexx{call data location attribute}
2257 \livetargi{chap:DWATcalldatalocationofcallparameter}{attribute}{call data location attribute}
2258 whose value is a location description and a
2259 \DWATcalldatavalueDEFN{}\addtoindexx{call data value attribute}
2260 \livetargi{chap:DWATcalldatavalueofcallparameter}{attribute}{call data value attribute}
2261 whose value is a DWARF expression. The \DWATcalldatalocationNAME{} attribute
2262 \addtoindexx{call data location attribute}
2263 describes where the referenced value lives during the call. If it is just
2264 \DWOPpushobjectaddress{}, it may be left out. The
2265 \DWATcalldatavalueNAME{} attribute describes the value in that location.
2266 The expression should not use registers or memory
2267 locations that might be clobbered by the call, as it might be evaluated after
2271 unwinding from the called function back to the caller.
2274 Each call site parameter entry may also have a
2275 \DWATcallparameterDEFN{}\addtoindexx{call parameter attribute}
2276 \livetargi{chap:DWATcallparameterofcallparameter}{attribute}{call parameter attribute}
2277 which contains a reference to a \DWTAGformalparameter{} entry,
2278 \DWATtype{} attribute referencing the type of the parameter or
2279 \DWATname{} attribute describing the parameter's name.
2281 \textit{Examples using call site entries and related attributes are
2282 found in Appendix \refersec{app:callsiteexamples}.}
2285 \section{Lexical Block Entries}
2286 \label{chap:lexicalblockentries}
2289 lexical \livetargi{chap:lexicalblock}{block}{lexical block}
2291 \addtoindexx{lexical block}
2292 a bracketed sequence of source statements
2293 that may contain any number of declarations. In some languages
2294 (including \addtoindex{C} and \addtoindex{C++}),
2295 \nolink{blocks} can be nested within other
2296 \nolink{blocks} to any depth.}
2298 % We do not need to link to the preceding paragraph.
2299 A lexical \nolink{block} is represented by a debugging information
2301 tag \DWTAGlexicalblockTARG.
2303 The lexical \livetargi{chap:lexicalblockentry}{block}{lexical block entry}
2305 either a \DWATlowpc{} and
2306 \DWAThighpc{} pair of
2308 \addtoindexx{high PC attribute}
2310 \addtoindexx{low PC attribute}
2312 \DWATranges{} attribute
2313 \addtoindexx{ranges attribute}
2314 whose values encode the contiguous or non-contiguous address
2315 ranges, respectively, of the machine instructions generated
2316 for the lexical \nolink{block}
2317 (see Section \refersec{chap:codeaddressesandranges}).
2319 A\hypertarget{chap:DWATentrypcoflexicalblock}{}
2320 lexical block entry may also have a
2321 \addtoindexx{entry PC attribute!for lexical block}
2322 \DWATentrypc{} attribute
2323 whose value is the address of the first executable instruction
2324 of the lexical block (see
2325 Section \refersec{chap:entryaddress}).
2327 If a name has been given to the lexical \nolink{block}
2328 in the source program, then the corresponding
2329 lexical \nolink{block} entry has a
2330 \DWATname{} attribute whose
2331 \addtoindexx{name attribute}
2332 value is a null-terminated string
2333 containing the name of the lexical \nolink{block}.
2335 \textit{This is not the same as a \addtoindex{C} or
2336 \addtoindex{C++} label (see Section \refersec{chap:labelentries}).}
2338 The lexical \nolink{block} entry owns debugging
2339 information entries that describe the declarations
2340 within that lexical \nolink{block}. There is
2341 one such debugging information entry for each local declaration
2342 of an identifier or inner lexical \nolink{block}.
2345 \section{Label Entries}
2346 \label{chap:labelentries}
2347 \textit{A label is a way of identifying a source location.
2348 A labeled statement is usually the target of one or more
2349 \doublequote{go to} statements.}
2352 A label is represented by a debugging information entry with
2353 \addtoindexx{label entry}
2354 the tag \DWTAGlabelTARG.
2355 The entry for a label should be owned by
2356 the debugging information entry representing the scope within
2357 which the name of the label could be legally referenced within
2360 The label entry has a \DWATlowpc{} attribute whose value
2361 is the address of the first executable instruction for the
2362 location identified by the label in
2363 the source program. The label entry also has a
2364 \DWATname{} attribute
2365 \addtoindexx{name attribute}
2366 whose value is a null-terminated string containing
2367 the name of the label.
2370 \section{With Statement Entries}
2371 \label{chap:withstatemententries}
2373 \textit{Both \addtoindex{Pascal} and
2374 \addtoindexx{Modula-2}
2375 Modula-2 support the concept of a \doublequote{with}
2376 statement. The with statement specifies a sequence of
2377 executable statements within which the fields of a record
2378 variable may be referenced, unqualified by the name of the
2381 A with statement is represented by a
2382 \addtoindexi{debugging information entry}{with statement entry}
2383 with the tag \DWTAGwithstmtTARG.
2385 A with statement entry may have either a
2387 \DWAThighpc{} pair of attributes
2388 \addtoindexx{low PC attribute}
2389 \addtoindexx{high PC attribute}
2391 \DWATranges{} attribute
2392 \addtoindexx{ranges attribute}
2393 whose values encode the contiguous or non-contiguous address
2394 ranges, respectively, of the machine instructions generated
2395 for the with statement
2396 (see Section \refersec{chap:codeaddressesandranges}).
2398 A\hypertarget{chap:DWATentrypcofwithstmt}{}
2399 with statement entry may also have a
2400 \addtoindexx{entry PC attribute!for with statement}
2401 \DWATentrypc{} attribute
2402 whose value is the address of the first executable instruction
2403 of the with statement (see
2404 Section \refersec{chap:entryaddress}).
2407 The with statement entry has a
2408 \addtoindexx{type attribute}
2409 \DWATtype{} attribute, denoting
2410 the type of record whose fields may be referenced without full
2411 qualification within the body of the statement. It also has
2412 \addtoindexx{location attribute}
2413 a \DWATlocation{} attribute, describing how to find the base
2414 address of the record object referenced within the body of
2418 \section{Try and Catch Block Entries}
2419 \label{chap:tryandcatchblockentries}
2420 \livetarg{chap:tryandcatchblockentries}{}
2421 \textit{In \addtoindex{C++}, a \livelink{chap:lexicalblock}{lexical block} may be
2422 designated as a \doublequote{catch \nolink{block}.}
2423 A catch \nolink{block} is an exception handler that
2424 handles exceptions thrown by an immediately preceding
2425 \doublequote{try \nolink{block}.}
2426 A catch \nolink{block}
2427 designates the type of the exception that it can handle.}
2429 A \livetarg{chap:tryblock}{try block} is represented
2430 by a debugging information entry
2431 \addtoindexx{try block entry}
2432 with the tag \DWTAGtryblockTARG.
2433 A \livetarg{chap:catchblock}{catch block} is represented by
2434 a debugging information entry
2435 \addtoindexx{catch block entry}
2436 with the tag \DWTAGcatchblockTARG.
2438 Both try and catch \nolink{block} entries may have either a
2440 \DWAThighpc{} pair of attributes
2441 \addtoindexx{low PC attribute}
2442 \addtoindexx{high PC attribute}
2444 \DWATranges{} attribute
2445 \addtoindexx{ranges attribute}
2446 whose values encode the contiguous
2447 or non-contiguous address ranges, respectively, of the
2448 machine instructions generated for the \nolink{block}
2449 (see Section \refersec{chap:codeaddressesandranges}).
2451 A\hypertarget{chap:DWATentrypcoftryblock}{}
2452 try or catch\hypertarget{chap:DWATentrypcofcatchblock}{}
2453 block entry may also have a
2454 \addtoindexx{entry PC attribute!for try block}
2455 \addtoindexx{entry PC attribute!for catch block}
2456 \DWATentrypc{} attribute
2457 whose value is the address of the first executable instruction
2458 of the try or catch block
2459 (see Section \refersec{chap:entryaddress}).
2462 Catch \nolink{block} entries have at least one child entry,
2463 an entry representing the type of exception accepted by
2464 that catch \nolink{block}.
2465 This child entry has one of the tags
2466 \DWTAGformalparameter{}\addtoindexx{formal parameter entry!in catch block}
2468 \DWTAGunspecifiedparameters{},
2469 \addtoindexx{unspecified parameters entry!in catch block}
2470 and will have the same form as other parameter entries.
2472 The siblings immediately following a try \nolink{block}
2473 entry are its corresponding catch \nolink{block} entries.
2476 \section{Declarations with Reduced Scope}
2477 \label{declarationswithreducedscope}
2478 \hypertarget{chap:DWATstartscopeofdeclaration}{}
2479 Any debugging information entry for a declaration
2480 (including objects, subprograms, types and modules) whose scope
2481 has an address range that is a subset of the address range for
2482 the lexical scope most closely enclosing the declared entity
2484 \DWATstartscopeDEFN{}\addtoindexx{start scope attribute}
2485 attribute to specify that reduced range of addresses.
2487 There are two cases:
2488 \begin{enumerate}[1. ]
2489 \item If the address range for the scope of the entry
2490 includes all of addresses for the containing scope except
2491 for a contiguous sequence of bytes at the beginning of the
2492 address range for the containing scope, then the address is
2493 specified using a value of class \CLASSconstant.
2495 \begin{enumerate}[a) ]
2496 \item If the address
2497 range of the containing scope is contiguous, the value of
2498 this attribute is the offset in bytes of the beginning of
2499 the address range for the scope of the object from the low
2500 PC value of the debugging information entry that defines
2501 that containing scope.
2502 \item If the address range of the containing
2503 scope is non-contiguous
2504 (see \refersec{chap:noncontiguousaddressranges})
2505 the value of this attribute is the offset in bytes of the
2506 beginning of the address range for the scope of the entity
2507 from the beginning of the first \addtoindex{range list} entry
2508 for the containing scope that is not a base selection entry,
2509 a default selection entry or an end-of-list entry.
2513 \item Otherwise, the set of addresses for the scope of the
2514 entity is specified using a value of class \CLASSrangelistptr{}.
2515 This value indicates the beginning of a \addtoindex{range list}
2516 (see Section \refersec{chap:noncontiguousaddressranges}).
2519 \textit{For example, the scope of a variable may begin somewhere
2520 in the midst of a lexical \livelink{chap:lexicalblock}{block} in a
2521 language that allows executable code in a
2522 \nolink{block} before a variable declaration, or where one declaration
2523 containing initialization code may change the scope of a
2524 subsequent declaration.}
2527 \textit{Consider the following example \addtoindex{C} code:}
2539 \textit{\addtoindex{C} scoping rules require that the value of the
2540 variable \texttt{x} assigned to the variable \texttt{f} in the
2541 initialization sequence is the value of the global variable \texttt{x},
2542 rather than the local \texttt{x}, because the scope of the local variable
2543 \texttt{x} only starts after the full declarator for the local \texttt{x}.}
2545 \textit{Due to optimization, the scope of an object may be
2546 non-contiguous and require use of a \addtoindex{range list} even when
2547 the containing scope is contiguous. Conversely, the scope of
2548 an object may not require its own \addtoindex{range list} even when the
2549 containing scope is non-contiguous.}